OPTIMAL CONTROL ALGORITHMS FOR SECOND ORDER SYSTEMS

Proportional Integral Derivative (PID) controllers are widely used in industrial processes for their simplicity and robustness. The main application problems are the tuning of PID parameters to obtain good settling time, rise time and overshoot. The challenge is to improve the timing parameters to achieve optimal control performances. Remarkable findings are obtained through the use of Artificial Intelligence techniques as Fuzzy Logic, Genetic Algorithms and Neural Networks. The combination of these theories can give good results in terms of settling time, rise time and overshoot. In this study, suitable controllers able of improving timing performance of second order plants are proposed. The results show that the PID controller has good overshoot values and shows optimal robustness. The genetic-fuzzy controller gives a good value of settling time and a very good overshoot value. The neural-fuzzy controller gives the best timing parameters improving the control performances of the others two approaches. Further improvements are achieved designing a real-time optimization algorithm which works on a genetic-neuro-fuzzy controller.


INTRODUCTION
The quality of control in a system depends on settling time, rise time and overshoot values.The main problem is to optimally reduce such timing parameters, avoiding undesirable overshoot, longer settling times and vibrations.
To solve this problem, many authors have proposed different approaches.A first approach is the Proportional Integral Derivative (PID) controllers application.They are extensively used in industrial process control application.Vaishnav and Khan (2007) designed a Ziegler-Nichols PID controller higher order systems.A tuning method which uses PID controller has been developed (Shamusuzzoha and Skogestad, 2010).Such method requires one closed-loop step setpoint response experiment similar to the classical Ziegler-Nichols experiment.However, in complex systems characterized by nonlinearity, large delay and timevariance, the PID's are of no effect (Cao et al., 2008).The design of a PID controller is generally based on the assumption of exact knowledge about the system.Because the knowledge is not available for the majority of systems, many advanced control methods have been introduced.Some of these methods make use of the fuzzy logic which simplifies the control designing for complex models.As an example Kumar and Garg (2004) designed a fuzzy controller to control a single link manipulator robot.Moreover, a gain tuning fuzzy controller has been designed to monitor the track seeking in optical disks (Huang and Su, 2007).In order to improve the control precision of a ball mill circuit, a fuzzy interpolation algorithm is presented (Cao et al., 2008).Moreover, PID fuzzy controllers can be designed as power system stabilizer (Corcau and Stoenescu, 2007).
The design of a fuzzy controller depends on the choice of membership functions.A natural choice through trial and errors procedures is impossible to obtain, overall for complex systems.In these situations, a huge computational time is necessary.In order to overcome such difficulty, Genetic Algorithms (GA) are applied to fuzzy controllers with good results (Khan et al., 2008;Kumar and Garg, 2004;Chegeni et al., 2007;Pelusi, 2011c).Such genetic methods are useful approaches for problems that require efficient searching.Khan et al. (2008) the membership functions and the fuzzy logic rules were optimized through Genetic Algorithms methods for a temperature control system.Thanks to GA, Leng et al. (2006) eliminated the limitation on symmetric membership functions and symmetric fuzzy rules.To achieve better control performances of complex systems, neuro-fuzzy techniques are developed.These two techniques match the capability of modelling a problem using the knowledge with the capability to learn from data.A neural-fuzzy network can self-adjust the parameters of rule base using neural-network-based learning algorithms.In the literature, a datadriven adaptive neuro-fuzzy controller has been designed for the water-level control of U-tube steam generators in nuclear power plants (Munasinghe et al., 2005).Moreover, in (Allaoua et al., 2009) a neuro-fuzzy controller has been designed to control the DC motor speed.

JCS
Many authors have proposed suitable combinations of fuzzy, genetic and neural techniques for different applications (Leng et al., 2006;Saridakis et al., 2006;Cho, 2002).In this way, hybrid intelligent algorithms have been developed.For example, a hybrid algorithm based on a genetic algorithm to design a neuro-fuzzy network is proposed in (Leng et al., 2006).In such work, the model has been built for a system without a priori knowledge about the partitions of input space and the number of fuzzy rules.Akbarzadeh et al. (2000) hybrid paradigms are successfully implemented to solve three prominent robot control issues.Handwritten digit recognition can be solved through combining methods of neural networks (Cho, 2002).The proposed hybrid method uses some fuzzy concepts to combine the outputs of separate networks which relevance is assigned by GA.Good solution for real-time crack identification systems is described in (Saridakis et al., 2006).In this work, the analytical model is approximated with a neural network which is used to solve the inverse problem of the crack identification.A genetic search method produces values for the crack attributes as input arguments to the neural network and the genetic algorithm objective function relies on a fuzzy logic representation.Recent studies (Pelusi, 2011a;2011b;2012) have proposed geneticneuro-fuzzy techniques able to improve the timing performances of second order control systems.
The aim of this study is to achieve an optimal control performance of industrial actuators designing suitable controllers.Four research guidelines are considered.The first one regards the design of a PID controller based on Ziegler-Nichols tuning formula (Xue et al., 2007).Ziegler and Nichols presented two methods: the step response method and the frequency response method (Astrom and Hagglund, 2004).The first method is presented in this work and it is applied to three different plants.Our second approach attempts of improving the PID timing results designing a fuzzy controller optimized through GA techniques.The optimization is initially made on membership functions only, subsequently, with the same genetic procedure, is made on fuzzy rules.The design of a suitable neuro-fuzzy controller which improves the performances of geneticfuzzy controller is the third approach of our model.To further improve the settling time and rise time values, a suitable real-time optimization algorithm is designed.Such algorithm works on a suitable genetic-neuro-fuzzy controller.The target of these different approaches is also to improve the simulation results shown in (Khan et al., 2008).

Tuning Parameters of PID Controller
The PID controllers have a wide range of applications in industrial control because of their simple control structure.The PID controllers need of less plant information than a complete mathematical model.In this way, the controller parameters can be adjusted with a minimum of effort.One survey of Desborough and Miller (2002) indicates that more than 97% of regulatory controllers utilize the PID algorithm.
There are many versions of a PID controller.In this study, we consider a controller described by Equation (1): e( )d T T dt where, u(t) is the input signal sent to the plant model, e(t) = r(t)-y(t) the error, y(t) the output and r(t) is the reference input signal.The parameters K p , T i and T d are the tuning parameters.There are more ways to obtain the tuning values of K p , T i and T d : our PID controller uses the Ziegler-Nichols tuning formula.The tuning formula is obtained when the plant model is given by a first-order plus dead time which can be expressed by Equation 2: A huge variety of plants can be approximately modeled by (2).If the system model cannot be physically derived, experiments can be performed to extract the parameters for the approximate model (2).For instance, if the step response of the plant model can be measured through an experiment, the output signal can be recorded and the parameters k, L and T (or a, where a = kL= T) can be extracted (Xue et al., 2007).The proposed PID controller is designed to control some second order control Science Publications

JCS
systems.In order to verify the robustness of the model, we consider three plants with different transfer functions.The first one is typically used to approximate the working of DC motors (Khan et al., 2008) and has the form Equation 3: The second transfer function (Equation 2) is used for processes with first order dynamics with time delay Equation 4 (Amini, 2008): The third transfer function (Equation 5) is joined to the attempts of many researches of improving the tuning parameters through intelligent techniques (Meza et al., 2009): The Fig. 1 shows the block diagram of PID controller.The difference between the step and the output feedback is passed as input into PID controller block.Such block contains MATLAB functions which implement the Ziegler-Nichols tuning formulas (Xue et al., 2007).
The output of the PID controller block serves as an input to the transfer function block.We consider the PID controller behavioral for different plants defined by ( 3), ( 4) and ( 5) whereas the intelligent controllers are designed only for second order plants with transfer function (3).

Design of Genetic-Fuzzy Controller
In order to improve the timing performances of designed PID controller, suitable genetic procedures are used.
Generally, the first step to design a fuzzy system is the choice of the number of input/output membership functions.Assuming all possible rules are used (which is often the case), if the membership functions number increasing, then the number of rules grows exponentially.It needs to avoid this situation because it is very important trying to minimize the time to compute the fuzzy controller outputs given some inputs.Some studies (Chopra et al., 2005) deal with the design of fuzzy logic controllers with less number of rules leading to a smaller amount of computational time.The designed fuzzy controller has two inputs: the error e, that is the difference between the reference value and the output of controller and the change in error de, that is the difference between the error at time t and that one at t-1.
These inputs have seven membership functions: Negative Big (NB), Negative Medium (NM), Negative Small (NS), Zero Error (ZE), Positive Small (PS), Positive Medium (PM), Positive Big (PB).The fuzzy output has the same membership functions of fuzzy inputs.Analyzing the findings of (Chopra et al., 2005), we define the rules of Table 1.During the rules designing process, we have discovered that increasing the fuzzy rules beyond 49 rules is useless.In fact, this procedure increases the complexity of fuzzy logic controller and has no positive effects on output response of the system.
The Fig. 2 shows the block diagram of fuzzy controller.The difference e between the step and the output feedback is passed as an input into fuzzy logic controller together to the change in error de.The output of the fuzzy logic controller serves as an input to the transfer function block.The membership functions parameters are optimized through a search algorithm based on GA.This technique assures that at least a good local optimum can be discovered.Because GA are based on the survival principle of the fittest, it is necessary to establish a fitness function which provides a performance measure of tuning parameters.Such function can be expressed through the Equation 6 and 7: Where: and n is the number of iterations.In this way, the error e is reduced at minimum.The variables to optimize are four for the first and seventh membership function (trapezoidal functions) and three for the others five membership functions (triangular functions).Because there are two fuzzy inputs and one fuzzy output with seven membership functions, the number of variables to optimize is 69.The optimization algorithm works as follows: Step 1: Initialize the variables to optimize.
Step 2: Compute randomly the slope parameters and establish the termination criteria.
Step 3: If it is achieved the termination criteria, the genetic procedure is stopped and go to Step 6.
Step 6: Print the optimal values of slope parameters.
After 20 generations, the optimal fuzzy sets of Fig. 3-5 are obtained.The optimized fuzzy controller uses the Mamdani inference method and the centroid defuzzification technique.Many authors (Khan et al., 2008;Kumar and Garg, 2004;Chegeni et al., 2007;Pelusi, 2011b) have proposed GA techniques to achieve optimal fuzzy rules.Therefore, the above optimization algorithm is also used to find the fuzzy rules with the higher weight.In fact, to improve the control, it is very important discovering the rules which give the smallest timing control parameters.For this task, we consider the (7) as fitness function and apply the described optimization algorithm.

Neural Networks Application
In order to improve the control performances of genetic-fuzzy controller, a suitable optimization of fuzzy rule is proposed.For this task, we consider a data-driven intelligent controller based on adaptive features.A neural-fuzzy network can self-adjust the parameters of the fuzzy rules using neural-based learning algorithms.Our idea is to tune the rules weights considering the rules that give good timing performances.The fuzzy rules weights are tuned with the constraint of achieving small values of settling and rise time.Our control system has self-tuning capabilities and requires an initial rule base (Table 1) to be specified prior to training.
Generally, the design of neural networks for specific applications is a test and error process.This process sometime depends mainly on previous experience in similar applications.Moreover, the performances and the cost of a neural network are joined to neurons number, net architecture and learning algorithms.Some works (Fiszelew et al., 2007;Chad, 2005) are focused in the development of methods for the evolutionary design of architectures to search optimal configurations of neural networks.
Among the main training techniques there is the backpropagation algorithm.This training procedure is used in many applications (Amini, 2008;Chang and Shih, 2002).Back-propagation involves minimization of an error function which is accomplished by performing gradient descent search on the error surface.
In order to define the layers number and the neurons number for each layer, trial and error procedures are used.The designed neural network has three layers: the first one has 2 neurons (equal to inputs number), the hidden layer has 7 neurons and the output layer has 49 neurons (Fig. 6  A single presentation of all input vectors to the network is defined as training epoch.The network is then updated according to the results of all the presentations.Training occurs until a maximum number of epochs occurs or the performance goal is met.After 150 epochs and with a goal of 0.05, the performance of neural network is 0.0820087 (Fig. 8).
The block diagram of neuro-fuzzy controller is showed in Fig. 7.The inputs e and de are sent to the trained neural network which gives the optimal weights for the 49 fuzzy rules.Such tuning parameters are passed to the fuzzy controller together with the error signal e and the change in error de.The output of fuzzy controller tunes the second order plant G 1 (s).The difference between the signal reference and the output feedback is passed as an input to the neural network and fuzzy controller.The process restarts with the calculation of new values of the error and change in error.

Real-Time Optimization Algorithm
The genetic fuzzy controller works on a run time optimization algorithm described before.The new idea is to design a real-time optimization algorithm taking into account time computer problems.To accomplish such task, genetic techniques are again used.
The intelligent procedure performs a stochastic search via iteratively processing populations of solutions in according to fitness.In control applications, the fitness is usually depending on performance measures as settling time and rise time.To design our real-time algorithm, we define the fitness function f as expressed in equation 10: , where n is the number of iterations.
The goal is to reduce the quantity x at minimum, where x is the sum of square errors.The Fig. 9 shows the block diagram of control system.In order to evaluate the timing performance of structure, we consider the step response of system.The difference between the step and the output feedback is sent to the input of genetic-neurofuzzy controller together with the change in error computed by change in error block.Such inputs serve as inputs to the trained neural network which gives the optimal weights of fuzzy rules.At the same time, the GA block gives the optimal MF scaling parameters for given inputs.The output of fuzzy logic controller drives the second order plant defined by (3).The novelty of this approach is the real-time optimization of MF and weights using respectively GA and NN.The steps of our real-time optimization algorithm are the following: Step 1: Initialize the MF scaling parameters.The number of parameters is 69.The population number is 100 and the number of generation is 20.A population of problem solutions is expressed in the form of chromosomes, i.e., strings encoding problem solutions.
Step 2: Define the range of each MF scaling parameter.This is a delicate phase because there could be undesirable overlapping.Subsequently, compute randomly the scaling parameters and establish the termination criteria.

Simulation Results
The designed controllers are simulated through the MATLAB.The simulation results for different plants of PID controller are shown in Table 3.Our PID controller improves the rise time and the overshoot of (Khan et al., 2008).In fact, the rise time of conventional PID controller in (Khan et al., 2008) is 0.371s, whereas the PID controller here designed has rise time equal to 0.118s.Moreover, the overshoot of (Khan et al., 2008) is 0.6748, whereas our PID controller gives a value of 0.223.The step response of PID controller with plant defined by ( 3) is shown in Fig. 13.Moreover, the controller has shown good robustness performances changing the plant parameters.In Table 3 are shown the settling time, rise time and the overshoot values of control system for the three different plants G 1 (s), G 2 (s) and G 3 (s).The step response is respectively shown in Fig. 13-15.
The genetic-fuzzy controller with optimized MF has better t s and t r than fuzzy logic PD controller in (Khan et al., 2008).In our work, the settling time is 0.699s versus a value of 0.8735s of fuzzy logic PD controller designed in (Khan et al., 2008).Comparing the results, we can note that the rise time has an improvement of above 45% percent respect to (Khan et al., 2008).The geneticfuzzy controller also gives a settling time better than our PID controller (considering G1(s) as transfer function) and zero overshoot.The improvements can be deduced observing PID and genetic-fuzzy controllers step response (Fig. 13-16).We remind that the genetic fuzzy, neuro-fuzzy and genetic-neuro-fuzzy controllers are applied on plants with transfer function defined by (3).
Better timing results are achieved optimizing the fuzzy rules through the run-time optimization algorithm..The optimization of rules weights shows that there are five more relevant rules (Table 4).These rules have weight greater than 0.9.We can note that with error e equal to NB and NM and for all de values, the fuzzy rules are characterized by weights less equal than 0.9.Moreover, with e = ZE there are not relevant rules.The genetic fuzzy controller with optimal rules improves the timing values of fuzzy controller with optimal membership functions.In fact, the settling time is 0.436s, versus the value of 0.699s of genetic fuzzy controller with only optimal membership functions.Moreover, also the value of t r is improved from 0.385s to 0.241s.
Thanks to the constraints (8) and ( 9) defined in the neuro-fuzzy controller with t sbest = 0.699s and t rbest = 0.385s, the genetic-fuzzy controller results are improved.In fact, the adaptive neuro fuzzy approach gives a settling time of 0.423s and a rise time of 0.234s.The step response of neuro-fuzzy controller is shown in Fig. 17.
Further improvements are achieved defining a realtime optimization procedure.The designed genetic-neurofuzzy controller works in according with the real-time optimization algorithm described before.Because such algorithm adopts Fuzzy Logic, Genetic Algorithms and Neural Networks techniques which run at the same time, computational cost must be considered.We simulate our controller through the MATLAB software and run the optimization algorithm on a 2.5GHz CPU speed computer.The algorithm yields the optimal parameters after about 10 h time computer.This is due to the fact that the variables to optimize are 69 and that GA and NN work together.Moreover, the convergence of the algorithm depends on the amplitude of optimization parameters ranges.

JCS
Some time computer problems come from fuzzy rules number of the controller.Such number depends on the membership functions number of each fuzzy input.In order to increase the precision of system, a MF number greater than 7 has been considered.However, the results show that increasing the MF number do not improve the controller performances.The optimal membership functions of inputs and output are shown in Fig. 10-12.We can note that there are different slopes for each membership function.We underline that the first membership function and the seventh one are characterized by trapezoidal shape.The first membership function of change in error fuzzy input tends to assume a triangular shape rather than trapezoidal one (Fig. 11).From the observation of Fig. 12, we deduce that the middle membership functions of output (NS, ZE, PS) are narrow.This means that near the zero, the output value must be evaluated more exactly than others output values.
Let <e: de; o> be the fuzzy rule with e and de as inputs and o as output.The optimization results of the fuzzy rules via Neural Networks show that the more relevant rule, i.e., the rule with the greatest weight, is <PB: NS; PS>.Such rule shows a weight value equal to 1. Viceversa, the rule <PB: ZE; PM> assumes zero value.Three rules have weight less than 0.504, whereas the other ones have weights that lie between 0.504 and 0.777 (Table 2).
The Fig. 18 shows the step response of the geneticneuro-fuzzy controller.We can note that the overshoot is equal to zero, therefore some results of (Khan et al., 2008) are improved.In fact, in (Khan et al., 2008) the optimized fuzzy logic PD controller yields a not zero overshoot value.However, the main designing problem of the control systems is to reduce the rise time.Sometime, the huge reduction of the rise time causes high overshoot values (Khan et al., 2008).The timing results obtained using the real-time optimization algorithm are shown in Table 5, where GFC is Genetic Fuzzy Controller, NFC is Neuro Fuzzy Controller and GNFC is Genetic Neuro Fuzzy Controller.Comparing our results with the previous ones, we can note that there are improvements.In fact, our controller yields a settling time equal to 0.276s versus a value of 0.423s obtained with a run-time algorithm.Moreover, the rise time is reduced from 0.234s to 0.153s.Finally, the real-time optimization algorithm assures an improvement of 35% of control performances.
The good values of settling and rise times given by the optimized controller in (Khan et al., 2008), are obtained at the expense of overshoot value.The optimized fuzzy logic PD controller shows a settling time equal to 0.2526s and a rise time equal to 0.1559s with a not equal zero overshoot.Therefore, the other significant result of our research is that with zero overshoot, also settling time and rise time of optimized controller in (Khan et al., 2008) are improved (Table 5).
Finally, by comparing the results of control systems performances, we conclude that the geneticneuro-fuzzy and neuro-fuzzy controllers produces a more desirable performance when compared with PID and genetic-fuzzy controllers.

CONCLUSION
Different approaches have been presented for the control of second order plants.The first approach employs a PID controller based on Ziegler-Nichols tuning technique to control second order systems.The designed PID controller gives good results in terms of rise time.In fact, the simulations shown a value of t r = 0.118s.Moreover the controller has shown a good robustness considering the plant parameters changing.In order to improve the overshoot and the settling time, a fuzzy controller with optimized membership functions is designed.This optimization is accomplished through the application of genetic procedures.The genetic-fuzzy controller gives a good value of settling time and a very good overshoot value.Better results are obtained applying the optimization algorithm also to optimize the fuzzy rules.Another approach is based on the construction of data-driven intelligent controllers able to adjust the weights of fuzzy rules.This task is accomplished through the neural networks application.The neural-fuzzy controller gives good timing parameters improving the control performances of the others approaches.Taking into account the real-time optimization of membership functions with the best weights given by trained neural network, the best settling time and rise time values are achieved.The goodness of such results is obvious if settling time t s = 0.276s and rise time t r = 0.153s values are compared with those ones in (Khan et al., 2008).In other words, the simulation results show that the proposed approaches improve the control performance of conventional PID and fuzzy logic PD controllers.
The next task will be the application of genetic-fuzzy, neuro-fuzzy and genetic-neuro-fuzzy controllers to plants defined by (4) and (5).To reduce the computational time for the real-time optimization, fuzzy rules with low weight will be identified and removed to make fuzzy controller more compact and transparent.Another task will be design a suitable training sample to improve the training phase of the neural network.A further improvement will consist of optimizing the weights of the neural networks through Genetic Algorithms.Our attempt will be improving the training phase to achieve optimal neural networks.
A future challenge will be the application of the proposed skills on simulators for drum boiler (Prego and Seisdedos, 2011).

Fig. 2 .Fig. 3 .
Fig. 2. Fuzzy controller blocks diagram ).The training technique used is backpropagation.The network has been designed through Neural Network Toolbox of MATLAB.Difficult task is the definition of a suitable training set.The training sample of our neural network is characterized by the inputs e and de and 49 rules weights values.The training set is obtained as follows.The error e, the change in error de and the weights are randomly generated and sent to the genetic-fuzzy controller.The weights values with settling and rise time less than the best timing values of genetic-fuzzy controller are extracted.Formally Equation 8 and 9

Table 3 .
Settling time and rise time of PID controller for

Table 4 .
Fuzzy rules with weight greater than 0.9

Table 5 .
Timing performance of PID controller, genetic-fuzzy Science Publications JCS Fig. 18.Step response of Genetic-Neuro-Fuzzy controller