Вы находитесь на странице: 1из 4

ANNALSofFacultyEngineeringHunedoara

InternationalJournalofEngineering

TomeXII[2014]Fascicule2[May]
ISSN:15842665[print];ISSN:15842673[online]
afreeaccessmultidisciplinarypublication
oftheFacultyofEngineeringHunedoara
PetarMANDI,2.MihailoLAZAREVI,3.SlavoljubSTOJANOVI,4.MilanRISTANOVI

1.

REALTIMECONTROLOFROTARYINVERTEDPENDULUM

FacultyofMechanicalEngineering,Belgrade,SERBIA

14.

Abstract: This paper proposes advanced control strategy for a rotary inverted pendulum (RIP). RIP is an
underactuated mechanical system because it has only one control input and two degrees of freedom.
Because of its complex nonlinear dynamics, RIP is usually used to test performance of different control
algorithms. First, laboratory electromechanical system representing the full control system is described in
short,followedbythemathematicalmodelfortheRIP.Controlproblemisdividedandimplementedintwo
differentsteps:swingupandstabilizationroutines.Here,apartialfeedbacklinearizationprocedureandPID
control are suggested for the control of RIP. The effectiveness of the proposed control method is tested in
MatlabSimulinkenvironment.
Keywords:invertedpendulum,PIDcontrol,feedbacklinearization

1.INTRODUCTION
Underactuatedsystemshavemoredegreesoffreedomthanactuators,[13].Arotationalinverted
pendulum, also known as Furuta pendulum, is an example of such a system, [47]. Almost all
dynamic systems are nonlinear by its nature, therefore a lot of research is done in the area of
nonlinear control. The aim of this paper is to develop a nonlinear control system for both the
rotationalpendulumandactuatedarm.First,adescriptionoftheFurutapendulumwillbegiven.
Then, a mathematical model of the system will be derived. The control strategy consists of two
parts,aswingupandabalancingphase.Thetheoryofinversedynamiccontrolwillbeusedfor
the latter. However, the resulting zero dynamics of the actuated arm shows unstable behavior.
Hence,acontrolfeedbacklawwillbeextendedinordertostabilizethehorizontalarm.
2.DYNAMICEQUATIONSOFROTARYINVERTEDPENDULUM
2.1Descriptionofthesystem
In Figure 1 a schematic of Furuta pendulum and real
laboratory model are shown. Inverted pendulum is a
mechanicalsystemwithtwodegreesoffreedom,where
angular position of the arm and the pendulum are
denoted as and , respectively. The arm is driven
withatorque,whilenotorqueisapplieddirectlytothe
pendulum.
The variables used to define the model of the rotary
invertedpendulumareshownintablebelow.

The laboratory electromechanical system is comprised


Figure1.Aschematicoftherotational
of three subsystems: measurement, power and control invertedpendulumandavailablelaboratory
model
supervision. The first one consists of high resolution
encodersformeasuringarmandpendulumanglepositions.Thesecondoneprovidesthepower
for DC motor which drives the arm shaft. Embedded compact RIO controller, together with
monitoring PC forms the last and most important part. LabVIEW software is used for
implementingtherealtimesoftwareandsupervision.

copyrightFacultyofEngineeringHunedoara,UniversityPOLITEHNICATimisoara

211 | Fascicule 2

ISSN: 1584-2665 [print]; ISSN: 1584-2673 [online]


Table1.Descriptionoftheparametersusedinthemodelingofthesystem
massofthearmandpendulum,respectively
distanceofthearmspivotpointtothependulumspivotpoint
distanceofthependulumspivotpointtoitsend(extreme)
totallengthofthearm,andpendulumrespectively
momentofinertiaofthearmwithrespecttoitscenterofmass
axialmomentsofinertiaofthependulumwithrespecttoitscenterofmass

m1,m2
R1
R2
2r1,2r2
J 1
J 2 , J 2 , J 2

2.2Mathematicalmodelofrotaryinvertedpendulum
Here, the Rodriguez method is proposed for modeling the dynamics of the system where
configuration of the mechanical model can be defined by generalized coordinates q1 and q2,
representing and , respectively. The equations of motion of the inverted pendulum can be
expressedinacovariantformofLagrangesequationofsecondkindasfollows[1,2]:
n

a q&& + , q& q&

=1

=1 =1

= 1, 2 (1)

= Q

where the coefficients a are the covariant coordinates of the basic metric tensor [ a ] R 22 ,
, , , = 1, 2 presents Christoffel symbols of the first kind, and Qr denote the generalized

gravitationalandcontrolforces.
Theequationsofmotionofoursystemcanberewrittenincompactmatrixform:

A(q)q&& + C (q, q& ) + g (q) = Q a (2)


where q = ( )T , A ( q ) = a11

a12
22 is basic metric tensor,
R
a
a
21 22

C (q, q& ) R 2 vector which takes care of

configuration of inverted pendulum system and velocity dependent effects, Q g ( q ) = -g (q ) R 2


vector of generalized gravitational forces, and

Qa = ( M

0 ) R 2

vector of generalized control

forces.Finally,Eq.(2)writteninfullformbecomes:
& & + & 2 = M (3)
a11&& + a12&& + 212,1

22,1
a12&& + a22&& 12,1& 2 = Q2g (4)

whereare

a11 = J 1 + J 2 sin 2 ( ) + J 2 cos 2 ( ) + m2 R12 + m1 ( R1 r1 ) 2 + m2 ( R2 r2 ) 2 sin 2 ( )

a12 = m2 R1 ( R2 r2 ) cos( ) = K 3 cos( ), a22 = J 2 + m2 ( R2 r2 ) 2 = K 4

12,1 = 0.5 ( m2 ( R2 r2 ) 2 + J 2 J 2 ) sin(2 ) = K 2 sin(2 )

(5)

22,1 = m2 R1 ( R2 r2 ) sin( ) = K 3 sin( ), Q2g = m2 g ( R2 r2 ) sin( ) = K1 sin( )

Forsimplicity,weintroducephysicalparameters K1 , K 2 , K3 , K 4 whicharedefinedasshownabove.
3.CONTROLLERDESIGN
In this section a control strategy is developed to stabilize the pendulum in upright position. As
mentioned before, there are two different control problems. The first one is swinging the
pendulumupfromdowntotheuprightposition.Oncethesystemisclosetothedesiredposition,
with a simple change in the controller, it is possible to bring the pendulum in the desired
equilibrium.
3.1.Swingupcontroller
There are many ways to bring the pendulum to the upper half plane, when < / 2 . One of the
most popular is based on energy control [3,4]. The goal of this paper is not to build an accurate
swing up controller, but to bring the pendulum close enough so the stabilizing controller can
stabilize it in the upright position. Hence, the swing up strategy will only be described here in
short.
Theequationofmotionforthependulumis:

( J 2 + m2 ( R2 r2 )2 ) && m2 g ( R2 r2 ) sin + m2 a( R2 r2 ) cos = 0 (6)


wherearepresentstheaccelerationofthependulumspivotpoint.Frictionhasbeenneglected.For
212 | Fascicule 2

ANNALS of Faculty Engineering Hunedoara International Journal of Engineering

thesakeofclarity,letusintroduce J 2 = J 2 + m2 ( R2 r2 )2 .Theenergyoftheuncontrolledpendulum
(withouttherotatingarm)is:
E=

1
J 2& 2 + m 2 g ( R2 r2 )(cos 1) (7)
2

Theenergyisdefinedsothatitiszeroinuprightrestposition.Now,itisnecessarytounderstand
howtheenergyisinfluencedbytheaccelerationofthepivot.Wecanfinditbycomputingthetime
derivativeofE:
dE
& && m 2 g ( R 2 r2 )& sin = m 2 a ( R 2 r2 )& cos (8)
= J 2
dt

whereEq.(6)hasbeenusedtoobtainthelastequality.Equation(8)impliesthatsystemissimply
an integrator with varying gain. To increase energy the acceleration of the pivot a should be
positivewhenthequantity & cos isnegative.WiththeLyapunovfunction = ( E0 E )2 2 andthe
controllaw u (t ) = a (t ) = k ( E E0 )& cos , k = const > 0 ,itfollows:
& = km 2 ( R 2 r2 )(( E 0 E )& cos ) 2 (9)
Thiscontrollawdrivestheenergytowardsitsdesiredvalue E0 = 0 ,exceptwhen & cos = 0 .

3.2Stabilizingcontroller
Nowwecandesignacontrollerthatstabilizesthependuluminuprightposition.Forthispurpose,
wewillusenonlinearcontroltechniqueknownasinversedynamiccontrol.Itisbasicallyapartial
feedback linearization procedure [5], which simplifies the control design. The first step of this
procedure is to calculate && from Eq. (4) and plug it into Eq. (3). After rearranging, Eq. (3) now
reads,[6]:

a11
a a
Q2g + 12,1& 2 + a12 11 22
a12
a12

& & + & 2 = M


&& + 212,1
12,1

(10)

Wecanseethat && hasbeencanceledoutin(10).ControlinputMcanbechosenasfollows:


M =

a11 g
a a
& & + & 2 (11)
Q2 + 12,1& 2 + a12 11 22 M R + 212,1
12,1
a12
a12

whereMRisnewcontrolinput.Now,Eq.(3)and(4)become:
&& =

K1
K
K MR
(12)
tan( ) 2 2 sin( )& 2 + 4
K3
K3
K 3 cos( )

&& = M R (13)

wherephysicalparameters K1 , K 2 , K3 , K 4 aredefinedinEqs.(5).Becauseofthecosineterminterm
a12 inthedenominatorofEq.(11),thecontrolsignalisdefinedineverypositionofthependulum

except for the horizontal, i.e. < / 2 . To achieve asymptotic stability for the ( , & ) , a PD
controllercanbeused:

M R = K P K D & (14)

ThePDcontrollerstabilizestheinvertedpendulumforevery K P , K D > 0 ,butdoesnotstabilizethe


arm.Thiscanbeseenbyobservingthezerodynamicsofthesystem.Substituting = 0, & = 0 into
Eq.(12),itfollows && = 0 & = const .
So,underactuatedmechanicalsystemslikeinvertedpendulumarenotfullyfeedbacklinearisable,
andcontroltechniquesdevelopedforafullyactuatedsystemscannotbeappliedhere[7].Thenew
goalistoimprove M R sothatasymptoticstabilityfor ( , & , , & ) canbeaccomplished.Toachieve
this,controlfeedbacklawwillbeextendedasfollows:
M R = K P K D & K P cos( ) K D & cos( ) +

K1
sin( ) (15)
K4

AftersubstitutingEq.(15)intoEq.(12)and(13),weobtain:

&& +

K4
K
K4
K
K D & + 4 K P =
K D & + K P ) 2 2 sin( )& 2 (16)
(
K3
K3
K 3 cos( )
K3

213 | Fascicule 2

ISSN: 1584-2665 [print]; ISSN: 1584-2673 [online]


K
&& + K D & + K P 1 sin( ) = cos( ) ( K D & + K P ) (17)
K4

Now, we can linearize system described with Eqs. (16)(17) around equilibrium point
( ,&, , & ) = ( 0, 0, 0, 0 ) .Acontrollerderivedfromalinearizedsystemwillworkforanonlinearsystem,
provided region of attraction is not too large. Under this condition, linearization allows us to
neglectnonlinear,quadraticterm & 2 inEq.(16).So,linearizationarounddesiredequilibriumpoint
leadsto:

&& +

K4
K
K
K
K D & + 4 K P = 4 K D & 4 K P (18)
K3
K3
K3
K3

&& + K D & + K P

K1
= K D & K P
K4

(19)

ChoosingthefollowingvaluesforPDparameters:

K P = 30; K D = 12; K P = 250; K D = 30; (20)


where K1 = 6.514e 2, K 2 = 9.186e 4, K 3 = 1.428e 3, and K 4 = 1.837e 3 aresystemparameterstakenfrom
thereallaboratorymodelofinvertedpendulum,eigenvaluesofthelinearizedsystemare:
*
*

s1,2
= 5.6 9.81 j
s3,4
= 1.67 2.81 j (21)
Conditions for asymptotic
stabilityoflinearizedsystemare
fulfilled. Simulation studies are
performed in Matlab Simulink
environment to illustrate the
performance of the designed
controller.Figure2belowshows
results for the change of the
pendulum and arm angle, with
Figure2.Changeofpendulumandarmangle
respecttotime.Initialconditions
are ( , &, , & ) = ( 0, 0, , 0 ) .Achangefromswinguptostabilizingcontrollerhappenswhen < 6 .

4.CONCLUSION
In this paper a control algorithm for rotational inverted pendulum is provided. The control
strategy consists of two parts, a swing up controller and stabilizing controller. A stabilization
algorithmisbasedonpartialfeedbacklinearization,whichmadeitpossibletocompensatesomeof
nonlinearities of the pendulum. Control feedback law is designed to achieve local asymptotic
stabilityforboththependulumandthedrivenarm.Resultshavebeensupportedbymeansofthe
computer simulation. For future research, an improvement of the proposed method is to be
considered,basedonLyapunovsdirectmethod.Also,transferfromsimulationtoreallaboratory
invertedpendulumwillbeasubjectoffutureinvestigations.
Acknowledgement
Authors gratefully acknowledge the support of Ministry of Education, Science and Technological
DevelopmentoftheRepublicofSerbiaundertheprojectTR33047andTR35006.
REFERENCES
[1.] ovi,V.,Lazarevi,M.(2009).RobotMechanics.FacultyofMechanicalEngineering,Belgrade.
[2.] Acosta, J.A. (2009). Furutas pendulum: A Conservative Nonlinear Model for Theory and Practise.
MathematicalProblemsinEngineering,Vol.2010,no.29.
[3.] Astrom,K.J.,Furuta,K.(2000).Swingingupapendulumbyenergycontrol.Automatica,Vol.36,no.9,
p.287295.
[4.] Stojanovi,S.(2011)Diplomawork.FacultyofMechanicalEngineering,Belgrade.
[5.] Khalil,H.(2002).Nonlinearsystems.PrenticeHall,UpperSaddleRiver.
[6.] Spong, M.W. (1996). Energy Based Control of a Class of Underactuated Mechanical Systems. IFAC
WorldCongress,p.431435.
[7.] Chen,C.K.,Lin,C.J.,Yao,L.C.(2004).InputStateLinearizationofaRotaryInvertedPendulum.Asian
JournalofControl,Vol.6,no.6,p.130135.

214 | Fascicule 2

Вам также может понравиться