Balancing a Practical Inverted Pendulum Model Employing Novel Meta-Heuristic Optimization-based Fuzzy Logic Controllers

—This paper concentrates on proposing a newly effective control approach to ensure the balance of an inverted pendulum (IP) system consisting of a free-rotational rod and a small cart. The novel idea is to create an effective integration between a PD-like fuzzy logic architecture and a modified genetic algorithm ( m GA). The m GA is executed with an appropriately fast optimization as an initial phase in dealing with optimizing scaling factors of the fuzzy logic controller. There are totally six meaningful scaling factors corresponding to two fuzzy logic controllers applied in the balance control system of the IP. These six scaling coefficients are highly significant to strongly affect control quality of the system applying such a PD-like fuzzy logic control methodology. Excellent results obtained in terms of numerical simulations compared with those of both the conventional PID and existed fuzzy logic counterparts as well as practical experiments implemented in a real IP topology verify the promising applicability of the new control methodology proposed in this study.


I. INTRODUCTION
It should be obvious that controlling an inverted pendulum (IP) system to be balanced at a desirable position of the rod embedded in the model is one of the most traditional control problems [1][2][3]. This control approach is highly significant to a various number of nonlinear control strategies such as control of transport machines needing to balance things, robot technology, and even launch direction of missiles. Naturally, the IP system has been usually used to testify the applicability of new control strategies.
Recently, intelligent controllers, i.e. fuzzy logicbased regulators have been increasingly developed to replace with conventional counterparts such as PI (proportional integral) and PID (proportionalintegralderivative) in dealing with nonlinear and/or uncertain control systems [4][5][6][7][8][9][10]. Fuzzy logic technique has been considered to be highly suitable for these types of control plants due to its operation principle depends only on knowledge and experiences of experts to handle a system. Obviously, the better understanding of the system we have, the more effective operation of a control strategy based on fuzzy logic model we can obtain [11][12][13].
This work concentrates on applying fuzzy logicbased control strategy which was presented in [5] to design intelligent controllers, carrying out the balance of an IP system. Since an IP system is a multi-input multi-output (MIMO) system and the balance control problem should be solved by suitable controllers, the PD-like fuzzy logic control methodology has been selected. Technically, such a fuzzy logic controller has two inputs, error and derivative of error, and one output. Corresponding to these inputs and output, there are three scaling factors which strongly affect control quality of the system need to be determined in an effective manner. This mission is able to be successfully executed by using an appropriate optimization method. Metaheuristic optimization techniques [14][15][16][17][18], such as GA and PSO, have been completely capable of dealing with the determination of three scaling factors.
When applying a number of aforementioned biologyinspired optimization techniques, e.g. GA, it should be clear this is a time-consuming procedure. To find an optimal solution corresponding to a set of scaling factors for the fuzzy logic controller effective for the IP's balancing control, this is a fact that the duration is frustrating to operators. The new contribution of the current paper is to find a possible way to reduce this time period. The authors propose a hybrid procedure to initialize the GA mechanism by means of a faster optimization technique [15], e.g. Salp Swarm Optimization Algorithm (SSOA). This optimization mechanism is used to initially create a set of closed-optimal parameters as first phase of the GA. It is denoted modified GA (mGA) procedure and will be used to determine scaling coefficients of the two controllers embedded in the balance control for the IP: cart's position and pendulum's rotational angle ones. Simulation processes and experiments in a real model will be implemented to demonstrate the feasibility and applicability of the control scheme proposed in this study.
The rest of this paper is organized as follows. Section II presents an overview of related works to the IP's balance control. Section III will briefly create a mathematical model of an IP system which is helpful to design balance control strategies. Next, Section IV focuses on proposing a novel GA technology modified from a typical one. A control strategy applying such a modified GA mechanism will also be provided in Section V for solving the IP's balancing problem. Section VI concentrates on testifying the control strategy proposed in both simulation and experiment scenarios. Eventually, the conclusion and future work raised from this study will also be provided in the last section. www.ijacsa.thesai.org II. RELATED WORK Studies on IP systems, especially on the balancing control problem, have been conducted by a lot of researchers around the world. In [1], the authors investigated several traditional control strategies i.e. PID, LQR, Pole placement and Fractional PID to control the position of the pendulum's rod as well as cart via a number of simulations implemented in MATLAB software.
Reference [2] introduced a comprehensive illustration from the past to current approach of nonlinear control theory for the IP system, focusing on robust control methodology. The classical PID regulators had been used for a linear inverted pendulum system in cooperation with the GA mechanism which was embedded to tune PID's parameters [3]. In [19], the conventional PID, LQR together with MPC (model predictive controller) -based schemes were applied in dealing with the IP's balance control. The authors in [20] proposed a Sugeno -based fuzzy parallel distributed compensation regulator to control a nonlinear IP model with demonstration on MATLAB simulations. In almost reports conducted on the IP balance control, the control methodologies might not be sufficient in terms of their applicability and effectiveness concerning both theory and practice. It means that if the studies used conventional regulators such as PID and LQR, the control qualities were not good enough to ensure a high quality control system. In contrast, if the intelligent control approaches e.g. fuzzy logicbased schemes were applied, they had only been employed for the theoretical IP system testified by a proper software such as MATLAB. This work will be addressed by an idea of integration theoretical and practical IP topology. In addition, a novel hybrid intelligent control strategy using fuzzy logic technology integrated with a modified GA in comparison with conventional regulator as well as initial smart controllers will be proposed in this paper.

III. A MATHEMATICAL MODEL OF THE IP SYSTEM
A dynamic model representing a typical inverted pendulum system is shown in Fig. 1. This model consists of two main parts, i.e. a cart and a pole. The cart is actually a wagon driven by a small DC motor. The pole looks like a rod attached to a weight of mass m. This pole can be freely rotated by a cartmounted rotary joint. The system as drawn in Fig. 1 is manipulated by only one force F taken out by the DC motor.
In order to establish the dynamic model of the inverted pendulum system, taking the second Newton's law of motion the following equation can be obtained: Where F or u is the force of motion generated from the dc motor mounted on the cart. The fact that this force is only the control signal to keep the rod to be stable at the equilibrium. From (1), the following can be deduced: The two equations indicated above are usually used to represent the dynamics of the IP system.

IV. THE MODIFIED GENETIC ALGORITHM -MGA
Considered to be one of the most effective optimization techniques, the genetic algorithm (GA) has been applied for a huge number of optimization problems, including a significant layer of control issues. The balance control problem of the IP system is exactly suitable in using this optimization mechanism.
Typically, the conventional GA technique is presented in Fig. 2. The core idea for the GA came from the principles of biology relating to the theory of genetics and natural selection, an alternative name of the theory of natural evolution invented by Charles Darwin. This theory mainly focuses on a natural phenomenon in which the reproduction of the fittest individuals which are selected to replace the other ones must be implemented. The production of new generations, so-called offsprings, reflects the evolution of nature. Developed by John Holland and his colleagues, the GA has been inspired by stepby-step of the genetics. They consist of several main steps as shown in Fig. 3. Remember that the first step, normally defined as initialization of parameters for the GA mechanism, is highly important. If this phase is executed in a reasonable manner, it should be possible to dramatically reduce the duration of whole procedure.  In this paper, a modified GA (mGA) mechanism is proposed in order to minimize the period of time regarding the GA execution. An auxiliary phase is added as an initialization of parameters for the GA procedure. As shown in Fig. 3, the mGA is initialized by running a preliminary optimization mechanism. Such an optimization method aims to create initial parameters for the GA applying a possible optimization technique. A feasible method is selection of a faster optimization procedure, i.e. PSO (particle swarm optimization) and Salp Swarm Optimization Algorithm (SSOA) [15]. Theoretically, the PSO or SSOA is a local optimization technique may obtain faster execution time in comparison with the GA mechanism. This statement is also examined and confirmed by numerical simulation experiments. The mission of such a preliminary optimization technique in this aspect is to temporarily find a possible solution to the problem. The result obtained is a set of parameters which is near to local and/or global optimization point. From point of view, this idea can significantly minimize duration performing the GA procedure. Since the GA is a global optimization method, using a preliminary optimization technique to create initial parameters has a meaningful role, reducing significantly executed time. This feasible procedure also ensures the quality as well as convergent rate of the GA mechanism. The next section will verify the effectiveness of the proposed mechanism.

V. DESIGN OF AN MGA -BASED CONTROL STRATEGY TO BALANCING THE IP SYSTEM
The balance control of an IP system, considered to be a typical nonlinear control problem, can be successfully solved by applying intelligent controllers such as fuzzy logic regulators. This study is an extended work proposed in [5]. The authors integrate the fuzzy logic architectures presented in [5] with the mGA proposed in the previous section. The novel control methodology is described in Fig. 4.
As shown, the goals of the control issue are to bring the system back to the stable state within acceptable tolerances. This means both the position of the cart and the bias angle of the pole must be manipulated to ensure the balance of the IP system. It is noted that there is only one control signal, u, which is created from two controllers regarding two feedback parameters, i.e. position x and rotational angle θ. Technically, this control signal must be fed to an actuator which is normally a DC motor. The control signal also needs to be limited because the motor can only operate within certain constraints of parameters such as power, voltage and current. In this work, a permitted range of voltage is applied to the control signal u. The two controllers, position and angle regulators are employing the fuzzy logic architectures as presented in [5]. Since this is a nonlinear balance control problem, the PD-like fuzzy logic model is more suitable than the PI-based one. Remember that each of these PD-like fuzzy logic controllers has two inputs and one output. The two inputs are errors between desired and feedback signals. This study focuses on the vertical position of the pole, so that the desired value for the rotational angle is set to zero. In contrast, the setpoint corresponding to the desired position can be set at any value depending upon a particular control purpose. In this work, several references in accordance with the desired positions will be provided for verification via numerical simulations.
Each of two inputs and one output for an individual fuzzy logic controller as illustrated in Fig. 4 has a particular scaling factor. The fact that is each scaling factor in this aspect absolutely affects control quality of the system, leading to a mandatory requirement of determining it in a good enough manner. This is successfully implemented by means of a strong optimization technique. The modified GA proposed in the previous section is fully suitable in this perspective. Given a possible candidate of objective functions as indicated in the expression below, the proposed mGA can obtain the control quality as desired: Where e x (t) and e θ (t), expressed in the following two equations, are position error and angle error, respectively.
The factor ρ added in (3) denotes the weighting coefficient for executing the optimization mechanism.
As shown in Fig. 4, there are totally 6 parameters with regard to 6 scaling factors of two fuzzy logic controllers need to be optimized. The new GA optimization technique proposed in the previous section is utilized to determine these scaling factors. The control performance will be testified in the next section through both numerical simulation processes and practical experiments.

VI. NUMERICAL SIMULATIONS AND EXPERIMENTS
Performing numerical simulations on appropriate software as well as conducting experiments on real models is extremely necessary steps to prove the correctness and feasibility of the proposed control strategy. In this section, simulations applying MATLAB/Simulink will be executed at first to theoretically testify applicability of the new control methodology compared to those of conventional PID regulators [19] as well as fuzzy logic controllers [20]. Simulation parameters are given in Table  I and Table II. Two PD-type fuzzy logic controllers used for the IP system have the same structures with the membership functions as well as sets of fuzzy rules. Fig. 5 describes membership functions for two inputs and one output of each fuzzy logic architecture, while Fig. 6 illustrates fuzzy rules in form of a 3-D graph. The rule base can be specifically found in [6]. Applying the control methodology proposed in Section IV, after executing the mGA procedure, the optimal scaling factors obtained are indicated in Table III.

A. Simulation Results using MATLAB / Simulink
With six optimal factors presented in Table III, to verify the feasibility of the proposed control scheme, this work assumes the following three scenarios: 1) Scenario 1: The desired position of the cart is kept to be constant at 0.1 (m).
3) Scenario 3: This should be the most difficult case when the cart's position is supposed to periodically change in the form of a square pulse between 0.1(m) and 0.3 (m). www.ijacsa.thesai.org All three perspectives of desirable cart's positions are plotted in Fig. 7. The results concerning these simulation cases are shown in Fig. 8 to 11. It is noted that in each illustration, both position of the cart and deviated rotational angle are considered to ensure the balance of the system. Moreover, the proposed intelligent fuzzy control strategy is compared with widely-used conventional PID regulatorbased schemes [19] and fuzzy logic controllerbased counterparts [20] in each simulation scenario.
In the first simulation case, due to the simplest position of the cart when considered as reference of the control system, the settling times for both the angle and position are quite excellent as shown in Fig. 8. Obviously, these durations resulting from the proposed control strategy are much less than two seconds. The results of the conventional PID controllers [19] are apparently greater than three seconds. The control quality resulting from the proposed FLC is also better than that of the FLC presented in [20] as illustrated in Fig. 8. This description demonstrates more feasible performance of the new control strategy proposed in this study.    In the last two simulation scenarios as shown in Fig. 9 to 11 which are more complicated than the first case, it is clear that results of the proposed fuzzy logic controllers are still much better than those of the PID controllers [19] and FLC [20]. Even when the desired position x*(t) changes periodically as illustrated in Fig. 10, the actual position of the cart is able to track well with good control performances outperforming the conventional PID counterpart. Remember that in this perspective, the deviation angle of the pendulum must be still balanced at the vertical axis, ensuring the original goal of the control problem. In addition to the deviation angle, Fig. 11 shows several control signals such as rotational acceleration, angle control signal, and control force F fed to a motion DC motor for the third simulation scenario. It should be obvious that these signals tend to be extinguished to zero values, ensuring a stable goal of vertical equilibrium for the pendulum. www.ijacsa.thesai.org

B. Simulation Results via Python Software
To make a more obvious view verifying control performance of the proposed control strategy, the authors have employed Python software to simulate the balance of the inverted pendulum system in a highly intuitive way as shown in Fig. 12.

C. Practical Experiments
In an effort to examine the proposed control strategy, a practical IP system has successfully been built. Fig. 13 provides artwork for this practical prototype. With a set of optimal scaling factors obtained from the mGA as indicated in Table III, we address practical experiments on the IP model. Fig. 14 shows the real signals of both the position and angle of the IP system when considering the deviations of the position as presented if the previous simulation scenario. It was found that after transient period, both real signals, in form of transmitted into voltage values, are damped to be closed to zero, verifying the capability of the proposed control methodology.

Driver
Measuring instrument

VII. CONCLUSION AND FUTURE WORK
This study proposed a novel control strategy based on fuzzy logic architecture integrated with an mGA optimization technique to balance an IP system. The GA presented in this work used a faster optimization mechanism to accelerate global convergence, improving control quality of the system. Together with various simulation scenarios executed in MATLAB/Simulink platform, an actual IP system has also been built to demonstrate the efficiency of the control methodology proposed in this paper. Simulation results obtained by means of the proposed fuzzy logic control approach are much better than those of the conventional PID regulators as well as a single fuzzy logic controller, demonstrating the feasibility of this study. One direction to further improve this work as future work is to continue www.ijacsa.thesai.org optimizing membership functions of two fuzzy logic controllers as well as rule base sets. Technically, the mGA proposed will be completely able to carry out this mission. In this aspect, a promising intelligent fuzzy logicbased control strategy can be obtained in dealing with a huge number of complicated control problems, including the IP balancing issue.