Scientific Research

An Academic Publisher

**Simulation of a Triple Inverted Pendulum Based on Fuzzy Control** ()

Keywords

Share and Cite:

*World Journal of Engineering and Technology*,

**4**, 267-272. doi: 10.4236/wjet.2016.42026.

Received 18 January 2016; accepted 20 May 2016; published 23 May 2016

1. Introduction

The inverted pendulum system is a typical nonlinear, strong coupling, multivariable, naturally unstable system [1] . In the control process, the inverted pendulum can effectively be used for studies key issues such as the quality of stability, robustness, mobility, tracking and that is why, it is the ideal model for testing various theories in control engineering [2] [3] . So far, it has been used in classical control, modern control and intelligent control for stability analysis with techniques such as LQR control [4] [5] fuzzy control method [6] , fuzzy neural network method [7] etc. When fuzzy control is used, the total number of fuzzy rules growth exponentially without the use of real-time processing [8] . Through the fusion of multiple variables, the input variables of the fuzzy controller are reduced, diminishing the difficulty of the design and improving the real-time performance of the system.

In this paper, the design of a fuzzy controller based on the fusion structure for the triple inverted pendulum system is analyzed; the fusion weights of the multi-variables are based on the linear model. The control method has the advantages of simple structure, stable control and better convergence.

2. Triple Inverted Pendulum System Model

2.1. Physical Model

As shown in Figure 1, the triple inverted pendulum system is mainly controlled by the object, rails, motors, pulleys, belts and electrical measuring device component. The control object is composed of a trolley, a pendulum with two additional links that are connected by a bearing, and can freely rotate in x-y direction.

2.2. Mathematical Model

In order to facilitate the study for the triple inverted pendulum system shown in Figure 1, assumptions of the following conditions are true [9] :

1) Friction torque and the relative speed of each part (angular velocity) are proportional;

2) There is no slip between the belt pulley and the drive belt;

3) Link 1, Link 2, or Link 3 can be regarded as a rigid body;

The nonlinear dynamic model of the three stage inverted pendulum system is:

(1)

The meaning of each parameter can refer to the literature [4] .

The system status is, because the sensor can only measure the relative rotation angle of two connected swing rods, so the measurement is.

3. Fuzzy Controller

3.1. Fuzzy Controller Structure Design

The fusion method is used to design a fuzzy controller for the triple inverted pendulum system. The eight input variables are divided into two groups: the direct quantity and the differential value and those 2 groups are a fused into two variables (see Figure 2).

3.2. Parameter Setting of Fuzzy Controller

Fuzzy controller for the above structure set the parameters as follows:

1) Determine the input and output domain

For the E and EC domain can be selected as [−1, 1], the domain of Y is also selected as [−1, 1].

2) Determine the value of a variable membership function language

For E, EC and Y, are selected 7 language values, respectively, as NB, NM, NS, ZE, PS, PM, PB. And the “trimf” membership function is adopted [10] , in which the value of the core and the boundary value is the uniform distribution of Matlab by default.

3) Determine fuzzy rules

In accordance with the principles of linear fusion of fuzzy rules designed as shown in Table 1.

4) To determine the gain parameters (fusion factor, quantization factor and scale factor) the optimal state feedback matrix can be designed according to the linear model of the system.

K = [k1, K2, K3, K4, K5, K6, K7, k8], K00 = 5 can be set, the corresponding gain parameters can be obtained as follows:

K1 = k1/K00, K2 = k2/K00, K3 = k3/K00, K4 = k4/K00,

K5 = k5/K00, K6 = k6/K00, K7 = k7/K00, K8 = k8/K00, K0 = −2K00.

Using the best two performance indicators, taking Q = diag (10100100010000, 0, 0, 0, 0) and R = 1, using the LQR Matlab () function, the optimal linear control feedback coefficient matrix is

Figure 1. Triple inverted pendulum physical system architecture diagram.

Figure 2. Triple inverted pendulum fuzzy controller structure diagram system.

Table 1. Fuzzy rules of the fuzzy controller of the triple inverted pendulum.

K = [−3.1623, −57.2348300.8179, −383.7509, −11.5829, −3.8366, 5.3233, −51.9479].

The fusion factor of the fuzzy controller can be determined:

K1 = −0.6325, K2 = −11.4470, K3 = 60.1636, K4 = −76.7502, K5 = −2.3166, K6 = −0.7673, K7 = 1.0647, K8 = −10.3896, at the same time, it can be determined that the quantization factor is: KE = 1, KEC = 1; Scale factor KU = −10.

5) Fuzzy reasoning method using Mamdani fuzzy inference methods.

6) Determine the solution fuzzy method using the gravity method (COG) to solve the fuzzy.

4. Simulation and Analysis

Based on the Matlab environment, the triple inverted pendulum fuzzy control system simulation, the initialization code is shown below:

Setting the initial state of the system X = [0.05, 0.08, 0.001, 0.008, 0, 0, 0, 0], the simulation run triple inverted pendulum fuzzy control system model and the results show the linear velocity and angular velocity of the three angles goes to zero.

As shown in Figure 3, the position curve can be seen that the triple inverted pendulum system is under the control of the fuzzy controller.

And that the displacement is 0, the angles of the 3 links go to zero, the swing rod is stable and upright, and the control effect is good.

The effect of quantization factor and scale factor on the control effect of fuzzy controller is further analyzed. Because the fuzzy controller is obtained by the linear state feedback controller, in order to maintain the approximate linear relationship between the control variables and the state variables, the value of the quantization factor and scale factor can be changed under the following conditions:

1) KE = KEC;

2) KEKU = 2K00 = −10;

So as long as the determination of KE, KEC, KU one of the other, the other two also identified. When KE = 1, the input of the fuzzy controller is E and EC, the peak value of E can be found to be −0.1 and 0.6, while the peak value of EC is −0.02 and 0.18. So we can increase the value of the quantization factor, and make the input variable cover the scope of the controller.

The results show that the control system is still in steady state when the KE = 1.5 is in. And when KE = 4, the output of the control system is divergent, and the system is not stable, as shown in Figure 4.

Therefore, when the range of KE is 1 - 1.5, the control effect can be obtained.

Figure 3. Inverted pendulum fuzzy control simulation results.

Figure 4. Fuzzy Control Simulation position curve (KE = 4).

5. Conclusion

In this paper, the used of fuzzy has facilitate the control of the triple inverted pendulum. Through the linear model of the system, the LQR optimal control feedback weight matrix was designed, and the fuzzy control parameters were designed based on the feedback parameters of the optimal linear control. The simulation results show that the method can realize the triple inverted pendulum system stability control and that fuzzy controller design method can also be applied to other multi variable and nonlinear system control problems.

Conflicts of Interest

The authors declare no conflicts of interest.

[1] |
Liu, Y.M., Chen, Z., Xue, D.Y. and Xu, X.H. (2009) Real-Time Controlling of Inverted Pendulum by Fuzzy Logic. 2009 IEEE International Conference on Automation and Logistics, 1180-1183.
http://dx.doi.org/10.1109/ical.2009.5262618 |

[2] | Gupta, M.K., Bansal, K. and Singh, A.K. (2014) Stabilization of Triple Link Inverted Pendulum System Based on LQR Control Technique. Recent Advances and Innovations in Engineering (ICRAIE), IEEE. |

[3] |
Muskinja, N. and Tovornik, B. (2006) Swinging up and Stabilization of a Real Inverted Pendulum. IEEE Transactions on Industrial Electronics, 53. http://dx.doi.org/10.1109/TIE.2006.870667 |

[4] | Li, Y.C., Zhu, X. and Zheng, X.K. (2006) LQ R Algorithm Control Simulation of the Inverted Pendulum System. North China University of Technology. |

[5] |
El-Nagar, A.M., El-Bardini, M. and EL-Rabaie, N.M. (2014) Intelligent Control for Nonlinear Inverted Pendulum Based on Interval Type-2 Fuzzy PD Controller. Alexandria Engineering Journal, 53, 23-32.
http://dx.doi.org/10.1016/j.aej.2013.11.006 |

[6] | Yeh, Z. and Li, K. (2003) A Systematic Approach for Designing Multistage Fuzzy Control Systems Fuzzy Sets and Systems. |

[7] | Wang, L.X. (1997) A Course in Fuzzy Systems and Control. Prentice-Hall, Englewood Cliffs. |

[8] |
Yasunobu, S. and Mori, M. (1997) Swing up Fuzzy Controller for Inverted Pendulum Based on a Human Control Strategy. Proceedings of the Sixth IEEE International Conference of the Fuzzy Systems, 3, 1621-1625.
http://dx.doi.org/10.1109/fuzzy.1997.619783 |

[9] |
Krishen, J. and Becerra, V.M. (2006) Efficient Fuzzy Control of a Rotary Inverted Pendulum Based on LQR Mapping. IEEE International Symposium on Intelligent Control, 2701-2706. http://dx.doi.org/10.1109/ISIC.2006.285548 |

[10] |
Gu, D.-W., Petkov, P.H. and Konstantinov, M.M. (2013) A Triple Inverted Pendulum Control System Design. Robust Control Design with MATLAB®, Springer, London, 291-325. http://dx.doi.org/10.1007/978-1-4471-4682-7_15 |

Copyright © 2020 by authors and Scientific Research Publishing Inc.

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.