# T-S Fuzzy System Controller for Stabilizing the Double Inverted Pendulum

Authors: Boutaina Elkinany; Mohammed Alfidi; Redouane Chaibi; Zakaria Chalh
Journal: Advances in Fuzzy Systems
 (2020)

---

## Abstract

This article provides a representation of the double inverted pendulum system that is shaped and regulated in response to torque application at the top rather than the bottom of the pendulum, given that most researchers have controlled the double inverted pendulum based on the lower part or the base. To achieve this objective, we designed a dynamic Lagrangian conceptualization of the double inverted pendulum and a state feedback representation based on the simple convex polytypic transformation. Finally, we used the fuzzy state feedback approach to linearize the mathematical nonlinear model and to develop a fuzzy controllerH∞, given its great ability to simplify nonlinear systems in order to reduce the error rate and to increase precision. In our virtual conceptualization of the inverted pendulum, we used MATLAB software to simulate the movement of the system before applying a command on the upper part of the system to check its stability. Concerning the nonlinearities of the system, we have found a state feedback fuzzy control approach. Overall, the simulation results have shown that the fuzzy state feedback model is very efficient and flexible as it can be modified in different positions.


---

## Body

## 1. Introduction

A double pendulum is made up of two individual pendulums which mimic a nonlinear and unstable dynamic system [1–5]. It displays a perfect model of nonlinear and chaotic movements. Unlike the previous system, the simple pendulum is not as sophisticated and advanced as the double pendulum although its simple structure and instability are highly utilized for experimental research [6–8]. A double pendulum or the underactuated system has more joints than actuators, and its control is a subject of great interest for researchers because of its high applicability in robotics.One of the well-known models is the double pendulum on a cart [9–12]. It poses a control problem regarding its architecture which is composed of a straight-line moving cart, one rotary inverted pendulum around the cart’s mass center, and another around the mass center of the first inverted pendulum. To reach the desired equilibrium state, Neusser and Valášek [13] tried to control this system by applying the nonlinear quadratic regulator. Bogdanov [9] also tested a combination between the linear quadratic regulator, the neural network, and the Riccati equation in order to reach the overall stability of this model. The key downside of this approach lies in the large number of complex calculations. Concerning the double-pendulum crane model, the system consists of a payload attached to a hook. The combination of the double pendulum system with a crane became interesting because of its high utility and applicability in the industry. To provide more details about the functionality of this model, Chen et al. [14] presented the dynamics of the double-pendulum crane and proposed a time-optimal trajectory planning approach in order to achieve the control objectives. Muhammad et al. [15], moreover, focused on stabilizing the double-pendulum crane by using the linear matrix inequality method. Eventually, the simulation results proved a high effectiveness of this controller. Jaafar et al. [16] also employed this system and improved its vibration control by designing the model reference command shaping (MRCS) approach. In addition to this, Wu et al. and Yang et al. [17, 18] developed an adaptive output-feedback controller to avoid the instability and disturbances of this system.The stabilization of the Furuta double pendulum is one of highly recommended examples to study the double pendulum system. It is equipped with two pendulums and a rotating arm. Ismail and Liu [19] depicted a new optimal control technique to swing up the Furuta double pendulum model.From another point of view, a double inverted pendulum system represents a typical group of underactuated mechanical systems used in control theory which includes the modeling of an unstable chaotic system by formulating its motion equations, designing a stabilizing controller for the nonlinear systems, and establishing a numerical stability state simulation in order to show the good stability of this system.In this regard, Slavka and Anna [20] aimed at presenting the double inverted pendulum (DIP) modeling and control by developing a Simulink block library in MATLAB software. Demirci [21], furthermore, laid down the pole placement and the linear quadratic regulator (LQR) methods to achieve the satisfactory stability results in very small regions of this system equilibrium. Zhang and Zhang [22] also based their model on the LQR self-adjusting technique in order to maintain control over the planar DIP. Moysis [23], as well, focused on keeping the DIP on the upright equilibrium position by first employing the linear quadratic regulator and Laguerre functions.Other researchers [24–26] dealt with swinging up the DIP at the upright vertical position by creating a simulation prototype of this system and trying to maintain it on the vertical point.Since the DIP is a nonlinear model with a high level of nonlinearities widely applied in testing new control approaches, different nonlinear and intelligent methods have been used to control it. Al-Hadithi et al. [27], for instance, contributed to the stabilization of the DIP by employing a new optimal fuzzy controller. Lo and Lin [28] proposed a new approach that is based on the sliding mode controller to eliminate the chattering-generated phenomenon. Yang et al. [29] also employed the adaptive backstepping technique and the fuzzy logic system to form the fuzzy logic system-based adaptive fault-tolerant controller to stabilize a wheeled system.The state feedback fuzzy approach is regarded as the most effective device for explaining the dynamic behavior of the nonlinear system in an adequate way. Consequently, the novelty and the efficiency of this method are manifested in relevance to the following factors: the dynamic response, the complexity degree of the algorithm, the number of detectors, and the implementation cost.The majority of the researchers interested in the double pendulum system has used algorithms to achieve control over this system while applying a torque on both pendulums. Stabilizing the model through applying a torque on the second pendulum rather than the first is still a mystery to researchers; eventually, in this study, we aim to surmount such a challenge while making use of the state feedback fuzzy theory to control the DIP on the upright position. The second part presents a mathematical formulation of the DIP based on the Lagrangian approach, illustrated by a graphical modeling, which is rooted in the virtual reality and MATLAB software, as displayed in the third part. The fourth part provides a general overview of the state feedback fuzzy technique simulation results using MATLAB/Simulink, while the fifth and last part sum up all significant results and perspectives of this study.


## 2. Modeling of the System

The objective of this section is to determine motion equations of the system and to establish the graphical model of the DIP. As a matter of fact, Lagrangian was firstly calculated. After that, the system was drawn using MATLAB software.Figure1 illustrates our conceptualization of the double inverted pendulum system; once a torque F was applied on the upper part of the double inverted pendulum, both pendulums deviated on their gravity centers.Figure 1
Double inverted pendulum system.Table1 shows the technical parameters for using this system.Table 1
Parameters of the double inverted pendulum system.
Parameters and valueDescriptionm1Mass of the first pendulumm2Mass of the second pendulumL1Length of the first pendulumL2Length of the second pendulumg = 9.81 N/kgCoefficient of the gravityJ1=m1.L12/12Inertia moment of the first pendulumJ2=m2.L22/12Inertia moment of the second pendulumαRotation angle of the first inverted pendulumβRotation angle of the second inverted pendulumFApplied torque on the second pendulum (the upper part)


### 2.1. DIP Mathematical Modeling

Lagrangian of a mechanical system is extracted by the difference between its kinetic energy and its potential energy. From this Lagrangian, the equations of the DIP system are derived using Euler–Lagrange, as shown in the following.The kinetic energy of the system is(1)T=12⋅m1⋅L12⋅α˙2+12⋅m2⋅L1⋅α˙2+L22⋅β˙2−L1⋅L2⋅α˙⋅β˙cosα⋅cosβ+sinα⋅sinβ+12⋅J1⋅α˙2+12⋅J2⋅β˙2.The potential energy of the system is(2)V=m12+m2⋅g⋅L1⋅cosα−m22⋅g⋅L2⋅cosβ.Lagrangian is given by(3)ℒ=T−V.In accordance with the Lagrangian formulation, the entire dynamic model of the DIP system is provided by(4)α¨=1ζλ⋅ξ⋅F−μ⋅sinβ−γ⋅α˙2+λaγ⋅β˙2+ν⋅sinα+γ⋅β˙2+ν⋅sinα,(5)β¨=1ξF−μ⋅sinβ−γ⋅α˙2+λaγ⋅β˙2+ν⋅sinα,with(6)a=m1⋅L124+J1+m2⋅J22,λ=m22⋅L1⋅L2⋅cosα−β,γ=m22⋅L1⋅L2⋅sinα−β,ν=m12+m2⋅g⋅L1,η=m2⋅L224+J2,ξ=1η−λ2/a.Note. We will consider m1=3/4⋅m2 and L1=3/4⋅L2.According to the dynamic model presented in (5) and (7), the nonlinear state-space representation can take the following form:(7)Q=αα˙ββ˙T=q1q2q3q4T.The double inverted pendulum model can be depicted by its nonlinear state-space form as(8)q1.=q2,q2.=1ζλ⋅ξ⋅F−μ⋅sinq3−γ⋅q22+λaγ⋅q42+ν⋅sinq1+γ⋅q42+ν⋅sinq1,q3.=q4,q4.=1ξF−μ⋅sinq3−γ⋅q22+λaγ⋅q42+ν⋅sinq1.So, the nonlinear representation of the DIP can be given asQ˙=fq+gq⋅u, where(9)fq=q2−1ζλ⋅ξ⋅μ⋅sinq3+γ⋅q22−λaγ⋅q42+ν⋅sinq1−γ⋅q42−ν⋅sinq1q4−1ξμ⋅sinq3+γ⋅q22−λaγ⋅q42+ν⋅sinq1,gq=0λ⋅ξζ01ξ.


## 2.1. DIP Mathematical Modeling

Lagrangian of a mechanical system is extracted by the difference between its kinetic energy and its potential energy. From this Lagrangian, the equations of the DIP system are derived using Euler–Lagrange, as shown in the following.The kinetic energy of the system is(1)T=12⋅m1⋅L12⋅α˙2+12⋅m2⋅L1⋅α˙2+L22⋅β˙2−L1⋅L2⋅α˙⋅β˙cosα⋅cosβ+sinα⋅sinβ+12⋅J1⋅α˙2+12⋅J2⋅β˙2.The potential energy of the system is(2)V=m12+m2⋅g⋅L1⋅cosα−m22⋅g⋅L2⋅cosβ.Lagrangian is given by(3)ℒ=T−V.In accordance with the Lagrangian formulation, the entire dynamic model of the DIP system is provided by(4)α¨=1ζλ⋅ξ⋅F−μ⋅sinβ−γ⋅α˙2+λaγ⋅β˙2+ν⋅sinα+γ⋅β˙2+ν⋅sinα,(5)β¨=1ξF−μ⋅sinβ−γ⋅α˙2+λaγ⋅β˙2+ν⋅sinα,with(6)a=m1⋅L124+J1+m2⋅J22,λ=m22⋅L1⋅L2⋅cosα−β,γ=m22⋅L1⋅L2⋅sinα−β,ν=m12+m2⋅g⋅L1,η=m2⋅L224+J2,ξ=1η−λ2/a.Note. We will consider m1=3/4⋅m2 and L1=3/4⋅L2.According to the dynamic model presented in (5) and (7), the nonlinear state-space representation can take the following form:(7)Q=αα˙ββ˙T=q1q2q3q4T.The double inverted pendulum model can be depicted by its nonlinear state-space form as(8)q1.=q2,q2.=1ζλ⋅ξ⋅F−μ⋅sinq3−γ⋅q22+λaγ⋅q42+ν⋅sinq1+γ⋅q42+ν⋅sinq1,q3.=q4,q4.=1ξF−μ⋅sinq3−γ⋅q22+λaγ⋅q42+ν⋅sinq1.So, the nonlinear representation of the DIP can be given asQ˙=fq+gq⋅u, where(9)fq=q2−1ζλ⋅ξ⋅μ⋅sinq3+γ⋅q22−λaγ⋅q42+ν⋅sinq1−γ⋅q42−ν⋅sinq1q4−1ξμ⋅sinq3+γ⋅q22−λaγ⋅q42+ν⋅sinq1,gq=0λ⋅ξζ01ξ.


## 3. Initial Unstable Equilibrium Position

Regarding continuous system (10), the most complicated task is to achieve stability at its equilibrium point. We, therefore, need to select a convenient initial position to implement a controller that enables the system to move from an unstable equilibrium position to a stable one.As illustrated in Figure2, the Lyapunov approach is used for the examination of the equilibrium point stability movement in consonance with the DIP system’s motion while focusing on one positive scalar function.Figure 2
Convex and concave region of the Lyapunov function.By way of explanation, a continuous scalar functionVx is 0 at the origin and positive at a certain point surrounding the origin, i.e., (10)V0=0,Vx>0,∀x>0,x⟶∞⟹Vx⟶∞,V˙x<0,∀x≠0.Since the potential energy (3) is a positive and continuous scalar function, we consider it as a Lyapunov function.So, based on the Lyapunov approach, the initial unstable equilibrium position is determined by(11)VConvex=∂2U∂t2∈R+.Accordingly,(12)β=arccosm1/2+m2⋅g⋅L1m2/2⋅g⋅L2⋅cosα.


## 4. Virtual Reality via MATLAB Software

The visual representation of the movement of the double inverted pendulum is highly required for its design development. Such a representation is not only used for regulating this system’s degrees of freedom but also crucial for picking up a convenient controller. In this regard, the creation of a virtual prototype of this model on MATLAB requires using V-Realm builder for model’s drawing and MATLAB/Simulink (M-Script) for its animation.Figure3 captures the motion of the created model in various positions. The double inverted pendulum rotates when a torque is applied on the top of the model, causing the pendulums to move left and right.Figure 3
DIP system representation in V-Realm builder.


## 5. State Feedback Fuzzy Problem Formulation and Controller Design

### 5.1. DIP State Feedback Fuzzy Problem Formulation

The fuzzy controller system operates according to the so called fuzzy rules, namely, the if-then statements, fuzzy sets, logic, and inference. These rules are extremely useful for depicting sophisticated controls and models and for connecting input and output variables of fuzzy controllers. The most well-known types of fuzzy rules are Mamdani and T-S (state feedback).In fact, it has been shown that state feedback fuzzy models represent precisely some nonlinear systems using fuzzy if-then rules. Thus, these state feedback fuzzy models provide a simple and efficient method to complement other nonlinear control strategies and to decrease the complexity of the system in order to optimize the error rate in the simulation results and using mathematical nonlinear models.Consequently, we are more concerned in this paper with the state feedback fuzzy approach. So, the total membership state feedback fuzzy functions are set according to the following conditions:(13)∑i=14hiz1t,z3t,0≤hiz1t,z3t≤1,i=1,…,4,where(14)z1=q1,z3=q3,where the parameters qi are the input variables. Generally speaking, these variables are theoretically defined as either continuous or discrete, yet in practical terms, only the continuous variables are the most feasible because all fuzzy controllers and models are applied using digital computers.min2,min4,max2,max4 are, respectively, the minimum and the maximum of q2 and q4, so(15)min2<q2<max2,min4<q4<max4.The membership functionsMk,min and Mk,max assigned each variable are given as follows:(16)M11q2=q2−min2max2−min2,(17)M12q2=max2−q2max2−min2,(18)M21q4=q4−min4max4−min4,(19)M22q4=max4−q4max4−min4.The weighting functions of the state feedback fuzzy model are(20)h1=M11q2⋅M21q4,h2=M11q2⋅M22q4,h3=M12q2⋅M21q4,h4=M12q2⋅M22q4.So, the global state feedback fuzzy model is(21)q˙t=∑i=14hiztAi⋅qt+Bi⋅qt+D⋅wt,zt=∑i=14hiCi⋅qt,i=1,…,4,where the subsystems are established as(22)A=0100νξλa+1−γξq2−λaμξγξλa+10001−λaν−γξ−μξ−λaγq4,B=0λaξ01ξ.So,(23)A1=0100νξλa+1−γξqmin2−λaμξγξλa+10001−λaν−γξ−μξ−λaγqmin4,A2=0100νξλa+1−γξqmin2−λaμξγξλa+10001−λaν−γξ−μξ−λaγqmax4,A3=0100νξλa+1−γξqmax2−λaμξγξλa+10001−λaν−γξ−μξ−λaγqmax4,A4=0100νξλa+1−γξqmax2−λaμξγξλa+10001−λaν−γξ−μξ−λaγqmin4,B=B1=B2=B3=B4.Lemma 1 (see [26]).
The following statements concerning the continuous-time unforced nominal system are equivalent:(1)
There exists a matrixP=PT>0 such that(24)PAij+AijTPPEiCiT∗−γ2IDiT∗∗−I<0.(2)
x˙=Aijxt is a stable system, and the disturbed system x˙=Aijxt+Eiωt satisfies the H∞ performance.


### 5.2. State Feedback Fuzzy Controller Design

Assessing the previous matrices for each T-S fuzzy model linear subsystem for the double inverted pendulum system and taking into consideration the parameters of nonlinear system (10) provided m1=0.5kg,m2=0.75kg,L1=0.5m, and L2=0.75kg and presuming that the pair Ai,Bi is controllable and observable, it will be feasible to develop the stable state feedback fuzzy controller design.The T-S controller design is based on establishing the feedback gainKi for the linear pair Ai,Bi that satisfies the following theorem of stability.Theorem 1.
Consider closed-loop fuzzy system (17) and a scalar γ>0; the system is asymptotically stable with the H∞ performance γ if there exist symmetric matrix Q and matrices Yi such that the following LMIs hold:(25)Ωii<0,i=1,2,…,r,(26)Ωij+Ωji<0,i<j=i+1,2,…,r,where(27)Ωij=Ωij11EiQCiT∗−γ2IDiT∗∗−I<0,Ωij21=AiQ+QAiT+BiYj+YjTBiT,and the gain matrices are given by Ki=YQ−1.Obviously, the LMI conditions (24) and (25) can be rewritten as follows:(28)∑i=1rhi2Ωii+∑i=1r−1∑j=i+1rhihjΩij+Ωij<0,which is verified if(29)Ωij=Ωij11EiQCiT∗−γ2IDiT∗∗−I<0.Before and after multiplying both sides of (28) by diagQ−1,I,I and applying the change of variables Q−1=P and Yj=KjQ, we obtain inequality (19). This completes the proof.To represent the stability study and design techniques of the T-S fuzzy output feedback controller for the developed system, we should design the feedback gainKi of the linear submodels as follows:(30)K1=−9.3504−0.43111.08671.1527,K2=−9.3754−0.43211.08681.1552,K3=−9.3750−0.43091.08681.1551,K4=−9.3501−0.42991.08671.1526.MATLAB/Simulink was implemented to simulate the performance of the state feedback fuzzy controller. Figure4 shows the block diagram of the DIP system.Figure 4
State feedback fuzzy block diagram for the DIP system.


## 5.1. DIP State Feedback Fuzzy Problem Formulation

The fuzzy controller system operates according to the so called fuzzy rules, namely, the if-then statements, fuzzy sets, logic, and inference. These rules are extremely useful for depicting sophisticated controls and models and for connecting input and output variables of fuzzy controllers. The most well-known types of fuzzy rules are Mamdani and T-S (state feedback).In fact, it has been shown that state feedback fuzzy models represent precisely some nonlinear systems using fuzzy if-then rules. Thus, these state feedback fuzzy models provide a simple and efficient method to complement other nonlinear control strategies and to decrease the complexity of the system in order to optimize the error rate in the simulation results and using mathematical nonlinear models.Consequently, we are more concerned in this paper with the state feedback fuzzy approach. So, the total membership state feedback fuzzy functions are set according to the following conditions:(13)∑i=14hiz1t,z3t,0≤hiz1t,z3t≤1,i=1,…,4,where(14)z1=q1,z3=q3,where the parameters qi are the input variables. Generally speaking, these variables are theoretically defined as either continuous or discrete, yet in practical terms, only the continuous variables are the most feasible because all fuzzy controllers and models are applied using digital computers.min2,min4,max2,max4 are, respectively, the minimum and the maximum of q2 and q4, so(15)min2<q2<max2,min4<q4<max4.The membership functionsMk,min and Mk,max assigned each variable are given as follows:(16)M11q2=q2−min2max2−min2,(17)M12q2=max2−q2max2−min2,(18)M21q4=q4−min4max4−min4,(19)M22q4=max4−q4max4−min4.The weighting functions of the state feedback fuzzy model are(20)h1=M11q2⋅M21q4,h2=M11q2⋅M22q4,h3=M12q2⋅M21q4,h4=M12q2⋅M22q4.So, the global state feedback fuzzy model is(21)q˙t=∑i=14hiztAi⋅qt+Bi⋅qt+D⋅wt,zt=∑i=14hiCi⋅qt,i=1,…,4,where the subsystems are established as(22)A=0100νξλa+1−γξq2−λaμξγξλa+10001−λaν−γξ−μξ−λaγq4,B=0λaξ01ξ.So,(23)A1=0100νξλa+1−γξqmin2−λaμξγξλa+10001−λaν−γξ−μξ−λaγqmin4,A2=0100νξλa+1−γξqmin2−λaμξγξλa+10001−λaν−γξ−μξ−λaγqmax4,A3=0100νξλa+1−γξqmax2−λaμξγξλa+10001−λaν−γξ−μξ−λaγqmax4,A4=0100νξλa+1−γξqmax2−λaμξγξλa+10001−λaν−γξ−μξ−λaγqmin4,B=B1=B2=B3=B4.Lemma 1 (see [26]).
The following statements concerning the continuous-time unforced nominal system are equivalent:(1)
There exists a matrixP=PT>0 such that(24)PAij+AijTPPEiCiT∗−γ2IDiT∗∗−I<0.(2)
x˙=Aijxt is a stable system, and the disturbed system x˙=Aijxt+Eiωt satisfies the H∞ performance.


## 5.2. State Feedback Fuzzy Controller Design

Assessing the previous matrices for each T-S fuzzy model linear subsystem for the double inverted pendulum system and taking into consideration the parameters of nonlinear system (10) provided m1=0.5kg,m2=0.75kg,L1=0.5m, and L2=0.75kg and presuming that the pair Ai,Bi is controllable and observable, it will be feasible to develop the stable state feedback fuzzy controller design.The T-S controller design is based on establishing the feedback gainKi for the linear pair Ai,Bi that satisfies the following theorem of stability.Theorem 1.
Consider closed-loop fuzzy system (17) and a scalar γ>0; the system is asymptotically stable with the H∞ performance γ if there exist symmetric matrix Q and matrices Yi such that the following LMIs hold:(25)Ωii<0,i=1,2,…,r,(26)Ωij+Ωji<0,i<j=i+1,2,…,r,where(27)Ωij=Ωij11EiQCiT∗−γ2IDiT∗∗−I<0,Ωij21=AiQ+QAiT+BiYj+YjTBiT,and the gain matrices are given by Ki=YQ−1.Obviously, the LMI conditions (24) and (25) can be rewritten as follows:(28)∑i=1rhi2Ωii+∑i=1r−1∑j=i+1rhihjΩij+Ωij<0,which is verified if(29)Ωij=Ωij11EiQCiT∗−γ2IDiT∗∗−I<0.Before and after multiplying both sides of (28) by diagQ−1,I,I and applying the change of variables Q−1=P and Yj=KjQ, we obtain inequality (19). This completes the proof.To represent the stability study and design techniques of the T-S fuzzy output feedback controller for the developed system, we should design the feedback gainKi of the linear submodels as follows:(30)K1=−9.3504−0.43111.08671.1527,K2=−9.3754−0.43211.08681.1552,K3=−9.3750−0.43091.08681.1551,K4=−9.3501−0.42991.08671.1526.MATLAB/Simulink was implemented to simulate the performance of the state feedback fuzzy controller. Figure4 shows the block diagram of the DIP system.Figure 4
State feedback fuzzy block diagram for the DIP system.


## 6. Numerical Simulations

In this section, tracking the effectiveness and balance of the double inverted pendulum is simulated by the implementation of the state feedback fuzzy model.


### 6.1. Results

To verify the suggested state feedback fuzzy model of the DIP system, simulations were implemented via Simulink as shown in Figure4. The results showed that the double inverted pendulum can be balanced at the upright position regardless of the presence or the absence of perturbation as shown in Figures 5 and 6. The DIP system is incarnated into Matlab/Simulink based on nonlinear dynamic formulation (10). The linearized subsystems are also represented in Simulink based on the obtained data of the linearized model in equations, as illustrated in Section 5.Figure 5
DIP system control effort without perturbation.Figure 6
DIP response without perturbation.


#### 6.1.1. Discussion

The effectiveness of the state feedback fuzzy controller has been verified by the simulation of the double inverted pendulum in MATLAB software.The injected perturbationwt=2⋅sin2⋅π⋅t and the used state feedback fuzzy control effort are shown in Figures 7 and 8.Figure 7
DIP response with perturbation.Figure 8
Applied perturbation to the DIP system.As mentioned in Figures5 and 9, the selected state feedback fuzzy model brings up the system to the equilibrium point in [0, 10] s, without applying a perturbation, while in Figure 7, the controller with applying perturbation brings up the system to the equilibrium point in [0, 20] s.Figure 9
DIP system control effort with perturbation.Eventually, the state feedback fuzzy model selected without perturbation not only ensured the fast response but also provided good precision of controlling the DIP system.


## 6.1. Results

To verify the suggested state feedback fuzzy model of the DIP system, simulations were implemented via Simulink as shown in Figure4. The results showed that the double inverted pendulum can be balanced at the upright position regardless of the presence or the absence of perturbation as shown in Figures 5 and 6. The DIP system is incarnated into Matlab/Simulink based on nonlinear dynamic formulation (10). The linearized subsystems are also represented in Simulink based on the obtained data of the linearized model in equations, as illustrated in Section 5.Figure 5
DIP system control effort without perturbation.Figure 6
DIP response without perturbation.


### 6.1.1. Discussion

The effectiveness of the state feedback fuzzy controller has been verified by the simulation of the double inverted pendulum in MATLAB software.The injected perturbationwt=2⋅sin2⋅π⋅t and the used state feedback fuzzy control effort are shown in Figures 7 and 8.Figure 7
DIP response with perturbation.Figure 8
Applied perturbation to the DIP system.As mentioned in Figures5 and 9, the selected state feedback fuzzy model brings up the system to the equilibrium point in [0, 10] s, without applying a perturbation, while in Figure 7, the controller with applying perturbation brings up the system to the equilibrium point in [0, 20] s.Figure 9
DIP system control effort with perturbation.Eventually, the state feedback fuzzy model selected without perturbation not only ensured the fast response but also provided good precision of controlling the DIP system.


## 6.1.1. Discussion

The effectiveness of the state feedback fuzzy controller has been verified by the simulation of the double inverted pendulum in MATLAB software.The injected perturbationwt=2⋅sin2⋅π⋅t and the used state feedback fuzzy control effort are shown in Figures 7 and 8.Figure 7
DIP response with perturbation.Figure 8
Applied perturbation to the DIP system.As mentioned in Figures5 and 9, the selected state feedback fuzzy model brings up the system to the equilibrium point in [0, 10] s, without applying a perturbation, while in Figure 7, the controller with applying perturbation brings up the system to the equilibrium point in [0, 20] s.Figure 9
DIP system control effort with perturbation.Eventually, the state feedback fuzzy model selected without perturbation not only ensured the fast response but also provided good precision of controlling the DIP system.


## 7. Conclusion

In the present paper, we introduced a nonlinear dynamic model of a double inverted pendulum. The modeling of the DIP system was based on two representations: a mathematical representation by applying the Lagrangian approach and, at the same time, a graphic illustration using the virtual reality for drawing the system in MATLAB/Simulink in order to check the motion of the double inverted pendulum. A nonlinear model was developed, and a state feedback fuzzy model was established, so as to achieve good stability of the system. Finally, results showed the validity of this approach. In future works, we aim to add two pendulums to the inverted pendulum in a way to increase the number of pendulums until arriving to controln pendulums in different equilibrium positions.


## 8. Limitations

The major limitation of this system is the nonlinearity resulting from the integration of more than one arm in the system and to be controlled by the state feedback fuzzy approach.



---

*Source: 8835511-2020-12-07.xml*