# Forward/inverse kinematics and transformation matrices

I have found the homogeneous transformation matrix that can be used to determine the relation between the parent and child links of a robot. This matrix is shown below.

$$T_i = \left[\begin{array}{ c c c c } \cos \theta_{i} & -\sin \theta_{i} & 0 & a_{i-1} \\ \sin \theta_{i} \cos \alpha_{i-1} & \cos \theta_{i} \cos \alpha_{i-1} & -\sin \alpha_{i-1} & -\sin \alpha_{i-1} d_{i} \\ \sin \theta_{i} \sin \alpha_{i-1} & \cos \theta_{i} \sin \alpha_{i-1} & \cos \alpha_{i-1} & \cos \alpha_{i-1} d_{i} \\ 0 & 0 & 0 & 1 \end{array}\right]$$

I have used this matrix together with the Denavit Hartenberg parameters to make a Matlab Rigidbody Tree model. All the joints of the robot are behaving correctly. Does this mean that these matrices solve the forward kinematics? And what steps would I have to take to get the inverse kinematics in a Simulink block for example?

For each joint relation you model, you would get one homogeneous transformation matrix (HTM) T $$T^{i-1}_i$$ If you multiply all HTM from base to end-effector, you would get what is called forward kinematic matrix FK $$FK(\theta) = T^0_N= T^0_1*T^1_2*...*T^{N-1}_N$$ which map joint configuration into cartesian space (represent pose of end-effector). Then for inverse kinematic there are two main method, graphical method and analytical method. For low number DOF (degree of freedom) (DOF<3), you can perform graphical method, by calculating end-effector and joint relation using simple trigonometry function. For high number DOF (DOF>3) , you should perform analytical method. This method really complex, but luckily there are several library available for MatLab which you can use such as RTB or MatLab official library.