Speed Control for DC Motor Drive based on Fuzzy and Genetic PI Controller – A Comparative Study

A Proportional–Integral (P-I) controller is a generic control loop feedback mechanism, which is widely used in industrial control systems due to that its structure is simplex and it can almost ensure zero error in steady-state when its gains are properly tuned. A PI controller calculates an ‘error’ value as the difference between the desired set point and the measured output process variable. The conventional PI controller has fixed gains and is based on the mathematical model of the system being controlled. Moreover, a disadvantage of the conventional PI controller is that for optimum output quality and performance (overshoot, rise time and settling time), the controller gains must be tuned according to the nature of the system. Unfortunately, it has been quite difficult to tune the gains properly of PI controllers because many industrial plants are often burdened with problems such as high order, time delays and nonlinearities [1]. An alternative method for the speed control of a DC motor is based on fuzzy logic controller (FLC). While conventional controllers depend on the accuracy of the system model and parameters, FLCs use a different approach. Instead of using a system model, the operation of a FLC is based on heuristic knowledge and linguistic description [2]. The advantage of fuzzy control is that it can integrate the knowledge of anthropologists into the design process of controllers, without the need of the design process of controllers, without the need of accurate mathematical models [3]. However, building a FLC from a ground-up may not provide good results or sometime even a worse result than a conventional controller if there is not enough knowledge of the system. Therefore, the performance of a FLC can be improved by adjusting the rules, scaling coefficients and membership functions [4]. GA is a stochastic global adaptive search optimization technique based on the mechanisms of natural selection. In recent years, GA has been recognized as an effective and efficient technique to solve optimization problems compared with other optimization techniques [5]. A controller is decomposed into a set of parameters, which the GA attempts to optimize by using simulation based fitness evaluation of candidate controllers in the closedloop systems [6]. This study applies genetic PI control to design a fastresponse controller and improve traditional PI controllers with poorer response. The results of applying the genetic PI controller to the DC motor drive system have been compared to those obtained by the application of a fuzzy controller. The computer simulation results show that the genetic PI controller provides improved dynamic performance than the fuzzy controller. It is also observed that the genetic PI controller shows better transient performance when the system parameters are changed.


Introduction
A Proportional-Integral (P-I) controller is a generic control loop feedback mechanism, which is widely used in industrial control systems due to that its structure is simplex and it can almost ensure zero error in steady-state when its gains are properly tuned.A PI controller calculates an 'error' value as the difference between the desired set point and the measured output process variable.The conventional PI controller has fixed gains and is based on the mathematical model of the system being controlled.Moreover, a disadvantage of the conventional PI controller is that for optimum output quality and performance (overshoot, rise time and settling time), the controller gains must be tuned according to the nature of the system.Unfortunately, it has been quite difficult to tune the gains properly of PI controllers because many industrial plants are often burdened with problems such as high order, time delays and nonlinearities [1].An alternative method for the speed control of a DC motor is based on fuzzy logic controller (FLC).While conventional controllers depend on the accuracy of the system model and parameters, FLCs use a different approach.Instead of using a system model, the operation of a FLC is based on heuristic knowledge and linguistic description [2].The advantage of fuzzy control is that it can integrate the knowledge of anthropologists into the design process of controllers, without the need of the design process of controllers, without the need of accurate mathematical models [3].However, building a FLC from a ground-up may not provide good results or sometime even a worse result than a conventional controller if there is not enough knowledge of the system.Therefore, the performance of a FLC can be improved by adjusting the rules, scaling coefficients and membership functions [4].
GA is a stochastic global adaptive search optimization technique based on the mechanisms of natural selection.In recent years, GA has been recognized as an effective and efficient technique to solve optimization problems compared with other optimization techniques [5].A controller is decomposed into a set of parameters, which the GA attempts to optimize by using simulation based fitness evaluation of candidate controllers in the closedloop systems [6].
This study applies genetic PI control to design a fastresponse controller and improve traditional PI controllers with poorer response.The results of applying the genetic PI controller to the DC motor drive system have been compared to those obtained by the application of a fuzzy controller.The computer simulation results show that the genetic PI controller provides improved dynamic performance than the fuzzy controller.It is also observed that the genetic PI controller shows better transient performance when the system parameters are changed.

Mathematical models of a separately excited dc motor
The equivalent circuit diagram of the separately excited DC motor (SEDM) is shown in Fig. 1.In such a DC motor, the field windings are separately excited from an external dc source [7].Hence, the current in the field windings is independent of the current in the armature windings.The equations describing the dynamic behavior of the SEDM are given by the following equations.The voltage equations of DC motor is expressed in matrix form: where R a , L a are motor armature resistance and inductance, R f , L f are motor field resistance and inductance, V a , V f are armature and field coil voltages, i a , i f are armature and field coil currents, e a is electromotive force (EMF) and P is the differential operator (d/dt) , where k af is the armature-field mutual inductance and ω m is the rotor electrical speed in radian.Solving (1) yields the currents i a and i f , respectively.The developed torque T e is .
In the constant torque region, the speed of a SEDM could be varied from zero to rated speed mainly by varying armature voltage V a , and hence controlling armature current i a in (3).The ω m can be calculated using the mechanical equation expressed in (4) where B m is the frictional coefficient and J m is the moment of inertia of the rotor.
It is learnt from (3) that for a given constant i f , it is only required to control armature current i a in order to control the speed of the motor.The DC motor features under study are listed in Table 1.

Control techniques of SEDM
A. Proportional-Integral (PI) Controller.In control engineering, a PI Controller is a feedback controller which drives the plant to be controlled with a weighted sum of the error and the integral of that value.It is certainly the most commonly used control algorithm in industry.The main reason is its relatively simple structure, which can be easily understood and implemented in practice [6].PI controller can be represented by where i * (t) is the reference armature current required by the motor, K p is the proportional gain, K t is the integral gain and e(t) is the speed error signal between the desired and measured output speed.The speed error signal at t-th instant is given by It can be noticed that the control signal depends on the present value of the error signal as well as its previous values.In the computer simulation of a PI controller, ( 5) becomes where T > 0 is the sampling period.
B. Fuzzy Logic Controller.Fuzzy control is one of the useful control techniques to deal with uncertain and illdefined nonlinear systems.Control actions of the fuzzy controller are realized by running some linguistic rules, which also contribute to a significant interpretability of the controller [8].The design of fuzzy controller generally includes three steps: fuzzification, inference engine and defuzzification [3].These three steps are shown in Fig. 2. Fuzzification converts crisp input variables into fuzzy variables, inference engine library converts these linguistic values into fuzzy sets of fuzzy variables and finally defuzzification is used to convert fuzzy value into identifiable controlled variable for the controlled system

Fig. 2. Block diagram of a fuzzy controller
The process of the controlling the speed of the SEDM is a two-input and single output system.The inputs and the output of the speed controller are: the difference of speed command ω * and actual speed ω, i * (t) is the output of the speed controller, which is the reference armature current for the hysteresis current control.Thus, the speed error e(t) is taken as an input and the change of speed error de(t) as the other input.So, two inputs for every sampling instant are: where T is the sampling period, .(t)and .(t-1)are actual and previous time value, respectively.In this study, three fuzzy sets of N, ZE, P are chosen for e and de and five fuzzy sets of NB, N, ZE, P, PB are chosen for i * , reference current command.Input and output fuzzy sets are symmetrical triangle-type membership functions.The input and output membership functions of the PI fuzzy controller are shown in Fig. 3.a, 3.b and 3.c, respectively.
The value of membership degree μ, for each fuzzy variable ranges between 0 and 1.The speed error, e, for the designed fuzzy speed controller is at the range from -0.05 to 0.05.Yet, error change variable, de, is at the range from -1 to 1 and the range of the output i * , is set between -4 to 4.
The key point for the fuzzy controller is the establishment of the knowledge and the rule base, because they are established according to the experience of expert system [2].Fuzzy rules are a collection of linguistic statements that describe how the fuzzy inference system (FIS) should make a decision regarding classifying an input or controlling an output [9].A rule is expressed with the form of if-then and in this study nine rules are included in the rule base.The control rule table is given in Table 2.According to the rule base given in Table 2, description of a rule in this study can be expressed in the following form: If error is positive (P) and error change is positive (P) then control signal is positive-big (PB).The overall drive system used in this article is composed of a speed controller (genetic PI and fuzzy PI), a hysteresis band current controller, a current limiter and a DC-DC converter.For a PI-type fuzzy controller, because of having scaling problems in fuzzying the integral of the error signal, in the literature applications, error and error change signals are used as controller inputs and in the output, by obtaining the change of the control signal, PI feature is provided to the fuzzy controller [10].Fuzzy PI control system is shown in Fig. 4. In this control strategy, in addition to fuzzy speed controller, a hysteresis current controller is inserted into the system in order to improve the performance of DC motor drive.In a hysteresis current controller (HCC), switching patterns required for DC-DC converter circuit are generated by comparing the actual current being drawn by the motor with the reference current.A positive pulse is generated if the actual current is less than the reference armature current, whereas a negative pulse is produced if the actual current exceeds the reference current [11].Developments in the output quality and performance (overshoot, rise time, and settling time) have been achieved by applying the both control strategy.In the defuzzification process where the output of the fuzzy sets is transferred into identifiable value, the weighted average method is used in (10) where i * is the crisp output of the fuzzy controller, u i is the i-th rule weight and (u i ) is the membership value of the output membership function corresponding to the i-th control rule.

Genetic algorithms
The genetic algorithm is a stochastic global adaptive search optimization technique based on the mechanisms of natural selection.In recent years, GAs have been recognized as effective and efficient techniques to solve optimization problems compared with other optimization techniques because of not requiring to take objective function derivatives and can thus deal with discrete variables and non-continuous objective functions [5,12].Basically, GAs consists of three main stages: Selection, Crossover and Mutation.Selection directs the search of GAs toward the best individual.In the process, strings with high fitness receive multiple copies in the next generation while strings with low fitness receive fewer copies or even none at all.Crossover can cause to exchange the property of any two chromosomes via random decision in the mating pool and provide a mechanism to product and match the desirable qualities through the crossover.Mutation is a form of global search where the genetic information of a chromosome is randomly altered [5].The application of these three basic operations allows the creation of new individuals which may be better than their parents.This algorithm is repeated for many generations and finally stops when reaching individuals that represent the optimum solution to the problem [13]. A. Chromosome Structure and Evaluation Criterion.GAs begin to explore the search space by defining a population of strings or chromosomes.Hence, first of all, the controller parameters, which will be optimized, should be coded into a string-called chromosome.In classical GAs, binary numbers are mainly used [14].However, in this study, real number coding method is chosen in order not to consider how many bits are necessary to accurately represent a coefficient and also to reduce the processing time.The appearance of a chromosome in the population is given in Fig. 5.The chromosome consists of two genes representing the controller parameters K p and K i , respectively.The solution space for the proportional gain K p * is set to the values between 0-40 A/rad/s and the solution space for the integral gain, K i * is at the range 0-10 A/rad.The fitness of each of the chromosomes in the population is calculated using a "fitness function" that characterizes how well each particular member solves the given problem [6].In this study, integral of the square of the error (ISE) is chosen as a fitness function where e represents the errors between the speed reference and the actual output speed and k is the end time for offline iterative computation.The ultimate goal of the use of the genetic algorithm is to achieve a minimal value of the objective function so as to improve the transient and stable response quality [15].

Application of GA for PI Controller Design
During the computer simulations, the PI speed loop is reconstructed using the GA in order to achieve the desirable closed loop characteristics of the system.In this study, the genetic population consists of 8 chromosomes and the algorithm is terminated after 75 generations.The initial population is generated randomly.In each generation, a total of eight controllers (K p and K i pairs) are separately inserted into the DC motor drive system and the fitness values of the corresponding controllers are computed using the performance criteria defined in (11).According to these fitness values, the chromosomes in the population are sorted from the fittest to the worst.To use a 50% discard rate results in discarding the bottom four chromosomes.Then, the four with the highest fitness survive to the next generation and become potential parents to generate child population.These potential parents are selected through tournament selection and four offsprings are produced to replace the discarded chromosomes in the population.After the natural selection process, the crossover and mutation operations are performed.The proposed PI tuning based on GA is schematically shown in Fig. 6.The genetic algorithm parameters used in the simulations are listed in Table 3.

Simulation results
In this study, the gains of a PI speed controller are adjusted employing the off-line iterative GA.Thus, GA determines the controller gains which are the most compatible and provide optimum performance.The results are obtained for cases such as step speed reference 100 rad/s and 50 rad/s under 2 Nm load.Besides, in certain intervals, motor parameters (B m , J m ) are changed and speed responses of all the controllers are observed.A hysteresis bandwidth of 0.3 is chosen.The results of ω response and the armature current waveform relating to the genetic PI controller are given in Fig. 7, when there is a change in reference speed.At t = 0, reference speed is set to 100 rad/s and t = 1 sec, the reference speed is then decreased to 50 rad/s.In Fig. 7.a, the motor speed follows the reference speed with no overshoot.The error between the reference and the actual motor speed in the steady-state is about 0.0183 and its settling time to the reference speeds is approximately 0.36 sec and 0.115 sec, respectively.Fig. 7.b shows the actual motor current following the reference current waveform in the hysteresis band.During the transient periods, current is maintained at 50 A according to the current limiter set and the average current being injected in the steady-state stabilizes at 1.2 A. Fig. 8 shows the performances for the two controllers under variable load condition while the motor is running at 100 rad/s.At first, 10 Nm load is applied to the motor.At t = 1 sec, the load is completely removed from the motor shaft and at t = 1.05 sec, 10 Nm load is applied to the motor again.A comparison for ω responses have been made between the controllers.The responses of the drive system are obtained by setting the reference speed to step 100 rad/s at t = 0.The comparative system responses of the controllers are shown in Fig. 9.
In Fig. 10, the performances of the genetic PI and fuzzy controller are examined by changing the motor parameters while the motor is running under 1.5 Nm.In the simulation, at t = 1 sec, the motor parameters B m and J m are increased 30 and 5 times, respectively.The motor is run for 0.5 sec under this condition and t = 1.5 sec, the parameters are returned to their previous values.The speed responses are seen in Fig. 10.a.During the variation of parameters, the fuzzy controller has led to a larger steadystate error than the genetic PI controller.Hence, it can be easily said that the genetic PI controller is less affected by the parameter changes compared to the fuzzy controller.Fig. 10.b shows the motor armature current for the genetic PI controller.In this condition, the motor has drawn more current to meet the increased torque, which is closer to its rated current.

Fig. 3 .
Fuzzy sets on the universe of discourse for (a) speed error e(t) (b) speed error change de(t) (c) reference current i * (t)

Fig. 4 .
Fig. 4. Fuzzy PI control systems developed in this study

Fig. 6 .
Fig. 6.Block diagram of learning the GA based optimum speed controller for DC motor control drive.

Fig. 7 .
Simulation results for the genetic PI controller under variable speed reference condition (a) speed response (b) reference and actual motor currents.

Fig. 10 .
Fig.11presents distributing situation of the best controller gains in the population during the evolution procedure according to versus generation.Generation 1 shows the random initial gains.At the end of the learning algorithm, best controller gains have been found approximately K p * : 39.1 A/rad/s and K i * : 0.19 A/rad.

Fig. 11 .
Fig. 11.The gain solutions of the best controller according to versus generation (a) proportional gain K p (b) integral gain K i

Table 1 .
Motor features

Table 2 .
Rule base for fuzzy speed controller *Note: e and de are input variables.i * is output variable.

Table 3 .
Genetic Algorithm Parameters