Robot Manipulator Modeling in Matlab-Simmechanics With PD Control and Online Gravity Compensation

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/224205422

Robot manipulator modeling in Matlab-SimMechanics with PD control and


online gravity compensation

Conference Paper · November 2010


DOI: 10.1109/IFOST.2010.5668085 · Source: IEEE Xplore

CITATIONS READS

41 6,719

3 authors, including:

Tien Dung Le Hee-Jun Kang


The University of Danang - University of Science and Technology University of Ulsan
23 PUBLICATIONS   185 CITATIONS    155 PUBLICATIONS   1,980 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

ROBOT CALIBRATION - ROBOT ACCURACY IMPROVEMENT View project

hybrid car View project

All content following this page was uploaded by Hee-Jun Kang on 27 May 2014.

The user has requested enhancement of the downloaded file.


Robot manipulator modeling in Matlab-
Simmechanics with PD control and online Gravity
compensation

Le Tien Dung Hee-Jun Kang, Young-Shick Ro


Graduate School of Electrical Engineering School of Electrical Engineering
University of Ulsan University of Ulsan
Ulsan, Korea Ulsan, Korea
[email protected] [email protected], [email protected]

Abstract — The objective of this article is to present a method to The paper is organized as follow. Section 2 describes the
model the mechanics of robot manipulators. A complete tasks of building mechanical model of two-link arm using
description of the procedure to model and control a two-link SimMechanics Toolbox. The Dynamic model of general
planar robot arm is detailed and simulated using industrial robot is recalled, and detailed for two-link planar
Matlab/Simulink from the generation of a mechanical model in robot manipulator. PD control and gravity compensation
SimMechanics Toolbox. One of the simplest position controllers method is also reviewed in this section. Section 3 shows the
for robot manipulators is the PD control with desired gravity results of simulation. Finally, section 4 concludes the paper.
compensation. The implementation of this method was verified
on this model. The results of simulation show that SimMechanics
can be used to model the mechanics of robot and the better II. DESCRIPTION
performance can be obtained with the online gravity
compensation method as compared to the case of constant gravity A. Mechanical Model
compensation method. The first step is to create a model of a simple two-link
planar arm for testing the control methods. Figure 1 shows the
Keywords: Robotic manipulator; Simulation; Modelling; PD mechanical model of the two-link planar arm described with
control; Gravity compensation.
SimMechanics. The model is composed by two revolute joints
and two bodies. The module receives torques as input and
I. INTRODUCTION outputs are joint angles, angular velocities, joint torques. The
The position control of robot manipulators is the simplest masses are considered to be concentrated at the end of each
aim in robot control, at the same times, it is one of the most link, to simply the modeling tasks. In SimMechanics this is
relevant issues in practical manipulators. Many approaches realized setting the inertias as ‘zeros(3,3)’, a 3x3 matrix that
have been introduced to treat this control problem. It is well defines point masses and defining the Centre of Gravity (CG)
known that a rigid robot arm can be globally asymptotically on the edge of each link.
stabilized around a given joint configuration via a PD
controller on the joint errors, provided that gravity is cancelled B. Dynamical Model
by feedback. Under a mild condition on the proportional gain, The dynamic model of a n-joint robot manipulator can be
this scheme can be simplified by performing only constant written in the Lagrangian form as:
gravity compensation at the desired configuration [1].
M (q )q + C (q, q ) + G (q ) = τ (1)
This paper presents a case study which has been done by
Sciavicco and Siciliano [2], where a nonlinear gravity where q is the joint variable n-vector and τ is the vector of
compensation term evaluated online at the current generalized forces acting on the robot manipulator. M(q) is the
configuration. But here we model the mechanics of robot inertia matrix, C ( q, q ) are the Coriolis/centripetal forces, and
manipulator by using SimMechanics Toolbox. The use of
G(q) is the gravity vector. In equation (1) we are not taking into
SimMechanics as a tool to model the mechanics of the robot
account the friction torques that are always to be found in a real
allows the possibility to verify model-based control algorithm.
robot manipulator.
The precise mechanical model, as in a real application, is
unknown for the designer so that the ability of the control The dynamic model of the two-link planar arm following
algorithm to match the real model can be easily proven. That (1) is:
would allow the testing of techniques like the dynamic model-
⎡τ ⎤
τ = ⎢ 1 ⎥ ; M (q) = ⎡⎢ M 11 (q) M 12 (q) ⎤⎥ ;
based control but also learning techniques that extract the ⎡q ⎤ ;
q = ⎢ 1⎥
⎣τ 2 ⎦
model of the plant under consideration.
⎣ q2 ⎦ ⎣ M 21 (q ) M 22 (q )⎦
⎡ C ( q , q ) ⎤ ; ⎡ G (q ) ⎤ (2) Sciavicco and Siciliano [2] proposed the PD control with
C (q ) = ⎢ 1 ⎥ G (q) = ⎢ 1 ⎥ online gravity compensation method as:
⎣ C 2 ( q , q ) ⎦ ⎣G2 (q )⎦

Where: τ = K P q~ − K D q + G ( q ) (12)

M 11 (q ) = (m1 + m2 )l12 + m2l22 + 2m2l1l2 cos q2 (3) The different between the control laws (11) and (12) is that
the term G ( qd ) computed off-line in (11) and online in (12).
M 12 ( q ) = M 21 ( q ) = m2l22 + m2l1l2 cos q2 (4)
For proving the globally asymptotically stable, choose the
M 22 (q) = m2l22 (5) following positive definite quadratic form as Lyapunov
function candidate
C1 (q, q ) = −m2l1l2 (2q1q2 + q22 ) sin q2 (6)
1 1 ∀q , q~ ≠ 0
C2 (q, q ) = m2l1l2 q12 sin q2 (7) V (q , q~ ) = q T M (q )q + q~ T K P q~ > 0 (13)
2 2
G1 (q) = (m1 + m2 ) gl1 cos q1 + m2 gl2 cos(q1 + q2 ) (8) An energy-based interpretation of (13) reveals a first term
expressing the system kinetic energy and a second term
G2 (q ) = m2 gl2 cos(q1 + q2 ) (9) expressing the potential energy stored in the system of
equivalent stiffness KP provided by the n position feedback
The term l1 and l2 are the length of links 1 and 2, loops.
respectively and m1 and m2 are their masses. In our example, Differentiating (13) with respect to time, and recalling that
l1 = l2 = 0.5m and m1 = 20kg , m1 = 10kg . qd is constant, yields:
1
C. PD control with online gravity compensation V = q T M (q )q + q T M (q)q − q T K P q~ (14)
2
Let a constant equilibrium posture be assigned for the
system as the vector of desired joint variables qd . It is desired Solving (1) for M ( q ) q and substituting it in (14) gives:
to find the structure of the controller which ensures global 1 (15)
V = q T ( M (q) − 2C (q, q ))q + q T (τ − G (q ) − K P q~ )
asymptotic stability of the above posture. 2
~T q T
Take the vector q [ ]
T
as the system state, where: The first term on the right-hand side is null because of the
skew-symmetry of matrix N = M − 2C . Then, the choice of
q~ = qd − q (10) controller (12) gives:

The PD control with constant gravity compensation in V = −q T K D q (16)


(Tomei, 1991) is express as According to the above, the function candidate V decreases

Figure 1. Mechanical model of robot in SimMechanics

τ = K P q~ − K D q + G(qd ) (11) as long as q ≠ 0 for all system trajectories. It can be shown


that the system reaches an equilibrium posture when q ≡ 0
Where K P > 0 and K D > 0 are both symmetric and
and q~ = qd − q ≡ 0 . The above rigorously shows that any
typically diagonal matrices.
manipulator equilibrium posture is globally asymptotically
stable under a controller with a PD linear action and a And the results obtained are shown in figures 3 and 4.
nonlinear gravity compensation action. Stability is ensured for Although both controllers achieve the correct steady-state
any choice of KP and KD, as long as these are positive definite position, the transient with the online gravity compensation is
matrices. faster than with the constant gravity compensation. This is
Link 1 Torque
III. RESULTS 600

500
Figure 2 shows the complete Matlab model of the control 400
system. It includes the mechanical model and the PD controller 300

Torque [Nm]
with gravity compensation. 200

100

-100

-200
0 1 2 3 4 5 6 7 8 9 10
Time [s]

Link 2 Torque
200

150

100

Torque [Nm]
50

Figure 2. Complete control system modelled with


-50
Matlab/Simulink
0 1 2 3 4 5 6 7 8 9 10
Time [s]

Simulation tests have been carried out in order to measure Figure 4. Motor torques in the test 1 with online (solid) and
constant (dashed) gravity compensation
dynamic performance of the PD controller with online vs.
constant gravity compensation.
achieved at the cost of just slightly higher motor torques at the
Link 1 position start of motion.
2

The test 2 was done with the inverse requested motion,


from qi = [π / 2 π / 6]T rad to qd = [0 0] , differences in
1.5 T
Angle [rad]

1 behavior are less evident. After extensive simulations, it has


been observed in general that, for a given set of gains, transient
0.5
performance with the online gravity compensation scheme is
0
usually better than with constant gravity compensation.
0 1 2 3 4 5 6 7 8 9 10
Time [s]

Link 2 position
IV. CONCLUSIONS
0.7
This paper describes the process of modeling a simple robot
0.6
manipulator using PD control with online gravity
0.5
compensation method. The use of SimMechanics as a tool to
Angle [rad]

0.4
model the mechanics of the robot allows the possibility to
0.3
verify model, as in real application, is unknown for the
0.2
designer so that the ability of the control method to match the
0.1
real model can be easily proven. That would allow the testing
0
0
Figure1 2
3. Link 3 4
positions the5 (s)
in Time test 16 with online
7 8
(solid)9 and 10
of techniques like the dynamic model-based control but also
constant (dashed) gravity compensation learning techniques that extract the model of the plant under
consideration.

V. ACKNOWLEDGMENT
The test 1 was done with a step change of the link positions
from the initial configuration qi = [0 0]T to the desired The authors would like to express financial supports from
Ministry of Knowledge Economy under Human Resources
configuration qd = [π / 2 π / 6]T rad. The robot is initially in an Development Program for Convergence Robot Specialists.
equilibrium state, under the action of the control torque
τ = G (qi ) . The gains of both controllers in (11) and (12) are
set to:
K P = diag{260,260} , K D = diag{80,80}
REFERENCES [4] John J. Craig, Introduction to Robotics Mechanics and control,
third edition, Pearson Prentice Hall, 2005.
[1] P. Tomei: “Adaptive PD controller for robot manipulators”,
[5] Krzysztof Kozlowski, Modelling and Identification in robotics,
IEEE Trans. Robotics Automat., Vol. 7, pp. 565-570,1991.
Springer – London, 1998.
[2] L. Sciavicco, B. Siciliano, Modelling and control of robot
manipulators (2nd ed.), London: Springer.
[3] Rafael Kelly: “PD Control with Desired Gravity Compensation of
Robotic Manipulator: A Review”, The International Journal of
Robotics Research 1997; 16; 660.

View publication stats

You might also like