Robotics Assignment Two
Robotics Assignment Two
z1
=35
y0
x0
x1
Determine the rotational matrix which expresses the rotation of frame {1} with
respect to frame {0}
Answer
1A.
1
√ The projection of x1 on x0,y0,z0 is 0
0
0 0
√ The projection of y1 0n x0,y0,z0 is cos(35) = 0.82
sin( 35) 0.574
0 0
√ The projection of z1 on x0, y0, z0 is −sin(35) = −0.574
cos(35) 0.82
z0
p (-2,5.5,4)
y0 x1
x0
y1
z1
Answer
1B.
0 0 1 𝑝1 0 0 1 2
𝑅 𝑃 0 1 0 𝑝2 0 1 0 10
T=[ ]= [ ]=[ ]
0 1 −1 0 0 𝑝3 −1 0 0 −5
0 0 0 1 0 0 0 1
0 0 1 2
0 1 0 10
Therefore: T = [ ]
−1 0 0 −5
0 0 0 1
2. Consider the following robotic manipulator
2a, Sensors provide analogs to human senses and can monitor other phenomena
for which humans lack explicit sensors.
Sensors can measure physical properties, such as the distance between objects, the
presence of light and the frequency of sound. They can measure:
Internal sensor-It is the part of the robot. Internal sensors measure the robot's
internal state. They are used to measure position, velocity and acceleration of the
robot joint or end effectors.
2. B
i 𝛼i ai Di Θi
1 0 0 0 θ1
2 0 L1 0 θ2
3 0 L2 0 θ3
𝑐1 −𝑠1 0 0
𝑠1 𝑐1 0 0
T01 = [ ] rotate on z axis
0 0 1 0
0 0 0 1
𝑐2 −𝑠2 0 𝑙1
𝑠2 𝑐2 0 0
T12 = [ ] rotate on z axis and translate on by l1 x axis
0 0 1 0
0 0 0 1
1 0 0 𝑙3
0 1 0 0
T3tool = [ ] there is no rotation it is only translating
0 0 1 0
0 0 0 1
from T0tool = T01 *T12 *T23 *T3tool. This then gives the position and orientation of
the tool frame expressed in base coordinates
T0tool =
𝑐12𝑐3 − 𝑠12𝑠3 −𝑐12𝑠3 − 𝑠12𝑐3 0 𝑙1𝑐1 + 𝑙2𝑐12 + 𝑙3𝑐123
𝑠12𝑐3 + 𝑐12𝑠3 −𝑠12𝑠3 + 𝑐3𝑐13 0 𝑙1𝑠1 + 𝑙2𝑠12 + 𝑙3𝑠123
[ ]
0 0 1 0
0 0 0 1
Z= 0
Ф = θ1 + θ2 + θ3
2C.
0 1 0 0 0 0 1 0 0 0 1 0
0 0 0 1 0 0 0 1 0 0 0 1
C1C23 − C1S 23 S1 C1 (L3C23 + L2C2 ) r11 r12 r13 r14 − 0.6 − 0.5 0.7 0.5
S C − S1S 23 − C1 S1 (L3C23 + L2C2 ) r21 r22 r23 r24 0.35 0.866 − 0.35 − 0.18
0
T3 = 1 23 =
S 23 C23 0 L3 S 23 + L2 S 2 r31 r32 r33 r34 = 0.7 0 0.6 0.21
0 0 0 1 0 0 0 1
0 0 0 1
sin 𝜃1
= −0.36
cos 𝜃1
tan 𝜃1 = −0.36
θ1 = tan−1 (−0.36)
𝜃1 = −19.8°
T1 1T2 2T3 = T
0
T1 1T2 = T 2T3
0 −1
----------------------------(1)
Square equation (2) $ (3), add them and use the trigonometric identity
𝐿2𝑆2 −𝐿3𝑟31+𝑟34
= =
𝐿2𝐶2 ±√(−𝐿3𝑟11+𝑟14)2 +(−𝐿3𝑟21+𝑟24)2
−𝐿3∗0.7+0.21
±√(−𝐿3∗−0.6+0.5)2 +(−𝐿3∗0.35−0.18)2
0.21 − 0.7𝐿3
=
±√(0.6𝐿3 + 0.5)2 + (−0.35𝐿3 − 0.18)2
0.21 − 0.7𝐿3
θ2 = tan−1 ( )
±√(0.6𝐿3 + 0.5)2 + (−0.35𝐿3 − 0.18)2
= ____________________
𝑙3 = 0
0.21 − 0.7𝐿3
θ2 = tan−1 ( )
±√(0.6𝐿3 + 0.5)2 + (−0.35𝐿3 − 0.18)2
0.21
= tan−1 = tan−1 (±0.4) = 49.41°𝑜𝑟 − 49.41°
±0.53
𝜃2 = 21.8°𝑜𝑟 − 21.8°
The third angle is obtained by dividing (r22) by (r21) and equating to left side
𝜃2 + 𝜃3 = −67.99°
𝜃3 = −46.19°𝑜𝑟 − 89.79°
3) . A spherical robotic manipulator having 3 robotic joints shown below is
required to move an object from location A=[-0.6m -0.8m 0m] to location
B=[0.8m 0.6m 0.0m ].
a) Design a third order polynomial joint space trajectory for the three joints
assuming equal time motion of the three joints. T=10sec. Assume L1=1.5m,
L2=1m and L3=0.5m all having shape of rectangular prism
b) In the joint trajectory given above, if the mass of the three joints is
M1=1.0Kg, M2=1Kg and M3=1.0Kg,. Which of the three motors, need large
torque.
c) With the details given in b above and considering all valid assumptions,
implement the robotic manipulator using SIMMECHANICS. Implement a PID
controller and show the motion of the manipulator for the trajectory designed in
a above.
Answer
3A
1 0 0 −0.6
0 1 0 −0.8
Position matrix A= [ ] Position matrix B=
0 0 −1 0
0 0 0 1
1 0 0 0.8
0 1 0 0.6
[ ]
0 0 −1 0
0 0 0 1
Performing inverse kinematics to get the initial and final angle values for
polynomial trajectory calculation:
−0.8
𝑡𝑎𝑛𝜃1 =
−0.6
∴ 𝜃𝑖𝑛𝑖𝑡𝑖𝑎𝑙 = 53°
0.6
𝑡𝑎𝑛𝜃1 =
0.8
𝜃(𝑡) = 𝑎0 + 𝑎1 𝑡 + 𝑎2 𝑡 2 + 𝑎3 𝑡 3
𝜃(0) = 𝜃0 − − − − − − − − − − − (1)
𝜃(𝑡𝑓) = 𝜃𝑓 − − − − − − − − − − − (2)
𝜃̇(0) = 0 − − − − − − − − − − − −(3)
𝜃̇(𝑡𝑓) = 0 − − − − − − − − − − − (4)
𝜃(0) = 𝜃0 = 𝑎0 =53
𝑎0 =53
𝑎1 = 0
𝜃(𝑡𝑓) = 𝜃𝑓 = 𝑎0 + 𝑎1 𝑡 + 𝑎2 𝑡 2 + 𝑎3 𝑡 3 = 37
𝑎1 𝑡 + 𝑎2 𝑡 2 + 𝑎3 𝑡 3 = 37 − 53
2𝑎2 𝑡 1 + 3𝑎3 𝑡 2 = 0
2𝑎2 + 3𝑎3 𝑡 = 0 − − − − − − − − − −(6)
3
𝑎2 = (−16)
𝑡2
3
𝑎2 = (−16) = −0.48
100
𝑎2 = −0.48
2
𝑎3 = (−16)
𝑡3
2
𝑎3 = − (−16) = 0.032
1000
𝑎3 = 0.032
Answer
4a, Model Predictive Control (MPC) is an optimal control strategy based on
numerical optimization. A model predictive control law contains the basic
components of prediction, optimization and receding horizon implementation.
Model Predictive Control (MPC) is a multivariable control algorithm that uses:
How far ahead the model predicts the future. When the prediction horizon is
well matched to the lag between input and output, the user learns how to control
the system more rapidly, and achieves better performance.
4B
Solution
𝑦𝑘 = 𝐶𝑥𝑘 + 𝑑𝑘 − − − − − − − −(2)
One step ahead prediction models is given at sample ‘k’ , one can determine data at
sample ‘k+1’
The one-step ahead prediction can be used recursively to find an n-step ahead
prediction
.
.
𝑥𝑘+𝑛 = 𝐴𝑥𝑘+𝑛−1 + 𝐵𝑢𝑘+𝑛−1
= 𝐴𝑛 𝑥𝑘 + 𝐴𝑛−1 𝐵𝑢𝑘 + 𝐴𝑛−2 𝐵𝑢𝑘+1 + ⋯ + 𝐴𝐵𝑢𝑘+𝑛−2 + 𝐵𝑢𝑘+𝑛−1
Prediction notation is double subscript, the 1st term determines as the sample of the
prediction (how many steps ahead) and the 2nd denotes the sample at which the
prediction was made.
𝑥𝑘+1/𝑘 𝐴 𝐵 0 . . . 0 𝑢𝑘/𝑘
𝑥𝑘+2/𝑘 𝐴 2
𝐴𝐵 𝐵 . . . 0 𝑢𝑘+1/𝑘
. . . . . . . . .
. = 𝑥𝑘 + .
. . . . . . .
. . . . . . . . .
[𝑥𝑘+𝑛/𝑘 ] [𝐴 ]
𝑛 [𝐴 𝐵
𝑛−1
𝐴𝑛−2 𝐵 . . . 𝐵] [𝑢𝑘+𝑛−1/𝑘 ]
Similarly
𝑦𝑘+1/𝑘 𝐶𝐴 𝐶𝐵 0 . . . 0 𝑢𝑘/𝑘 𝑑𝑘
𝑦𝑘+2/𝑘 𝐶𝐴 2
𝐶𝐴𝐵 𝐶𝐵 . . . 0 𝑢𝑘+1/𝑘 𝑑𝑘
. . . . . . . . . .
. = 𝑥𝑘 + . +
. . . . . . . .
. . . . . . . . . .
[𝑦𝑘+𝑛/𝑘 ] [𝐶𝐴𝑛 ] [𝐶𝐴𝑛−1 𝐵 𝑛−2
𝐶𝐴 𝐵 . . . 𝐶𝐵] [𝑢𝑘+𝑛−1/𝑘 ] [𝑑𝑘 ]
Now for a give problem we can calculate the next state 𝑥1/0 and 𝑦1/0 of the MPC
𝑥1/0 = 𝐴𝑥0 + 𝐵𝑢0/0
0 1 2 0
𝑥1/0 = [ ] [ ] + [ ]2.5
−2 −3 0 1
0 0
𝑥1/0 = [ ]+[ ]
−4 2.5
0
𝑥1/0 = [ ]
−1.5
If there is no disturbance, 𝑑0 =0
𝑦0 = 𝐶𝑥0
2
𝑦0 = [1 0] [ ]
0
𝑦0 = 2
𝑦1/0 = 𝐶𝑥1/0
0
𝑦1/0 = [1 0] [ ]
−1.5
𝑦1/0 = 0
4c, Prediction horizon is the number of future control intervals the MPC controller
must evaluate by prediction when optimizing its Manipulated Variable at control
interval. The prediction horizon keeps being shifted forward and for this reason
MPC is also called receding horizon control.
Receding horizon is a general-purpose control scheme that involves repeatedly
solving a constrained optimization problem, using predictions of future costs,
disturbances, and constraints over a moving time horizon to choose the control
action. RHC handles constraints, such as limits on control variables, in a direct
and natural way, and generates sophisticated feed-forward actions.
Answer
5
Solution
𝜏 = 𝑀𝑥̈ + 𝐶(𝑥𝑥̇ )𝑥̇ + 𝐺(𝑥)
−1 1 0 −1 1 0
𝑀 =[ ] =[ ]
0 0.5 0 2
𝑥̈ 1 1 0 𝑢1 0.7𝑥2 𝑥̇ 12 𝑥̇ 22 0 𝑢1 0.7𝑥2 𝑥̇ 12 𝑥̇ 22 0
[ ] =[ ] ([𝑢 ] − [ ]−[ ]) = [2𝑢 ] − [ ]−[ ]
𝑥̈ 2 0 2 2 0.15𝑥̇ 1 2 1.5𝑥2 2 0.3𝑥̇ 1 2 3𝑥2
𝑥̈ 1 𝑢1 0.7𝑥2 𝑥̇ 12 𝑥̇ 22 0
𝑙𝑒𝑡𝑣 = [ ] = [2𝑢 ] − [ ] − [ ]
𝑥̈ 2 2 0.3𝑥̇ 12 3𝑥2
1 0 𝑣1 0.7𝑥2 𝑥̇ 12 𝑥̇ 22 0 𝑢1
[ ] [𝑣 ] + [ ] + [ ] = [𝑢2 ]
0 0.5 2 0.15𝑥̇ 12 1.5𝑥2