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

)is 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 controller H∞, 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.


Introduction
A double pendulum is made up of two individual pendulums which mimic a nonlinear and unstable dynamic system [1][2][3][4][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][7][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][10][11][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. e 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. e 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. e 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][25][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. e 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. e 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. e 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. e 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.

Modeling of the System
e 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. Figure 1 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. Table 1 shows the technical parameters for using this system.

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. e kinetic energy of the system is (1) e potential energy of the system is Lagrangian is given by (3) In accordance with the Lagrangian formulation, the entire dynamic model of the DIP system is provided by with 2 Advances in Fuzzy Systems Note. We will consider m 1 � (3/4) · m 2 and L 1 � (3/4) · L 2 .
According to the dynamic model presented in (5) and (7), the nonlinear state-space representation can take the following form: e double inverted pendulum model can be depicted by its nonlinear state-space form as So, the nonlinear representation of the DIP can be given as Mass of the first pendulum m 2 Mass of the second pendulum L 1 Length of the first pendulum L 2 Length of the second pendulum g � 9.81 N/kg Coefficient of the gravity Rotation angle of the first inverted pendulum β Rotation angle of the second inverted pendulum F Applied torque on the second pendulum (the upper part)

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 Figure 2, 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.
By way of explanation, a continuous scalar function V(x) is 0 at the origin and positive at a certain point surrounding the origin, i.e., 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 Accordingly,

Virtual Reality via MATLAB Software
e 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.

DIP State Feedback Fuzzy Problem
Formulation. e fuzzy controller system operates according to the so called fuzzy rules, namely, the if-then statements, fuzzy sets, logic, and inference. ese rules are extremely useful for depicting sophisticated controls and models and for connecting input and output variables of fuzzy controllers. e most wellknown 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. us, 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: where where the parameters q i 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. min 2 , min 4 , max 2 , max 4 are, respectively, the minimum and the maximum of q 2 and q 4 , so min 2 < q 2 < max 2 , e membership functions M k, min and M k, max assigned each variable are given as follows: e weighting functions of the state feedback fuzzy model are So, the global state feedback fuzzy model is where the subsystems are established as Potential energy, U Unstable equilibrium d 2 U/dt 2

Advances in Fuzzy Systems
So, Lemma 1 (see [26]). e following statements concerning the continuous-time unforced nominal system are equivalent: (1) ere exists a matrix P � P T > 0 such that (2) _ x � A ij x(t) is a stable system, and the disturbed system _ x � A ij x(t) + E i ω(t) satisfies the H ∞ performance.

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 m 1 � 0.5 kg, m 2 � 0.75 kg, L 1 � 0.5 m, and L 2 � 0.75 kg and presuming that the pair (A i , B i ) is controllable and observable, it will be feasible to develop the stable state feedback fuzzy controller design.
e T-S controller design is based on establishing the feedback gain K i for the linear pair (A i , B i ) that satisfies the following theorem of stability. Theorem 1. Consider closed-loop fuzzy system (17) and a scalar c > 0; the system is asymptotically stable with the H ∞ performance c if there exist symmetric matrix Q and matrices Y i such that the following LMIs hold: where and the gain matrices are given by K i � YQ − 1 .
Obviously, the LMI conditions (24) and (25) can be rewritten as follows: which is verified if Before and after multiplying both sides of (28) by diag Q − 1 , I, I and applying the change of variables Q − 1 � P and Y j � K j Q, we obtain inequality (19). is 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 gain K i of the linear submodels as follows: 6 Advances in Fuzzy Systems MATLAB/Simulink was implemented to simulate the performance of the state feedback fuzzy controller. Figure 4 shows the block diagram of the DIP system.

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.   e injected perturbation w(t) � 2 · sin(2 · π · t) and the used state feedback fuzzy control effort are shown in Figures 7 and 8.
As mentioned in Figures 5 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.
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.

Conclusion
In the present paper, we introduced a nonlinear dynamic model of a double inverted pendulum. e 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 control n pendulums in different equilibrium positions.

Limitations
e 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.
Data Availability e material and data involved in this study can be shared. Individual requests for further information on the study can be sent to the corresponding author.

Disclosure
is study was carried out in Sidi Mohammed Ben Abdellah University, National School of Applied Sciences, Laboratory of Engineering Systems and Applications, Fez, Morocco.

Conflicts of Interest
e authors declare that they have no conflicts of interest.   Advances in Fuzzy Systems