Beruflich Dokumente
Kultur Dokumente
INTRODUCTION
2
Member IEEE, AP,
Senior Member IEEE, Professor,
Department of Electrical Engineering,
Indian Institute of Technology Roorkee, India
btyagfee@iitr.ernet.in,
harifee@iitr.ernet.in
I.
Hari Om Gupta2
540
MATHEMATICAL MODELLING
d2
d2
x + m 2 xG = u + Fw
2
dt
dt
which can be manipulated as to give
M
(1)
( M + m)
x ml sin 2 + ml cos = u + Fw
(2)
1. Solve the torque balance expression for ml and put this
into the force balance equation, giving
ml = mg sin + Fw cos mx cos
,
and
2
2
[ M + m m cos ]
x = u + ml sin mg sin cos + Fw sin 2
2. Solve the torque balance equation for x and put this into
the force balance equation, giving
mg sin + Fw cos ml
,
and
x=
m cos
mg sin + Fw cos ml
( M + m)
ml sin 2 + ml cos
m cos
= u Fw
Multiplying both sides by cos gives
[ ml cos 2 ( M + m)l ] = u cos ( M + m) g sin
M +m
+ ml cos sin 2
Fw cos + Fw cos
m
y
l sin
l cos
f1 =
P
u
(5)
M
Fw cos x1
m
ml cos 2 x1 ( M + m)l
mg
l
(3)
1 0 0 0
y = = Cx =
(6)
or
y = Cx
x
0 0 1 0 x
x
Equations (5) and (6) give a complete state space
representation of the nonlinear inverted pendulum with
disturbance input.
541
0
1 0 0
0
0
( M + m) g
1
1
0 0 0
d
x = Ml
x + Ml u + ml Fw (7)
0
0 0 1
0
dt
0
1
mg
0 0 0
0
M
M
This is the open loop linearized model for the inverted
pendulum with a cart force, u (t ) , and a horizontal wind
disturbance, Fw (t ) . The two inputs have been separated for
convenience, thus the LTI system can be written as
d
x = A x + b1 u + b 2 Fw
dt
III.
(11)
where,
X = [ , , x, x ] .
The state feedback control u = KX leads to
X = ( A BK ) X
(12)
where, K is derived from minimization of the cost function
T
J = ( X QX + u Ru ) dt
(13)
where, Q and R are positive semi-definite and positive definite
symmetric constant matrices respectively.
(8)
CONTROL METHODS
K = R 1 BT P
(14)
where, P is a positive definite symmetric constant matrix
obtained from the solution of matrix algebraic reccatti equation
(ARE)
A.
PID Control
To stabilize the inverted pendulum in upright position and
to control the cart at desired position using PID control
approach two PID controllers- angle PID controller, and cart
PID controller have been designed for the two control loops of
the system. The equations of PID control are given as
following:
AT P + PA PBR 1 BT P + Q = 0
IV.
(15)
de (t )
(9)
dt
de (t )
(10)
uc = K pc ex (t ) + Kic ex (t ) + K dc x
dt
where, e (t ) and ex (t ) are angle error and cart position error.
Since the pendulum angle dynamics and cart position dynamics
are coupled to each other so the change in any controller
parameters affects both the pendulum angle and cart position
which makes the tuning tedious. The tuning of controller
parameters is done using trial & error method and observing
the responses of SIMULINK model to be the optimal.
u p = K pp e (t ) + K ip e (t ) + K dp
0
29.8615
A=
0
0.9401
1 0 0
0 0 0
0 0 1
0 0 0
1 0 0 0
C=
0 0 1 0
With the choice of
1
0
Q=
0
0
542
1 0
0
0 500 0
0 0 250
0
,and
0
1.1574
B=
0
0.4167
0
D=
0
,and R = 1
PID
Ref. Angle
u
Theta
PID
Ref. position
Cart PID Controller
Theta
x
Saturati on
Inverted Pendulum
Band-Limited
White Noise
ip_pid_dist
T o Workspace
543
theta (rad)
PID + LQR CONTROL OF NONLINEAR INVERTED PENDULUM S YS TEM WITH DISTURBANCE INPUT
Band-Li mi ted
White Noi se
Control u
Theta
0.1
-0.01
thetadot
PID
-0.02
Saturati on
10
20
30
40
50
60
70
80
90
xdot
100
Inverted Pendul um
x & xdot
0.15
ip_pid_lqr1_dist
0.1
x(m)
K* u
T o Workspace
0.05
0
-0.05
10
20
30
40
50
60
70
80
90
Figure 6. Cart PID & LQR Control of Nonlinear Inverted Pendulum System
with Disturbance Input.
100
CART PID + STABILIZATION LQR CONTROL OF NONLINEAR INVERTED PENDULUM SYSTEM WITH DISTURBANCE INPUT
0.02
control u
-1
-2
10
20
30
40
50
time (sec)
60
70
80
90
100
0
-0.02
-0.04
x and xdot
2 PID + LQR CONTROL OF NONLINEAR INVERTED PENDULUM S YSTEM WITH DIS TURBANCE INPUT
10
12
14
16
18
20
10
12
14
16
18
20
10
time (sec)
12
14
16
18
20
0.1
0.05
0
-0.05
0.15
PID
Ref. Angl e
Control u
Theta
PID
Thetadot
u
Saturation
0.1
Ref. Cart Position
xdot
Inverted Pendulum
-1
Band-Limited
White Noise
x & xdot
ip_pid_lqr_dist
K* u
T o Workspace
LQR
Figure 4. Angle PID, Cart PID & LQR Control of Nonlinear Inverted
Pendulum System with Disturbance Input.
PID + LQR CONTROL OF NONLINEAR INVERTED PENDULUM SYSTEM WITH DISTURBANCE INPUT
0.02
0
-0.02
-0.04
10
10
5
time (sec)
10
x and xdot
0.1
-0.1
2
1
0
-1
Figure 5. Responses of Angle PID , Cart PID & LQR Control of Nonlinear
Inverted Pendulum System with Disturbance Input.
544
V. CONCLUSION
PID control, and LQR, an optimal control technique to
make the optimal control decisions, have been implemented to
control the nonlinear inverted pendulum-cart system with
disturbance input. To compare the results PID control has been
implemented. In the optimal control of nonlinear inverted
pendulum dynamical system using PID controller & LQR
approach, all the instantaneous states of the nonlinear system,
are considered available for measurement, which are directly
fed to the LQR. The LQR is designed using the linear statespace model of the system. The optimal control value of LQR
is added negatively with PID control value to have a resultant
optimal control. The MATLAB-SIMULINK models have been
developed for simulation of the control schemes. The tuning of
the PID controllers which are used here either as PID control
method or PID+LQR control methods is done by trial & error
method and observing the responses achieved to be optimal.
The simulation results justify the comparative advantages of
optimal control using LQR method. The pendulum stabilizes in
upright position with acceptable minor oscillations and cart
approaches the desired position even under the continuous
disturbance input such as wind force justify that the control
schemes are effective & robust. The response of PID
controller using LQR is better than PID controller.
REFERENCES
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
[10]
[11]
[12]
[13]
[14]
[15]
[16]
[17]
[18]
[19]
[20]
[21]
545