You are on page 1of 12

University of Engineering and Technology Lahore

Department of Mechatronics and Control Engineering

LAB 11: Implementation of Forward & Inverse Kinematics


on 3 DOF Manipulator in MATLAB

OBJECTIVE:
• To learn Forward Kinematics on a 3 DOF manipulator using Robotics Toolbox
• To learn Inverse Kinematics on a 3 DOF manipulator using Robotics Toolbox
• To learn Forward Kinematics on a 3 DOF manipulator using Graphical approach
• To learn Inverse Kinematics on a 3 DOF manipulator using Graphical approach
• To learn Forward Kinematics on a 3 DOF manipulator using D-H Table

APPARATUS:

• Laptop\PC with MATLAB installed and activated


• Installed Peter Croke’s Robotics Toolbox RTB10.x

INTRODUCTION:
Forward Kinematics refers to the use of kinematic equations of a robot to compute the position of end-effector
from specified values for joint parameters. While Inverse Kinematics, in robotics, makes use of kinematics
equations to find joint parameters that provide a desire position for each of the robot’s end-effector.
Forward & Inverse Kinematics using Robotics Toolbox:
Firstly, you have to know about your robot whose forward and inverse kinematics analysis would be observed.
By using “Robotics Toolbox by Peter Corke”, firstly run the file ‘startup_rvc.m’.

By following these instructions, design 3 DOF planar robot and follow these MATLAB commands for forward
and inverse kinematics analysis.
%Forward and Inverse Kinematics Using Robotics Toolbox
%---------------------------------------------------------
clc,clear

% Define 3 DOF Robotic Manipulator


Links = [pi/2, 0, 2, 0; % [theta, d, L, alpha] of each joint
pi/2, 0, 2, 0; 0, 0, 2, 0];

% Manipulator
Manipulator_3DOF = SerialLink(Links,'name','3 DOF Manipulator');
q = [pi/2, pi/3, pi/4];

%Forward Kinematics
finalPose = Manipulator_3DOF.fkine(q); % Homogeneous Transform of end effector
%Manipulator_3DOF.plot(q)
Manipulator_3DOF.teach

%Inverse Kinematics
jointAngles = Manipulator_3DOF.ikine(finalPose,'mask',[1 1 1 0 0 0])

MCT 451: Introduction to Robotics


Department of Mechatronics and Control Engineering, U.E.T. Lahore
University of Engineering and Technology Lahore
Department of Mechatronics and Control Engineering

Important notes while calculating Inverse Kinematics:


• A solution is not always possible, for instance if the specified transform of end-effector describes a
point out of reach of the manipulator i.e. not in the work envelope.
• Also solutions are not necessarily unique, and there are singularities at which the manipulator loses
degrees of freedom and joint coordinates become linearly dependent. And the solution that is found
depends on the initial choice of angles. But we can verify the same pose of end-effector by using
Forward Kinematics.
• In ikine(finalPose,'mask',[1 1 1 0 0 0]), mask vector (1x6) which specifies the Cartesian
DOF (in the wrist coordinate frame) that will be ignored in reaching a solution. The mask vector has
six elements that correspond to translation in X, Y and Z, and rotation about X, Y and Z respectively.
The value should be 0 (for ignore) or 1. The number of non-zero elements should equal the number
of manipulator DOF. For example, when using a 3 DOF manipulator rotation orientation might be
unimportant in which case m = [1 1 1 0 0 0].

Forward Kinematics using Graphical Approach:


You have done all the calculations of forward kinematics in theory lectures. Implement those equations in
MATLAB, and find the end-effector position for given orientation.

Figure 1: 3 DOF Planar Robot


Pseudo Code:
1. Specify link lengths
2. Specify theta1=0, theta2=900 and theta3=900

3. Write down the equations of forward kinematics


4. X1=__________
5. Y1=__________
6. X2=__________
7. Y2=__________
8. X3=__________
9. Y3=__________

10. Then plot the 3 DOF Robot


11. Properly label the diagram
TASK 1:
Find the different positions of end-effector for theta1=theta2=theta3=pi/2, pi/3, pi/4, pi/5 and pi/6. [use for
loops].

MCT 451: Introduction to Robotics


Department of Mechatronics and Control Engineering, U.E.T. Lahore
University of Engineering and Technology Lahore
Department of Mechatronics and Control Engineering

MCT 451: Introduction to Robotics


Department of Mechatronics and Control Engineering, U.E.T. Lahore
University of Engineering and Technology Lahore
Department of Mechatronics and Control Engineering

Inverse Kinematics using Graphical Approach:


You have done all the calculations of inverse kinematics in theory lectures. Implement those equations in
MATLAB, and find the angles of both links for given end-effector position.

Pseudo Code:
1. Specify link lengths
2. Specify end-effector position x=1; y=0;

3. Write down the equations of inverse kinematics


4. Theta1=__________
5. Theta2=__________
6. Theta3=__________

7. In order to show the right position of end-effector use forward kinematic


equations
8. Then plot the 3 DOF Robot
9. Properly label the diagram
TASK 2:
Find the different joint angles for different end-effector positions as computed in TASK 1. [use for loops].

MCT 451: Introduction to Robotics


Department of Mechatronics and Control Engineering, U.E.T. Lahore
University of Engineering and Technology Lahore
Department of Mechatronics and Control Engineering

MCT 451: Introduction to Robotics


Department of Mechatronics and Control Engineering, U.E.T. Lahore
University of Engineering and Technology Lahore
Department of Mechatronics and Control Engineering

Forward Kinematics using DH Table:


You have done all the calculations of inverse kinematics in theory lectures. Implement those equations in
MATLAB, and find the angles of both links for given end-effector position.

Pseudo Code:
1. Specify link lengths
2. Specify theta1=0 theta2=900, and theta3=900

3. Write down the transformation matrix


4. Write down the DH parameters for 3 DOF planar robot
5. Substitute the DH parameters in transformation matrix

6. Find matrix T01, T12 and T23


7. Then plot the 3 DOF Robot
8. Properly label the diagram

TASK 3:
Find the different positions of end-effector for theta1=theta2=theta3=pi/2, pi/3, pi/4, pi/5 and pi/6. [use for
loops].

MCT 451: Introduction to Robotics


Department of Mechatronics and Control Engineering, U.E.T. Lahore
University of Engineering and Technology Lahore
Department of Mechatronics and Control Engineering

MCT 451: Introduction to Robotics


Department of Mechatronics and Control Engineering, U.E.T. Lahore
University of Engineering and Technology Lahore
Department of Mechatronics and Control Engineering

TASK 4 (optional):
Repeat Task 1-3 for a 4 DOF manipulator. (5 bonus marks)

Task-1 Graphical Method

MCT 451: Introduction to Robotics


Department of Mechatronics and Control Engineering, U.E.T. Lahore
University of Engineering and Technology Lahore
Department of Mechatronics and Control Engineering

MCT 451: Introduction to Robotics


Department of Mechatronics and Control Engineering, U.E.T. Lahore
University of Engineering and Technology Lahore
Department of Mechatronics and Control Engineering

Task-3 DH Method

MCT 451: Introduction to Robotics


Department of Mechatronics and Control Engineering, U.E.T. Lahore
University of Engineering and Technology Lahore
Department of Mechatronics and Control Engineering

MCT 451: Introduction to Robotics


Department of Mechatronics and Control Engineering, U.E.T. Lahore
University of Engineering and Technology Lahore
Department of Mechatronics and Control Engineering

OBSERVATIONS:
➢ In forward kinematics end-effector position are found using joint angles and in inverse kinematics joint
angles are found using end-effector position.
➢ Robotics toolbox provides an easy way to find forward and invers kinematics.

MCT 451: Introduction to Robotics


Department of Mechatronics and Control Engineering, U.E.T. Lahore

You might also like