Professional Documents
Culture Documents
Appendix
B
Use of MATLAB
and RIDIM
In this appendix, steps to use the commercial software, MATLAB, and RIDIM
program developed by the author and his group of students are explained.
shown here. For detailed description, one may refer to the books available on
MATLAB, e.g. Pratap (2002), and use the Demos and Help menu of the software.
LM2 3 1 OP LM1 2 3 OP
A∫ 3 5 2 ; and B ∫ 2 3 5 (B.1)
MM5 6 PQ
P MM8 9PQ
P
N 1 N 2
Representation of the above matrices in MATLAB are as follows:
>> am = [2 3 1; 3 5 2; 5 1 6]
am =
2 3 1
3 5 2
5 1 6
>> bm = [1 2 3;2 3 5;8 2 9]
bm =
1 2 3
2 3 5
8 2 9
Addition of above two matrices, A + B, is obtained as
>> am+bm
ans =
3 5 4
5 8 7
13 3 15
Besides algebraic operations, one can find the properties of the matrices as well,
e.g. determinant, eigenvalue, etc. For example, determinant of A is calculated as
>> det(am)
ans =
10
RIDM is the acronym for Recursive Inverse Dynamics for Industrial Manipulators.
Its VC++ interface program developed for the MS-Windows users to combine two
C++ programs, one to solve the inverse kinematics problem formulated in Marothiya
and Saha (2003) and the other one is the recursive inverse dynamics algorithm
proposed in Saha (1999). Both the aspects of inverse kinematics and inverse
dynamics are discussed in Chapters 6 and 9 of this book as well. The program
requires the following inputs:
• The Denavit and Hartenberg (DH) parameters of the robot manipulator de-
fined in Chapter 5. A file stores these DH parameters.
• The program then asks for the initial and the final configurations of the robot.
This input could be fed in joint level coordinates as well as in Cartesian coor-
dinates.
• Time of moving from initial to the final specified positions, and
• Number of steps.
Based on the above inputs, the program calculates the trajectory to be followed
and stores it in another file. Then, there is an option of performing the inverse
dynamics using RIDIM for the calculated trajectory, whose output (joint torques/
forces) is also stored in a file. The results stored in the files are available for plotting
or other analyses.
350 Introduction to Robotics
If the above files are not there in the system, then take them from
RIDIM\SYSTEM-FILES
folder of unzipped folders.
Next, to instal RIDIM follow the steps given below:
1. Unzip it in ‘C:\’ folder. That is, while unzipping ‘select different folder’ and
give/choose ‘C:\’ .
2. Go to ‘C:\’ folder. Right click on RIDIM folder. Click on ‘properties.’ Click on
‘read only’ (it will remove the tick mark, if any). Apply and close window.
3. Double click on ‘RIDIM’ to enter the folder. Click ‘select all.’ Take the cursor
arrow on any file icon. Right click. Click on ‘properties.’ Click ‘read only’ (it
will remove the tick mark, if any). Apply and close window.
4. Double click on Debug folder. Drag ‘proj’ file (application file where RIDIM
icon appears to the Desktop.
5. Double click the ‘RIDIM’ icon.
6. Enter the input as desired.
7. Plot using MS-EXCEL or MATLAB.
If the above things do not work, then most probably you do not have write access
on ‘C:’ drive. Ask the system administrator for permission, or send email to the
administrator of the book’s website.
No. Jt. ai bi a qI mi xcm ycm zcm Ixx Ixy Ixz Iyy Iyz Izz
1 R 1 0 –90 0 1 1 1 1 1 1 1 1 1 1
2 R 2 5 180 0 1 1 1 1 1 1 1 1 1 1
3 R 3 3 –90 0 1 1 1 1 1 1 1 1 1 1
4 R 0 7 90 0 1 1 1 1 1 1 1 1 1 1
5 R 0 0 90 0 1 1 1 1 1 1 1 1 1 1
6 R 1 2 90 0 1 1 1 1 1 1 1 1 1 1
Wrist
x
Fig. B.1 PUMA 560 robot and its DH parameters
Appendix B 355
2 0.4
1.5 0.3
1 0.2
0.5 0.1
0 0
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10
Time (sec) Time (sec)
(a) Position (b) Velocity
0.25
0.2
0.15
0.1
Joint acceleration
0.05
0
0 1 2 3 4 5 6 7 8 9 10
–0.05
–0.1
–0.15
–0.2
–0.25
Time (sec)
(c) Acceleration
Fig. B.2 Joint trajectory: (a) Position, (b) Velocity, and (c) Acceleration
356 Introduction to Robotics
The generated trajectories for each joint are shown in Fig. B.2(a–c). Inverse
dynamics results are then obtained for PUMA 560, which are plotted in Fig. B.3(a–
f.). The plots were generated using MS-Excel program.
8 100
6 80
4 60
40
Torque (Nm)
Torque (Nm)
2 20
0 0
0 1 2 3 4 5 6 7 8 9 10
–2 –20 0 1 2 3 4 5 6 7 8 9 10
–4 –40
–60
–6 –80
–8 –100
Time (sec) Time (sec)
(a) Joint 1 (b) Joint 2
30 0.5
0.4
20
0.3
Torque (Nm)
Torque (Nm)
10 0.2
0 0.1
0 1 2 3 4 5 6 7 8 9 10
0
–10 0 1 2 3 4 5 6 7 8 9 10
–0.1
–20 –0.2
–30 –0.3
Time (sec) Time (sec)
(c) Joint 3 (d) Joint 4
0.015
0.2
0.01
0.15
0.005
0.1
Torque (Nm)
Torque (Nm)
0
0.05 0 1 2 3 4 5 6 7 8 9 10
–0.005
0 –0.01
0 1 2 3 4 5 6 7 8 9 10
–0.05 –0.015
–0.1 –0.02
–0.15 –0.025
Time (sec) Time (sec)
(e) Joint 5 (f) Joint 6
Fig. B.3 Torque values at (a) Joint 1; (b) Joint 2; (c) Joint 3; (d) Joint 4; (e)
Joint 5; (f) Joint 6
SUMMARY
In this appendix, the use of MATLAB and RIDIM are explained. This will help the
reader to solve some of the examples and exercises given in the chapters on
kinematics and dynamics.