A Study of Stabilization and Swing-Up Linear Control For A Single Link Rotary Pendulum
A Study of Stabilization and Swing-Up Linear Control For A Single Link Rotary Pendulum
1
[email protected] [email protected]
Abstract— Single link rotary inverted pendulum (SLRIP) is [5]. An optimal robust controller is required to control the
a highly nonlinear control system that has complex dynamic SLRIP. Modern controls are considered to control the
behavior. This type of system requires a high-performance systems with multiple-input-multiple-output [6].
controller for its control. The rotary pendulum system is
present as a control problem challenge because the system This paper proposes a study of a PID, Linear Quadratic
often moves to an uncontrolled state. The problem consists to Regulator (LQR) stabilization control, and swing-up linear
balance one or more attached pendulums vertically in the control based on LQR. The parameters of the PID and LQR
upward position on a rotational arm which has a single degree controllers are optimized by using the PSO algorithm to
of freedom and turns horizontally on only one axis. The aim is provide more robust controllers.
to find a control strategy that provides accurate performance
with respect to the angles of the pendulums and the horizontal This paper has been organized as follows: the modeling
arm. This paper proposes a study of a PID, Linear Quadratic of the SLRIP is presented in section II. The controllers'
Regulator (LQR) stabilization control, and swing-up linear design is described in section III. The performance of the
control based on LQR. The gains of the PID and LQR designed controllers is verified by simulation tests in section
controllers are optimized by using the particle swarm IV. The conclusions of this study are presented in section V.
optimization (PSO) algorithm to provide more robust
controllers. A dynamic mechanical simulation study was II. MODELING OF A SINGLE LINK ROTARY PENDULUM
conducted on MATLAB/SimMechanics obtained by the SYSTEM
designed 3D-CAD models of the SLRIP. According to
experimental results, the systems demonstrate the efficiency In this section, kinematic, nonlinear dynamic models and
and robustness of all controllers. the Jacobian matrix of each model of the SLRIP are
explained in detail. The kinematic parameters of the SLRIP
Keywords— Single Link Rotary Inverted Pendulum (SLRIP), are described as corresponding to its design. The kinematics
PID, LQR, stabilization Control, Swing up Control, PSO model was derived using an adaptation of the Denavit-
Hartenberg (D-H) convention. The nonlinear dynamics
model was derived based on the Euler-Lagrange
formulation. Furthermore, rotation and transformation
I. INTRODUCTION matrices of the kinematics model are used to determine the
The inverted pendulum system (IPS) is a very common dynamic model. Additionally, the Jacobian matrix of the
mechatronics system in the robotic control engineering system is calculated, which is used to estimate the
(RCE) field [1]. IPS is many open-loop unstable systems parameters of the system. Finally, numeric modeling is
such as crane trolleys, Fly-board, segway human transporter, investigated using the SimMechanics toolbox of MATLAB
humanoid robots…etc [2]. Therefore, it has been a to verify the system's analytic modeling. A comparative
benchmark control problem for the field of RCE which study of joints' signals attained by both mathematical and
verify a modern control theory. It can be designed and MATLAB SimMechanics simulation models is explained.
installed in a research laboratory for control education [3].
A. Kinematic Model
According to researchers in this field, the classical inverted
pendulum on a cart has a limitation depending on the cart Figure 1 shows the 3D solid and kinematics modes of the
length trajectory. To avoid this limitation, Katsuhsia Furuta SLRIP system. The SLRIP is composed of two connected
and his colleagues invented the first rotary single link rigid bodies; the horizontal rotary arm and the pendulum.
inverted pendulum system at the institute of technology in The SLRIP is actuated by a brushless servo motor. It's
Tokyo, in 1992. It was named the “Furuta pendulum” [4]. mounted to supply torque to the system. The pendulum is
The SLRIP is composed of two connected mechanical bodies mounted at the horizontal arm. The angles of the horizontal
controlled using a torque servo motor. These two mechanical arm and pendulum are ( ) and ( ) respectively.
parts are the rotational arm and the pendulum. The rotational Furthermore, a balance mass is fixed above the rotational
arm turns on the horizontal axis, and the pendulum is arm in the other extremity to ensure the system's balance
mounted at the end of the rotating arm that rotates on the inertia. The SLRIP is assumed to be a serial kinematic chain.
vertical axis. The SLRIP has two degrees of freedom The kinematic model of the system is obtained by the D-H
(2DOF); the arm and pendulum have 1 DOF, respectively method. Rotation and homogeneous transformation matrices
cos θ sin θ 0 a
parameters of the SLRIP are presented in Table III, [7].
&T T T &T
' '
B. Dynamic Model
Motions equations of the two links are found using the
D-H method. The dynamic matrix form of the SLRIP is
given below:
τ b θ-
D#θ$θ* ( C,θ, θ-. ( G#θ$ 0 1 #3$
b θ-
θ
equations of SLRIP are derived using the Euler–Lagrangian
,
Angles of the first and second joints,
rad approach. The mass matrix terms are calculated using
τ
respectively.
Input torque in the first joint. Nm equation (4), [8].
9
I Kg m
D#θ$ 23#A $5 m A ( #B $5 I B 7 #4$
,
Inertias of the arm and pendulum,
respectively.
m , :
Mass of the arm and pendulum,
∂ 1 ∂
c?@ #θ$ D #θ$ D , 1 D i, j, k D n #6$
∂θ? @ 2 ∂θ ?@
Mechanical Mechanical Mechanical
Value Value Value
parameter parameter parameter
m L I
kg m
3.11
0.44 m
0.0025 The gravity vectors can be calculated using equation (7).
kg
9 9
m L b
G#θ$ 2 2Gg ? m@ A? #θ$ H #7$
@
0.0024
,
0.08
0.52 m N-m-
kg
?: @:
s/rad
m I
m N kg
3.14 0.43kg 9.81
g
kg
The nonlinear equations of the SLRIP system are as follows:
m L L sin θ L L m cos θ
⎡ (I M(m N (L O P Q⎤
⎢ 4 4 2 ⎥ θ*
TABLE III. D-H-PARAMETERS OF THE SLRIP
α a d θ ⎢ L L m cos θ L m ⎥ 0θ * 1
⎢ P Q N ( I RO ⎥
Coordinates
0 0 θ ⎣ 2 4 ⎦
1 1
1 0
L θ - $ - -
VL L m θ sin#θ W ( ,L m θ θ sin#2θ $.
2 2
( 2 4 "
2 0
L 0 0 1
VL θ - m sin#2θ $W
3
8
0
ICTACSE 2022 61
Authorized licensed use limited to: Universiti Teknikal Malaysia Melaka-UTEM. Downloaded on December 25,2023 at 16:07:35 UTC from IEEE Xplore. Restrictions apply.
0
τ The state vector is x 5 3θ θ θ- θ- 7. u is the input
(Y 1 Z G H #8$
#L g m sin#θ $ $ 0
2
control signal (h). To linearise the non-linear equations, a
*
are obtained by solving θ in equation (8).
C. Jacobian
The linear and angular velocities of the arm and
θ*
0 1
pendulum are needed to calculate the Jacobian of SLRIP. A
m L L sin θ L L m cos θ
⎡ (I (m N (L O P Q⎤
⎢ 4 4 2 ⎥
from the linear and angular velocities in the end-link,
M
⎢ ⎥
respectively [9].
J\ #θ$ ⎢ L L m cos θ L m
J#θ$ ^ _ #9$ P Q N ( I RO ⎥
J] #θ$ ⎣ 2 4 ⎦
τ b θ-
The linear velocities matrix of the SLRIP is given as
N O
b θ-
follows:
J\ &' #θ$
L cos θ sin θ L sin θ L cos θ cos θ
The next task is to calculate the partial derivatives for both
0 L sin θ
linear SSM is given as follows:
x- Ax ( Bu
m #17$
y Cx ( Du
The angular velocities matrix of the SLRIP is given as
follows:
0 sin θ θ -
&w &R &w Y0 cos θ Z 0 - 1 #12$
' ' &
1 0 θ
A, B, C, and D matrices of the SSM are given below:
0 sin θ θ- ⎢ * ⎥ θ ⎢ ⎥
⎢∂θ ∂θ* ∂θ* ∂θ* ⎥ ⎢ ∂θ* ⎥
J] &' #θ$ Y0 cos θ Z #13$ ⎣ ∂τ ⎦
⎣∂θ ∂θ ∂θ- ∂θ- ⎦
1 0
307 3I7 307
⎡ * = =
⎤ ⎡ *= ⎤
The Jacobian matrix taken from the linear and angular
⎢ opM op*M op*M op*M
⎥ ⎢ opM ⎥
A ⎢opM op-R ⎥ ;B ⎢ oq ⎥ #19$
velocities is given in equation (14).
opR op-M
J'& #θ$ ⎢op*R op*R op*R op*R ⎥ ⎢ op*R ⎥
L cos θ sin θ L sin θ L cos θ cos θ ⎣opM opR op-M op-R ⎦ ⎣ oq ⎦
⎡ L cos θ sin θ ⎤
L sin θ ( sin θ L cos θ
⎢ ⎥ C 3I7 D 3075 #20$
⎢ 0 L sin θ ⎥
=
#14$
=
⎢ 0 sin θ ⎥
⎢ 0 cos θ ⎥
Where [I] is an identity matrix.
⎣ 1 0 ⎦
by its transpose, ∆ >J30 #θ$ J30 #θ$d A. The optimal lengths are
using the determinant (∆) of the Jacobian matrix multiplied mechanical dynamic model is developed using the
SimMechanics toolbox. Furthermore, for both models, the
D. Linearized Model the two models match exactly. Figure 2 shows the non-
The non-linear state space model (SSM) of the SLRIP is linear mathematical model of the SLRIP in
derived as below: Matlab/Simulink. Figure 3 shows a comparison of the two
joint positions attained by both models without friction.
x- f#x, u$ #15$
ICTACSE 2022 62
Authorized licensed use limited to: Universiti Teknikal Malaysia Melaka-UTEM. Downloaded on December 25,2023 at 16:07:35 UTC from IEEE Xplore. Restrictions apply.
algorithm may be used to find the optimal controller
parameters [11].
(a)
B. LQR Controller
LQR is a full-state feedback (FSF) controller; it is used a
linear SSM to create a fixed gains matrix (k) multiplied by
the FSF to make the equilibrium point of the system overall
asymptotically stable. The linear model of the SLRIP was
calculated by linearizing the dynamic model, given in part
(b) (II-D). The objective of this control method is to calculate
Fig. 2. SLRIP : (a) SimMechanics model, (b) Virtual reality model the matrix K. Furthermore, the optimal parameters of K are
obtained from the cost function (J).
1 { 5
In this section, the controller methods applied to control
J x #x Qx ( u5 Ru$ dt #24$
2 '
our SLRIP are explained in detail.
A. PID Controller
Where J relates to Q and R matrices. Furthermore, the last
Two PID controllers are developed to maintain the two matrices must be positive semi-defined matrices. Also,
stability of the pendulum vertically and rotary horizontal
of u#t$ is given below:
K is determined according to Q and R [14]. The expression
arm at the desired positions, respectively. The PID
controllers' equations are given below:
u#t$ R B5 P#t$x #t$ Kx #t$ #25$
d epM #t$
us K us epM #t$ ( K s x epM #t$ dt ( K ys #21$
dt
d epR #t$
C. Swing-up Linear Control
U~] u• €θ &
€sng ,cos θ θ- . #26$
ICTACSE 2022 63
Authorized licensed use limited to: Universiti Teknikal Malaysia Melaka-UTEM. Downloaded on December 25,2023 at 16:07:35 UTC from IEEE Xplore. Restrictions apply.
The initial conditions of θ ,θ are zero degrees. When the 81.75% and 14.28% for the first link and second joints,
inverted pendulum approaches the upright stability position, respectively. The RMSEs improvement percentages are
the control needs to switch to balance the LQR controller 75,28% and 24.28% for the first and second joints,
[13-14]. respectively. Moreover, LQR needed more effort 42.95 %
compared to PID, see Table. VI.
IV. SIMULATION RESULTS
K us Ks K ys
pendulum link 4.0698 0.605 0.176
Parameters of PID controller of the
horizontal link −1.25 0.02 3.6
ICTACSE 2022 64
Authorized licensed use limited to: Universiti Teknikal Malaysia Melaka-UTEM. Downloaded on December 25,2023 at 16:07:35 UTC from IEEE Xplore. Restrictions apply.
TABLE V. COMPARISON OF THE PERFORMANCE OF THE PID V. CONCLUSION
AND LQR UNDER EXTERNAL TORQUE DISTURBANCE
This paper presents a swing-up linear control using PID,
θ θ
Control Joints
Controllers and LQR for a SLRIP. The gains of the PID and LQR
T~ (s)
parameters
1.3009 0.7289
controllers are optimized by using the PSO algorithm.
According to the time response results, the LQR gives us the
E~~ (°)
PID PO % 1.51 47
0.2 0.035 best results than the PID. To test the robustness performance
of both controllers, external force disturbances were applied
T~ (s)
RMSE (°) 0.0229 0.0159
1.2007 0.5295 to the system The results obtained here indicate that LQR is
more robust. For future work, the adaptive sliding mode
E~~ (°)
LQR PO % 0.8 23
0.0365 0.03 controller (SMC) will be developed in order to be compared
RMSE (°) 0.0057 0.0210 with PID and LQR controllers.
θ θ
Control Joints [3] Boubaker O., “The inverted pendulum: A fundamental benchmark in
Controllers
T~
parameters control theory and robotics”, In International conference on
7.702 % 27.39 % education and e-learning innovations, IEEE, pp. 1-6, , 2012.
E~~
LQR versus PO 47.01 % 51.06 % [4] Hazem Z.B., Fotuhi M.J., Bingül Z., “A comparative study of the
PID 81.75 % 14.28 % friction models with adaptive coefficients for a rotary triple inverted
RMSE 75,28 % 24.28 % pendulum”, 6th International Conference on Control Engineering &
Information Technology (CEIT), IEEE, pp. 1-6, 2018.
D. Results of Swing-up control based on LQR [5] Awtar S., King N., Allen T., Bang I., Hagan M., Skidmore D., Craig,
K., “Inverted pendulum systems: rotary and arm-driven-a
Figure 6 shows the responses of the pendulum angle , mechatronic system design case study”, Mechatronics, Vol. 12(2),
horizontal link and the torque input signal of SLRIP with 357-370, 2002.
swing-up controller-based LQR. An external disturbance is [6] Hazem Z.B., “Anti swing up control of a single, double and triple link
given to the system at 7s to see the performance controller. rotary inverted pendulum with nonlinear friction models”, Phd thesis,
As can be seen from Figure 6, the swing-up controller-based Kocaeli University, 2021.
LQR is robust and can control the system. [7] Hazem Z.B., Fotuhi M.J., Bingül Z., “Development of a Fuzzy-LQR
and Fuzzy-LQG stability control for a double link rotary inverted
pendulum”, Journal of the Franklin Institute, Vol. 357(15), pp.10529-
10556, 2020.
[8] Hazem Z.B., Fotuhi M.J., Bingül Z., “A comparative study of the
joint neuro-fuzzy friction models for a triple link rotary inverted
pendulum”, Ieee Access, 8, pp.49066-49078, 2020.
[9] Gage W.H., Winter D.A. , Frank, J.S., Adkin, A.L., “Kinematic and
kinetic validity of the inverted pendulum model in quiet standing”,
Gait & posture, Vol. 19(2), pp. 124-132.
[10] Hazem Z.B., Fotuhi M.J., Bingül Z., “Anti-swing radial basis neuro-
fuzzy linear quadratic regulator control of double link rotary
pendulum”, Proceedings of the Institution of Mechanical Engineers,
Part I: Journal of Systems and Control Engineering, Vol. 236(3), pp.
531-545, 2021.
[11] Fujinaka T., Kishida Y., Yoshioka M., Omatu S., “Stabilization of
double inverted pendulum with self-tuning neuro-PID”, In
Proceedings of the IEEE-INNS-ENNS International Joint Conference
on Neural Networks, IJCNN, Neural Computing: New Challenges
and Perspectives for the New Millennium, Vol. 4, pp. 345-348, 2000.
[12] Nalavade M.R., Bhagat M.J., Patil V.V., “Balancing double inverted
pendulum on cart by linearization technique”, International Journal
of Recent Technology and Engineering (IJRTE), 3(1), pp.153-157,
2014.
[13] Hazem Z.B., Fotuhi M.J., Bingül Z., “A study of anti-swing fuzzy
LQR control of a double serial link rotary pendulum”, IETE Journal
of Research, pp. 1-12, 2021.
[14] Prasad L.B., Tyagi B., Gupta H.O., “Optimal control of nonlinear
inverted pendulum system using PID controller and LQR:
performance analysis without and with disturbance input”,
International Journal of Automation and Computing, Vol. 11(6), pp.
661-670,2014.
Fig. 6. Responses of θ , θ and the torque input signal of the SLRIP with
swing-up controller-based LQR under external disturbance
ICTACSE 2022 65
Authorized licensed use limited to: Universiti Teknikal Malaysia Melaka-UTEM. Downloaded on December 25,2023 at 16:07:35 UTC from IEEE Xplore. Restrictions apply.