Modeling and C
Modeling and C
Modeling and C
Modeling and comparative study of linear and nonlinear controllers for rotary inverted
pendulum
This content has been downloaded from IOPscience. Please scroll down to see the full text.
(http://iopscience.iop.org/1742-6596/783/1/012047)
View the table of contents for this issue, or go to the journal homepage for more
Download details:
IP Address: 184.174.98.134
This content was downloaded on 21/01/2017 at 01:53
The comparative study for the isotropic and orthotropic circular plates
C Popa and G Tomescu
Analysis of degradation in UHMWPE a comparative study among the various commercial and laboratory
grades UHMWPE
A. M. Azam, A. Ali, H. Khan et al.
Shock-produced ejecta from tin: Comparative study by molecular dynamics and smoothed particle
hydrodynamics methods
S A Dyachkov, A N Parshikov and V V Zhakhovsky
Improved Air Gap Controller for Solid Immersion Lens-Based Near-Field Recording Servo System
Jung-Gon Kim, Won-Ho Shin, Jun Jeong et al.
Abstract. The rotary inverted pendulum (RIP) is a problem difficult to control, several studies
have been conducted where different control techniques have been applied. Literature reports
that, although problem is nonlinear, classical PID controllers presents appropriate performances
when applied to the system. In this paper, a comparative study of the performances of linear and
nonlinear PID structures is carried out. The control algorithms are evaluated in the RIP system,
using indices of performance and power consumption, which allow the categorization of control
strategies according to their performance. This article also presents the modeling system, which
has been estimated some of the parameters involved in the RIP system, using computer-aided
design tools (CAD) and experimental methods or techniques proposed by several authors
attended. The results indicate a better performance of the nonlinear controller with an increase
in the robustness and faster response than the linear controller.
1. Introduction
The rotary inverted pendulum is a classic problem in the control systems area, which allows to evaluate
performance and demonstrate the effectiveness of control techniques. The RIP system is a simple
structure with not minimum phase multivariable unstable and highly nonlinear characteristics. It has a
pendulum arm attached to a rotary instead of a moving car [1]. Several works have presented some
methods to modeling dynamic systems such as: the used Euler-Lagrange in [2-6] with good result, so it
is used to model the dynamics of rotary inverted pendulum shown in [7]. Moreover, the mathematical
modeling used with the iterative method of nonlinear least squares that uses the Trust-Region-Reflective
Algorithm, which tries to minimize the error between the actual and simulated signals [8].
Research community has studied and proposed diverse improvements to the classical PID approach
in RIP systems: linear PID with a direct control of each system variable [9], Fuzzy Logic focused on a
fuzzy controller [10], Optimum state regulator [11], and genetic algorithm based controller (GA) [12].
All the proposed controllers referred in the articles in this paragraph aim to identify, optimize and
stabilize systems in general.
The research developed in this paper proposes to apply some methods, techniques and the use of
CAD tools for estimating parameters that are not easy to measure and study because of the performance
of RIP system by using a nonlinear control technique (nonlinear PID) presented in [13]. This nonlinear
version is based on the classical method of Ziegler and Nichols tuning in the frequency domain.
Content from this work may be used under the terms of the Creative Commons Attribution 3.0 licence. Any further distribution
of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.
Published under licence by IOP Publishing Ltd 1
13th European Workshop on Advanced Control and Diagnosis (ACD 2016) IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 783 (2017) 012047 doi:10.1088/1742-6596/783/1/012047
This article is organized as follows: Section 1 presents the introduction, Section 2 describes the
system used. Mathematical modelling for RIP system shown in section 3, section 4 estimating some
parameters of the RIP system is performed. The validation of the model with the estimated parameters
is shown in Section 5.Section 6 shows the design of linear and nonlinear PID controllers. Section 7
shows the results and performance of the algorithms developed control. Finally, some conclusions are
summarized in Section 8.
COMPUTER
a(t)
q(t) ARDUINO
MEGA
DATA
ADQUISITION
u(t)
DRIVER
RIPS
Figure 1. Schematic architecture of the RIP system
In order to measure the angular position of the pendulum and arm a ,q is used an incremental encoder
model E50S8-600-3-type T-24, which measures with high precision (600 pulses per revolution), and the
angle and direction of rotation through phases A and B
3. Mathematical model
The RIP system consists of a cylindrical rod with freedom to oscillate about a fixed pivot, which is
mounted on an arm following an angular movement as shown in Figure 2.
2
13th European Workshop on Advanced Control and Diagnosis (ACD 2016) IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 783 (2017) 012047 doi:10.1088/1742-6596/783/1/012047
The mathematical model for RIP system used in the present study is based in the work developed in
[8], which representation is given by:
m p gL sin a B pa
J P m p L2
m p rL cos a a
kt
(1)
2 q
kt kb 2
m rL cos a
p
J r m p r Va
Br q m p rL sin a α
Ra Ra
d
x1 x2
dt
d kt k2 k DG cos x1 k cos x1 kb kt Ra Br
x2 u 2 x4 ...
dt
Ra k1k5 k2 k4 cos 2 x1
Ra k1k5 k2 k4 cos 2 x1
k2 k6 (sin x1 )(cos x1 ) x2 2
k5 B p x2 k3 sin x1 (2)
k1k5 k1k4 cos x1 2
k1k5 k2 k4 cos x1 2
d
x3 x4
dt
d
B p x2 k3 sin x1 k1 x2
d
x4 dt
dt k2 cos x1
3
13th European Workshop on Advanced Control and Diagnosis (ACD 2016) IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 783 (2017) 012047 doi:10.1088/1742-6596/783/1/012047
Each physical signal [a a q q ] in state-space RIP system model is represented by: [ x1 x2 x3 x4 ]
respectively. Some intermediate model variables and parameters area used:
k1 J P mp L2 , k2 mp rL, k3 mp gL, k4 mp rL, k5 J r J m mp r 2 , k6 mp rL, Va kDGu (4)
4. Parameter estimation
In this section the parameters estimation of the RIP is performed that is the reason why the system is
analysed by parts, engine, driver, pendulum, and arm.
4
13th European Workshop on Advanced Control and Diagnosis (ACD 2016) IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 783 (2017) 012047 doi:10.1088/1742-6596/783/1/012047
15
10
Output (V)
5
0
-5
-10 y = 5,6364*x
Measure
-15
-2 -1 0 1 2
Input (V)
Figure 3. Relationship input - output driver
The differential equation describing the oscillatory motion of the pendulum damped when it should
fall from a small height, it is given by:
d 2a da (9)
J p 2 Bp mp gLa 0
dt dt
da
Where Bp , represents the damping produced by the friction between the pendulum and air.
dt
The solution to this equation is shown in (10):
Bpt
a a 0e cos 0t
2J p
(10)
The term Bp t / 2 J p , corresponds to the damping constant of the wobble signal of the pendulum.
For this constant experimentally the pendulum is positioned with a small initial angle and drops it until
it stops. The response of the pendulum and its signal envelope can be approximated as shown in Figure.5.
5
13th European Workshop on Advanced Control and Diagnosis (ACD 2016) IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 783 (2017) 012047 doi:10.1088/1742-6596/783/1/012047
15
Physical System
10 y=9,3*exp(-0,278*t)
Angle (deg.)
Pendulum
5 y=-9,3*exp(-0,278*t)
0
-5
-10
-15
0 1 2 3 4 5 6 7 8
Time (sec.)
Figure 5. Response damped oscillatory motion of the pendulum
Finally, the estimation of the Rotating arm length (r) and the inertia moment arm Equivalent ( J r ) is
obtained from the RIP design CAD system made previously.
6
13th European Workshop on Advanced Control and Diagnosis (ACD 2016) IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 783 (2017) 012047 doi:10.1088/1742-6596/783/1/012047
used. The applied input terminals of driver and engine angular position, is shown in Figure 6. The
average angular position error between the nonlinear model and the actual system is -0.0023 (deg).
15
Motor Model
10 Physical System
Motor Position(deg.)
-5
-10
-15
0 1 2 3 4 5 6 7 8 9 10
Time (sec.)
Figure 6. Response engine model to a square entry
20
195
Pendulum Position (deg.)
10
Arm Position (deg.)
190
0
185
-10
180
-20
175
-30
170
-40
-50 165
-60 160
0 5 10 15 0 5 10 15
Time (sec.) Time (sec.)
Figure 7. Response nonlinear model and real RIP system to an input combination of sinusoids.
7
13th European Workshop on Advanced Control and Diagnosis (ACD 2016) IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 783 (2017) 012047 doi:10.1088/1742-6596/783/1/012047
2
d5 ( k1s B p s k3 )
G A ( s)
ps 4 qs 3 k2 (d3 d7 ) s 2 k2 (d 4 d8 ) s
(13)
: d1 Ra (k1k5 k4 k2 ); d 2 Ra (k5 B p Br k1 ); d3 Ra (k5k3 Br B p ); d 4 Ra Br k3
d5 kt k2k DG ; d6 kb k1kt ; d7 kb B p kt ; d8 kbk3kt ; p k2 d1; q k2 d 2 k2 d6
C1(s)
The controller parameters of the PID are tuned by using SISOTOOL, which is a Matlab package.
Specifically, the method utilized is LGR, the tuned controller is represented as follows: (14).
kd 1s 2 k p1s ki1
C1 ( s) : kd 1 0.6247; k p1 25.8634; ki1 244.4404 (14)
s
6.2. Linear PID controller design for the arm position.
The design of the pendulum controller was presented in the former section, the development of the
complete control structure is presented in this section. The structure is shown in Figure 9.
In the design of the linear PI arm controller, it is important to take into account that the value of a d
should stabilize around zero degrees, taking into account the latter, the block diagram shown in Figure
9, is reduced by using blocks algebra, the reduced block diagram leads to the following transfer function:
kDG
G2 dof ( s) GA ( s ) (15)
1 GP ( s)C1 ( s)kDG
As in the tunning of the former controller, the arm controller is tuned by using SISOTOOL and the
LGR method. The resultant controller is given by equation (16).
k p 2 s ki 2
C2 (s) : k p 2 5.7951; ki 2 5.4358 (16)
s
8
13th European Workshop on Advanced Control and Diagnosis (ACD 2016) IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 783 (2017) 012047 doi:10.1088/1742-6596/783/1/012047
0
0 1 0 0
h 1/2
a b 0 c , C 1 0 0 0 , D 0; a (a 3 ) a4
Ap , B Ra k3k5
00 0 1 p
0 p
0 0 1 0
p
Ra a2 Ra k3k5
d
e 0 f
i
B p k5 k a k kk kkk ka
b , c 2 1 (a 3 ) 1/2 , h 2 t DG (a 3 ) 1/2 , i 1 t DG , f 1 1
a2 Ra a2 Rab2 Rab1 Ra a2
Ra k2 k3k4 2 2U 2k1k2 2k4k DG 2kt 2 2 Ra k1k3k4k5
Ra k1k3k4 k5 (18)
a3 Ra k3k5a3 a3 B p k4
d 2 1
, e (a 3 ) 1/2
Ra k1 k5 Ra k2 k4 ( a3 ) 2 Ra k1k2k4k5 ( a3 )
2 2 2 2
a2
k2 k4 a
a1 kb kt Br Ra , a2 k1k5 , a3 2 42 2 1
a3 Ra k3 k5
k2 k4 U 2 k2 2 kt 2 k DG 2
a4 U 2 k2 2 kt 2 k DG 2 b1 k1k5
, b2 2 2 2
1
b2 Ra k3 k5
In control theory, an alternative way of systems representation is the transfer function. Thus, equation
(14) is the transfer function obtained after linearization and parametrization of the nonlinear model.
hs ci fh is 2 (eh bi )s dh ai (19)
G (s)
P (U ) , G (s) A(U )
s3 (b f ) s 2 (bf a ce) s af cd ) s (s 3 (b f )s 2 (bf a ce)s af cd )
It should be noticed that the transfer function presented in equation (19) are parametrized transfer
functions with respect to the input U. As it is indicated in section 6.2, the control scheme is the same as
the one presented in Figure 9 with the difference in the transfer function C2(s) which in the present study
corresponds to a nonlinear PI. With the former considerations, a reduction of the system is possible. In
equation (20), a reduced version of the transfer functions is presented.
GA(U ) ( s)
G2 dof (U ) ( s) : c1 i; c2 eh bi; c3 dh ai; c4 hkd 1 b f
1 G ( s)C ( s) (20)
P (U ) 1
c5 bf a ce hk p1 kd 1 ci fh ; c6 af cd hki1 k p1 ci fh ; c7 ki1 ci fh
By using Ziegler-Nichols method, the ultimate response in frequency domain gives important
information in order to obtain optimal controller parameters. Specifically, it is possible to obtain the
ultimate period P0 (U) and the ultimate gain K0 (U) . In the approach presented in this study, the ultimate
gain and period are obtained based on the transfer function G2dof (U ) (s) as follows:
9
13th European Workshop on Advanced Control and Diagnosis (ACD 2016) IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 783 (2017) 012047 doi:10.1088/1742-6596/783/1/012047
1
P0 (U ) 2 0 (U ) ; K 0 (U ) G2 dof (U ) ( j0 )
1
; 0 (U ) c c 2 5 c1c6 c3c4 N 2(c2 c1c4 )
1 1/2
(21)
( c5 c7 ) (c6 c4 ) 3 2 1/2
1/2 4 2 2
N (c2c5 c1c6 c3c4 ) 2 4 c2 c1c4 c2c7 c3c6 ; K 0 (U )
(c3 c1 2 ) 2 (c2 ) 2
In the nonlinear PI controller approach considered in this study, the nonlinear controller is
generalized as follows:
K 0 ( zv (t ))
z (t ) 0.54 (q d x3 (t )); u (t ) z (t ) 0.45 K 0 ( z ( t ))(q d x3 ( t )) (22)
P0 ( zv (t ))
Where z(t ) is defined as an additional state of the nonlinear controller of the arm. The control signal
u(t ) is associated to the x3 (t ) , which represents in the RIP system, the current arm position.
7. Performance Assessment
The values of the identified parameters are used for modeling purposes and the evaluation of the PI and
PID controllers using MATLAB / Simulink, which is discussed in section 7.1 to 7.3.
15
Set Point Set Point
40
Position (deg.)
Position (deg.)
0 0
-20 -5
10 20 30 40 50 60 10 20 30 40 50 60
Time (sec.) Time (sec.)
3
Physical System
Control Signal
2 NonLinear Model
1
0
-1
-2
10 20 30 40 50 60
Time (sec.)
Figure 10. Responses of linear controllers for pendulum and arm position
10
13th European Workshop on Advanced Control and Diagnosis (ACD 2016) IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 783 (2017) 012047 doi:10.1088/1742-6596/783/1/012047
15
Set Point Set Point
40
Position (deg.)
Position (deg.)
Pendulum
NonLinear PI (NonLinear Model) Linear PID (NonLinear Model)
20
5
Arm
0 0
-20 -5
10 20 30 40 50 60 10 20 30 40 50 60
Time (sec.) Time (sec.)
3
Physical System
Control Signal
2 NonLinear Model
1
0
-1
-2
10 20 30 40 50 60
Time (sec.)
Figure 11. Response of linear and nonlinear controller for pendulum and arm position
The numerical values of IAE and ISU for both drivers applied in the RIP system are shown in Table
2.
Table 2. Indices performance obtained with linear and non-linear controller.
Arm Position Control Signal Computing
IAE ISU Time (sec)
Linear Controller 5.3218 x 104 1.0644 x 103 7.8215
Nonlinear Controller 4.8909 x 104 570.6625 29.1743
The values in Table 2 show that the nonlinear PI controller has better performance in energy used,
as in following references for positioning the arm. In the case of positioning the pendulum a linear PID
controller was designed. So when acting linear PI controller in the arm RIP system, the IAE linear PID
controller pendulum is 6.1272 x 103, and when it acts nonlinear PI controller in the arm, the IAE linear
PID controller pendulum is 2.9376 x 103, which shows an improvement in the performance of the linear
PID controller for the pendulum, when the nonlinear PI acts on the arm.
8. Conclusions
In this study, modeling, control and estimation of certain parameters of the inverted pendulum rotary
experimentally, which has a satisfactory response we are performed. This model was used to design the
PI and PID controllers for linear and nonlinear system. Of the assessment controllers shown that the
performance of nonlinear PI control both reference tracking, and energy consumption is better than the
linear PI control. Also, when the nonlinear PI controller acts on the arm of the system, the linear PID
controller designed to position the pendulum vertically improves its efficiency. Although the
computational time for the nonlinear controller is greater than the linear, a better result in energy
11
13th European Workshop on Advanced Control and Diagnosis (ACD 2016) IOP Publishing
IOP Conf. Series: Journal of Physics: Conf. Series 783 (2017) 012047 doi:10.1088/1742-6596/783/1/012047
consumption and reference tracking is obtained. Future works aims to design a nonlinear for positioning
the pendulum PID controller as well as using new control strategies for the RIP System.
Acknowledgments
The authors would like to acknowledge two important institutions in the development of this work:
Universidad Politécnica Salesiana and Escuela Superior Politécnica del Litoral for all the support offered
during the present study. Additionally, the authors are grateful with the GISCOR research who gave to
the authors the facilities regarding the use of infrastructure and equipment.
References
[1] Sukontanakarn, Viroch; Parnichkun, Manukid; "Real-Time Optimal Control for Rotary Inverted
Pendulum", American Journal of Applied Sciences 6 (6): 1106-1115, 2009 , ISSN 1546-9239
[2] J. Zhang and Y. Zhang, "Optimal linear modeling and its applications on swing-up and
stabilization control for Rotary Inverted Pendulum," Control Conference (CCC), 2011 30th
Chinese, Yantai, 2011, pp. 493-500.
[3] S. Jadlovská and J. Sarnovský, "A complex overview of the rotary single inverted pendulum
system," ELEKTRO, 2012, Rajeck Teplice, 2012, pp. 305-310.doi:
10.1109/ELEKTRO.2012.6225609.
[4] P. Xue and W. Wei, "An Analysis on the Kinetic Model of a Rotary Inverted Pendulum, and Its
Intelligent Control," Computational and Information Sciences (ICCIS), 2010 International
Conference on, Chengdu, 2010, pp. 978-981
[5] K. Lai, J. Xiao, X. Hu, J. Fan and B. Wu, "Modeling and control for stability and rotation velocity
of a rotary inverted pendulum," Industrial Electronics and Applications (ICIEA), 2015 IEEE
10th Conference on, Auckland, 2015, pp. 955-960.
[6] M. Roman, E. Bobasu and D. Sendrescu, "Modelling of the rotary inverted pendulum system,"
Automation, Quality and Testing, Robotics, 2008. AQTR 2008. IEEE International
Conference on, Cluj-Napoca, 2008, pp. 141-146.
[7] Nguyen Duc Quyen; Ngo Van Thuyen; Nguyen Quang Hoc; Nguyen Duc Hien., "Rotary Inverted
Pendulum and Control of Rotary Inverted Pendulum by Artificial Neural Network", Proc. Natl.
Conf. Theor. Phys. 37 (2012), pp. 243-249.
[8] D. I. Barbosa, J. S. Castillo and L. F. Combita, "Rotary inverted pendulum with real time control,"
Robotics Symposium, 2011 IEEE IX Latin American and IEEE Colombian Conference on
Automatic Control and Industry Applications (LARC), Bogota, 2011, pp. 1-6.
[9] Rahimi, A., Raahemifar, K., Kumar, K., Alighanbari, H. (2013). Controller design for rotary
inverted pendulum system using particle swarm optimization algorithm. In Electrical and
Computer Engineering (CCECE), vol., no., pp.1-5.
[10] Yunhai Hou., Hongwei Zhang., Kai Mei. (2011). Vertical-rotary inverted pendulum system based
on fuzzy control. In Electrical and Control Engineering (ICECE), vol., no., pp.2804-2807.
[11] Barbosa, D.I., Castillo, J.S., Combita, L.F. (2011). Rotary inverted pendulum with real time
control. In IEEE IX Latin American and IEEE Colombian, vol., no., pp.1-6.
[12] Hassanzadeh, I., Mobayen, S. (2008). GA based input-output feedback linearization controller for
rotary inverted pendulum system. In Mechatronics and Its Applications, vol., no., pp.1-6.
[13] Cajo, R., Agila, W. (2015). Evaluation of Algorithms for Linear and Nonlinear PID Control for
Twin Rotor MIMO System. In Computer Aided System Engineering (APCASE), vol., no.,
pp.214-219.
12