04 Forward Kinematics
04 Forward Kinematics
04 Forward Kinematics
Forward Kinematics
Forward kinematics is determining where the tip of the robot is given it's joint angles. To do this, a reference
frame is assigned to each joint. There is a standard way to do this: by having a standard, different designers will
get the same result.
First, you rotate the reference frame about the x-axis so that the two z-axis line up (twist)
Second, move along the x axis
Third, rotate about the z-axis, finally
Move along the z-axis to end up at the next reference frame.
Putting these rotations and translations into one matrix gives the transformation matrix to go from joint 1 to joint
0
T 01 = R x (α 0 )D x (a 0 )R z (θ 1 )D z (d 1 )
or, multiplying it out:
cθ 1 −sθ 1 0 a0
sθ cα cθ cα −sα −sα d
T 01 = 1 0 1 0 0 0 1
sθ 1 sα 0 cθ 1 sα 0 cα 0 cα 0 d 1
0 0 0 1
This is the subroutine Transform.m posted on Bison Academy.
end
Solution:
With a robot manipulator, you have N joints. Each joint will have its associate reference frame (i.e. the motor at
each joint knows its own angle.) The problem is how to determine the tip position given the joint angles.
Before we can do that, however, we need to define the reference frames for each joint. For this assignment, there
is a standard way of doing it.
Types of Joints:
First, determine the type of joint you're dealing with. This doesn't really affect the assignment of reference
frames (it it's a rotational joint, and angle will be a variable, if it's a translational joint, a displacement will be a
variable).
Translational: The motor changes the length of the arm
Rotational: The motor changes the angle of the arm
Compound: If a joint can do several things, like a hip joint
If a joint is compound, it is treated as two separate joints with a displacement of zero.
Link Numbering:
Next, determine how many links you need. The links are numbered starting from the immobile base, frame 0.
Coordinate frame 0 is also called the earth reference frame, since it is usually where the robot is bolted to the
floor.
Each subsequent reference frame is numbered from 1 on up.
Link i connects axis i to i+1
Twist 3
Z2
X2
Length 2
Z1
Length 1
X1
Twist 2
Length i: The length of link i is the distance from axis i to i+1. This is the shortest distance between the two
lines that pass through the axis of rotation.
Twist i: Relative to the line which is perpendicular to both axis (i.e. looking down this line), the twist is the
angle between the two axis.
Procedure:
1. Identify the joint axis. Draw an infinite line along each axis.
2. Identify the perpendicular lines between each axis. At the point of intersection, define a reference frame.
3. Assign the Zi axis pointing along the ith joint axis.
4. Assign the Xi axis pointing to the next axis (i.e. along the perpendicular line between axis). If the joint axis
intersect, Xi is perpendicular to both Z axis.
5. Assign the Yi axis following the right-hand rule
X×Y = Z
6. Assign axis 0 to match axis 1 when the first joint angle is zero.
7. The zero position is when a all X axis are pointing in the same direction.
Link Parameters:
ai The distance from Zi to Zi+1 measured along the Xi axis
αi The angle between the Zi and Zi+1 axis (twist)
di The distance from Xi-1 to Xi measured along the Zi axis
θi The angle between Xi-1 and Xi measured about the Zi axis
Example: Define the reference frames for the following robot (a model for a human finger):
Tip
Pt
Q3
L3
L2
Q2
L1
Q1
z1
50 40 30
x1 x5
x2 x3 x4
z2 z0 10 z5
z3 z4
x0
Definition of reference frames and zero position for modeling a human finger
1 0 0 10 0
2 +90 degrees 0 0 θ1
3 0 50 0 θ2
4 0 40 0 θ3
5 0 30 0 0
Note that the previous table defines the robot: simply change this table and you have a whole new robot.
The way this program works is, once you define the refrence frames (alpha, a, d, Q), it
Defines the transformation matrix to reference frame #1,
Then #2, etc.
It then draws a line from each reference frame to the next, and
It returns the tip position.
Draw the robot and calculate the tip position for angles of ( 0.5, 1, 1.5 radians)
Solution:
>> RRR([0.5,1,1.5],TIP)
x 17.0088
y 0.0000
z 78.1047
1.0000
You can also show the path of the tip during a move:
Start from zero position
Rotate Q1 to 90 degrees, then
Rotate Q2 to 90 degrees, then
Rotate Q3 to 90 degrees
Code:
for i=1:90
T = RRR([pi/2, i*pi/180, 0], TIP);
TIP = [TIP,T];
end
for i=1:90
T = RRR([pi/2, pi/2, i*pi/180], TIP);
TIP = [TIP,T];
end
Result:
Trajectory of the tip (green) as you rotate Q1, then Q2, then Q3
Z3
X3
L3
Q2
Z1
X1
Z2 X2
Q1
Y0 L1
X0
z1
L3 x3
x1
x2
z2 z3
L1
z0
x0
1 0 0 L1 θ1
2 +90 degrees 0 0 θ2
3 0 L3 0 0
To simulate this robot, change the first four lines of code in RRR (creating RRP)
etc.
x 0
y 0
z 50
1
x 17.6777
y 17.6777
z 93.3013
1.0000
Code
TIP = RRP([0,0,0], zeros(4,1));
for i=1:50
T = RRP([0, 0, i], TIP);
TIP = [TIP,T];
end
for i=1:90
T = RRP([i*pi/90, 0, 50], TIP);
TIP = [TIP,T];
end
for i=1:90
T = RRP([pi, i*pi/90, 50], TIP);
TIP = [TIP,T];
end
Z3
Z2 Z3
X3
L4
Z1
X2 X2
Q1
Z2
X1
L3
L1
L2 Z0
Y0
Y1 X0
Z0 X0
Z1 X1
Top View - Zero Position
It helps to redraw in zero position with the reference frames. It's not necessary, but I found it easier to add five
frames
z1
x1
z2
L2
L1
L3 x4
x3
z3 z4
z0
L4
x0
x5
z5
Reference frames in zero position for an RRR robot
1 0 0 L1 Q1
2 pi/2 0 0 0
3 0 0 L2 Q2
4 0 L3 0 0
5 0 0 L4 Q3
RRR3([0,0,0],zeros(4,1))
50
-100
50
1
Code:
TIP = RRR3([0,0,0], zeros(4,1));
for i=1:180
T = RRR3([i*pi/180, 0, 0], TIP);
TIP = [TIP,T];
end
for i=1:180
T = RRR3([pi, i*pi/180, 0], TIP);
TIP = [TIP,T];
end
for i=1:180
T = RRR3([pi, pi, i*pi/180], TIP);
TIP = [TIP,T];
end