DiscreteDynamics-BasedParameterAnalysis andOptimizationof Fuzzy Controller for Inverted Pendulum Systems Based on Chaos Algorithm

In order to reduce the difficulty in the selection of the quantization factor and the proportion factor in the general fuzzy controller, a controller with the novel algorithm based on the Logistic chaotic variable is proposed in this paper. By introducing the chaotic variable factor into the global search, the suboptimal solution can be obtained and the optimization interval reduced. *e global optimal solution is obtained in the vicinity of the suboptimal solution under an integrated performance index. Finally, the control scheme is applied to the control of a double inverted pendulum model. *e simulated results show the effectiveness of the proposed method.


Introduction
e inverted pendulum is a class of systems, which are a common platform and can be used to test the correctness and feasibility of control methods. Control objects in many actual fields, such as aircrafts and intelligent balancing vehicles, are related to the balance control problem of the inverted pendulum. erefore, research studies on the controller design of the inverted pendulum have particularly important engineering significance [1][2][3].
It is noted that, in the previous research of control techniques, the precise mathematical model of nonlinear systems should be provided, which is hard to realize in practice [4][5][6]. However, as an important branch of intelligent control strategies, the fuzzy control can perform well in the nonlinear systems as well as the unstable control objects with the guidance of fuzzy rules and fuzzy membership functions [7][8][9][10], and this motivates our study in fuzzy control. Dynamic performances of the fuzzy controller, including the fuzzy rule, membership function, and proportion factor, are important indexes to evaluate the quality of the fuzzy controller [11]. However, the effective design and adjustment methods for the parameters of the fuzzy controller (quantification factor, ratio factor, etc.) are limited. In practice, the tuning work relies on the experience and repeated debugging of operators. It takes a lot of energy and time, and obtaining their optimal values is still a difficult issue. In [12], the genetic algorithm was used to optimize the parameters of the fuzzy controller, but it can only optimize the shape and position of the membership function. However, fuzzy sets that directly affect the completeness of the fuzzy rules cannot be chosen. As the number of variable increases, the system will be paralyzed. With the numerical analysis, we propose a method to optimize the scaling factor, but the optimization of the quantification factor and proportion factor cannot be achieved simultaneously. In [13], a random optimization method based on the simulated annealing algorithm was proposed, which can avoid the local minimum problem. e rate of the convergence is still too slow. Based on the nonlinear dynamic characteristics of chaos, such as ergodicity, randomness, and regularity, the developed chaos optimization algorithm has been widely concerned by many scholars [14,15].
In this paper, the issues of discrete dynamics-based parameter analysis and optimization of the fuzzy controller for inverted pendulum systems based on a chaos algorithm are investigated.
e main contributions can be concluded as follows. (1) Taking the fuzzy control scheme into the implementation of the control for the two-stage inverted pendulum system. Moreover, different chaotic sequences generated by logistic mapping are introduced into the parameter domain of the fuzzy controller in this work. (2) rough using chaotic variables to construct the global rough search method, the optimal solution is obtained. Based on this, the local fine search is proposed in the minimal range near the suboptimal solution to optimize the parameters of the fuzzy controller automatically via optimizing the global search technique by reducing the search space and coefficient.
(3) A robust control scheme is used to control an inverted pendulum experiment system model under stochastic disturbance, which shows that the controller with optimized parameters can make the double pendulum rod staying in the straight position and has a fast dynamic response.

Model Description.
To simplify the modeling, it is necessary to ignore the air and the external friction of the inverted pendulum system. e system can be abstracted into a model consisting of a small cart and two uniform pendulum rods. e double inverted pendulum is a typical rigid body motion system to facilitate the modeling of the system. e structure of the double inverted pendulum system is shown in Figure 1 [16]. Moreover, its specific parameters are shown in Table 1.
Select x, θ 1 , θ 2 , _ x, _ θ 1 , and _ θ 2 as the system state variables. Based on the Lagrange equation in analytical mechanics, the mathematical model of the double inverted pendulum system is derived, and the linear treatment is finished near the unstable equilibrium point [18], which is replaced by the known parameters in Table 1. e equation of the state for a linear double inverted pendulum system can be obtained as follows: (2)

Fuzzy Control Design.
In view of the linear model of (1), the Lyapunov theory is applied to analyze its stability [19]. e characteristic root of the system is solved according to matrix A as 10.0438 5.0262 −10.0438 −5.0262 0 0 .
It is obvious that the system has two poles located on the right half plane of S. Based on the stability criterion, the double inverted pendulum system is a naturally unstable system.
According to the controllability criterion [20,21], Norder linear continuous system is _ X � Ax + Bu. e condition that the state is fully controllable is if and only if the energy criterion of the system is full rank(S) � B AB A 2 B · · · A n− 1 B , that is, rank(S) � n. After calculating, one has It can be seen that the system is controllable near the equilibrium point, which means it is possible to design a controller maintaining the stability of the system.

e Input and Output Variables of a Fuzzy Controller.
For a typical double inverted pendulum system with multiple inputs, if the six state variables are used as input variables of the fuzzy controller, the fuzzy rule explosion will inevitably lead to the difficulty in the optimization of fuzzy parameters [22][23][24]. e output information of the linear system can be fused directly, and six state variables are weighted into two input variables; thus, the problem of fuzzy rule explosion is solved to simplify the design of the fuzzy controller.
(1) Design State Feedback Matrix. According to the strategy based on the linear quadratic optimal theory, a state feedback matrix K is designed for system (1): Using state feedback matrix K to construct fusion function f 1 (·), (2) Dimensionality Reduction. Two input variables are obtained by dimensionality reduction: the synthesis error E is synthesized by weighting the position state variables and the comprehensive error rate EC is synthesized by weighting the speed state variables: E In view of the abovementioned statement, a two-dimensional Mamdani-type fuzzy controller with two inputs and one output is designed, and the system structure diagram is shown in Figure 2.
In Figure 2, K e and K ec are the quantitative factors of the system error and the rate of error change, respectively. e input variables are converted from the basic domain to the corresponding fuzzy set theory domain, and K u is the output proportional factor, which converts the fuzzy set domain of the input variable into the exact value.

Membership Function.
In fuzzy systems and control, the membership functions are commonly selected as triangle membership function, trapezoid membership function, and Gauss type membership function. In this paper, the input and output variables of the fuzzy controller are designed by the triangular membership function, and the center of gravity method is used for defuzzification.

Chaos Optimization.
e fuzzy controller parameters (quantification factors K e and K ec and proportion factor K − u) play an important role in the fuzzy control of the double inverted pendulum system [25]. Selection is usually achieved by means of experience and trials, which contains subjectivity and seriously affects the effectiveness of the control. erefore, we combine the fuzzy control with the chaos optimization algorithm, which makes full use of the chaos algorithm to optimize the quantitative factor and proportion factor of the fuzzy controller.
e optimized parameters will improve the effectiveness of the fuzzy control.

Selection of Performance Index.
For the double inverted pendulum system with nonlinearity and multiple inputs, it is necessary to select a performance index to measure the control effect. e index can reflect not only the dynamic characteristics of the control system but also its steady-state characteristics. erefore, select the performance index function (8); r, θ 1 , and θ 2 are unified by expression, and its performance index functions with different parameters are Table 1: Introduction of symbols used in the double inverted pendulum system [17].

Parameters
Values Significance where δ represents the percentage of overshoot, w i,1 and w i,2 are selected as the user according to the actual situation, and l represents the number of cycles to be set. In the control of the double inverted pendulum system, the key is that the two pendulums cannot be reversed, and the cart can move back and forth within a certain range. A comprehensive performance index is introduced in the paper as follows: where the performance of the cart and the double inverted pendulum bars are expressed by J i (i � 1, 2, 3); the weight coefficients are expressed as a, b, and c, and the selection is made according to the actual situations. e priority of the control for the cart and two inverted pendulum bars is considered comprehensively, the requirements for the dynamic characteristics and stability performance of the system are satisfied. Combined with the algorithm of prechaotic optimization, the parameters of the fuzzy controller K e , K ec , and K u are adjusted and the minimum performance index J is finally obtained.

e Steps of Chaos Optimization.
In the paper, the logistic mapping is selected as follows: x n+1 � μx n 1 − x n , n � 0, 1, . . . , N, where μ is the control variable which satisfies μ � 4, and when 0 < x n < 1, formula (11) is completed in chaos. Since the chaotic state is very sensitive to the initial value, we choose different initial values of small differences to get chaotic variables of different trajectories. e N-order fixed formula (10) can not be selected here; otherwise, chaos cannot be generated. Considering the parameter domain of the fuzzy control, the following set of iterative equations can be considered: e k * p in formulas (12)- (14) can be properly amplified and converted. In the interval (0-1), three different initial values are taken into the Logistic mapping; then, three different chaotic variable trajectories can be generated. ey are also used in the parameters of the fuzzy controller to calculate the target function J according to formula (9), and then the optimal value is selected.
Fuzzy controller The double inverted pendulum Chaos optimization  Step 1 (initialization): in the random interval (0-1), three initial values of different small differences are selected and replaced into the Logistic mapping, and different chaotic locus variables can be obtained as the search space of the fuzzy controller parameters k * e , k * ec , and k * u . en, formula (8) is used to calculate the system performance index of the trolley and the two swing lever J i (i � 1, 2, 3).
Step 2: in formula (9), select appropriate values for parameters a, b, and c. Using formula (10) to calculate the comprehensive performance index J, the minimum of the target function in the N comprehensive performance index J is found as J min . e corresponding fuzzy control parameter value is the approximate optimal solutions k * e , k * ec , and k * u of the chaotic rough search method.
Step 4: in order to make the system find the global optimal value quickly, the chaotic local fine search is introduced to reduce the range of the variables so as to improve the precision of the control system. e approximate optimal solutions k * e , k * ec , and k * u obtained in Step 2 are substituted in the following expressions (15)-(17), respectively: k * e,n � k * e × z(t)x n , (n � 0, 1, . . . , N), k * ec,n � k * ec × z(t)x n , (n � 0, 1, . . . , N), N). (17) ree new chaotic trajectory variables k * e,n , k * ec,n , and k * u,n are generated, which are used for local fine search of chaos. According to formula (9), the corresponding system performance index J i (i � 1, 2, 3) is calculated.
Step 5: calculate the comprehensive performance J based on formula (9).
Step 6: chaotic search is carried out in the left and right neighborhood of the approximate optimal solution obtained from the chaotic rough search. e timevarying factor z(t) is calculated according to the formula as follows: where λ is the attenuation factor of z(t).
Step 7: t � t + 1. Again, the chaotic search space is reduced as in Step 4.
Step 8: compare the value of comprehensive performance index function in the search process, and find J min . Terminate the search. e global optimal solutions k * e,n , k * ec,n , and k * u,n are the fuzzy controller parameters corresponding to J min .
In the Matlab software, the module of the double inverted pendulum control system is built, and the sampling time is selected as 5 ms. e parameters of the fuzzy controller after the chaos optimization are applied to the simulation control of the system. e simulation result of the experiment is shown in Figure 3. Figure 3 shows the curves of θ 2 with the initial states x(0) � 0, θ 1 (0) � θ 2 (0) � 0.1 rad. From the curves, we can see that the system responds quickly and returns to the equilibrium position within 3-4 seconds. e simulation result also shows the effectiveness of the designed fuzzy controller.

Robust Control of the Double Inverted Pendulum
To further verify the robustness, for the inverted pendulum system in the basic Simulink simulation block diagram, as shown in Figure 4, the −80 dBW white Gaussian noise is applied, and the required signal is generated by wgn function in the simulation. For the considered two-stage inverted cycloidal model system with parameters shown in Table 1 [17], the initial value is given as [0, 0, 0, 0.02, 0, 0]. By employing the Matlab software, the corresponding simulation results are shown in  e sampling period is taken as 0.001 s. In formula (18), the initial value of chaos rough search is z 0 � 0.002. Termination conditions are z n ≤ 10 −3 and β � 0.001. In formula (9), a � 0.2, b � 0.3, and c � 0.5. It has gone through 692 steps of chaotic fine search, and the global optimal solution of fuzzy controller parameters is in the 357th step. Fuzzy controller parameters are K c � 9.00005, K ec � 9.00131, and K u � 18.00026. Figures 5-7 are the robust control curves of the car displacement, and the angle of the pendulum rod 1 and the angle of the pendulum rod 2 of the two inverted pendulums, respectively. e model is shown as Figure 1. e results show that the controller designed by the chaotic optimization method in this paper can effectively control the twostage inverted pendulum. e displacement of the car and Remark 1. It is worth noticing that the networked control system has been a high-profile topic during the past few decades. Correspondingly, the control issues of the networked control system subject to various network-induced phenomena, such as communication delays, packet dropouts, and fading channels, have obtained great research interest of scholars and abundant literature studies have been reported on these topics. Aiming at the network control system, the observer-based dissipative control and passivitybased H ∞ control have been proposed in [26,27], respectively. Nonetheless, the proposed parameter analysis and optimization of the fuzzy control method in this paper can also be employed in the networked control system to further optimize the conservativeness with respect to the aforementioned mechanisms, which is one of the directions of our future work.

Conclusion
In the paper, the optimal control theory has been used to design the fusion function to reduce the dimension of the input variables of the fuzzy controller for a double inverted pendulum system. en, the chaotic sequence variables have been introduced into the fuzzy control system. e chaotic global rough search and the chaotic fine search technique have been used to optimize the parameters of the fuzzy controller. After optimization, the time of adjusting the parameters has been reduced, and the performance of the double inverted pendulum system has been improved.   Finally, the proposed method has been tested through an example. e effectiveness and capability of our approach have been proved by the simulation results. To further improve the practical application of the proposed parameter analysis and optimization of the fuzzy control technique, our future works will concentrate on other actual systems, such as stochastic switching systems, and this will be an interesting and challenging area.

Data Availability
All datasets used in this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.