pid control dynamics of a robotic arm manipulator with two degrees of freedom

7

Upload: popochis

Post on 07-May-2015

5.722 views

Category:

Technology


13 download

DESCRIPTION

This paper presents a basic example of PID control applied to a robotic manipulator arm with two DOF (degrees of freedom), as well as the design of the dynamic model, explaining in detail each step so that in future work, we can increase the diculty level regardless of DOF of the robot. Also shown how to introduce the PID controller parameters to the equation of the dynamics of the robot, left as future work the implementation of a real-time control of these variables.

TRANSCRIPT

Page 1: PID control dynamics of a robotic arm manipulator with two degrees of freedom

PID control dynamics of a robotic arm manipulator with two

degrees of freedom.

David I. Robles G.

[email protected]

August 17, 2012

Abstract

This paper presents a basic example of PID controlapplied to a robotic manipulator arm with two DOF(degrees of freedom), as well as the design of the dy-namic model, explaining in detail each step so thatin future work, we can increase the di�culty level re-gardless of DOF of the robot. Also shown how tointroduce the PID controller parameters to the equa-tion of the dynamics of the robot, left as future workthe implementation of a real-time control of thesevariables.Keywords: PID control, Dynamic model, Robotic

manipulator arm.

1 Introduction

The robot arm manipulators in recent years hada slight growth in the industry. Because in stan-dard industrial the controllers don't include thenon-linearities between the joints of the robot andthe problem of modelling the dynamics and motioncontrol arise the complications of the system whencomputing the inertia tensor of a moving rigidbody. The purpose of robot arm control is tomaintain the dynamic response of a computer-basedmanipulator in accordance with some pre speci�edsystem performance and goals. Most of the robotmanipulators are driven by electric, hydraulic, orpneumatic actuators, which apply torques (or forces,in the case of linear actuators) at the joints of therobot.

Conventional robot control methods depend heav-ily upon accurate mathematical modelling, analysis,and synthesis. Dynamic modelling of manipulatorsis a very active �eld of research, it's can be used toinvestigate the system responses and system proper-ties, like �nding the stability of the system. Actuallythe manipulators use proportional-derivative con-trollers (PD) or proportional-integral-derivativecontrollers (PID) in closed-loop systems in order toreach the desired con�gurations.

The proportional-integral-derivative (PID) controlhas simple structure and clear physical meanings forits three gains. The control performances are accept-able in the most of industrial processes. Most robotmanipulators employed in industrial operations arecontrolled by PID algorithms independently at eachjoint [3].

In practice, the tuning of PID controllers is easierfor robots whose transmission system includes re-duction mechanisms such as gears or bands. The useof these reductions e�ectively increases the torque orforce produced by the actuators, and therefore, theseare able to drive links of considerably large masses.

Many control algorithm such as computer torquemethod, optimal control, variable structure control(VSC), neural networks (NNs) and fuzzy system havebeen proposed by many researchers to deal with thisproblem. Our proposal is to use an approach of an

1

Page 2: PID control dynamics of a robotic arm manipulator with two degrees of freedom

David I. Robles G. Control de Procesos y Robótica 2

adaptive tuning methods: These are for automatedon-line tuning based on real-time identi�cation.

1.1 Dynamic model

The dynamic model of a robot is the relationshipbetween the movement and the forces involvedin the robot. This establishes the mathematicalrelationship between the location of the robot jointvariables, de�ned by its coordinates or location ofits end, its derivatives (velocity and acceleration),the forces or torques applied to the joints and thedimensional parameters of the robot.

This model relies heavily on the established bal-ance of forces in Newton's second law (equation 1) orits equivalent for rotational movements, the so-calledlaw of Euler (equation 2).

∑F =

d

dt(mv) (1)

∑T =

d

dtIω = Iω + ω × (Iω) (2)

Thus, in the simplest case of a robot with one linkshown in Figure (1), the balance of forces-torqueswould result in the following equation:

τ −MgLcosθ = Id2θ

dt2⇒

τ =ML2θ +MgLcosθ

Figure 1: Model of the link with concentrated mass.

There are two approaches to dynamic robot model,the direct and inverse dynamic model.

• The direct dynamic model expresses the tempo-ral evolution of the robot joint coordinates asa function of the forces and torques involvedθ(t) = f(τ(t)).

• The inverse dynamic model determines theforces and torques required to achieve a jointevolution of the coordinates determined τ(t) =g(θ(t)).

There is also another alternative approach for ob-taining the model using the Lagrangian formulationbased on energetic considerations, that is thereforethe di�erence between kinetic energy (KE) and po-tential energy (PE), this formulation greatly facili-tates the obtaining of a more complex model of arobot. This equation is de�ned as

L(q(t), q(t)) = KE(q(t), q(t))− PE(q(t)) (3)

With the Lagrangian L, we can solve the Euler-Lagrange equation which relies on the partial deriva-tive of kinetic and potential energy properties of me-chanical systems to compute the equations of motionand is de�ned as follow

F =d

dt

[∂L∂θ

]−∂L∂θ

(4)

where F is the external force acting on the θgeneralized coordinate, represents the torque appliedto the robot and L is the Lagrangian equation of themotion.

The kinetic energy equation is de�ned as

KE =1

2mv2 (5)

where m is the mass of link and v is the theangular velocity of the joint. For simplicity, the massof each link is supposed to be punctual and locatedat the end of the link.

The potential energy equation is de�ned as

August 17, 2012 Maestría en Ciencias Área Cibertrónica

Page 3: PID control dynamics of a robotic arm manipulator with two degrees of freedom

David I. Robles G. Control de Procesos y Robótica 3

PE = mgl (6)

Where g is the gravity and l is the projection ofthe position vector of the link.

In the simplest case of a robot shown in �gure (1)we obtain the following dynamic model

KE =1

2Iθ2 (7)

where I is the inertia tensor I =ML2. Also

PE =Mgh =MgLsenθ (8)

and substituting with the Lagrangian equation (3)we obtained the following expression.

L(q(t), q(t)) = KE(q(t), q(t))− PE(q(t))

L(q(t), q(t)) = 1

2ML2θ2 −MgLsenθ

(9)

Now we can calculate the force applied to thegeneralized coordinate using the equation Euler-Lagrange

∂L∂θ

= −MgLcosθ

∂L∂θ

=ML2θ

d

dt

∂L∂θ

=ML2θ

(10)

and �nally we get the torque applied to the joint.

F =ML2θ +MgLcosθ (11)

Whatever the method is chosen to obtain the dy-namic model of the robot, it has the following formof a nonlinear equation

F =M(q)q + C(q, q) + g(q) (12)

where q ∈ Rn represents the link positions. n isjoint number or degrees of freedom, M(q) is the in-ertia matrix, C(q, (q)) = {ckj} ∈ Rnxn representscentrifugate force, g(q) is vector of gravity torquesand F ∈ Rn is control input.

1.2 PID control

Considering the nonlinear equation that are derivefrom Euler-Lagrange equation (12), the control in-put variable F which represents the torque appliedto the robot, is unknown, (we assumed that the con-sidered robot actuators were ideal sources of torquesand forces). However it's requires a control in thetorque applied of the joints to reach a �nal position.Therefore we use the classical linear PID law as shownbelow;

F = Kpe+Ki

∫ t

0

e(τ)dτ +Kde (13)

where e = qd − q, qd is desired joint angle, Kp, Ki

andKd are proportional, integral and derivative gainsof the PID controller, respectively. This PID controllaw can be expressed via the following equations.

F = Kpe+Kde+ ξ

ξ = Kie, ξ(0) = ξ0(14)

The integral action of the PID control law (14) in-troduces an additional state variable that is denotedhere by ξ and whose time derivative is ξ = Kie. Theclosed-loop equation is obtained by substituting thecontrol action F from (14) in the robot model (12).

M(q)q + C(q, q) + g(q) = Kpe+Kde+ ξ (15)

which may be written in terms of the state vector[ξT eT ˙eT

]T, as

d

dt

ξee

=

ee

qd −M(q)−1 [Kpe+Kde+Kiξ−C(q, q)q − g(q)

(16)

The equilibrium of the equation above, if any, have

the form[ξT eT ˙eT

]T=[ξ∗T 0T 0T

]Twhere

ξ∗ = K−1i

[M(qd)qd + C(qd, qd)qd + g(qd)

](17)

August 17, 2012 Maestría en Ciencias Área Cibertrónica

Page 4: PID control dynamics of a robotic arm manipulator with two degrees of freedom

David I. Robles G. Control de Procesos y Robótica 4

must be a constant vector. Certainly, for ξ∗ tobe a constant vector, if the desired joint position qd

is time-varying, it may not be arbitrary but shouldhave a very particular form. One way to obtain a qd

for which ξ∗ is constant, is by solving the di�erentialequations

d

dt

[qd

qd

]=

[qd

M(qd)−1[F0 − C(qd, qd)qd − g(qd)

] ](18)[

qd0

qd0

]∈ <2n

where F0 ∈ <n is a constant vector. This wayξ∗ = K−1

i F0.

2 PID control dynamics of a

robotic arm manipulator

For this experiment, what we want to control with thePID is the force applied to the robot to take it to adesired position using as parameter the error betweenthe actual and the desired coordinate. To developthe dynamic model we will consider the robot armmanipulator with two degrees of freedom as shown inFigure 2, where M1 =M2 = 1 and L1 = L2 = 1.

Figure 2: Two-link planar manipulator.

First we need to solve the Lagrangian equation (3)

calculating the kinetic and potential energy. How-ever, we don't know the velocity but we know thatthe derivative of an position respect to time is the ve-locity. So we de�ne the position in the end of the linkusing the variables we already know, in other words,we can put

x1 = L1sinθ1y1 = L1cosθ1

x2 = L1sinθ1 + L2sin(θ1 + θ2)y2 = L1cosθ1 + L2cos(θ1 + θ2)

(19)

Then substituting in the equation of kinetic energywe obtain the following expression

KE =1

2M1x

21 +

1

2M1y

21 +

1

2M2x

22 +

1

2M2y

22 (20)

and by simpli�cation.

KE =1

2(M1 +M2)L

21θ

21 +

1

2M2L

22θ

21 +M2L

22θ1θ2

+1

2M2L

22θ

22 +M2L1L2cosθ2(θ1θ2 + θ21)

(21)And Potential energy is

PE =M1gL1cosθ1 +M2g(L1cosθ1 + L2cos(θ1 + θ2))(22)

So we can now form the Lagrangian equation (3).

L =1

2(M1 +M2)L

21θ

21 +

1

2M2L

22θ

21 +M2L

22θ1θ2

+1

2M2L

22θ

22 +M2L1L2cosθ2(θ1θ2 + θ21)

−M1gL1cosθ1 +M2g(L1cosθ1 + L2cos(θ1 + θ2))(23)

The next step is to form the Lagrange-Euler equa-tion (4) with the Lagrangian (L) we already know, inorder to calculate the force applied to the robot.

Fθ1,2 =d

dt

[∂L∂θ1,2

]− ∂L∂θ1,2

(24)

So, the dynamic equations after simpli�cations be-come

August 17, 2012 Maestría en Ciencias Área Cibertrónica

Page 5: PID control dynamics of a robotic arm manipulator with two degrees of freedom

David I. Robles G. Control de Procesos y Robótica 5

Fθ1 = ((M1 +M2)L21 +M2L

22 + 2M2L1L2cosθ2)θ1

+(M2L22 +M2L1L2cosθ2)θ2 −M2L1L2sinθ2(2θ1θ2 + θ22)

−(M1 +M2)gL1sinθ1 −M2gL2sin(θ1 + θ2)(25)

Fθ2 = (M2L22 +M2L1L2cosθ2)θ1 +M2L

22θ2

−M2L1L2sin(θ2)θ1θ2 −M2gL2sin(θ1 + θ2)(26)

So, we can describe the motion of the system bythe equation (12),

q =

[θ1θ2

]

M(q) =

[D1 D2

D3 D4

]where

D1 = ((M1 +M2)L21 +M2L

22 + 2M2L1L2cosθ2)

D2 = (M2L22 +M2L1L2cosθ2)

D3 =M2L22 +M2L1L2cosθ2

D4 =M2L22

C(q, q) =

[−M2L1L2sinθ2(2θ1θ2 + θ22)

−M2L1L2sinθ2θ1θ2

]

g(q) =

[−(M1 +M2)gL1sinθ1 −M2gL2sin(θ1 + θ2)

−M2gL2sin(θ1 + θ2)

]

F =

[Fθ1Fθ2

]Having the system equation, we can have

q =M(q)−1 [−C(q, q)− g(q)] + F (27)

with

F =M(q)−1F ⇔ F =M(q)F (28)

So, we decoupled the system to have the new (non-physical) input

F =

[f1f2

](29)

however, the physical torque inputs to the system are[fθ1fθ2

]=M(q)

[f1f2

](30)

The error signals of the system are

e(θ1) = θ1f − θ1e(θ2) = θ2f − θ2

(31)

where θf is the �nal positions. For the experiment, the�nal position is given by[

θ1fθ2f

]=

[π2

−π2

](32)

and for the initial position is given by

θ0 =

[−π

2π2

](33)

with this information, we can design the general struc-ture of PID controller for any input using the classicallinear law (13). So, the complete system equations withcontrol would be

q =M(q)−1 [−C(q, q)− g(q)] + F (34)

with

F =

[f1f2

]=

[Kp1(θ1f − θ1)−Kd1θ1 +Ki1

∫e(θ1)dt

Kp2(θ2f − θ2)−Kd2θ2 +K21

∫e(θ2)dt

](35)

Recalling the physical actual torques(30). Howeverin order to apply all controls of Proportional-Derivative-Integral actions, a extra state is added for each angle toresemble the integration inside the computer:

x1 =∫e(θ1)dt⇒ x = θ1f − θ1

x2 =∫e(θ2)dt⇒ x = θ2f − θ2

(36)

So, the system equations are

x1 = θ1f − θfx2 = θ2f − θf[

θ1θ2

]=M(q)−1 [−C(q, q)− g(q)] +

[F](37)

August 17, 2012 Maestría en Ciencias Área Cibertrónica

Page 6: PID control dynamics of a robotic arm manipulator with two degrees of freedom

David I. Robles G. Control de Procesos y Robótica 6

3 Results and Conclusions

Our �rst approach to control the robotic manipulator armis by trial and error, the two parameters of the controllerswill be tuned manually to obtain the best performance.The best performance of the controller parameters valuesare shown below

Kp1 = 15

Kd1 = 7

Ki1 = 10

Kp2 = 15

Kd2 = 10

Ki2 = 10

As shown in the �gures (3) and (4), the position errorreaches zero at a considerably fast time,

Figure 3: Theta 1 error.

Figure 4: Theta 2 error.

the force or torque applied can be seen in Figures (5)and (6), slight overshoot or peaks but stabilize quickly

Figure 5: Torque of Theta 1.

Figure 6: Torque of Theta 2.

By the experiments, we can notice how Kp is relatedto direct error and to speed of evolution, Kd is relatedto speed of interaction with change in states and Ki isrelated to overall error cancellation. However the slight-est change in the parameters of the controller producesmore overshoots and oscillations and are highly sensitiveto initial and �nal positions.

As future work is proposed to use other techniques,such as fuzzy controller systems that works only with theposition of the angle and torque response as well as anonline controller with auto tuning of the parameters Kp,Kd and Ki

References

[1] Reyes, Cortés, F. (2012) �MATLAB Aplicado a

Robótica y Mecatrónica� (1st Edition). México City.Alfaomega.

August 17, 2012 Maestría en Ciencias Área Cibertrónica

Page 7: PID control dynamics of a robotic arm manipulator with two degrees of freedom

David I. Robles G. Control de Procesos y Robótica 7

[2] Barrientos, A. Peñin, Luis, F. Balaguer, C. Aracil,R. (2007) �Fundamentos de Robótica� (2nd Edition).México City. McGrawHill.

[3] M.W.Spong and M.Vidyasagar (1989) �Robot Dy-

namics and Control� Canada. John Wiley Sons Inc.

[4] R. Kelly, V. Santibáñez and A. Loría (2005) �Controlof Robot Manipulators in Joint Space� (2nd Edition).Springer.

August 17, 2012 Maestría en Ciencias Área Cibertrónica