0% found this document useful (0 votes)
12 views8 pages

LQR Control for Cart-Inverted Pendulum

This paper discusses the control of a Cart-Inverted Pendulum System (CIPS) using the Linear Quadratic Regulator (LQR) method to stabilize its highly unstable dynamics under various physical constraints. The authors present a novel model that incorporates mechanical transmission and a DC motor, enhancing real-time implementation and minimizing control challenges. Simulation results demonstrate the effectiveness of the proposed method in maintaining the pendulum in an upright position while controlling the cart's position.

Uploaded by

Si tha Thach
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views8 pages

LQR Control for Cart-Inverted Pendulum

This paper discusses the control of a Cart-Inverted Pendulum System (CIPS) using the Linear Quadratic Regulator (LQR) method to stabilize its highly unstable dynamics under various physical constraints. The authors present a novel model that incorporates mechanical transmission and a DC motor, enhancing real-time implementation and minimizing control challenges. Simulation results demonstrate the effectiveness of the proposed method in maintaining the pendulum in an upright position while controlling the cart's position.

Uploaded by

Si tha Thach
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

International Journal of Mechanical & Mechatronics Engineering IJMME-IJENS Vol:17 No:01 119

State space control using LQR method for a cart-inverted pendulum


linearised model
Indrazno Siradjuddin1 , Budhy Setiawan1 , Ahmad Fahmi2 , Zakiya Amalia1 and Erfan Rohadi3
1 ElectricalEngineering Department, Malang State Polytechnic, Malang, Indonesia
2 Electrical
Engineering Department, Malang State University, Malang, Indonesia
3 Information Technology Department, Malang State Polytechnic, Malang, Indonesia

The Cart-Inverted Pendulum System (CIPS) is a classical benchmark control problem. Its dynamics resembles with that of many
real world systems of interest like missile launchers, pendubots, human walking and segways and many more. The control of
this system is challenging as it is highly unstable, highly non-linear, non-minimum phase system and underactuated. Furthermore,
the physical constraints on the track position also pose complexity in its control design. This paper presents a control method
to stabilise the unstable CIPS within the different physical constraints such as in track length and control voltage. A novel cart-
inverted pendulum model is proposed where mechanical transmission and a dc motor mathematical model have been included which
resembles the real inverted pendulum. Therefore problems emerged in realtime implementation can be minimised. A systematic the
state feedback design method by choosing weighting matrices key to the Linear Quadratic Regulator (LQR) design is presented.
Simulation experiments have been conducted to verify the controller’s performances. From the obtained simulation and experiments
it is seen that the proposed method can perform well stabilising the pendulum at the upright angle position while maintaining the
cart at the desired position.

Index Terms—Cart-Inverted Pendulum, Linear Quadratic Regulator, Optimal Control, Non Linear System

I. I NTRODUCTION approach firstly discussed in Section II In this section, the


state space representation of the CIPS is presented where the
ONTROLLING a Cart-Inverted Pendulum System
C (CIPS) is a challenging problem which is widely used
as benchmark for testing control algorithms such as PID
DC motor and its transmission system are considered. Section
III discusses the LQR method in detail, followed by simulation
and results of the LQR control approach applied on CIPS
controllers [1], neural networks [2], [3], fuzzy control [4],
problem presented in Section IV Conclusion is presented in
genetic algorithms [5]. The CIPS features as higher order,
Section V
nonlinear, strong coupling and multivariate system, which has
been studied by many researchers. It is used to model the
field of robotics and aerospace field, and so has important II. S YSTEM M ODELING
significance both in the field of the theoretical study research
and practice. It has good practical applications right from mis- A. Lagrange’s Equation
sile launchers to segways, human walking, earthquake resistant Lagrange’s equation is used to describe the motion equation
building design etc. The CIPS dynamics resembles the missile of a complex system dynamic in a very efficient way. It reduces
or rocket launcher dynamics as its center of gravity is located the need for complicated vector analysis that usually required
behind the centre of drag causing aerodynamic instability. for discribing forces applied on a mechanical system.
The CIPS has two equilibrium points [6], one of them is The fundamental principle of Lagrane’s equation is the
stable while the other is unstable. The stable equilibrium representation of the system by a set of generalised coordinate
corresponds to a state in which the pendulum is pointing q = {q1 , · · · , qi , · · · , qn }, where n is the total assigned
downwards. The control challange is to maintain the pendulum generalised coordinate. qi is an independent degree of freedom
at the unstable equilibrium point where the pendulum upwards, of true system which completely incorporate the contraints
with minimum control energy. In recent times optimal control unique to that system, i.e., the interconnections between parts
provides the best possible solution to process control problems of the system.
for a given set of performance objectives. Detail review on The Lagrangian function L is expressed by the kinetic
optimal control has been presented in [7]. Survey on optimal energy K and the potential energy P as discribed as follows
control approaches and their applications have been conducted,
for instance, an optimal control approach for inventory systems L = K(q, q̇) − P(q) (1)
[8] and energy optimisation [9].
This paper investigates the application of the Linear where the kinetic energy function in terms of the geralised
Quadratic Regulator (LQR) to stabilise the CIPS at the unsta- coordinate q and its derivative q̇. The potential energy function
ble equilibrium point. The organisation of this paper is struc- is expressed in terms of only the generalised coordinate.
tured as follows: The dynamic modelling using Lagrangian The desired motion equations are derived using
 
Corresponding author: Indrazno Siradjuddin (email: in- d ∂L ∂L
drazno@[Link]). − = Qi (2)
dt ∂ q̇i ∂qi

176401-3232-IJMME-IJENS c February 2017 IJENS


International Journal of Mechanical & Mechatronics Engineering IJMME-IJENS Vol:17 No:01 120

where Qi denotes the external force applied in term of qi The potentioal energy involved in the system is only from the
coordinate. The expression in (2) is called Lagrange’s equa- pendulum mass m
tion. It can be deduced that for n generalised coordinates, the
system dynamic is represented by n second order differential P = mgh (13)
equations. = mgl cos θ (14)
Then, the Lagrangian equation (15) can be fully defined using
B. Lagrange’s Equation of The System Eq. (12) and Eq. (14), as follows
1 1
L = M ẋ2 + m(ẋ2 + 2ẋlθ̇ cos θ + l2 θ̇2 )
2 2
−mgl cos θ (15)
The motion of the inverted pendulum on a cart can be specifi-
cally defined by the displacement of the cart in the î direction
with respect to the origin and the angle of the pendulum with
respect to the ĵ direction. Hence, the system only has two
degrees of freedom reprented by x and θ, the system dynamics
must be expressed in terms of x and θ. Thus, x and θ can be
selected as the elements of the generalised coordinate vector
q. Using this selection, the Lagrange’s equation (??) can be
expressed for each generalised coordinate:
 
d ∂L ∂L
− = f (16)
dt ∂ ẋ ∂x
 
d ∂L ∂L
− = 0 (17)
dt ∂ θ̇ ∂θ
Fig. 1. The inverted pendulum on a cart system It is assumed that the external forces applied on the system
is only applied on cart in î direction, there is no external
The motion of the cart is only in î direction, thus the total torque applied on the pendulum. Deriving for each term in
kinetic energy of the cart can be expressed as the differential equation in (16) and (17), it can be obtained
1 that
KM = M ẋ2 (3)
2 ∂L
= (M + m)ẋ + mlθ̇ cos θ (18)
The pendulum moves in ĵ and î directions, therefore the total  ∂ ẋ
d ∂L
kinetic energy of the pendulum is expressed as = (M + m)ẍ + mlθ̈ cos θ
dt ∂ ẋ
1
Km = m(ẋθ + ḣ) (4) −mlθ̇2 sin θ (19)
2 ∂L
It can be seen in Fig. 1 that = 0 (20)
∂x
xθ = x + l sin θ (5) and
= l cos θ ∂L
h (6) = mlẋ cos θ + ml2 θ̇ (21)
 ∂ θ̇

Taking the derivative of Eq. (5) and Eq. (6), we have d ∂L
= ml(ẍ cos θ − θ̇ẋ sin θ)
dt ∂ θ̇
ẋθ = ẋ + lθ̇ cos θ (7)
+ml2 θ̈ (22)
ḣ = −lθ̇ sin θ (8)
∂L
= −mẋlθ̇ sin θ + mgl sin θ (23)
Therefore, the pendulum kinetic energy in Eq. (4) can be ∂θ
rewritten as Therefore, the Lagrange’s equation for each generalised coor-
1 dinate can be rewritten as
Km = m((ẋ + lθ̇ cos θ)2 + (−lθ̇ sin θ)2 ) (9)
2 f = (M + m)ẍ + mlθ̈ cos θ − mlθ̇2 sin θ (24)
1
= m(ẋ2 + 2ẋlθ̇ cos θ + l2 θ̇2 ) (10) 0 = ml(ẍ cos θ − θ̇ẋ sin θ) + ml2 θ̈
2
hence the total kinetic energy from the cart and the pendulum −(−mẋlθ̇ sin θ + mgl sin θ) (25)
can be obtained as It can be seen that Eq.(24) and (25) are nonlinear which
have trigonometric terms sin() and cos(). The controller will
K = KM + Km (11)
1 1 be designed to stabilised the pendulum vertically with small
= M ẋ2 + m(ẋ2 + 2ẋlθ̇ cos θ + l2 θ̇2 ) (12) deflection of θ. Thus, it can be approximated that with small
2 2
176401-3232-IJMME-IJENS c February 2017 IJENS
International Journal of Mechanical & Mechatronics Engineering IJMME-IJENS Vol:17 No:01 121

θ, sin θ ≈ θ and cos θ ≈ 1. Deriving Eq.(24) and (25) using where the term 2πr2 is the circumference of the pulley that
this approximation, one will find the quadratic terms θ̇2 and connects to the cart using a belt. Therefore,
θ̇θ. In the small region near equilibrium, the terms θ̇2 and θ̇θ ẋ
are significantly small. Using aforementioned assumptions, the ω1 = (35)
r1
linearised Lagrange’s equation can be obtained as follows
Substituting Eq.(35) into Eq.(32) yields
f = (M + m)ẍ + mlθ̈ (26)

0 = ẍ + lθ̈ − gθ (27) τ1 = Kr (−Kb + va ) (36)
r1
The force that moves the cart is caused by the torque τ2 , for
C. DC Motor: Torque, Armature Voltage and Angular Ve- this reason, it is needed to transform τ1 7→ τ2 . Consequently,
locity Model using f r2 = τ2 (the force that perpendicular to the direction
The armature circuit equation is of r2 from pulley centre), it can be verified that
dia Kr ẋ
i a Ra + L a+ vb = va (28) f= (−Kb + va ) (37)
dt r1 r1
The generated back electromotive force (emf), vb , is propor- Kt
where Kr = R a
. Substituting Eq.(37) into Eq.(26) produces
a new Lagrange’s equation in term of generalised coordinate
x as follows
Kr Kr Kb
va = (M + m)ẍ + ẋ + mlθ̈ (38)
r1 (r1 )2
To simplify the derivation, the following shorthands are used
K r Kb
c1 = (39)
(r1 )2
Kr
c2 = (40)
r1
then from the Lagrange’s equation (38), and by substituting
Fig. 2. DC Motor Armature Equivalent Circuit
the term lθ̈ from Eq.(27) into Eq.(38), it can be obtained a
following the first differential equation of the system
tional to the rotational speed of the rotor
1
dθ1 ẍ = (c2 va − c1 ẋ − mgθ) (41)
vb = Kb (29) M
dt
Rearranging Eq.(27), one can derive
where Kb is the back emf constant and ω1 = dθ dt . The motor
1
1
torque τ1 is proportional to the armature current ia , hence θ̈ = (gθ − ẍ) (42)
l
τ1 = Kt i a (30) Substituting Eq.(41) into Eq.(42), the second differential equa-
tion of the system can be expressed as follows
where Kt is the motor torque constant. Substituting Eq.(29)  
and (30) (in term of ia ) into (28), one obtains 1 1
θ̈ = gθ − (c2 va − c1 ẋ − mgθ) (43)
τ1 d 2 τ1 dθ1 l M
R + La + Kb = va (31) c2 c1 (M + m)g
Kt (dt)2 dt = − va + ẋ + θ (44)
Ml Ml Ml
Generally, the inductor in the rotor is small, thus can be
At this point, the diffrential equations of the cart-pendulum
neglected, then the armature circuit equation in term of τ1
motion which based on the Lagrange’s method have been
becomes
developed. Next step, before the optimal controller can be
Kb Kt defined, firstly, the differential equations in the state space
τ1 = −Kt ω1 + va (32)
Ra Ra representation has to be formed, as discussed in the following
In the mechanical transmission (i.e., geared and pulley sys- section.
tems), it applies a following formula
τ2 N2 ω1 r2 D. State Space Representation
= = = (33)
τ1 N1 ω2 r1 Following equations are state space representation of a system
where N is the number of a gear teeth and r is the radius of ẋ = Ax + Bu (45)
a pulley. The motor angular velocity ω1 can be expressed in
y = Cx + Du (46)
term of the cart velocity ẋ (reffering to the Fig.1) by
2πr2 r2 2π where x ∈ Rj is a state vector and j is the total number of
= (34) the state variable. ẋ is the time derivative of the state vector.
ẋ r1 ω 1

176401-3232-IJMME-IJENS c February 2017 IJENS


International Journal of Mechanical & Mechatronics Engineering IJMME-IJENS Vol:17 No:01 122

importance of the error and the energy cost. Therefore, the


matrix Q and R signify the trade-off between performance
and control effort respectively. If |Q| is relatively smaller than
R, the control system becomes expensive since J primarily
penalises the use of control energy. In contrast, when |Q| is
relatively bigger than R, the control system becomes a cheap
control because an arbitrary small control effort can be used
to stabilise the system, however, the system responses will be
Fig. 3. Open loop system
relatively slow. It is a common practice to let R > 0 and Q
be a diagonal matrix in the form of
 
q1 0 · · · 0
A vector u ∈ Rk is the control input or control vector which  0 q2 · · · 0 
has k elements of control variables. The A ∈ Rj×j , B ∈ Q =.

.. . .

(48)
 ..

Rj×k and C ∈ Rp×j are called the system, the input and the . . 0
output matrices, respectively, where p is the output number. 0 0 ··· qj
The output vector is denoted as y ∈ Rp . The open loop system
where (q1 , q2 , · · · , qj ) are positive values. From the Laplace
diagram describing the state space form is shown in Fig.3.
transfer function of the closed loop system (Fig,4), the denom-
For the case of CIPS, the state vector, its derivative
inator can be found as
and the control input are defined as x = [x θ ẋ θ̇]T , ẋ =
[ẋ θ̇ ẍ θ̈]T , u = va , respectively. Composing Eq.(41) and D(s) = sI − (A − BK) (49)
Eq.(44) into the state space form, we have
  where I is an identity matrix. Hence, all eigenvalues of
0 0 1 0 (A − BK) determine the stability and transient response
0 0 0 1 characteristics of the closed loop system. The design effort
A =  ,
0 − mg
M − c1
M 0 is to select the feed-back gain K such that the eigenvalues of
0 (MM +m)g c1
0 (A−BK) have negative real parts. The optimal feed-back gain
 l Ml
K can be obtained by solving the following Riccati Equation

0
for a positive definite matrix P:
 
 0  1 0 0 0
B =  c2  , C =
 
0 1 0 0
M AT P + PA − PBR−1 BT P + Q =0 (50)
−M c2
l
y = [x θ]T , D = ∅ then the optimal feed-back gain K can be computed as

It is assumed that only x and θ can be observed from sensors K = R−1 BT P (51)
(e.g optical encoders) and the mapping from the state vector
Note that if matrix (A − BK) is a stable matrix then P
into the output vector is one-to-one mapping.
always exists. In contrast, for the case of an unstable matrix
(A − BK), the matrix P does not exist for solving Eq.(50).
III. LQR METHOD Thus, it is necessary for the control engineer to check the con-
trollability and observability of the system model beforehand
the controller implementation. The controllability means that
for any initial state values, the acceptable control effort u can
steer the state to any final state values within some finite time
window if only if rank(C) is equal to the number of state
variables.
C = A|AB|A2 B| · · · |Aj−1 B
 
(52)
rank(C) = j (53)
Fig. 4. Closed loop system
Observability is a property of the plant with appropriate
sensor selection without considering actuator selection. To
Linear Quadratic Regulator Controller is based on full state-
test that the system is an observable system, the rank of
feedback control principle (see Fig.4). The control gain K
observability matrix O has to be equal to the number of the
can be obtained, based on minimising the perfomance cost
state. The observability matrix O can be computed as
function described as
O = C|CA|CA2 | · · · |CAj−1
 
Z∞ (54)
J = (xT Qx + u2 R) dt (47)
The aforementioned detail for obtaining the feed-back gain
0
K does not guarantee that the obtained K can give the steady
where Q ∈ Rj×j is a real symmetric matrix and R is a scalar state error e = 0. For a unit step reference input, it is very
that both should be selected. Q and R determine the relative often that the transfer function T (s) of a closed loop has

176401-3232-IJMME-IJENS c February 2017 IJENS


International Journal of Mechanical & Mechatronics Engineering IJMME-IJENS Vol:17 No:01 123

 
unsastifactory dc gain N , 0 < N < 1. The transfer function 1 0 0 0
0 1 0 0
of a closed loop system shown in Fig.4 is expressed as  
0 0 1 0
 
T (s) = C(sI − (A − BK))−1 B (55) 0 0 0 1
O=  (60)
0 −0.981 −0.040 0
where dc gain N can be obtained by T (s)|s=0 . The solution
 
0 43.164 0.160 0
 
to improve the performance of the steady state error is to put 0 0.039 0.002 −0.981
a pregain N̄ in the system as depicted in Fig.5. The pregain 0 −0.157 −0.006 43.164
N̄ is computed as N̄ = N1 . The full state space equation can
be expressed as The first design choice of Q and R in the performance cost
function are Q = CT C = diag{1, 1, 0, 0} and R = 1. It can
ẋ = (A − BK)x + Bu (56)
be noted that the elements of matrix Q; {q1 , q2 } = {1, 1}
y = Cx (57) means that the design choice control effort tries to make an
u = r − Kx (58) equal emphasis between state x and θ regardles the condition
of state ẋ and θ̇. Furthermore, the initial choice of Q ensures
where K ∈ Rj . that xT Qx is a positive semi definite matrix, for all x. The
feedback gain K, the characteristic polynomial function D(s)
and its roots are found as follow

K = {−1, −118.32, −3.83, −18.09}


D(s) = s4 + 13.75s3 + 51.29s2
+28.47s + 7.85 (61)
s = {−6.57 + 0.06i, −6.57 − 0.06i,
Fig. 5. Closed loop system with pregain
−0.3 + 0.3i, −0.3 − 0.3i}

IV. S IMULATION AND R ESULTS


In order to simulate the full state feed-back control system, TABLE II
LQR PARAMETERS FOR F IG .6
the defined system parameters in Table I are used. The
resulting eigenvalues of the open loop system depicted in Fig.3 No. q1 q2 R
are {0, 6.5681, −6.5718, −0.0364} which can be obtained by (1) 1 1 1
det(sI − A). It can be seen that the open loop system has a (2) 2 0.1 1
positive real part, therefore, the system is an unstable system. (3) 0.1 2 1
However, using the system state space described in Eq.(45) (4) 2 2 10
and (46), the CIPS is a completely controllable and observable
since the matrix ranks of C and O are both equal to the number
of the state, rank(C) = rank(O) = 4, which can be verified Based on the performance results of the first choice, then
using results shown in Eq.(59) and Eq.(60). Q = {q1 , q2 , 0, 0} and R were varied to see the effect of
the variations. Table II shows the variation of Q and R.
TABLE I Note that in this simulation the pregain was not used. The
T HE CIPS PARAMETERS corresponding output trajectories (x and θ) are depicted in
No.
Fig.6. The trajectory of the cart position for configuration
Parameter Value Units
number (1) in Table II is shown as x̄1 plot line in Fig.6 and
(1) Ra 1 Ω
likewise for the the rest of the other three configurations.
(2) Kt 0.02 N · m/A
(3) Kb 0.02 V · s/rad
It is shown that on both Fig.6(a) and Fig.6(b) the controller
can stabilise the state, cart position and pendulum angle,
(4) r1 0.015 m
respectively. The controller can regulate the pendulum angle,
(5) M 1 Kg
however, the final cart position is not at the desired position
(6) m 0.1 Kg
(r = 0.25 m). The configuration of q1 = 2, q2 = 0.1 and
(7) l 0.25 m
R = 1 (configuration (2)) gives the best performance since it
has the smallest steady state tracking error of the cart position
and the fastest regulation response of the pendulum angle.
By letting q1 relatively greater than q2 , it means that the
 
0 0.200 −0.008 0.785
 0 −0.800 0.032 −34.533 control effort prioritses the improvement steady state of the
C=
  (59) pendulum angle. Using configuration (2), The feedback gain
0.200 −0.008 0.785 −0.063
−0.800 0.032 −34.533 1.507 K, the characteristic polynomial function D(s) and its roots

176401-3232-IJMME-IJENS c February 2017 IJENS


International Journal of Mechanical & Mechatronics Engineering IJMME-IJENS Vol:17 No:01 124

TABLE III
0.1 LQR PARAMETERS FOR F IG .7
0

-0.1
No. q1 q2 R
(1) 2 0.1 0.01
-0.2
(2) 2 0.1 0.001
-0.3
(3) 2 0.1 0.0001
-0.4
(4) 2 0.1 0.00001
-0.5

-0.6

-0.7
required control input voltage is higher when R is smaller.
For instance, the smallest R = 0.00001 requires the control
-0.8
input of 115 volts. In this configuration, the feedback gain K,
-0.9
0 5 10 15 20 25 30 35 40 45 50 the pregain, the characteristic polynomial function D(s) and
its roots are found as follow
(a) Cart position response trajectories
K = {−447.2, −333.5, −174.9 − 50.7}
# 10 -3 N̄ = −447.21
1

0.5
D(s) = s4 + 60s3 + 1730s2
0
+13574s + 35097 (63)
-0.5 s = {−24.8 + 24.2i, −24.8 − 24.2i,
-1 −5.1 + 1.9i, −5.1 − 1.9i}
-1.5
Further simulation experiments were conducted to fine tune
-2 the LQR parameters to obtain the fastest transient response
-2.5 where the controller input was contrained with the maximum
-3 value of 15 volts (half of the maximum voltage of the DC
-3.5
motor). The configurations used in these simulations are listed
in Table IV. It can be seen on the Fig.8 that configuration (3)
-4
0 5 10 15 20 25 30 35 40 45 50

TABLE IV
(b) Pendulum angle response trajectories LQR PARAMETERS FOR F IG .8

Fig. 6. State responses without pre-gain No. q1 q2 R


(1) 2 0.1 0.01
(2) 2 0.01 0.01
are found as follow
(3) 4 0.1 0.01
K = {−1.41, −120.38, −4.58, −18.42} (4) 4 0.5 0.00001
D(s) = s4 + 13.86s3 + 52.86s2
is the most satisfactory result which met the desired criteria.
+34.38s + 11.1 (62)
In this final configuration, the feedback gain K, the pregain,
s = {−6.57 + 0.02i, −6.57 − 0.02i, the characteristic polynomial function D(s) and its roots are
−0.36 + 0.36i, −0.36 − 0.36i} found as follow
The configuration (2) in Table II was chosen as a starting K = {−63.25, −69.54 − 30.83 − 10.91}
point eliminating the steady state error for the next simulation N̄ = −63.2456
experiment where the pregain was used implementing a closed
D(s) = s4 + 31.2s3 + 434.2s2
system in Fig.5. In this simulation scheme, R was varied and
Q was kept the same, as shown in Table III. The simulation +2364.4s + 4963.5 (64)
result is depicted in Fig.7. s = {−11.4 + 9.5i, −11.4 − 9.5i,
By adding the pregain, the steady state tracking error of the −4.2 + 2.2i, −4.2 − 2.2i}
cart position is eliminated for all configuration in Table III in
which the desired position of the cart is reached (r = 0.25 m)
(see Fig.7(a)). The transient time of the cart position response
is improved slightly by reducing R. However, reducing R V. C ONCLUSIONS
also increases the overshoot of the pendulum angle response The dynamic modeling and control system design of a
as shown in Fig.7(b). Furthermore, reducing R makes |Q| complex dynamic system such as the CIPS has been suc-
relatively bigger than R, the control system penalises the use cessfully conducted. The CIPS dynamic model was analysed
of the control effort u. Referring to Table III and Fig.7(c), the using Lagrangian approach. The control system design process

176401-3232-IJMME-IJENS c February 2017 IJENS


International Journal of Mechanical & Mechatronics Engineering IJMME-IJENS Vol:17 No:01 125

0.3 0.3

0.25 0.25

0.2
0.2

0.15
0.15
0.1
0.1
0.05
0.05
0

0
-0.05

-0.1 -0.05

-0.15 -0.1
0 0.5 1 1.5 2 2.5 3 3.5 4 0 0.5 1 1.5

(a) Cart position response trajectories (a) Cart position response trajectories

0.5 0.3

0.25
0.4

0.2
0.3
0.15

0.2 0.1

0.1 0.05

0
0
-0.05

-0.1
-0.1

-0.2 -0.15
0 0.5 1 1.5 2 2.5 3 3.5 4 0 0.5 1 1.5

(b) Pendulum angle response trajectories (b) Pendulum angle response trajectories

120 20

100
15

80

10
60

40
5

20

0
0

-20 -5
0 0.5 1 1.5 2 2.5 3 3.5 4 0 0.5 1 1.5

(c) Control ouput trajectories (c) Control ouput trajectories

Fig. 7. State responses with pre-gain Fig. 8. State responses with pre-gain

involved state-feedback simulation after determining the con- design. The optimality of the resulted gain matrix K was
trollability and observability of the system. It was assumed analysed by the performance cost function J . The parameters
that the cart position x and the pendulum angle θ where in the performance cost function, the LQR weights Q and R
available from sensor measurements. Hence, it was determined were manually selected, knowing that the trade-off between
that by giving two sensor measurements was sufficient to the performance and the control effort were determined by the
construct a state-feedback system observable. Determining the selection of Q and R. Regardless, the values of Q and R,
gain matrix K was the important step in the optimal control the cost function has a unique minimum that can be obtained

176401-3232-IJMME-IJENS c February 2017 IJENS


International Journal of Mechanical & Mechatronics Engineering IJMME-IJENS Vol:17 No:01 126

by solving the Riccati Equation.


It is important to be noted that for the case of the tracking per-
formance, where the controller effort should make y(t) ≈ r(t)
as t → ∞, hence the DC gain of the transfer function should
be approximately 1. Therefore, it is necessary to scale the
reference input using pregain N̄ . Simulation experiments were
systematically conducted by varying the configuration of Q
and R. Simulation results have been discussed in detail. The
simulation results have shown that the larger Q and R the
more you penalize the state and the control effort. Choosing
a large value for R means that the controller stabilises the
system with less (weighted) energy, it is called expensive
control strategy. This control strategy is used when the control
signal is constrained . On the contrary, choosing a small value
for R means that the controller penalises the control signal
(cheap control strategy), causing a large control signal. Large
Q implies less concern about the changes in the states.

ACKNOWLEDGMENT
Published results were acquired with the support of Min-
istry of Research and Technology and Higher Education of
Indonesia.

R EFERENCES
[1] C. Wang, G. Yin, C. Liu, and W. Fu, “Design and simulation of inverted
pendulum system based on the fractional pid controller,” in 2016 IEEE
11th Conference on Industrial Electronics and Applications (ICIEA), June
2016, pp. 1760–1764.
[2] Z. Pengpeng, Z. Lei, and H. Yanhai, “Bp neural network control of single
inverted pendulum,” in Proceedings of 2013 3rd International Conference
on Computer Science and Network Technology, Oct 2013, pp. 1259–1262.
[3] M. H. Arbo, P. A. Raijmakers, and V. M. Mladenov, “Applications of
neural networks for control of a double inverted pendulum,” in 12th
Symposium on Neural Network Applications in Electrical Engineering
(NEUREL), Nov 2014, pp. 89–92.
[4] G. O. Tirian, O. Prostean, I. Filip, and C. Rat, “Inverted pendulum
controlled through fuzzy logic,” in 2015 IEEE 10th Jubilee International
Symposium on Applied Computational Intelligence and Informatics, May
2015, pp. 85–90.
[5] N. Metni, “Neuro-control of an inverted pendulum using genetic algo-
rithm,” in 2009 International Conference on Advances in Computational
Tools for Engineering Applications, July 2009, pp. 27–33.
[6] R. F. Harrison, “Asymptotically optimal stabilising quadratic control of an
inverted pendulum,” IEE Proceedings - Control Theory and Applications,
vol. 150, no. 1, pp. 7–16, Jan 2003.
[7] D. Tabak, “Applications of mathematical programming techniques in
optimal control: A survey,” IEEE Transactions on Automatic Control,
vol. 15, no. 6, pp. 688–690, Dec 1970.
[8] P. Ignaciuk and A. Bartoszewicz, “Linear-quadratic optimal control of
periodic-review perishable inventory systems,” IEEE Transactions on
Control Systems Technology, vol. 20, no. 5, pp. 1400–1407, Sept 2012.
[9] A. I. Bratcu, I. Munteanu, and E. Ceanga, “Optimal control of wind
energy conversion systems: From energy optimization to multi-purpose
criteria - a short survey,” in 2008 16th Mediterranean Conference on
Control and Automation, June 2008, pp. 759–766.

176401-3232-IJMME-IJENS c February 2017 IJENS

Common questions

Powered by AI

The approximation assumes that around the equilibrium with small deflection of θ, the trigonometric terms can be linearized; specifically, sin θ ≈ θ and cos θ ≈ 1. This simplifies the nonlinear elements ˙θ² and ˙θθ in the Lagrange's equations considering them small near the equilibrium, allowing for linearization of the equations to a more approachable form for control analysis .

Evaluating controllability and observability is crucial in designing an optimal control system because they determine whether all system states can be manipulated and measured, respectively, through available inputs and outputs. For the inverted pendulum, ensuring the system is controllable and observable permits the effective application of feedback mechanisms, such as LQR, facilitating precise state regulation and system stability which is essential for achieving desired dynamic responses .

The Linear Quadratic Regulator (LQR) stabilizes the inverted pendulum by determining an optimal control law that minimizes a cost function combining the state of the system and the control effort. By setting up matrices Q and R in the LQR performance cost function to assess state deviations and control energy respectively, the LQR calculates a feedback gain K that optimizes this balance, helping keep the pendulum in a stable upright position .

Lagrange's equation is used to efficiently describe the motion equations of complex dynamic systems, like the inverted pendulum on a cart system, by reducing the need for complicated vector analysis typically required to describe forces on mechanical systems. It represents the system using generalized coordinates and incorporates the constraints unique to the system's interconnections. For the inverted pendulum, the Lagrange's equation derives the system dynamics through second-order differential equations essential for modeling the motion of the cart and the pendulum .

The back electromotive force (emf) in the DC motor is modeled as proportional to the rotor's rotational speed, expressed as vb = Kb dθ1/dt. This force impacts the voltage balance in the motor's armature circuit and the resulting motor torque. This relationship governs the motor's ability to exert a mechanical force that moves the cart, thus directly influencing the movement control of the cart through the torque transmitted to the wheels .

Varying the motor torque constant (Kt) alters how efficiently the motor converts electrical input into mechanical force, directly affecting control precision and responsiveness. A higher Kt enhances the motor's ability to adjust to control signals, leading to quicker and potentially more precise adjustments in the cart's movement and pendulum’s balance. Conversely, a lower Kt might require increased control input (voltage) to achieve the same effect, impacting control strategy by necessitating adjustments in other parameters to maintain desired dynamic performance .

The key differences between LQR configurations are primarily in the values of Q and R, which determine system behavior. For instance, configuration (2) with q1 = 2, q2 = 0.1, and R = 1 prioritizes steady-state of the pendulum angle with small tracking error and fast regulation response, indicating focus on performance improvement over control effort. Other configurations show varying emphases with corresponding differences in transient response, overshoot, and steady-state errors, influenced by the chosen weight magnitudes .

In LQR-controlled systems, the pre-gain is used to scale the reference input to ensure that the system accurately tracks the desired outputs, crucially influencing the steady-state tracking performance. It adjusts the influence of the computed feedback gain on the control signal, effectively minimizing the steady-state error, ensuring the cart reaches the desired position exactly, and optimizing system response time, particularly important in systems constrained by control input limits .

The trade-off between control effort and system performance is critical in selecting LQR weights Q and R because it affects the system's stability and efficiency. A high value of R minimizes control effort by discouraging large control inputs, potentially leading to slower system responses. Conversely, a high Q enhances system performance by prioritizing state stability, but it may require a high control input. This balance is essential to ensure that the system remains stable without expending undue energy, particularly under constraints .

The Riccati Equation plays a pivotal role in determining the LQR feedback gain as it provides a method for calculating the optimal gain matrix K, ensuring that the cost function is minimized. Solving the Riccati Equation yields a unique minimum value, balancing system performance and control effort within the defined parameters, and is critical for achieving optimal control solutions in linear systems such as the inverted pendulum .

You might also like