Professional Documents
Culture Documents
M. Morelli
mmorelli@users.sourceforge.net
Centro E.Piaggio
Facolt di Ingegneria
Universit di Pisa
Pisa, Italy
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 1 / 109
Outline
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 2 / 109
RTSSthe
Robotics Toolbox for Scilab/Scicos
M ATLAB Robotics Toolbox (MRT) as source of inspiration
Purpose of MRT
Enable students and teachers to better understand the theoretical
concepts behind classical robotics.
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 3 / 109
RTSSthe
Robotics Toolbox for Scilab/Scicos
M ATLAB Robotics Toolbox (MRT) as source of inspiration
Features of MRT
Manipulation of fundamental datatypes such as:
homogeneous transformations;
quaternions;
trajectories.
Functions for serial-link rigid-body manipulators:
forward and inverse kinematics;
differential kinematics;
forward and inverse dynamics.
S IMULINK blockset library.
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 4 / 109
RTSSthe
Robotics Toolbox for Scilab/Scicos
M ATLAB Robotics Toolbox (MRT) as source of inspiration
Points of strenght
Based on M ATLAB , MRT takes advantage of:
a powerful environment for linear algebra;
a powerful environment for graphical presentation;
an easy integration with other toolboxes;
the S IMULINK environment for dynamic systems simulation.
Main drawback
MRT is an open source software, requiring a proprietary and
expensive software environment to run.
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 5 / 109
RTSSthe Robotics Toolbox for Scilab/Scicos
Milestone 1 (2008)
Development objective
Porting the functionalities of MRT to Scilab/Scicos version 4.0+, under
a free software license.
Achievements/Features
Porting process successfully completed;
free software licensed under GNU GPL.
Release history
Initial release, the 0.1.0, released in Oct. 2007;
release 0.3.0 available for Scilab-4.1.2 in Feb. 2008;
more than 3000 downloads.
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 6 / 109
RTSSthe Robotics Toolbox for Scilab/Scicos
Milestone 2 (2010)
Development objectives
Internal code refactoring and integration with the Scicoss code
generation tools.
Achievements/Features
Modular framework facilitating maintainability and portability;
fully integrated with Linux RTAI/Xenomai code generators.
Release history
Release 1.0.0b1 available for Scilab-BUILD4 in Sep. 2009;
more than 1300 downloads.
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 7 / 109
RTSSthe Robotics Toolbox for Scilab/Scicos
Application areas
Education
Gain insights on subjects such as:
homogeneous transformations;
Cartesian and joint-space trajectories;
forward and inverse kinematics;
differential motions and manipulator Jacobians;
forward and inverse dynamics.
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 8 / 109
RTSSthe Robotics Toolbox for Scilab/Scicos
Application areas
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 9 / 109
ScicosLab Transformations
Outline
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 10 / 109
ScicosLab Transformations
Coordinate transformation
z0
0
O0
p = 0 o1 + 0 R 1 1 p
y0
x0
0
o1 y
0
p
z1 Compact representation
y1
x P 1 O1
p 0 0
0 1
p R1 o1 p
x1 =
1 0T 1 1
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 11 / 109
ScicosLab Transformations
Example
Z
Create the homogeneous 1.0
0.8
transform 0.6
0.4
w 0.2
Tb = Translx (0.5m)Roty (/2) 0.0
Z
Y
0.2 Z
Solution 0.4
0.6
0.8
twb = rt_transl(0.5, 0, 0)*.. X 1
1.0
rt_roty(%pi/2),
1.0 0
twb = 0.6
0.2
0.2
0.6 1 X
0. 0. 1. 0.5 Y 1.0
0. 1. 0. 0.
- 1. 0. 0. 0.
0. 0. 0. 1. Orientation of frame {B} (colored)
with respect to frame {W} (black)
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 12 / 109
ScicosLab Transformations
0. 1.5707963 - 1.5707963
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 13 / 109
ScicosLab Transformations
Transformations
demos/rt_rttrdemo.sce
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 14 / 109
ScicosLab Modelling
Outline
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 15 / 109
ScicosLab Modelling
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 16 / 109
ScicosLab Modelling
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 17 / 109
ScicosLab Modelling
Body frames
{W} is the world frame;
{L0 } is termed base frame;
{Li } is the body-fixed frame
attached to link i;
{E} is the tool frame.
n
Y
w
Te (q) = w T0 i1
Ai (qi ) n
Te
i=1
| {z }
0 T (q)
n
q + n(q, q)
B(q) = JT (q)he
+ Fv q + Fs sgn(q)
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 20 / 109
ScicosLab Modelling
Axis i Axis i + 1
Axis i 1
ai i
zi0
zi {L }
x i0 i
Link i 1
i xi
Link i
di
zi1
{Li1 } xi1
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 21 / 109
ScicosLab Modelling
Axis i Axis i + 1
Axis i 1
zi
{Li } xi
Link i 1
i
i1
Link i
zi1
{Li1 } xi1 di
zi0
ai1
xi0
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 22 / 109
ScicosLab Modelling
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 23 / 109
ScicosLab Modelling
Approach
Balance of forces and moments
acting on each link.
Forward recursion
Velocities and accelerations.
Backward recursion
Forces and moments along the
Computational structure of the
structure.
Newton-Euler recursive algorithm
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 24 / 109
ScicosLab Modelling
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 25 / 109
ScicosLab Modelling
(previous slide)
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 27 / 109
ScicosLab Modelling
0.2
Example: Where is the tool?
0.1
Pose: q = [ /10 7/25 ] rad
0.0
Forward kinematics
Pelican
0.1 -->>q = [%pi/10, 7/25*%pi];
-->T02 = rt_fkine(pel, q),
T02 =
0.2
y
0.9298 0.3681 0. 0.3221
- 0.3681 0.9298 0. - 0.3430
z 0.3 0. 0. 1. 0.
x 0. 0. 0. 1.
0.4
0.1 0.0 0.1
X 0.2 0.3 0.4 0.5 Draw the Pelican pose
-->ws = [-0.1, 0.5, -0.4, 0.2, -1, 1];
Top view of Pelican pose at -->rt_plot(pel, q, "workspace", ws);
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 28 / 109
ScicosLab Modelling
y0 y1
x0
l1 y2
x1 Link i1 ai1 i di
y20
1 0 0 10 ? 0
10 2 0 l1 2? 0
x2
2 x20 Modified Denavit-Hartenberg table
l2
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 29 / 109
ScicosLab Modelling
(previous slide)
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 30 / 109
ScicosLab Modelling
0.2
Show that the two approaches are
0.1 equivalent.
0.0 Forward kinematics
Pelican (2)
0.1 -->q = [%pi/10, 7*%pi/25];
-->T02m = rt_fkine(pelm, q),
T02m =
0.2
y 0.9298 0.3681 0. 0.3221
- 0.3681 0.9298 0. - 0.3430
0.3 0. 0. 1. 0.
z 0. 0. 0. 1.
x
-->T02 - T02m
0.4 ans =
0.1 0.0 0.1
X 0.2 0.3 0.4 0.5
0. 0. 0. 0.
0. 0. 0. 0.
0. 0. 0. 0.
MDH-based Pelican, at 0. 0. 0. 0.
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 31 / 109
ScicosLab Modelling
lc1
l1
m 1 , I1
10
Question
Which are the parameters that
m2 , I2 depend on the adopted frame
lc2 assignment?
2
l2
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 33 / 109
ScicosLab Modelling
Actuators of Pelican
Two brushless DC motors located at the base and at the elbow.
Actuator/transmission parameters
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 35 / 109
ScicosLab Modelling
Inertial parameters and gravity ac- Show 1st link data in detail
celeration vector
-->rt_showlink(pel.links(1)),
// kinematic data displayed here...
-->CL(1).I = [0,0,I1,0,0,0]; m = 6.5225
-->CL(2).I = [0,0,I2,0,0,0]; !r = -0.1617 !
-->CL(1).m = m1; ! !
-->CL(2).m = m2; ! 0 !
-->CL(1).r = [lc1;0;0]; ! !
-->CL(2).r = [lc2;0;0]; ! 0 !
-->pel = rt_robot(pel, CL); !I = 0 0 0 !
-->pel.gravity = [0;9.81;0]; // X-Y plane ! !
! 0 0 0 !
! !
! 0 0 0.1213 !
Jm =
G =
B = 0
!Tc = 0 0 !
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 36 / 109
ScicosLab Modelling
l1 l2
lc1 m1 lc2 m2
m2 g
m1 g
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 37 / 109
ScicosLab Modelling
11.967401 0.4595869
0. - 5.551D-17
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 38 / 109
ScicosLab Modelling
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 39 / 109
ScicosLab Modelling
Body frames
Kinematic chain
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 41 / 109
ScicosLab Modelling
Link i ai i di
1.0
1 /2 0 1 d1
0.8
2 0 a2 2? 0
3 /2 0 3? 0 0.6
Z
0.4
4 /2 0 4 d4 z
y
5 /2 0 5 0 0.2 x
6 0 0 6 0 0.0
R3
0.2
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 42 / 109
ScicosLab Modelling
Outline
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 44 / 109
ScicosLab Analysis
Forward kinematics
// robot configuration Inverse kinematics
q = [0.377, -0.754, -1.711,..
0.754, 2.011, -0.440];
// solve the inverse kinematics (IKP)
q0 = qz; q0(2:3) = [-1, -1];
// pose of the EE
modulo(rt_ikine(r3, twe, q0), 2*%pi),
twe = rt_fkine(r3, q),
ans =
twe =
0.377 - 0.754 - 1.711
0.680 0.572 0.458 0.743
0.754 2.011 - 0.440
- 0.348 0.802 - 0.485 0.294
- 0.645 0.170 0.745 0.465
0. 0. 0. 1.
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 45 / 109
ScicosLab Analysis
Differential kinematics
The Jacobian matrix maps velocity be-
ve = J(q)q
tween joint and Cartesian space.
Jacobian analysis
// manipulators Jacobian matrix in base coordinates, and its determinant
j0 = rt_jacob0(r3, q),
j0 =
- 0.294 0.190 0.529 0. 0. 0.
0.743 0.075 0.210 0. 0. 0.
0.000 0.799 0.457 0. 0. 0.
0.000 0.368 0.368 0.582 - 0.228 0.458
0.000 - 0.930 - 0.930 0.231 - 0.874 - 0.485
1. 0.000 0.000 - 0.780 - 0.429 0.745
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 46 / 109
ScicosLab Analysis
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 47 / 109
ScicosLab Analysis
Z
ans = 0.6 R3
0.3
0.4
1.949 1.571 0.744 0.1
0.529 0.342 0.000 0.2
0.1
0.0
// large joint velocities
dqs = inv(js)*[0.1; 0; 0; 0; 0; 0]; dqs., 0.2 0.3
ans = X
0.3 0.5
0.1 0.1
Y 0.3 0.5
- 219.6 0.052 0.000
105.6 32.66 - 145.6
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 49 / 109
ScicosLab Analysis
0.2
Joint 2 (rad.)
0.4
demos/rt_rttgdemo.sce 0.6
0.8
demos/rt_rtandemo.sce 1.0
1.2
1.4
1.6
// initial configuration 1.4
qi = [0, -%pi/2, %pi/2, 0, 0, 0]; 1.2
Joint 3 (rad.)
1.0
0.8
// final configuration
0.6
qf = [0, 0, 0, 0, 0, 0]; 0.4
0.2
// travelling time 0.0
t = [0:.056:2]; 0.2
0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0
Time (s)
// 5th order interpolating polynomial
[q, qd, qdd] = rt_jtraj(qi, qf, t);
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 50 / 109
ScicosLab Analysis
8
6
Torque 1 (Nm)
4
2
0
2
4
6
8
0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0
800
700
Torque 2 (Nm)
600
500
Joint-torques analysis 400
300
200
100
0
100
// joint torques computation 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0
tau = rt_frne(r3, q, qd, qdd);
10
0
Torque 3 (Nm)
// contribution of gravitational torques 10
20
taug = rt_gravload(r3, q);
30
40
50
60
0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0
Time (s)
The gear ratios of the base axes are fairly low, so the actuator inertia
do not dominate the total joint inertia.
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 52 / 109
ScicosLab Analysis
Inertia of joint 1 90
80
70
// manipulators pose definition as a
b11 (kgms^2)
60
// function of joint angles q2 and q3 50
[q2, q3] = meshgrid(-%pi:0.2:%pi); 40
[r, c] = size(q2); 30
q=[zeros(r*c,1) q2(:) q3(:) zeros(r*c,3)]; 20
4
3
// compute inertia matrix & plot results 2
4
b = rt_inertia(r3, q); b11 = b(1,1,:); 1
0
3
2
b11 = matrix(b11,r,c); surf(q2, q3, b11); 1
0
1
2 1
q3 (rad) 3 2
3 q2 (rad)
4
// factor of variation over the path 4
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 53 / 109
ScicosLab Analysis
30
25
b23 (kgms^2)
// manipulators pose definition as a 15
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 55 / 109
ScicosLab Analysis
q + G(q) =
q + C(q, q)
B(q)
Question
How to use the (recursive) balance of all the forces acting on each link
to compute:
G(q);
B(q);
q;
C(q, q)
(argh!).
C(q, q)
q;
B(q)
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 56 / 109
ScicosLab Analysis
0.0
0.1 quantities in standard SI units.
0.2
0.3
0.3 0.2
Create a Puma 560 robot
0.1 0.0
// standard DH-based robot object (p560)
0.2
0.1 exec <RTSS-DIR>/models/rt_puma560.sce;
0.4
Y X
0.3 0.6 // modified DH-based robot object (p560m)
exec <RTSS-DIR>/models/rt_puma560akb.sce;
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 57 / 109
ScicosLab Analysis
0.8
0.6
0.2 y
z x
0.0
Standard DH-based model;
0.2
quantities in standard SI units.
0.3 Stanford arm
0.2 Create a Stanford manipulator
0.1
0.0 // standard DH-based robot object (stanf)
0.1 0.2 exec <RTSS-DIR>/models/rt_stanford.sce;
Y 0.0
0.1 0.2 0.1
0.4 0.3 X
Outline
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 59 / 109
Scicos Basics
RTSS
XYZ2Tr
RTSS
RPY2Tr
RTSS
Sine RTSS
Wave RTSS Eul2Tr
Backward
Euler
JTraj RTSS
RTSS
Tr2XYZ
Square
Wave
Forward
Euler Category RTSS
Tr2RPY
Trajectory
Category Others
RTSS
Tr2Eul
Category
Homogeneous
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 61 / 109
Scicos Basics
RTSS
FKine
RTSS RTSS
noname
RNE Robot
noname noname
RTSS
0
J
noname
RTSS RTSS
Coriolis Accel
noname noname
RTSS
n
J RTSS
noname Gravload
noname
RTSS
RTSS
Inertia
noname
Tr2Diff
Category Dynamics
Category Kinematics
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 62 / 109
Scicos Basics
RTSS
The user must specify the robot
Robot model to be simulated as block
parameter;
noname
the robot model must be a
symbolic parameter defined in
A block which operates on a robot the context of the diagram.
model: the Forward Dynamics
Block (FDB)
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 63 / 109
Scicos Basics
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 64 / 109
Scicos Basics
RTSS
Robot
R3
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 65 / 109
Scicos Motion control
Outline
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 66 / 109
Scicos Motion control
=
q + n(q, q)
B(q)
n(q, q)
y
Z
q
Z
q
= B(q)y + n(q, q)
which leads the system to
Exact lineatization performed by
=y
q
inverse dynamics control
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 67 / 109
Scicos Motion control
y=q + Kp q
d + Kv q
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 68 / 109
Scicos Motion control
d
q
q d
q
Kv
X
q
y
B(q)
X X
MANIPULATOR q
qd
q
Kp
X
n(q, q)
4
~
q q
. RTSS
1
. Kp
q
~ RNE 1
q y
2 Kd R3
..
qd
3
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 70 / 109
Scicos Motion control
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 71 / 109
Scicos Motion control
l1,2,3 = 0.5 m
x3
y3 Link i ai i di
3
1 0 l1 1 0
l3
x2 2 0 l2 2 0
y2
3 0 l3 3 0
2
y1 Denavit-Hartenberg table
x 1 l2
Robot kinematic model
y0 l1
x 0 1
dh_123=[0,l_123,0,0];
R3arm = rt_robot([dh_123;dh_123;dh_123],..
"RRR arm", "", "Sciavicco-Siciliano");
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 73 / 109
Scicos Motion control
q = J1 d + Ke)
A (q)(x
x d
xd q q
Z
e
J1
X X
K A (q)
xe
k( )
1e05 0
0.8e05 1e08
0.6e05 2e08
[rad]
[m]
0.4e05 3e08
0.2e05 4e08
0 5e08
0 1 2 3 4 5 0 1 2 3 4 5
[s]
[s]
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 76 / 109
Scicos Motion control
q = JA (q)(x d + Ke) + (I JA JA )q 0
w(q)
T k0 > 0;
q 0 = k0
q w(q) secondary objective function.
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 77 / 109
Scicos Motion control
Simulation scenario
q1m = 2, q1M = 2;
q2m = /2, q2M = /2;
q3m = 3/2, q3M = /2;
k0 = 250.
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 78 / 109
Scicos Motion control
// in/out pointers
y = GetRealOutPortPtrs(block, 1);
u = GetRealInPortPtrs(block, 1);
// computational code
y[0] = -250/3 * u[0]/(16*pi*pi);
y[1] = -250/3 * u[1]/(pi*pi);
y[2] = -250/3 * (u[2]+pi)/(pi*pi);
The Jacobian pseudo-inverse algorithm
with redundancy resolution
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 79 / 109
Scicos Motion control
Joints 2 and 3 keep far from their min. and max. limit, respectiv.
[rad]
0 0
5 5
0 1 2 3 4 5 0 1 2 3 4 5
[rad]
0 0
5 5
0 1 2 3 4 5 0 1 2 3 4 5
[s] [s]
5e06 2e04
4e06
1.5e04
3e06
[m]
[m]
1e04
2e06
0.5e04
1e06
0 0
0 1 2 3 4 5 0 1 2 3 4 5
[s] [s]
Simulation scenario
[Caccavale et al., 1996]
// initial configuration
tri = rt_roty(%pi)*rt_rotz(-2/3*%pi);
tpi = rt_transl([.975, -2.194, 1.288]);
ti = tpi*tri;
// final configuration
trf = rt_roty(%pi)*rt_rotz(3/4*%pi);
tpf = rt_transl([.975, -.594, 1.288]);
tf = tpf*trf;
RTSS
Tr2NOA
RTSS
Tr2XYZ
Mux +
1
RTSS
Tr2XYZ
Mux
Mux
1/2*( n x nd + o x od + a x ad )
2
RTSS
Tr2NOA
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 83 / 109
Scicos Motion control
2.5e06
Norm of position error (m)
2.0e06
1.5e06
1.0e06
5.0e07
0.0e+00
0 1 2 3 4 5 6
2.5e06
1.0e06
task
5.0e07
0.0e+00
0 1 2 3 4 5 6
Time (s)
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 84 / 109
Scicos Developments
Outline
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 85 / 109
Scicos Developments
Further applications
Blocks under developments
RTSS Applications
0. Second order CLIK
J algorithms;
operational space control;
noname interaction control.
Time-derivative Jacobian block
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 86 / 109
Scicos Developments
Further applications
Blocks under developments
RTSS
RNE+
Applications
interaction control.
noname
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 87 / 109
Scicos Developments
Further applications
Blocks under developments
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 88 / 109
Code Generation RTSS/Scicos_RTAI/RTAI-Lab
Outline
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 89 / 109
Code Generation RTSS/Scicos_RTAI/RTAI-Lab
1.6
joint 1
joint 2
1.4
1.2
Positions 1.0
[rad]
homing traj. (1012 s); 0.6
0.4
0.0
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 90 / 109
Code Generation RTSS/Scicos_RTAI/RTAI-Lab
dk
q
qk
A/D
q dk X k
q
Kv,c
q
X yk X k
k)
B(q D/A MANIPULATOR q
qdk X k
q
Kp,c
(qk , q k )
n
qk
q k A/D
To workspace To workspace
pos_err comp_torq
qd ~qk
TRAJECTORY. qd
+
~q.k
q
S/H
qk
.. +
k rt_robot
GENERATOR qd
qk
INVERSE DYNAMICS
S/H .q .qk
.qk CONTROLLER
Pelican S/H
4
~
qk qk
1 Kpc . k
.
~
qk
qk
yk
rt_rne
P/NF/Pelican 1
2 Kvc
..q
dk
3
Position errors
3e04
joint 1
2e04 joint 2
1e04
[rad]
0e+00
1e04
2e04
3e04
0 2 4 6 8 10 12
Computed torques
10
6
[Nm]
2
0 2 4 6 8 10 12
Time [s]
Difference between the diagrams for simulation and real time code
generation: trajectory generator and scope blocks.
Scope Scope
POSERR1 TORQUE2
Scope Scope
Demux
POSERR2 TORQUE1
TRAJECTORY.qqdd +
~qk
~q.k
q
S/H
qk
.. +
k rt_robot
GENERATOR qd
qk
INVERSE DYNAMICS
S/H .q .qk
.qk CONTROLLER
Pelican S/H
Scicos block diagram for the control system (real time control)
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 95 / 109
Code Generation RTSS/Scicos_RTAI/RTAI-Lab
dats/DDqd2.dat
extdata
dats/DDqd1.dat
extdata
dats/Dqd2.dat
extdata
dats/Dqd1.dat
extdata
dats/qd2.dat
extdata
dats/qd1.dat
extdata
Mux
Mux
Mux
qd
.
qd
..q
d
1
3
Block diagram for the trajectory generator (real time control)
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 96 / 109
Code Generation RTSS/Scicos_RTAI/RTAI-Lab
Scope Scope
POSERR1 TORQUE2
Scope Scope
Demux
POSERR2 TORQUE1
TRAJECTORY.qqdd +
~qk
~q.k
COMEDI A/D
qk
.. +
k
GENERATOR qd
qk
INVERSE DYNAMICS
COMEDI D/A .qk
.qk CONTROLLER
COMEDI A/D
Block diagram for real time control with a set of COMEDI blocks
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 97 / 109
Code Generation RTSS/Scicos_RTAI/RTAI-Lab
Actions
1 Use the
Region-to-Super-block
facility to construct the SB;
2 click the RTAI CodeGen button;
3 click on the SB.
QRtaiLab with the scope manager and the position errors scopes
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 101 / 109
Code Generation RTSS/Scicos_RTAI/RTAI-Lab
QRtaiLab with the scope manager and the computed torques scopes
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 102 / 109
Summary
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 103 / 109
Further readings about RTSS
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 104 / 109
References
Generic references
P.I. Corke.
A robotics toolbox for MATLAB.
IEEE Robotics and Automation Magazine, vol. 3, pp. 2432,
Mar. 1996.
A. Winkler and J. Such.
Novel joint space force guidance algorithm with laboratory robot
system.
Proceedings of the 16th IFAC World Congress, 2005.
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 105 / 109
References
Technical Literature of the Pelican arm model treated in this presentation
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 106 / 109
References
Technical Literature of the Manutec r3 robot model treated in this presentation
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 107 / 109
References
Technical Literature of the Manutec r3 robot model treated in this presentation
P. Anell.
Modeling of multibody systems in Omola.
Master thesis ISRN LUTFD2/TFRT5516SE, Department of
Automatic Control, Lund Institute of Technology, Lund, Sweden,
Sep 1994.
M. Vukobratovic et al.
Dynamics and Robust Control of Robot-environment Interaction.
World Scientific Publishing Co., Inc., River Edge, NJ, USA, 2009.
D. Katic and M. Vukobratovic.
Intelligent Control of Robotic Systems.
Kluwer Academic Publishers, 2003.
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 108 / 109
References
Technical Literature of the other models and simulation scenarios presented in this work
F. Caccavale et al.
Experiments of kinematic control on a redundant robot manipulator
with non-spherical wrist.
Laboratory Robotics and Automation, vol. 8, pp. 2536, 1996.
L. Sciavicco and B. Siciliano.
Modelling and Control of Robot Manipulators.
Advanced Textbooks in Control and Signal Processing, London,
UK: Springer-Verlag, 2nd ed., 2000.
M. Morelli (Centro E.Piaggio, UNIPI) the Robotics Toolbox for Scilab/Scicos 25/05/11, A21, Robotica 1 109 / 109