Abstract
The Proportional Integral Derivative (PID) controllers are extensively used as the controllers for controlling the system outputs. The performance of the system is mainly depends on the parameters of the PID controller. To tune these parameters, various techniques are available, and in these methods, there exists drawbacks. To overcome these drawbacks in this paper, the tuning of PID parameters are done by using genetic algorithm, and it is effectively tested on linear inverted pendulum system (LIP). In addition, extensive simulations are performed by varying parameters of the pendulum. For brevity, comparison is made with ZāN methods of tuning, and it is observed that GA-tuned PID controller is giving better performance.
Access provided by CONRICYT-eBooks. Download chapter PDF
Similar content being viewed by others
Keywords
1 Introduction
The controllers are placing major in the automated industry due to its efficient operation of system. In this PID, controller is extensively used in industry due to its simplicity and effectiveness. To realize any controller, the gains of controller must be determined effectively. To determine the gains of PID controller, more efforts has been devoted to reduce the required time and to optimize the PID parameter values. There are numerous tuning techniques are available based on the implementation methods [1]. Tuning methods are mainly classified as: (i) empirical methods (ZāN) (ii) analytical method such as rootālocus-based design, and (iii) Optimization methods such as iterative feedback tuning. For the extensive range of industrial applications, ZāN fine-tuning technique suits well, but the main shortcoming of this process is that the operator needs to have clear awareness about plant model [2]. Once it is tuned by ZāN technique, it gives good response, but it is not optimum. If there exists any change in the plant dynamics, then the transient response of the system will vary drastically. To guarantee an independent performance, the controller must have the capability of adapting to the changes in the plant dynamics [3]. Current years, artificial intelligent methods such as fuzzy logic, genetic algorithms (GA), and neural networks are rigorously used due to various features.
Advancements in digital technology have made the controllers automatic. The automatic control system facilitates a wide range of options for control schemes, despite the fact that more than 90% of industrial controllers are still employed based on the PID algorithms, mostly at the low levels, since none of the controller will facilitate the advantages like PID controller. The main features of PID controller are applicability, clear functionality, and simplicity in structure. There are numerous optimization and optimal control procedures available for linear and nonlinear dynamic systems [4,5,6] to meet the performance optimization requirements of dynamic systems.
The authors in [7] tuned controller constants in a trial-and-error technique, which was time consuming and increased the complexity, and the system response is not satisfactory. More efficient ways to optimize PID gains has been proposed by the authors in [8,9,10]; in these methods, authors implemented the deterministic optimization procedures based on the integrated absolute error (IAE) standards are used, but these techniques use the predefined MATLAB toolbox and their tuned gains are optimum in only certain operative regions and these techniques are not robust. To bring the inverted pendulum to be stable in vertical position and to control the cart at the preferred position, two PID controllers are required. One can be used for the rod angle control known as angle PID controller, and another for the cart position, and it is referred as cart PID controller [1]. This method increases the complexity of the system. To overcome the drawbacks of existing systems, optimization techniques were widely used for effective operation of system.
Genetic algorithms (GAās) are search techniques motivated by the laws of a genetics and natural selection. The GA is first implemented by Holland based on the Darwinās principal. This can be seen as an optimization technique and is applied to search, machine learning, and optimization tasks [11,12,13]. GA was effectively adapted to the system dynamics [14]. In this article, gains of PID controller are tuned via GA method for a linear inverted pendulum. To illustrate the effectiveness of genetic algorithm-tuned PID controller, the impulse and step* responses are plotted and are compared with that of the conventional (ZāN) method.
2 Mathematical Model
In this analysis, an inverted pendulum on a moving cart is explored. A pendulum rod is moved around a rigid pivot point fixed to the cart, driven by the stepper motor which is forced to move on the horizontal platform. The rod is set in the vertical position, which is known as an equilibrium point. Main intention is to apply a force to move the cart so that the pendulum stays in the vertical position. The system is shown in Fig.Ā 1, where F is the force in Newton, m is the mass of the pendulum rod in kilogram, M is the mass of the moving cart in kilogram, FV is the force applied to the cart in Newton, \(F_{f}\) is the force due to friction in Newton, g is the acceleration due to gravity in \(m^{*} s^{ - 2}\), and Īø is the angle of the inverted pendulum measured from the vertical y-axis in radians.
Consider the free-body diagrams shown in Fig.Ā 2. In addition, assume that the coordinates of the center of gravity of the pendulum, (\(x_{G}\), \(y_{G}\)), are given by:
where l is the distance along the pendulum to the center of gravity and x is the xĀ -coordinate of the cart.
From the Newtonās laws of motion, the force along horizontal and vertical axis is given as: For any object, the relationship between the moment applied and angular acceleration of the object is given by the following relationship.
For the inverted pendulum, moment is summed around its center of gravity, Eq.Ā (3) can be rewritten as
The equations of motion for the inverted pendulum on a moving cart can be written as
The model of the pendulum system given in Eq.Ā (5) is nonlinear model and must be linearized in order to get a sensible model for control purposes. The parameter values selected for experimentation were mentioned in TableĀ 1. Linearization will be performed about the point \(x = 0\;{\text{m}}\) and \(\theta = 0\,{\text{radians}}\) (appx). Under these assumptions, Eq.Ā (5) can be rewritten as
By using Laplace transformation to the Eq.Ā (6), it can be written as:
The output of the system can be written by solving the Eq.Ā (7)
3 PID Controller
Tuning of PID controller is a challenging task, even though there are only three parameters in the system, because it must satisfy several criteria within the limitations of PID control. Controller design and tuning seem to be theoretically intuitive; however, it can be tough in real time, if various objectives such as good stability and transient response are to be attained. PID controllers generally provide adequate control by default tunings by using the traditional methods, but performance can be enhanced by fine tuning, and poor tuning may lead to undesirable performance. Typically, initial designs need to be adjusted frequently through simulations until the closed-loop system performs as desired. The most common practice in industries is to utilize PID controller. The schematic of PID is shown in Fig.Ā 3. This set up is acknowledged as parallel form or non-interacting form.
The output of a general PID controller in a parallel form is given as:
where \(K_{p}\),\(T_{i}\), and \(T_{d}\) are proportional gain, integral, differential time constants. \(K_{i} = K_{p} /T_{i}\), \(K_{d} = K_{p} T_{d} \,k_{p} \,k_{i}\) are derivative and integral gains, respectively.
The tuning of PID means generating the gains of individual controller in a system, for this conventional ZāN method is used. It is based on critical gain \(K_{c}\) and oscillation period \(T_{c}\). In this technique, the integral time T i is initially set to infinity, and the derivative time \(T_{d}\) is set to zero. This step is only for the proportional control. \(K_{p}\) will be varied until the system output is oscillatory, and the gain pertaining to this is called as critical gain. In case the output is not oscillatory which indicates ZāN method is not applied. The goal is to minimize the peak overshoot within the limit of 10%. In case the maximum overshoot is greater than 15%, gain adjustment has to be done to decrease it to less than 10%. The parameters tuned using ZieglerāNichols frequency method [1]; the parameters of PID controller are tuned and shown in TableĀ 2.
4 Genetic Algorithm
Genetic algorithm is a population-based global search algorithm that follows Darwinās principle of survival of the fittest was first proposed by John Holland and his students in the year 1970. The process of GA starts without any knowledge of the output, it will adapt to the environment in which it is working, and the optimization will take place with the help of its operators such as crossover, mutation, and reproduction to attain the global best solution. The method starts with random initial values and explore the search space parallelly. GAās can be applied to complex problems irrespective of its dimensionality, compared to the other gradient techniques which depends on the order of derivative [14].
4.1 Characteristics of Genetic Algorithm
In GA method, solution to the problem is represented as chromosome, and groups of chromosomes form population. Chromosomes are individually awarded with fitness and compared with the other in the population and the success rate is determined. To attain the better solution, genetic algorithm uses the genetic procedures such as crossover and mutation for generating new set of population. This process is achieved by combining two chromosomes or by changing the bits in chromosomes. Selection of parental chromosomes will be based on the fitness of the parents. By this type of selection, the child chromosomes will have the better characteristics of both parents. Initialization of chromosomes is done with the set of 20ā100 chromosomes. In this article, chromosomes are represented in binary. The performance of individual chromosomes is evaluated by a function called objective function. The objective function value for the corresponding chromosome is called as fitness value. The evaluation is based on fitness value and the strongest chromosomes are survived for the next iteration.
Here, each chromosome is having three parts as \(K_{p}\), \(K_{i}\), \(K_{d}\) with a length of 30 bit and 10 bit for each parameter.
Steps involved in development and implementation of GA.
-
1.
Initialize the GA parameters.
-
2.
Evaluate the chromosomes for best fitness.
-
3.
Parents should be selected based on the fitness.
-
4.
Reproduction is done by the roulette wheel method.
-
5.
Crossover is introduced to the chromosomes after reproductions.
-
6.
Mutation is done for the resulted chromosomes at lowest probability.
-
7.
Iterate the process from step 2 to 6 until the performance criteria is met. The values of parameters used for the experimentation are given as, Population sizeĀ =Ā 20, Length of chromosomeĀ =Ā 30, Length \(K_{p} = 10\), Length of \(K_{i} = 10\), Length of \(K_{d} = 10\), Max. GenerationsĀ =Ā 50, \(0\, \le K_{p} \le 100\), \(0\, \le K_{i} \le 100\), \(0\, \le K_{d} \le 100 .\)
4.2 Objective Function Problem Formulation
Here, the objective function is framed to tune PID gains in such a way that it provides less peak over shoot, small rise time. Each chromosome is evolved, and chromosome having highest fitness considers to be the fittest chromosome. GA uses the fitness values of individuals to produce a new generation set of population comprising of the members with best fitness.
In the evaluation process, the chromosome is divided into 3 parts and it is used for tuning. The newly designed PID gains are placed in the LIP system with unity feedback. For faster evaluation, the Simulink model is designed in other file and is called during the process. The system is given with an impulse input and the error is estimated ITAE.
Integral of time multiplied by absolute error (ITAE)
The ITAE evaluates the error with time and therefore minimizes the error values later on in the response.
5 Results
In this section, the simulations have been performed to evaluate the response of GA-tuned controller. Calculations are performed with 20 chromosomes. The tuned controller is characterized by minimum overshoot, less settling time, and rise time. The best response will then be chosen.
The parameters of GA are chosen as: probability of crossoverĀ =Ā 0.8, probability of mutationĀ =Ā 0.3, generationsĀ =Ā 50, crossover is single point crossover, and selection is roulette wheel selection. From the Fig.Ā 4, an impulse disturbance of 0.1 PID controller is giving a peak of 0.08, whereas GA-tuned controller is giving around 0.1. Settling time has drastic improvement in GA-tuned PID controller and it is around 0.15Ā s, whereas in traditional controller it is around 1Ā s.
Hardware plots are plotted without disturbance in pendulum angle and cart position because of complexity in providing same disturbance with same magnitude since the disturbance is given manually. The cases with disturbance are shown in the simulation results. Different sets of PID gains tuned by GA are verified on hardware, and the plots for both cart position and pendulum angle are plotted for all methods including conventional method. From the hardware response with the 2 types of PID tuning, conventional PID controller will make the pendulum oscillate around the 3.14, but ITAE-based gains provide less oscillations. The experimental setup is shown in Fig.Ā 5.
The oscillation in the pendulum angle is because of the output collected from optical encoder. TableĀ 3 gives the details about the tuned parameters based on two methods (conventional and proposed method).
6 Conclusion
From the experimentations, it can be conclude that GA-tuned PID controller will give the faster and good response compared to traditional PID controller tuning methods. These traditional methods will lead us to a starting value of PID controller gains but not the optimal one. Along with this, obtaining gain from classical techniques is more troublesome. It requires more steps, and sometimes trial-and-error procedure is to be followed for reaching the desired performance. With GA tuning, the sound knowledge about the system is not required. The tuning time also will be reduced with the help of GA tuning.
References
Prasad, L.B., Tyagi, B., Gupta, H.O.: Optimal control of nonlinear inverted pendulum dynamical system with disturbance input using PID controller and LQR. In: 2011 IEEE International Conference on Control System, Computing and Engineering (ICCSCE), pp. 540ā545, IEEE (2011)
Ghosh, A., Krishnan, T.R., Subudhi, B.: Brief paper-robust proportional-integral-derivative compensation of an inverted cart-pendulum system: an experimental study. IET Control Theory Appl. 6(8), 1145ā1152 (2012)
Lin, G., Liu, G.: Tuning PID controller using adaptive genetic algorithms. In: 2010 IEEE 5th International Conference on Computer Science and Education (ICCSE), pp. 519ā523. IEEE (2010)
Lewis, L.: Optimal Control. Wiley, New York (1986)
Bandyopadhyay, M.N.: Control Engineering: Theory and Practice (Chapter 13). Prentice Hall of India Pvt. Ltd., New Delhi (2004)
Burns, R.S.: Advanced Control Engineering (Chapters 9 and 10). ElsevierāButterworth Heinemann (2001)
Yusuf, G.A., Lukman A., Magaji, N.: GA-PID controller for position control of inverted pendulum. In: 2014 IEEE 6th International Conference on Adaptive Science and Technology (ICAST), pp. 1ā5. IEEE (2014)
Lee, Y., Park, S., Lee, M., Brosilow, C.: PID controller tuning for desired closedāloop responses for SI/SO systems. Aiche J. 44(1), 106ā115 (1998)
Lopez, A., Murrill, P., Smith, C.: Tuning PI and PID digital controllers. Instrum. control 42, 89ā95 (2009)
Haupt, L.R., Haupt, S.E.: Practical Genetic Algorithms, 2nd edn., p. 685. Wiley, New York (2002)
Priya, K., Babu, T.S., Balasubramanian, K., Kumar, K.S., Rajasekar, N.: A novel approach for fuel cell parameter estimation using simple genetic algorithm. Sustain. Energy Technol. Assess. 12, 46ā52 (2015)
Rajasekar, N., Jacob, B., Balasubramanian, K., Priya, K., Sangeetha, K., Babu, T.S.: Comparative study of PEM fuel cell parameter extraction using genetic algorithm. Ain Shams Eng. J. 6(4), 1187ā1194 (2015)
Balasubramanian, K., Jacob, B., Priya, K., Sangeetha, K., Rajasekar, N., Babu, T.S.: Critical evaluation of genetic algorithm based fuel cell parameter extraction. Energy Procedia 75, 1975ā1982 (2015)
Varsek, A., Urbancic, T., Filipic, B.: Genetic algorithms in controller design and tuning. IEEE Trans. Syst. Man. Cybern. 23(5), 1330ā1339 (1993)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
Ā© 2018 Springer Nature Singapore Pte Ltd.
About this chapter
Cite this chapter
Sravan Bharadwaj, C., Sudhakar Babu, T., Rajasekar, N. (2018). Tuning PID Controller for Inverted Pendulum Using Genetic Algorithm. In: Konkani, A., Bera, R., Paul, S. (eds) Advances in Systems, Control and Automation. Lecture Notes in Electrical Engineering, vol 442. Springer, Singapore. https://doi.org/10.1007/978-981-10-4762-6_38
Download citation
DOI: https://doi.org/10.1007/978-981-10-4762-6_38
Published:
Publisher Name: Springer, Singapore
Print ISBN: 978-981-10-4761-9
Online ISBN: 978-981-10-4762-6
eBook Packages: EngineeringEngineering (R0)