Unstable System Control Using an Improved Particle Swarm Optimization-Based Neural Network Controller

: In this study, an improved particle swarm optimization (IPSO)-based neural network controller (NNC) is proposed for solving a real unstable control problem. The proposed IPSO automatically determines an NNC structure by a hierarchical approach and optimizes the parameters of the NNC by chaos particle swarm optimization. The proposed NNC based on an IPSO learning algorithm is used for controlling a practical planetary train-type inverted pendulum system. Experimental results show that the robustness and e ﬀ ectiveness of the proposed NNC based on IPSO are superior to those of other methods.


Introduction
The multilayer neural network is one of the most popular methods for solving real-time signal processing, system control, and signal prediction [1][2][3] problems. In general, determining the number of hidden levels and neurons for solving a problem is difficult. However, within the provided training period, a fixed structure in an artificial neural network may not provide satisfactory performance. A large neural network has some redundant and complex connections, whereas a small neural network cannot provide the optimal performance because of its limited information processing abilities. Therefore, a learning method that simultaneously tunes the network structure and parameters of a neural network was proposed.
The parameter training of a neural network design is the primary concern in various applications. A backpropagation (BP) learning method is commonly adopted and is a powerful training technique for feedforward neural networks. Since the gradient descent algorithm is used to minimize the error function in the BP training process, this algorithm can quickly trap into the local minimum, and finding a global solution is difficult. Although neural networks have a beneficial topology, the aforementioned drawbacks result in suboptimal performance. Therefore, several algorithms were used to adjust parameters in neural networks and to find the appropriate network structure. Recently, several researchers [4][5][6][7][8][9] have used various evolutionary algorithms to determine the parameters of neural networks. In [4][5][6][7], several researchers have adopted genetic algorithms (GAs), artificial bee colony (ABC), and gray wolf optimization (GWO) to adjust parameters of neural networks. However, search in GAs is extremely tedious, which is the primary disadvantage of GAs. Similar to GAs, particle swarm optimization (PSO) [8,9] is a robust numerical optimization algorithm. PSO has been successfully used for solving several optimization problems. PSO is a simple, rapid-convergence, and easy-implementation algorithm. 1.
The proposed improved particle swarm optimization can automatically determine the neural network structure and adjust the parameters of a neural network controller.

2.
A hierarchical chromosome architecture is proposed. This architecture has a multi-level control gene, which consists of the control genes and the parameter genes. 3.
The chaotic local search method is proposed to improve the searching space and avoid trapping into the local minimum.
The remainder of the paper is organized as follows: Section 2 introduces the dynamics analysis of the planetary wheel inverted pendulum. The structure of the hierarchical neural network is presented in Section 3. Section 4 illustrates the optimization method of PSO and the local search method of the chaotic method. The experimental results of a planetary train-type inverted pendulum control are shown in Section 5. Section 6 presents the conclusions.

Dynamic System Analysis of Planetary Train-Type Inverted Pendulum
The mathematical model of the derived planetary train inverted pendulum system [16] is based on initial conditions and input signals to predict the dynamic behavior of the system. The dynamic behavior of an unstable system was used to determine the size of an actuator to select amplifier power, design mechanisms, and tune the controller based on the computer simulation. To explain the dynamic and kinematic relations, Figure 1 shows a pendulum, sun gear, and planetary gear. The kinematic relationship between the planetary gears, the sun gear, and the pendulum lies in the mutual movement between the two. First, when the pendulum is stationary ( , the ratio between the planetary gear motion and sun gear motion is shown as follows: where 1 θ is the sun gear angle, 2 θ is the planetary gear angle, N1 and N2 present the number of sun gear and planetary gear, respectively, and r1 and r2 are the radii of the sun gear and planetary gear, respectively. Thus, the angular velocity of the planetary gear is derived as follows: Assume that the center gear is stationary ( ) and the pendulum and planet gear are allowed to rotate. The planetary gear center velocity is derived as follows: The angular velocity of planetary gear ( 1 θ ′ ′  ) is as follows: Equations (3) and (4) are combined and derived as follows: Lagrangian mechanics were used to obtain relations among input motor torque 2 τ , center gear 2 θ , and output of the pendulum 0 θ . This method can be used to analyze mechanisms in system methods. The potential energy and kinetic of each movable part are derived as follows: The kinematic relationship between the planetary gears, the sun gear, and the pendulum lies in the mutual movement between the two. First, when the pendulum is stationary ( . θ 0 = 0), the ratio between the planetary gear motion and sun gear motion is shown as follows: where θ 1 is the sun gear angle, θ 2 is the planetary gear angle, N 1 and N 2 present the number of sun gear and planetary gear, respectively, and r 1 and r 2 are the radii of the sun gear and planetary gear, respectively. Thus, the angular velocity of the planetary gear is derived as follows: .
Assume that the center gear is stationary ( . θ 2 = 0) and the pendulum and planet gear are allowed to rotate. The planetary gear center velocity is derived as follows: The angular velocity of planetary gear ( . θ 1 ) is as follows: .
Equations (3) and (4) are combined and derived as follows: where θ 0 and θ 2 are two independent variables, which are generalized coordinates. Moreover, two dynamic equations are derived using the Lagrange equation as follows: .. θ 2 + e r 1 +r 2 Equation (8) shows that the pendulum is not applied with external torque, therefore zero is assigned to the variable τ 0 .

Structure of a Hierarchical Neural Network
In this section, the structure of a hierarchical neural network is introduced. Figure 2 shows the structure of a multi-level control gene in a layered approach. The value of the first-level control gene controls the activation of the parameter gene. To illustrate the status of the control genes, each open control gene was assigned a value of 1 and each of the closed genes was designated as 0. Although the inactive genes were turned off for a period of time, they still exist in the chromosome. This is called hierarchical chromosome architecture. the inactive genes were turned off for a period of time, they still exist in the chromosome. This is called hierarchical chromosome architecture. Figure 2 shows that a chromosome comprises six control genes in the form of bits and six parametric genes in the form of integers, where X represents a chromosome with a length of 2 and a solution of 5 and 8. In addition, multi-layered chromosomes are formulated by increasing the level of stratification in the chromosome. Figure 3 illustrates an example of a three-level chromosome.  A hierarchical chromosome representation is shown in Figure 4. Each chromosome contains a control gene and a connection gene. A control gene in the form of bits activates layers and neurons. A connection gene, which is a real value representation, has connection weights and neuron biases. Figure 5 presents the structure of a hierarchical neural network, where w1, w2, and w3 represent the weights of neural networks.   Figure 2 shows that a chromosome comprises six control genes in the form of bits and six parametric genes in the form of integers, where X represents a chromosome with a length of 2 and a solution of 5 and 8. In addition, multi-layered chromosomes are formulated by increasing the level of stratification in the chromosome. Figure 3 illustrates an example of a three-level chromosome.

Structure of a Hierarchical Neural Network
In this section, the structure of a hierarchical neural network is introduced. Figure 2 shows the structure of a multi-level control gene in a layered approach. The value of the first-level control gene controls the activation of the parameter gene. To illustrate the status of the control genes, each open control gene was assigned a value of 1 and each of the closed genes was designated as 0. Although the inactive genes were turned off for a period of time, they still exist in the chromosome. This is called hierarchical chromosome architecture. Figure 2 shows that a chromosome comprises six control genes in the form of bits and six parametric genes in the form of integers, where X represents a chromosome with a length of 2 and a solution of 5 and 8. In addition, multi-layered chromosomes are formulated by increasing the level of stratification in the chromosome. Figure 3 illustrates an example of a three-level chromosome.  A hierarchical chromosome representation is shown in Figure 4. Each chromosome contains a control gene and a connection gene. A control gene in the form of bits activates layers and neurons. A connection gene, which is a real value representation, has connection weights and neuron biases. Figure 5 presents the structure of a hierarchical neural network, where w1, w2, and w3 represent the weights of neural networks.  A hierarchical chromosome representation is shown in Figure 4. Each chromosome contains a control gene and a connection gene. A control gene in the form of bits activates layers and neurons. A connection gene, which is a real value representation, has connection weights and neuron biases. Figure 5 presents the structure of a hierarchical neural network, where w 1 , w 2 , and w 3 represent the weights of neural networks.

Structure of a Hierarchical Neural Network
In this section, the structure of a hierarchical neural network is introduced. Figure 2 shows the structure of a multi-level control gene in a layered approach. The value of the first-level control gene controls the activation of the parameter gene. To illustrate the status of the control genes, each open control gene was assigned a value of 1 and each of the closed genes was designated as 0. Although the inactive genes were turned off for a period of time, they still exist in the chromosome. This is called hierarchical chromosome architecture. Figure 2 shows that a chromosome comprises six control genes in the form of bits and six parametric genes in the form of integers, where X represents a chromosome with a length of 2 and a solution of 5 and 8. In addition, multi-layered chromosomes are formulated by increasing the level of stratification in the chromosome. Figure 3 illustrates an example of a three-level chromosome.  A hierarchical chromosome representation is shown in Figure 4. Each chromosome contains a control gene and a connection gene. A control gene in the form of bits activates layers and neurons. A connection gene, which is a real value representation, has connection weights and neuron biases. Figure 5 presents the structure of a hierarchical neural network, where w1, w2, and w3 represent the weights of neural networks.  This particular treatment ensures that the structural chromosome contains both active and inactive genes. Inactive genes remain in the chromosomal structure and can continue to exist in the next generation. In the chromosome, the natural genetic variation avoids falling into local optimization and leads to early convergence. Therefore, it balances the use of its accumulated knowledge with the exploration of new search spaces. In addition, this structure allows for greater genetic variation in the chromosome and allows multiple simultaneous genetic changes to maintain high viability. This particular treatment ensures that the structural chromosome contains both active and inactive genes. Inactive genes remain in the chromosomal structure and can continue to exist in the next generation. In the chromosome, the natural genetic variation avoids falling into local optimization and leads to early convergence. Therefore, it balances the use of its accumulated knowledge with the exploration of new search spaces. In addition, this structure allows for greater genetic variation in the chromosome and allows multiple simultaneous genetic changes to maintain high viability.

Proposed Improved Particle Swarm Optimization
This section introduces the review of particle swarm optimization, local search of chaos, and the IPSO algorithm.

Review of Particle Swarm Optimization (PSO)
In PSO [17,18], the trajectory of each particle is based on its flight experience and search space to update the speed of each particle. The position and speed vector of the ith particle are represented as ) ,......, , , ,......, , , respectively. The optimal position of each particle is defined as ) ,......, , , , and the optimal position of all particles is defined as The new speed and position of the particle used for the next evaluation is derived as follows: where 1 c and 2 c are acceleration coefficients. Moreover, two separately generated random numbers (i.e., ) (⋅ rand ) are between 0 and 1. The first term in Equation (9) illustrates the speed of the previous generation and provides momentum for the particle search space. The second term in Equation (9) is a cognitive component that facilitates the movement of particles toward their own local optimal positions. The third term in Equation (9) illustrates the social components and synergistic effects of the particle's global optimal solution.

Proposed Improved Particle Swarm Optimization
This section introduces the review of particle swarm optimization, local search of chaos, and the IPSO algorithm.

Review of Particle Swarm Optimization (PSO)
In PSO [17,18], the trajectory of each particle is based on its flight experience and search space to update the speed of each particle. The position and speed vector of the ith particle are represented as . . , ν id ), respectively. The optimal position of each particle is defined as P i = (p i1 , p i2 , p i3 , . . . , p id ), and the optimal position of all particles is defined as P g = (p g1 , p g2 , p g3 , . . . , p gd ). The new speed and position of the particle used for the next evaluation is derived as follows: where c 1 and c 2 are acceleration coefficients. Moreover, two separately generated random numbers (i.e., rand(·)) are between 0 and 1. The first term in Equation (9) illustrates the speed of the previous generation and provides momentum for the particle search space. The second term in Equation (9) is a cognitive component that facilitates the movement of particles toward their own local optimal positions. The third term in Equation (9) illustrates the social components and synergistic effects of the particle's global optimal solution.

Local Search Using Chaotic Method
To improve the searching space and avoid falling into the local minimum, the chaotic method is used in PSO. A logistic equation in [19] was used for developing hybrid PSO and is defined as follows: where µ is a control parameter. Although Equation (11) In Equation (12), k is kth iteration and cx i is the ith chaotic variable. cx (k) i is set to between 0 and 1 for cx The CLS process is as follows: Step 1: Decision variables i is set between 0 and 1 and is shown as follows: Step 2: Using Equation (12), determine the chaotic variable cx in the next iteration.
Step 3: The conversion of the chaotic variable cx Step 4: The evaluation of the new solution is found by using decision variable x (k+1) i . If the new solution is superior to the previous solution, then the previous solution is updated as follows: Step 5: Go to i + 1. Figure 6 shows the parameter adjustment of the chromosome. The control genes are adjusted using a GA [20,21], whereas the parameter genes are tuned using PSO. The GA is a stochastic search procedure based on natural selection with the use of reproduce, crossover, and mutation operations.

Proposed Improved Particle Swarm Optimization
where μ is a control parameter. Although Equation (11)  The CLS process is as follows: Step 1: Decision variables ) ,......, , , is set between 0 and 1 and is shown as follows: Step 2: Using Equation (12), determine the chaotic variable Step 3: The conversion of the chaotic variable Step 4: The evaluation of the new solution is found by using decision variable Step 5: Go to i + 1. Figure 6 shows the parameter adjustment of the chromosome. The control genes are adjusted using a GA [20,21], whereas the parameter genes are tuned using PSO. The GA is a stochastic search procedure based on natural selection with the use of reproduce, crossover, and mutation operations. The reproduction operation is used to copy individual strings based on the evaluated fitness values. Each individual is assigned a fitness value using a fitness assignment method where a large The reproduction operation is used to copy individual strings based on the evaluated fitness values. Each individual is assigned a fitness value using a fitness assignment method where a large value indicates satisfactory fitness. In this study, a roulette-wheel selection method [22] was used. The individuals with the optimal performance in the first half of the population [23] are directly reproduced in the next generation. By performing crossover operations for individuals in the first half of the parent generation, the other half of the next generation is generated. For each generation, the reproduction operation keeps the same chromosomes in the first half of the population. Figure 7 shows the two-point crossover operation. The figure shows the generation of new individuals by exchanging site values between sites selected by parents. Figure 7 shows the two-point crossover operation. The figure shows the generation of new individuals by exchanging site values between the selected sites from parents. When the crossover operation is performed, the unsatisfactory individuals are replaced by the newly generated offspring. the reproduction operation keeps the same chromosomes in the first half of the population. Figure 7 shows the two-point crossover operation. The figure shows the generation of new individuals by exchanging site values between sites selected by parents. Figure 7 shows the two-point crossover operation. The figure shows the generation of new individuals by exchanging site values between the selected sites from parents. When the crossover operation is performed, the unsatisfactory individuals are replaced by the newly generated offspring.

Proposed Improved Particle Swarm Optimization
x 11 x 15 x 14 x 13 x 12 x 16 x 20 x 19 x 18 x 17 x 11 x 15 x 14 x 13 x 12 x 16 x 20 x 19 x 18 x 17 x 11 x 13 x 12 x 20 x 19 x 18 x 11 x 13 x 12 x 20 x 19 x 18 x 15 x 14 x 16 x 17 x 15 x 14 x 16 x 17 During mutation, the allele of a gene is randomly altered. Figure 8 shows the mutation of an individual. In contrast to conventional symbiotic evolution [22], a mutation value is created using a constant range. In mutation, new genetic materials are used in the population. Because mutation is a random search operation, it must be used sparingly.
x 11 x 15 x 14 x 13 x 12 x 16 x x 11 x x 14 x 13 x 12 x 16 Figure 8. Mutation operation.
By replicating better control genes in this generation and using them for crossover and mutation operations, the better control genes in the next generation are produced. Therefore, the GA is used to develop a hierarchical neural network. Figure 9 shows the flowchart of the proposed IPSO algorithm. The IPSO algorithm is illustrated as follows: Step 1: Initially, randomly generate P particles forming the swarm.
Step 2: Evaluate the fitness values from each particle.
where RMSE and W_R represents the root mean square error and the weight ratio of connected neurons, respectively; the evaluation ratio α and β are set as 0.7 and 0.3, respectively.
Step 3: Update the local best particle and the global best particle. During mutation, the allele of a gene is randomly altered. Figure 8 shows the mutation of an individual. In contrast to conventional symbiotic evolution [22], a mutation value is created using a constant range. In mutation, new genetic materials are used in the population. Because mutation is a random search operation, it must be used sparingly.
half of the parent generation, the other half of the next generation is generated. For each generation, the reproduction operation keeps the same chromosomes in the first half of the population. Figure 7 shows the two-point crossover operation. The figure shows the generation of new individuals by exchanging site values between sites selected by parents. Figure 7 shows the two-point crossover operation. The figure shows the generation of new individuals by exchanging site values between the selected sites from parents. When the crossover operation is performed, the unsatisfactory individuals are replaced by the newly generated offspring.
x 11 x 15 x 14 x 13 x 12 x 16 x 20 x 19 x 18 x 17 x 11 x 15 x 14 x 13 x 12 x 16 x 20 x 19 x 18 x 17 x 11 x 13 x 12 x 20 x 19 x 18 x 11 x 13 x 12 x 20 x 19 x 18 x 15 x 14 x 16 x 17 x 15 x 14 x 16 x 17 During mutation, the allele of a gene is randomly altered. Figure 8 shows the mutation of an individual. In contrast to conventional symbiotic evolution [22], a mutation value is created using a constant range. In mutation, new genetic materials are used in the population. Because mutation is a random search operation, it must be used sparingly.
x 11 x 15 x 14 x 13 x 12 x 16 x x 11 x x 14 x 13 x 12 x 16 Figure 8. Mutation operation.
By replicating better control genes in this generation and using them for crossover and mutation operations, the better control genes in the next generation are produced. Therefore, the GA is used to develop a hierarchical neural network. Figure 9 shows the flowchart of the proposed IPSO algorithm. The IPSO algorithm is illustrated as follows: Step 1: Initially, randomly generate P particles forming the swarm.
Step 2: Evaluate the fitness values from each particle.
where RMSE and W_R represents the root mean square error and the weight ratio of connected neurons, respectively; the evaluation ratio α and β are set as 0.7 and 0.3, respectively.
Step 3: Update the local best particle and the global best particle. By replicating better control genes in this generation and using them for crossover and mutation operations, the better control genes in the next generation are produced. Therefore, the GA is used to develop a hierarchical neural network. Figure 9 shows the flowchart of the proposed IPSO algorithm. The IPSO algorithm is illustrated as follows: Step 1: Initially, randomly generate P particles forming the swarm.
Step 2: Evaluate the fitness values from each particle.
where RMSE and W_R represents the root mean square error and the weight ratio of connected neurons, respectively; the evaluation ratio α and β are set as 0.7 and 0.3, respectively.
Step 3: Update the local best particle and the global best particle.
Step 4: Adjust control genes by using reproduce, crossover, and mutation operations.
Step 6: Use CLS to update the optimal particle.
Step 7: If the learning process has been completed, the best individual is derived. Otherwise, go back to Step 2.
Step 4: Adjust control genes by using reproduce, crossover, and mutation operations.
Step 6: Use CLS to update the optimal particle.
Step 7: If the learning process has been completed, the best individual is derived. Otherwise, go back to Step 2. Figure 9. Flowchart of the proposed improved particle swarm optimization (IPSO) algorithm.

Experimental Results
The performance of IPSO-based NNC in practically unstable nonlinear control applications is evaluated using the VisSim environment with a RT-DAC4/PCI motion control card and hardwarein-the-loop. VisSim is a simulation of complex nonlinear dynamic systems in a Windows environment. In this study, based on the VisSim environment, the IPSO-based NNC was implemented in a planetary train inverted pendulum control system. Figure 10 shows the block diagram of the control system. The encoder was used for sensing the pendulum angle. The angle signal was used as a feedback signal. The motor torque is used to control the swing angle of the pendulum in the equilibrium state to indicate that the control is completed. This study compared the proposed IPSO-based NNC with a proportional-integral-derivative (PID) controller, PSO-based NNC, and GA-based NNC. The PID controller is shown in the following: (17) where u(t) represents the controller's output and e(t) represents the difference between the controller's desired and measured values. The control gains obtained through extensive experimental experience are Kp = 830, Ki = 0 and Kd = 0.3284. Figure 9. Flowchart of the proposed improved particle swarm optimization (IPSO) algorithm.

Experimental Results
The performance of IPSO-based NNC in practically unstable nonlinear control applications is evaluated using the VisSim environment with a RT-DAC4/PCI motion control card and hardware-in-the-loop. VisSim is a simulation of complex nonlinear dynamic systems in a Windows environment. In this study, based on the VisSim environment, the IPSO-based NNC was implemented in a planetary train inverted pendulum control system. Figure 10 shows the block diagram of the control system. The encoder was used for sensing the pendulum angle. The angle signal was used as a feedback signal. The motor torque is used to control the swing angle of the pendulum in the equilibrium state to indicate that the control is completed. Step 4: Adjust control genes by using reproduce, crossover, and mutation operations.
Step 6: Use CLS to update the optimal particle.
Step 7: If the learning process has been completed, the best individual is derived. Otherwise, go back to Step 2. Figure 9. Flowchart of the proposed improved particle swarm optimization (IPSO) algorithm.

Experimental Results
The performance of IPSO-based NNC in practically unstable nonlinear control applications is evaluated using the VisSim environment with a RT-DAC4/PCI motion control card and hardwarein-the-loop. VisSim is a simulation of complex nonlinear dynamic systems in a Windows environment. In this study, based on the VisSim environment, the IPSO-based NNC was implemented in a planetary train inverted pendulum control system. Figure 10 shows the block diagram of the control system. The encoder was used for sensing the pendulum angle. The angle signal was used as a feedback signal. The motor torque is used to control the swing angle of the pendulum in the equilibrium state to indicate that the control is completed. This study compared the proposed IPSO-based NNC with a proportional-integral-derivative (PID) controller, PSO-based NNC, and GA-based NNC. The PID controller is shown in the following: (17) where u(t) represents the controller's output and e(t) represents the difference between the controller's desired and measured values. The control gains obtained through extensive experimental experience are Kp = 830, Ki = 0 and Kd = 0.3284. This study compared the proposed IPSO-based NNC with a proportional-integral-derivative (PID) controller, PSO-based NNC, and GA-based NNC. The PID controller is shown in the following: where u(t) represents the controller's output and e(t) represents the difference between the controller's desired and measured values. The control gains obtained through extensive experimental experience are K p = 830, K i = 0 and K d = 0.3284.

Control of Different Reference Trajectories
To validate the control abilities of the proposed IPSO-based NNC, the set-point and periodic square commands are used as different reference trajectories in this experiment. The initial parameters of the particle swarm optimization are the number of particles, the single inertia weight w, acceleration constants C 1 and C 2 , and number of generations (see Table 1). The different inertia weights will lead to the different performance of the proposed algorithm. Thus, in this study, the inertia weight values were set as 0.3, 0.4, 0.6, 0.8, and 0.9. The performance evaluations of the inertia weight (ω = 0.8) were more efficient than that of the inertia weights (ω = 0.3, 0.4, 0.6 and 0.9). Therefore, the inertia weight (ω = 0.8) was adopted in this study. Table 1. Initial parameters of PSO.

Number of Particles
Inertia Weight (ω) C 1 C 2 Generation 30 0.3~0.9 2 2 3000 Figure 11 presents the real control system of a planetary train inverted pendulum. The performance measurement of the controller comprised set-point regulation and a square command tracking capability. In the set-point command experiment, the proposed method was used to control the inverted pendulum for following the set-point reference. In this study, the set-point reference is equal to zero. Figure 12a-d shows the comparison results of the regulation of IPSO-based NNC, PID controller, PSO-based NNC, and GA-based NNC. In order to validate the performance of set-point regulation, the sum of absolute error (SAE) are defined in the following: where θ 0 and θ re f 0 represent the actual angle of the pendulum and the referred angle of the pendulum, respectively, and . θ 0 and . θ re f 0 denote the actual speed of the pendulum and the referred speed of the pendulum, respectively. Table 1 shows the experimental results of the sum of the absolute error for the pendulum angle (SAE θ 0 ) and pendulum speed (SAE . θ 0 ). In the periodic square wave signal command experiment, we used a square wave with an amplitude of ±0.02 and a frequency of 0.5 Hz to evaluate the tracking ability of the proposed method. Figure 13a-d show the regulation performance of the proposed IPSO-based NNC, PID controller, PSO-based NNC and GA-based NNC, respectively. In this experiment, a sampling rate of 0.1 s is used.

Control of Different Reference Trajectories
To validate the control abilities of the proposed IPSO-based NNC, the set-point and periodic square commands are used as different reference trajectories in this experiment. The initial parameters of the particle swarm optimization are the number of particles, the single inertia weight w, acceleration constants C1 and C2, and number of generations (see Table 1). The different inertia weights will lead to the different performance of the proposed algorithm. Thus, in this study, the inertia weight values were set as 0.3, 0.4, 0.6, 0.8, and 0.9. The performance evaluations of the inertia weight (ω = 0.8) were more efficient than that of the inertia weights (ω = 0.3, 0.4, 0.6 and 0.9). Therefore, the inertia weight (ω = 0.8) was adopted in this study.  30 0.3~0.9 2 2 3000 Figure 11 presents the real control system of a planetary train inverted pendulum. The performance measurement of the controller comprised set-point regulation and a square command tracking capability. In the set-point command experiment, the proposed method was used to control the inverted pendulum for following the set-point reference. In this study, the set-point reference is equal to zero.   In the periodic square wave signal command experiment, we used a square wave with an amplitude of 02 . 0 ± and a frequency of 0.5 Hz to evaluate the tracking ability of the proposed method. Figure 13a-d show the regulation performance of the proposed IPSO-based NNC, PID controller, PSO-based NNC and GA-based NNC, respectively. In this experiment, a sampling rate of 0.1 s is used. Table 2 presents the summary of the experimental results. In this table, the comparison results of various controllers in the set-point and periodic square commands show that the proposed IPSO-based NNC outperforms the other controllers.

Reference Trajectories
Proposed IPSO-Based NNC

Robustness Test of IPSO-Based NNC
To validate the usefulness of the proposed control system, two different cases, including the influence of impulse noise (i.e., add unknown impulse noise to the plant output) and effect of change in plant dynamics (i.e., add dynamic value to the plant input), are used in this experiment. First, one impulse noise value, 0.1 rad, is added to the plant output at the 10th second when a set-point of 0.04 rad is adopted in this case. Experimental results show that the proposed method recovers quickly when pulse noise occurs, as illustrated in Figure 14a. Second, one general characteristic of many industrial-control processes is that their parameters tend to change in an unpredictable way. In this experiment, 0.5*u (k-0.005) is added to the plant input between the 7th second and the 15th second, in order to test the robustness of the proposed controller. Figure 14b shows the recovering results of the proposed method.

Robustness Test of IPSO-Based NNC
To validate the usefulness of the proposed control system, two different cases, including the influence of impulse noise (i.e., add unknown impulse noise to the plant output) and effect of change in plant dynamics (i.e., add dynamic value to the plant input), are used in this experiment. First, one impulse noise value, 0.1 rad, is added to the plant output at the 10th second when a set-point of 0.04 rad is adopted in this case. Experimental results show that the proposed method recovers quickly when pulse noise occurs, as illustrated in Figure 14a. Second, one general characteristic of many industrial-control processes is that their parameters tend to change in an unpredictable way. In this experiment, 0.5*u (k-0.005) is added to the plant input between the 7th second and the 15th second, in order to test the robustness of the proposed controller. Figure 14b shows the recovering results of the proposed method.

Stability Analysis of IPSO-Based NNC
Consider the nth-order nonlinear system ( Figure 15) that can be expressed in the canonical form , , ) ..., , , where f is an unknown continuous function, b is the control gain (For simplicity b = 1 is taken in the subsequent development), and ∈ , ∈ is the input and output of the plant, respectively. We assume that the state vector X = ( , , ⋯ , ) = ( , , ⋯ , ( ) ) ∈ is available for measurement. The control objective is to force the plant state vector y to follow a specified desired trajectory, y d , under the constraint that all signals involved must be bounded.

Stability Analysis of IPSO-Based NNC
Consider the nth-order nonlinear system ( Figure 15) that can be expressed in the canonical form x, . . . , x (n−1) ) + bu, where f is an unknown continuous function, b is the control gain (For simplicity b = 1 is taken in the subsequent development), and u ∈ R, y ∈ R is the input and output of the plant, respectively. We assume that the state vector X = (x 1 , x 2 , · · · , x n ) T = (x, . x, · · · , x (n−1) ) T ∈ R n is available for measurement. The control objective is to force the plant state vector y to follow a specified desired trajectory, y d , under the constraint that all signals involved must be bounded.
1 Figure 15. The overall scheme of stable IPSO-based NNC.
Defining the tracking error vector, e = y − y d the problem is thus to obtain a feedback control law, u = u c + u s , where u c and u s are control outputs of the NNC controller and the supervisor, respectively.
The global stability of the control system is a basic requirement for solving nonlinear control problems. Because the general evolution algorithm has become characteristic of random search, some search points may cause learning processes to be unstable. In this study, the supervisor u s (t) is designed ( Figure 15) to guarantee global stability of the closed-loop system in the sense that the error state variables must be uniformly bounded, i.e., e(t) ≤ D < ∞ for all t ≥ 0, where D is a design parameter specified by the designer.
If condition f (x(t)) ≤ C (C > 0 is a constant) is assumed, the supervisory u s (t) can be expressed as: u s (t) = k s −k d r(t) + y d (t) − M T v e(t) − sgn(r(t))C − u c (t) (23) where k d > 0 is a constant; k s = 1 if e(t) ≥ D, and k s = 0 if e(t) < D. Because all terms in Equation (23) can be determined, the supervisory control u s (t) can be implemented. Then, substitute Equation (23) into Equation (22) and consider the k s = 1 case, we can derive the results as follows: .

Conclusions
This study proposed an IPSO-based NNC for an unstable nonlinear system control. The proposed method can automatically determine the number of hidden levels and neurons and use the chaos method to enhance the ability of PSO to optimize neural network parameters. The proposed IPSO-based NNC was successfully applied to the control system of a planetary train-type inverted pendulum. Experimental results show that the proposed IPSO-based NNC has a smaller SAE than PID controllers, PSO-based NNC, and GA-based NNC. Moreover, the proposed method achieved 3.2% and 2.4% higher performance, respectively, in SAE θ 0 and SAE . θ 0 than the traditional PSO method. The trained NNC controller can successfully control an unstable nonlinear system, but the weights of the NNC have no physical meaning. Future works will design a new neural fuzzy network which has learning ability, and its fuzzy rules will have a similar thinking logic to that of humans.