PID Controller Tuning Using Soft
Computing Techniques
Nikhileshwar Prasad Adhikari and Amit Gupta
Abstract The aim of this paper is to design a position control of a DC motor by
selection of a PID controller using genetic algorithm. This paper compares two
kinds of tuning methods of parameter for PID controller. One is the controller
design by the genetic algorithm, second is the controller design by the Ziegler and
Nichols method. It was found that the proposed PID parameters adjustment by the
genetic algorithm is better than the Ziegler and Nichols’ method. This proposed
method could be applied to the higher order system also.
Keywords DC shunt motor PID controller Ziegler Nichols method Genetic
algorithm
Introduction
DC drive systems are often used in many industrial applications, such as robotics,
actuation, and manipulators. In the first two, a wide range of position control is
required. Tuning method for PID controller is very important for the process
industries. Proportional Integral Derivative (PID) controllers have the advantage of
simple structure, good stability, and high reliability [1]. Accordingly, PID con-
trollers are widely used to control system outputs, especially for systems with
N. P. Adhikari (&)
Department of Electrical Engineering, Control System, Gyan Ganga College of Technology,
Jabalpur, India
A. Gupta
Department of Electrical Engineering, Takshshila Institute of Engineering and Technology,
Jabalpur, India
V. Kumar and M. Bhatele (eds.), Proceedings of All India Seminar on Biomedical 277
Engineering 2012 (AISOBE 2012), Lecture Notes in Bioengineering,
DOI: 10.1007/978-81-322-0970-6_31, Ó Springer India 2013
278 N. P. Adhikari and A. Gupta
accurate mathematical models. The key issue for PID controllers is the accurate
and efficient tuning of parameters. In practice, controlled systems usually have
some features, such as nonlinearity, time-variability, and time delay, which make
controller parameter tuning more complex. Moreover, in some cases, system
parameters and even system structure can vary with time and environment. As a
result, the traditional PID parameter tuning methods are not suitable for these
difficult calculations.
As a popular optimization algorithm, the GA had been widely used to turn
PID parameters. Soltoggio [2] proposed an improved GA for tuning controllers
in classical, first and second order plants with actuator nonlinearities. Chen and
Wang [3] used the population-based distribution GA to optimize a PID controller,
and found that the search capability of the algorithm was improved by competition
among distribution populations in order to reduce the search zone. The PID
controllers based on GAs have good performance and have been applied in
practice.
The aim of this paper is to design a plant using Genetic Algorithm. Genetic
Algorithm or in short GA is a stochastic algorithm based on principles of natural
selection and genetics. Genetic algorithms (GAs) are a stochastic global search
method that mimics the process of natural evolution. Genetic algorithms have been
shown to be capable of locating high performance areas in complex domains
without experiencing the difficulties associated with high dimensionality or false
optima may occur with normal PID techniques. Using genetic algorithms to per-
form the tuning of the controller will result in the optimum controller being
evaluated for the system every time.
In order to solve this problem a PID controller under Genetic Algorithm with
self-tuning is applied, which will perform high efficiency position control. The
efficiency of Control Algorithm is presented through a simulation and compared
with the quality of PID controller.
Mathematical Modeling of DC Motor
Modeling Scheme
As reference we consider a DC shunt motors as is shown in Fig. 1. DC shunt
motors have the field coil in parallel (shunt) with the armature. The current in the
field coil and the armature are independent of one another. As a result, these
motors have excellent speed and position control [1]. Hence DC shunt motors are
typically used applications that require five or more horse power.
The input voltage V is applied to the field winding which has a resistance and
inductance of R and L, respectively. The armature current supplied to the armature
is kept constant and thus the motor shaft is controlled by the input voltage.
The field current produces a flux in the machine which in turn produces a torque at
PID Controller Tuning Using Soft Computing Techniques 279
Fig. 1 Diagram of DC shunt
motor
the motor shaft. The moment of inertia and the coefficient of viscous friction at the
motor shaft are Jm and fm, respectively. The angular shaft resulting in the motor
shaft being hm and the corresponding angular velocity being xm.
System Equations
The armature current is kept constant and the relationship between the developed
motor torque Tm and the field current is given by
Tm a if ð1Þ
Tm ¼ Kf if ð2Þ
The equations describing the dynamic behavior of the DC motor are given by
the following equations;
V ¼ Ri þ Lðdi=ðdtÞÞ þ eb ð3Þ
Tm ¼ Kt ia ð4Þ
Tm ¼ Jm ðd ^ 2hm Þ=ðdtÞ^ 2 þ fm dhm =dt ð5Þ
Tm ¼ Jm ðdxm Þ=dt þ fm xm ð6Þ
Simplification and taking the ratio of h(s)/v(s) we will get the transfer function
as below,
HðsÞ= vðsÞ ¼ Kb = ½J La S3 þ ðRa J þ B La ÞS2 þ ðKb 2 þ Ra BÞS ð7Þ
Where, Ra = Armature resistance in ohm, La = Armature inductance in Henry,
ia = Armature current in ampere, Va = Armature voltage in volts, eb = e(t) =
Back emf voltage in volts, Kb = back emf constant in volt/(rad/sec), Kt = torque
constant in N-m/Ampere, Tm = torque developed by the motor in N-m,
h(t) = angular displacement of shaft in radians, J = moment of inertia of motor
and load in Kg-m2/rad, B = frictional constant of motor and load in N-m/(rad/sec)
280 N. P. Adhikari and A. Gupta
Fig. 2 PID control
Motor Specifications and Parameter
2hp, 230 v, 8.5 A, 1500 rpm;
Ra = 2.45 ohm, La = 0.035 H, Kb = 1.0 v/(rad/sec), J = 0.022 kg-m2/rad,
B = 0.5 * 10-3 N-m/(rad/sec).
ðHðsÞÞ=ðvðsÞÞ ¼ 1:0=ð0:00077s^ 2 0:0539s^ 1 þ 1:441Þ: ð8Þ
Tuning of PID Controller Using Ziegler–Nichols Approach
The block diagram shown in Fig. 2 illustrates a closed-loop system with a PID
controller in the direct path, which is the usual connection. The system’s output
should follow as closely as possible the reference signal (set point) [4, 5].
The tuning of a PID controller consists of selecting gains Kp, Ki, and Kd so that
performance specifications are satisfied (Table 1). By employing Ziegler–Nic-
hols’s method for PID tuning [6, 7] those gains are obtained through experiments
with the process under control. Controller tuning involves the selection of the best
values of Kp, Ki, and Kd. PID gain values after simulation is given in Table 2,
(Fig. 3).
Tuning of PID Controller Using Genetic Algorithm Approach
Genetic algorithm (GA) is a heuristic mimicking the natural evolution process and
is routinely used to generate useful solutions to optimization problems. In this
paper, the genetic algorithm is used to derive the PID controller parameters. In GA
[6, 7], a population of strings called chromosomes, encodes the possible solutions
of an optimization problem and evolves for a better solution by process of
reproduction (Fig. 4).
The process of evolution starts from a population of randomly generated
individuals. Optimization is achieved in generations where in each generation, the
fitness function evaluates each individual in the population and multiple individ-
uals are selected stochastically based on their fitness. These selected individuals
are modified to form a new population. The algorithm terminates when either a
PID Controller Tuning Using Soft Computing Techniques 281
Table 1 Recommended PID Types of controller Kp (Ker) Ti Td
value setting
P 0.5 0 0
PI 0.45 (1/1.2) Per 0
PID 0.6 0.5 Per 0.125 Per
Table 2 PID values Kp Ki Kd
18 6.3223 12.811
Fig. 3 Closed-loop step
responses for DC shunt motor
Fig. 4 Genetic algorithm
process flowchart
282 N. P. Adhikari and A. Gupta
maximum number of generations has been produced, or a satisfactory fitness level
has been reached for the population [8]. The various steps in GA-based optimi-
zation are detailed below:
Initialization
From the initial population few individual solutions are generated. The population
is generated randomly, covering the entire range of possible solutions.
Selection
In each generation, individual solutions are selected by evaluating the fitness
function and the fitter solutions have a higher probability of selection.
Reproduction
Next set of population for the successive generation is generated by a process
called reproduction and involves crossover (recombination) and mutation. These
results in a new set of population derived from the fitter solutions of the previous
population. Generally the average fitness of the population is heightened as
compared to the population of the previous population.
Termination
The process of optimization is halted once a termination condition is achieved. The
termination condition can be either the number of generations or the solution
satisfying an optimum criterion [9].
Implementation of GA Controller
GA can be applied to the tuning of PID position controller gains to ensure optimal
control performance at nominal operating conditions [10, 11]. The Genetic
Algorithm parameters chosen for the tuning purpose (Table 3, Fig. 5).
PID Controller Tuning Using Soft Computing Techniques 283
Table 3 Parameters of GA GA property Value/method
Population size 80
Fitness function MSE
Selection method Geometric selection
Crossover method Arithmetic
Number of crossover points 3
Mutation method Uniform mutation
Mutation probability 0.01
Fig. 5 Position control using
genetic algorithm
Fig. 6 Comparison of GA
and ZN technique
Analysis of Result
All the conventional methods of controller tuning lead to a large settling time,
overshoot, rise time, and steady-state error of the controlled system. Hence a soft
computing techniques are introduced into the control loop. GA-based tuning
methods have proved their excellence in giving better results by improving the
steady-state characteristics and performance indices (Fig. 6, Table 4).
284 N. P. Adhikari and A. Gupta
Table 4 Comparison of results
Tuning method Rise time (s) Maximum overshot Settling time (s)
Ziegler Nichols 0.18 1.08 2.41
Genetic algorithm 0.161 1.01 0.7
Conclusion
The GA algorithm for PID controller tuning presented in this research offers
several advantages. The errors resulting from model reduction are avoided. It is
possible to consider several design criteria in a balanced and unified way.
Approximations that are typical to classical tuning rules are not needed. Soft
computing techniques are often criticized for two reasons: algorithms are com-
putationally heavy and convergence to the optimal solution cannot be guaranteed.
PID controller tuning is a small-scale problem and thus computational complexity
is not really an issue here. It took only a couple of seconds to solve the problem.
Compared to conventionally tuned system, GA tuned system has good steady-state
response and performance indices.
References
1. Ogata K (1987) Discrete-time control systems. University of Minnesota, Prentice Hall
2. Soltoggio A (2005) An enhanced GA to improve the search process reliability in tuning of
control systems. In: Proceedings of the 2005 conference genetic and evolutionary
computation, GECCO’05, Washington, pp 2165–2172
3. Chen QG, Wang N (2005) The distribution population-based genetic algorithm for parameter
optimization PID controller. Acta Automatica Sinica 31:646–650
4. Astrom K, Hagglund T (1995) PID controllers: theory, design and tuning. Instrument Society
of America. Research triangle park, NC
5. Chowdhuri S, Mukherjee A (2000) An evolutionary approach to optimize speed controller of
dc machines. In: Proceedings of IEEE international conference on industrial technology, Cilt
2, 682–687
6. Chambers L (1999) Practical handbook of genetic algorithms: complex coding systems.
CRC, Boca Raton
7. Pelczewski PM, Kunz UH (1990) The optimal control of a constrained drive system with
brushless dc motor. Ind Electron IEEE Trans on 37(5): 342–348
8. Goldberg DE (1989) Genetic algorithms in search, optimization and machine learning.
Addison-Wesley Pub. Co, Boston
9. Chipperfield AJ, Fleming PJ, Pohlheim H, Fonseca CM (1994) A genetic algorithm toolbox
for MATLAB. In: Proceedings international conference on systems engineering, coventry,
UK, 6–8 Sept 1994
10. Kristinsson K, Dumont GA (1992) System identification and control using genetic
algorithms. Syst Man Cybern IEEE Trans on 22(5): 1033–1046
11. Mahony TO, Downing CJ, Fatla K (2000) Genetic algorithm for PID parameter optimization:
minimizing error criteria. Proc Control Instrum 2000: 26–28