Robust Sliding Mode Control For Inverted
Robust Sliding Mode Control For Inverted
Article History The Inverted Pendulum is a highly nonlinear, unstable, and fast dynamic sys-
Received January 13, 2022 tem. These characteristics makes it a popular benchmark for building and
Revised February 17, 2022 testing novel controllers. Therefore, in this study, sliding mode controller
Accepted March 05, 2022 is proposed and tested on the inverted pendulum system. According to the
results of the simulation experiments with a sine signal as a reference, the
proposed controller can stabilize the system well and has so fast response.
Moreover, we have tuned the parameters of the proposed sliding mode con-
troller in order to eliminate the chattering effect, the overshoot, and the steady
Keywords
state error.
Inverted Pendulum;
Sliding Mode Control; This is an open access article under the CC-BY-SA license.
Robust Control;
Nonlinear
1. Introduction
The Inverted Pendulum is a highly nonlinear [1], unstable [2], fast dynamic [3], under-actuated
system [4], [5], and multivariable system [6]. This system belongs to the under-actuated mechanical
system, which its control inputs are more than its degrees of freedom [7], [6], [8], [9], [10].
This characteristic encouraged many researchers to use it as a traditional benchmark for the creation,
testing, assessing, and comparing of different classical and contemporary control techniques [6].
Fig. 1 shows the free body diagram of the inverted pendulum. The pendulum swings in time with
the cart’s movement. Even if the cart isn’t moving, the pendulum stick could easily fall [7], [11].
This makes the balancing of the stick requires a fast and great force. Else, the stick may fall on the
cart right away. As a result of this, the inverted pendulum controller should be designed in a way that
satisfies the high response requirement. The control system’s purpose is to balance the stick vertically
on the cart by applying a control signal (force) on the cart [12], [13].
In literature, the inverted pendulum system is an essential element in many applications such as
the balancing of robots and rocket systems when the rocket takes off [14], [15]. Consequently,
researchers have suggested different linear and nonlinear controllers for balancing the inverted pen-
dulum system. Proportional Integral Derivative Control (PID) was employed by some researchers
[16], [17], [18], while Linear Quadratic Regulator (LQR) and State Feedback Control with pole
placement controllers have been utilized by others [19], [20], [21], [22].
The nonlinear inverted pendulum system can be linearized using any linearization method then it
can be controlled using linear controllers such as PID and state feedback. Nonetheless, the linearized
http://dx.doi.org/10.31763/ijrcs.v2i2.594 ijrcs@ascee.org
ISSN 2775-2658 International Journal of Robotics and Control Systems 231
Vol. 2, No. 2, 2022, pp. 230-239
model is only a close approximation to the equilibrium with narrow angles; it cannot fully capture the
system’s dynamics. As a result, a linear controller can not satisfy the required response behaviour.
Taking this into consideration, a nonlinear robust controller is a better choice for the inverted pendu-
lum system.
With the recent advancement of Artificial Intelligence fields such as Fuzzy Logic Models, Ar-
tificial Neural Networks, and Evolutionary Computational Algorithms, researchers have proposed
different intelligence controllers for the inverted pendulum system [23], [24]. Although the outper-
formance of these models upon the linear controllers, they are computationally expensive [6]. This
fact motivates us to propose in this research a nonlinear robust controller which is computationally
inexpensive.
Sliding mode controller (SMC) is one of the common robust controllers which has been widely
utilized in the literature due to its robustness [25], [26], [27]. The basic goal of SMC is to drive the
error state variables of the controlled system toward zero by utilizing a discontinuous control signal.
When big control gains are utilized, the chattering effect may be activated [28]. Furthermore, the
vibrations that occur can be destructive to the system [29]. Consequently, chattering effect should be
taken into consideration when we design SMC [30].
The contribution of this study is to develop a suitable SMC for a nonlinear inverted pendulum
system. The proposed SMC is robust to parameter uncertainty and has no chattering effect.
This article consists of four sections as follows. The first section is an introduction, which includes
information about the research’s background. The second section discusses both the modeling of the
system and the designing of the proposed controller. The results and discussions section is the third
section. The final portion contains conclusions and recommendations for future work.
2. Method
2.1. Modeling
The free body diagram of the inverted pendulum is shown in Fig. 1. The system equations of
this nonlinear dynamic system can be derived as follows [7]. It is assumed here that the pendulum
rod is mass-less, and the hinge is frictionless. The cart mass and the ball point mass at the upper end
of the inverted pendulum are denoted as M and m, respectively. There is an externally x-directed
force on the cart, u(t) , and a gravity force acts on the point mass at all times. The coordinate
system considered is shown in Fig. 1, where x(t) represents the cart position and θ(t) is the tilt angle
referenced to the vertically upward direction.
The torque on the mass due to the acceleration force is balanced by the torque on the mass due to
the gravity force. The resultant torque balance can be written as follows.
A force balance in the x-direction gives that the mass times acceleration of the cart plus the mass
times the x-directed acceleration of the point mass must equal the external force on the system. This
can be written as follows.
x˙1 = θ̇ = x2 (9)
s1 = e˙1 + c1 e1 (11)
By substituting the first and second derivative of the error e1 with respect to time we can get.
where sign(s1 ) is the sign function of the sliding variable; k1 and c1 are any positive constants.
Now we can check the stability of the proposed controller system using Lyapunov equation. We
can start defining Lyapunov equation as follows.
s21
V1 = (17)
2
The derivative of Lyapunov equation (17) is shown in (18).
It is noticed from (21) that V˙1 < 0. Which means the suggested sliding mode control signal
derives the system to follow the desired angular position.
4. Conclusion
The Inverted Pendulum has been used as a popular benchmark for building and testing novel
controllers in many studies. This is due to its dynamic behaviour. Therefore, in this study, sliding
mode controller is proposed and tested on the inverted pendulum system. First, we have derived its
mathematical dynamic model. Then we have designed a sliding mode controller to derive the angular
position of the stick into the required angle. According to the results of the simulation experiments
with a sine signal as a reference, the proposed controller can stabilize the system well and has so
fast response. Moreover, we have tuned the parameters of the proposed sliding mode controller in
order to eliminate the chattering effect, the overshoot, and the steady state error. As a future study,
it is suggested to use a standard optimization method to tune the controller parameters within the
suggested ranges.
1
Response
0.8 Refrence
0.6
0.4
Position (meter)
0.2
-0.2
-0.4
-0.6
-0.8
-1
0 1 2 3 4 5 6 7 8 9 10
Time (seconds)
Fig. 2. System Response for Sliding Mode Control with sin(2πt) as a Reference, t = 0 : 0.01 : 10,
k1 = 500 and c1 = 100
6
X1
X2
4 Refrence
2
Position (meter)
-2
-4
-6
0 1 2 3 4 5 6 7 8 9 10
Time (seconds)
Fig. 3. State Variables for Sliding Mode Control with sin(2πt) as a Reference, t = 0 : 0.01 : 10,
k1 = 500 and c1 = 100
1.5
Response
Refrence
1
0.5
Position (meter)
-0.5
-1
-1.5
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Time (seconds)
Fig. 4. System Response for Sliding Mode Control with sin(2πt) as a Reference, t = 0 : 0.01 : 5,
k1 = 700 and c1 = 102,
8
X1
6 X2
Refrence
4
Position (meter)
-2
-4
-6
-8
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Time (seconds)
Fig. 5. State Variables for Sliding Mode Control with sin(2πt) as a Reference, t = 0 : 0.01 : 5,
k1 = 700 and c1 = 102
1.5
Response
Refrence
1
0.5
Position (meter)
-0.5
-1
-1.5
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Time (seconds)
Fig. 6. State Variables for Sliding Mode Control with sin(2πt) as a Reference, 0.5sin(2πt) as a
disturbance, t = 0 : 0.01 : 5, k1 = 700 and c1 = 102
8
X1
6 X2
Refrence
4
Position (meter)
-2
-4
-6
-8
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Time (seconds)
Fig. 7. State Variables for Sliding Mode Control with sin(2πt) as a Reference, 0.5sin(2πt) as a
disturbance, t = 0 : 0.01 : 5, k1 = 700 and c1 = 102
References
[1] M. F. Hamza, H. J. Yap, I. A. Choudhury, A. I. Isa, A. Y. Zimit, and T. Kumbasar, “Current development
on using rotary inverted pendulum as a benchmark for testing linear and nonlinear control algorithms,”
Mechanical Systems and Signal Processing, vol. 116, pp. 347–369, feb 2019, https://doi.org/10.1016/j.
ymssp.2018.06.054.
[2] J. Huang, T. Zhang, Y. Fan, and J.-Q. Sun, “Control of rotary inverted pendulum using model-free back-
stepping technique,” IEEE Access, vol. 7, pp. 96 965–96 973, 2019, https://doi.org/10.1109/ACCESS.
2019.2930220.
[3] A. de Carvalho, J. F. Justo, B. A. Angelico, A. M. de Oliveira, and J. I. da Silva Filho, “Rotary inverted
pendulum identification for control by paraconsistent neural network,” IEEE Access, vol. 9, pp. 74 155–
74 167, 2021, https://doi.org/10.1109/access.2021.3080176.
[4] P. Dwivedi, S. Pandey, and A. S. Junghare, “Stabilization of unstable equilibrium point of rotary inverted
pendulum using fractional controller,” Journal of the Franklin Institute, vol. 354, no. 17, pp. 7732–7766,
2017, https://doi.org/10.1016/j.jfranklin.2017.09.013.
[5] X. Chen, R. Yu, K. Huang, S. Zhen, H. Sun, and K. Shao, “Linear motor driven double inverted pendu-
lum: A novel mechanical design as a testbed for control algorithms,” Simulation Modelling Practice and
Theory, vol. 81, pp. 31–50, 2018, https://doi.org/10.1016/j.simpat.2017.11.009.
[6] A. Ma’arif, M. A. M. Vera, M. S. Mahmoud, S. Ladaci, A. Çakan, and J. N. Parada, “Backstepping
sliding mode control for inverted pendulum system with disturbance and parameter uncertainty,” Journal
of Robotics and Control (JRC), vol. 3, no. 1, pp. 86–92, 2021, https://doi.org/10.18196/jrc.v3i1.12739.
[7] L. B. Prasad, B. Tyagi, and H. O. Gupta, “Modelling and simulation for optimal control of nonlinear
inverted pendulum dynamical system using pid controller and lqr,” in 2012 Sixth Asia Modelling Sympo-
sium, 2012, pp. 138–143, https://doi.org/10.1109/AMS.2012.21.
[8] Y. Rizal, M. Wahyu, I. Noor, J. Riadi, F. Feriyadi, and R. Mantala, “Design of an adaptive super-twisting
control for the cart-pole inverted pendulum system,” Jurnal Ilmiah Teknik Elektro Komputer dan Infor-
matika, vol. 7, no. 1, pp. 161–174, 2021, http://dx.doi.org/10.26555/jiteki.v7i1.20420.
[9] E. Kennedy, E. King, and H. Tran, “Real-time implementation and analysis of a modified energy based
controller for the swing-up of an inverted pendulum on a cart,” European Journal of Control, vol. 50, pp.
176–187, 2019, https://doi.org/10.1016/j.ejcon.2019.05.002.
[10] J. F. S. Trentin, S. Da Silva, J. M. De Souza Ribeiro, and H. Schaub, “Inverted pendulum nonlinear
controllers using two reaction wheels: Design and implementation,” IEEE Access, vol. 8, pp. 74 922–
74 932, 2020, https://doi.org/10.1109/ACCESS.2020.2988800.
[11] A. Çakan, F. M. Botsalı, and M. Tınkır, “Pid control of inverted pendulum using adams and matlab co-
simulation,” in Proceedings of the 4th International Conference on Control, Mechatronics and Automa-
tion, ser. ICCMA ’16. New York, NY, USA: Association for Computing Machinery, 2016, p. 136–139,
https://doi.org/10.1145/3029610.3029643.
[12] M. Waszak and R. Łangowski, “An automatic self-tuning control system design for an inverted pendu-
lum,” IEEE Access, vol. 8, pp. 26 726–26 738, 2020, https://doi.org/10.1109/ACCESS.2020.2971788.
[13] Y. Silik and U. Yaman, “Control of rotary inverted pendulum by using on–off type of cold gas thrusters,”
Actuators, vol. 9, no. 4, 2020, https://doi.org/10.3390/act9040095.
[14] A. T. Azar, H. H. Ammar, M. H. Barakat, M. A. Saleh, and M. A. Abdelwahed, “Self-balancing
robot modeling and control using two degree of freedom pid controller,” in Proceedings of the Inter-
national Conference on Advanced Intelligent Systems and Informatics 2018, A. E. Hassanien, M. F.
Tolba, K. Shaalan, and A. T. Azar, Eds. Cham: Springer International Publishing, 2019, pp. 64–76,
https://doi.org/10.1007/978-3-319-99010-1 6.
[15] I. Gandarilla, V. Santibañez, and J. Sandoval, “Control of a self-balancing robot with two degrees of
freedom via ida-pbc,” ISA Transactions, vol. 88, pp. 102–112, 2019, https://doi.org/10.1016/j.isatra.2018.
12.014.
[16] I. Siradjuddin, Z. Amalia, B. Setiawan, F. Ronilaya, E. Rohadi, A. Setiawan, C. Rahmad, and S. Ad-
hisuwignjo, “Stabilising a cart inverted pendulum with an augmented PID control scheme,” MATEC Web
of Conferences, vol. 197, p. 11013, 2018, https://doi.org/10.1051/matecconf%2F201819711013.
[17] E. S. Varghese, A. K. Vincent, and V. Bagyaveereswaran, “Optimal control of inverted pendulum system
using PID controller, LQR and MPC,” IOP Conference Series: Materials Science and Engineering, vol.
263, p. 052007, nov 2017, https://doi.org/10.1088/1757-899x/263/5/052007.
[18] J.-J. Wang, “Simulation studies of inverted pendulum based on pid controllers,” Simulation Modelling
Practice and Theory, vol. 19, no. 1, pp. 440–449, 2011, https://doi.org/10.1016/j.simpat.2010.08.003.
[19] M. Fauziyah, Z. Amalia, I. Siradjuddin, D. Dewatama, R. P. Wicaksono, and E. Yudaningtyas, “Linear
quadratic regulator and pole placement for stabilizing a cart inverted pendulum system,” Bulletin of Elec-
trical Engineering and Informatics, vol. 9, no. 3, pp. 914–923, 2020, https://doi.org/10.11591/eei.v9i3.
2017.
[20] N. Tahir, M. Muhammad, M. Idi, S. Buyamin, L. Maijama’a, and S. Yarima, “Comparative analysis of
observer-based lqr and lmi controllers of an inverted pendulum,” Bulletin of Electrical Engineering and
Informatics, vol. 9, no. 6, pp. 2244–2252, 2020, https://doi.org/10.11591/eei.v9i6.2271.
[21] E. Susanto, A. Surya Wibowo, and E. Ghiffary Rachman, “Fuzzy swing up control and optimal state
feedback stabilization for self-erecting inverted pendulum,” IEEE Access, vol. 8, pp. 6496–6504, 2020,
https://doi.org/10.1109/ACCESS.2019.2963399.
[22] Ümit Önen and A. Çakan, “Multibody modeling and balance control of a reaction wheel inverted pendu-
lum using lqr controller,” International Journal of Robotics and Control Systems, vol. 1, no. 1, pp. 84–89,
2021, https://doi.org/10.31763/ijrcs.v1i1.296.
[23] Y. Liu, Z. Chen, D. Xue, and X. Xu, “Real-time controlling of inverted pendulum by fuzzy logic,” in
2009 IEEE International Conference on Automation and Logistics, 2009, pp. 1180–1183, https://doi.org/
10.1109/ICAL.2009.5262618.
[24] C. Tao, J. Taur, C. Wang, and U. Chen, “Fuzzy hierarchical swing-up and sliding position controller for
the inverted pendulum–cart system,” Fuzzy Sets and Systems, vol. 159, no. 20, pp. 2763–2784, 2008,
https://doi.org/10.1016/j.fss.2008.02.005.
[25] J.-J. E. Slotine, W. Li et al., Applied nonlinear control. Prentice hall Englewood Cliffs, NJ, 1991,
https://books.google.co.id/books?id=cwpRAAAAMAAJ.
[26] A. Concha, S. Thenozhi, R. J. Betancourt, and S. Gadi, “A tuning algorithm for a sliding mode controller
of buildings with atmd,” Mechanical Systems and Signal Processing, vol. 154, p. 107539, 2021, https:
//doi.org/10.1016/j.ymssp.2020.107539.
[27] Y. Ouberri, H. Yatimi, and E. Aroudam, “Design of a robust sliding mode controller for mppt based on
automation plc for pv applications,” International Transactions on Electrical Energy Systems, vol. 30,
no. 4, p. e12296, 2020, https://doi.org/10.1002/2050-7038.12296.
[28] Y.-J. Huang, T.-C. Kuo, and S.-H. Chang, “Adaptive sliding-mode control for nonlinearsystems with un-
certain parameters,” IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics), vol. 38,
no. 2, pp. 534–539, 2008, https://doi.org/10.1109/TSMCB.2007.910740.
[29] A. Šabanovic, “Variable structure systems with sliding modes in motion control—a survey,” IEEE Trans-
actions on Industrial Informatics, vol. 7, no. 2, pp. 212–223, 2011, https://doi.org/10.1109/TII.2011.
2123907.
[30] A. Bavarsad, A. Fakharian, and M. B. Menhaj, “Optimal sliding mode controller for an active trans-
femoral prosthesis using state-dependent riccati equation approach,” Arabian Journal for Science and
Engineering, vol. 45, no. 8, pp. 6559–6572, may 2020, https://doi.org/10.1007/s13369-020-04563-x.