Tuning of A PID Controller for Optimal Performance of Ball and Beam System

— In this paper design schemes for a PID controller have been introduced for a ball and beam system. The ball and beam system inherently possess instability, non-linearity, under-actuated motion and is a double integrating type process. Thus, plugging it as a typical platform for trying out different control strategies. Performance comparison of Genetic Algorithm (GA) based controller optimization is done against Simple Internal Model Control (SIMC) and the classical Ziegler Nicholas (ZN-PID) controller. The results obtained using MATLAB and SIMULINK reveal that (GA) based controller outperforms (SIMC) and (ZN-PID) controllers in set-point tracking, overshoot, peak response and settling time.


INTRODUCTION
One of the challenging problems in control system design is control of nonlinear, unstable systems. Many of industrial processes possess such characteristics inherently, which makes it difficult to design a proper control strategy for them. These systems cannot be brought into laboratories to be studied in real time due to their physical dimensions and cost. There are many standard laboratory instruments like inverted pendulum, floating ball, quad rotors which are both simple in construction and physical dimensions and exhibit same characteristics, ball and beam system being one of them. It is a special case of a second order system and is double integrating type in nature. It thus proves to be a good arena to study different control strategies. PID controllers are widely used in industries for controlling such processes for long time now due to its simplicity and very few parameters to tune the system. Many tuning methods are proposed to tune the controller for optimal performance, the most common being the trial and error and the classical Ziegler Nicholas methods. Many researchers have contributed in elucidating the control problem of the ball and beam system. The physical layout of the system is presented in [1] which is based on Arduino board as controller and MATLAB for data acquisition in real time. The correlation study between theoretical and practical response of the ball and beam system is shown in [2]. Tuning a controller is optimizing its tuning parameters for optimal system performance many researchers [3][4] have used the trial and error method along with Ziegler Nicholas method to tune the system for optimal performance within tolerable constraints. A new control strategy based on fuzzy logic has been proposed in [5,6] which presents hybrid fuzzy controller and model based PID to address the problem, the fuzzy controller proves to be better at disturbance rejection and provides zero steady state error. Results depict (SMC) sliding mode controller and (CDM) coefficient diagram method [7][8] show better performance in error elimination and set-point tracking along with stability response and robustness of the system respectively. New E-PID controller has been proposed [9] here the results show that E-PID eliminates the overshoot and decreases error by adding a feed-forward controller with proper design. In [10] Newtonian mechanics is used to derive the model of the system. In [11] Lagrange's method is used to derive the model of the system and suggest to have two degrees of freedom. The nonlinear model is derived using first principles and is linearized around the equilibrium to gain a state space model [12]. Reference [13] shows use of Lagrange's second type equation to model the system. The use of normal PD controller is done to regulate the nonlinear model in [14]. In [15] SIMC based PID and H infinity methods are used to control the system. PID controller along with neural network and LQR control have been applied to control the system in [17]. Reference [18] shows comparison between LQR subspace stabilization and combined error metric approaches. Various controllers exhibit characteristics which outperform PID in many aspects. But since PID controllers are being widely used in industries they cannot be replaced. Although conventional PID achieve some performance measures, the other like ISE, ITAE, overshoot still needs to be improved therefore besides these conventional PID tuning methods there are many heuristic methods that can be applied for PID optimization including the particle swarm, honey bee, ant colony and genetic algorithm which can overcome this problem. In [19] the controller tuning is done using SA and CSA heuristic tuning methods. GA and DE algorithm are used to tune PID controller and Performance evaluation is done on basis of error criteria in [20,27]. Also in [21] Meta heuristic techniques like ABC have been used to tune the PID controller and compared against swarm optimization algorithm. Reference [22] shows use of GA to tune the PID controller and the results are experimentally verified on a ball and beam setup using Quarc-platform. In [23][24][25] GA has been applied to control the ball and beam system, reverse osmosis plant and stewards platform. Reference [26] shows application of LQR to control the system and LQR parameters are tuned using GA. This paper aims comparison between the conventional Ziegler Nicholas, (SIMC) simple internal model control PID tuning methods and the evolutionary (GA) genetic algorithm technique based on the ITAE criteria. The rest of the paper is arranged as follows. Section 2 depicts mathematical model of the system. Section 3 shows the design of the PID controller. The comparison between (ZN-PID), (SIMC), (GA) is done in section 4. And section 5 concludes the paper.

II. BALL-BEAM SYSTEM AND MODELLING
This section comprises the mathematical modelling of the ball and beam system for carrying out simulations in MATLAB. The system construction is shown in figure 2 below. Newtonian mechanics is used to model the system. The system parameters used are as shown in table 1. The ball and beam system consist of a horizontal beam pivoted at the center about which it can rock up and down like a see-saw. A ball is placed on the beam which can roll in either direction freely. A DC servo motor is incorporated to control the beam angle using mechanical linkages. An analogue IR sensor placed at one end of the beam measures the balls position on the beam.
The system is unstable in nature since the ball rolls off freely to either end of the beam even if very little beam angle is applied. The system output increases indefinitely for a given definite input, which makes it necessary to incorporate a feedback control to keep the ball at a desired position on the beam.  The figure 1 shows the free body diagram of the system neglecting friction and slippage between ball and the beam surface.
[7]Summing the forces acting along the axes of the beam we get, We have, the translational force acting on the ball as mass multiplied by acceleration given by equation 2 The rotational force acting on the ball is given by equation 3.
Where is the moment of inertia of the ball and is the angular velocity given by equation 4 and 5 respectively.
We have, Substituting equation 8 in equation 7 and taking Laplace transform we get the transfer function of the system as follows.
Where, X-ball position on beam.
-angle of the servo arm. It is clear that the system transfer function is a special case of second order system and is double integrating type in nature.

III. DESIGN OF PID CONTROLLER
In this section the PID controller is designed using various methods, the PID controller has been used in parallel form for simplicity as shown by equation 10. Figure 3 shows the simulation model of the PID controller implemented in Simulink.

A. ZN-PID
The Ziegler Nicholas tuning method is one of the first methods that provided mathematical relations to tune a controller. It was developed in (1942) and is widely used in industries and can be easily implemented. This method is also called as the ultimate cycle method. It provides a good starting point for further fine tuning. This method can be easily applied to tune a PID controller by using the relations provided in table 2. Iterations are carried out to find optimum values of to obtain sustained oscillation at the system output. Based on the results gives good system response. Hence the corresponding optimum controller settings , are used for further analysis.

B. SIMC-PID
The double integrating type process is a special case of a second order system. Lot of PID controller tuning methods focus on SOPDT and FOPDT systems but very less literature is available for double integrating type processes. The most common being the (SIMC) simple internal model control. Skogestad in [16] have provided resulting PID settings for controlling a double integrating process quoting the need of derivative action required to control the process. Table 3 shows the SIMC PID settings for a double integrating process. This procedure results in only one tuning parameter . The small values of give fast speed of response and good disturbance rejection, While greater values of favour stable and robust system. The value of closed loop time constant is constrained to . The iterations carried out to find value of that provide good trade-off between speed of response and stability. Based on the results provide good system response. The corresponding optimum settings , , are used for further analysis.
C. GA-PID Evolutionary techniques are Algorithms inspired by natural processes of evolution in nature. These are heuristic methods to solve a given problem statement and optimize it. This has led to discovery of many techniques for optimization and problem solving. Genetic algorithm is a search-based algorithm based on Principles of natural selection and theory of evolution first introduced by J Holland in 1970. The use of evolutionary techniques since then for PID tuning have been done extensively. In this paper GA based optimization tool in MATLAB is used for finding optimum PID settings. The procedure involves finding a fitness function that encompasses the iterations for desired result based on some criteria and run the optimization tool over the function. The process may take several minutes to hours based on complexity of the fitness function. The fitness function is designed on the criteria to optimize the ITAE performance criteria.

Designing of the fitness function in MATLAB
Based on the results the optimized PID settings obtained are , , .

IV. SIMULATIONS AND RESULTS
In this section performance of the designed controllers are discussed. The simulations are carried out in MATLAB SIMULINK environment. The performance evaluation of the controllers is done by rating based on overshoot, settling time and peak response for closed loop response and set-point changes and disturbance rejection respectively. The Performance indices obtained for ZN-PID, SIMC and GA are tabulated as follows in table 4 and figure 5-7 show responses of the system for reference tracking set-point change and disturbance rejection respectively.  Figure 4 shows open loop response of the system the system which depicts that the ball rolls off to the edge in open loop and is unstable in nature. The closed loop response of the system is shown in figure 5. A step input is used as a set point. Figure 6 shows response of the system for set point tracking.
The reference used is a square wave of 0.5 Hz frequency. Figure 7 shows the system response for disturbance rejection, a spike of 0.4 amplitude is introduced in the system at 3 seconds interval as a disturbance. The responses show that the GA-PID controller based system has better time domain characteristics in comparison with SIMC-PID controller followed by ZN-PID controller. Also GA-PID system show minimum ITAE followed by SIMC-PID and ZN-PID respectively.

V. CONCLUSION
The PID controller was tuned using Ziegler Nichols, SIMC, GA method and simulations are carried out in MATLAB SIMULINK environment. Performance evaluation is done on basis of set point tracking using square wave as reference and disturbance rejection by introducing spike in system at three seconds interval. The results depict that GA tuning method provides good settling time, overshoot, ITAE and final value responses followed by SIMC method and Zeigler Nichols method respectively.