Optimization of control parameters for servo hydraulic systems using genetic algorithms V V r Zeljko SITUM, Zoran CIKOVIC Abstract: The dynamic characteristics of an electro-hydraulic servo-system are complex and highly nonlinear and, these features significantly add uncertainty to the controller design procedure. Therefore, it is a demanding task to obtain a precise mathematical model of controlled hydraulic drives. In this work, the PID controller parameters have been optimized using Genetic Algorithm (GA) for the position control task of a single-rod hydraulic cylinder. To demonstrate the effectiveness of the control algorithm the experiments have been performed and evaluated on the laboratory model for translational motion control. Keywords: optimal control, genetic algorithms, electro-hydraulic system, position control ■ 1 Introduction Electro-hydraulic servo systems (EHSS) have been used in a wide number of industrial applications due to their small size-to-power ratio and the ability to apply very large force and torque. However, it is well known that controlled hydraulic systems exhibit a significant nonlinear behaviour. Nonlinear valve flow-pressure characteristics, variations in control fluid volume due to piston motion and associated stiffness, control input saturation and valve overlap, besides there may be other unknown factors such as the parameters uncertainty, the unmo-delled dynamics, the external disturbance and leakage that cannot be modelled exactly etc. Consequently, this fact must be seriously considered when we design the controller which can achieve the requirements of process control. Željko Šitum, Ph.D., full professor, Zoran Cikovič, Univ. Bacc.Ing.Mech., University of Zagreb, Faculty of Mechanical Engineering and Naval Architecture, Zagreb, Croatia Thus, the conventional approach to the control of hydraulic drives mainly based on the linearization of the system around an operating point (typically for a null valve spool position, a nominal loading and actuator mid-stroke position) may not guarantee satisfactory control performance for high precise motion when the operating condition of the system changes. Due to the existing limitations of classical controllers, the idea of using control strategies that have the ability to cope with changing system parameters, such as the adaptive control algorithms, the variable structure control methods, or modern control techniques based on fuzzy logic has been developed [1-4]. Control techniques that can provide the required features in spite of significant non-linearities and uncertainties of the system, are essential for successful operation of high-performance hydraulic systems. In this work genetic algorithms (GA) are applied to optimize PID controller gains to control an electro-hydraulic servo cylinder drive. The GA is a direct search optimization technique which is based on the mechanics of biological evolution. It is shown that, by using minimum information specific to the system, near-optimal values of the controller gains can be obtained. The optimized gains are confirmed by a plot of the fitness distribution defined in this study, which represents the control performance of the system within the search space. The article is accompanied with some typical experimental results obtained during the system testing. ■ 2 Experimental system description The experimental system for tran-slational motion control is shown in Figure 1. It consists of two hydraulic cylinders: a main cylinder (l) shown in the left part of the figure, which represents the main servo system and a load cylinder (2) shown in the right part of the figure, which represents the disturbance simulation system. Motion control of the main cylinder is achieved by using a three-way proportional directional control valve (5), (Bosch-Rexroth, model 4WRA-E-6-07) with integrated electronics and ±10 V analogue input signal. The disturbance is generated by using a solenoid valve 1-Main cylinder, 2-Load cylinder, 3-Linear encoder, 4-Pressure sensor, 5-Proportional control valve, 6-Sole-noid valve, 7-Throttle valve, 8-Pressure control valve, 9-Pressure gauge, 10-Hydraulic accumulator, 11-Shut-off valve, 12-System pressure relief valve, 13-Upload valve, 14-Pressure filter, 15-Check valve, 16-Return flow filter, 17-Electric motor, 18-Gear pump, 19-Electronic interface, 20-DC power supply unit, 21-Control computer with data acquisition/ control card (a) Figure 1. Eiectro-hydrauHc system, a) photo, b) schematic diagram (6) and a load cylinder which is able to generate a reaction force in respect of the main cylinder motion direction. This force is equivalent to the product of the piston's area and the controlled pressure which is generated by using a pressure control valve (8). The hydraulic power is provided by a hydraulic gear pump, (ViVoil, model KV-1P), with a maximum rate of 3.7 l/min and maximum nominal pressure of 25 MPa. The oil pump is driven by a single-phase electrical motor (12), 1.1 kW at 1380 rpm. The piston position of the main cylinder along its stroke is measured by using a displacement encoder (3), (Festo, type MLO-POT-300-LWG), with a resolution of 0.01 mm, which is attached to the actuator. The measured signal from the encoder is used for the realization of a control algorithm for the main servo system. Two pressure transducers (4), (Siemens, type 7MF1564), with output 0-10V, are added to measure cylinder pressures. The experimental test rig can also be used to demonstrate the working principle of conventional hydraulic system. In that case the proportional valve should be replaced with another directional control valve and a throttle valve (7) using flexible hydraulic pipes. Data acquisition of the system is handled by a NI DAQCard-6024E in conjunction with the Matlab/Simu-link/Real-TimeWorkshop® platform. ■ 3 Genetic algorithm based control The genetic algorithm (GA) is an adaptive heuristic global search/ optimization technique that copies the basic principles of the biological evolution and natural selection [5]. This principle is similar to competition among individuals for scanty resources in nature where the individual that has better survival traits will survive for a longer period of time. GA uses the process like selection, crossover and mutation to evolve a solution to a problem. GA performs a series of operations on a population of potential solutions by applying the principle of survival of the fittest to hopefully produce successively better approximations of the solution. In each generation a new set of approximations is created by the process of selecting individuals according to their level of fitness in the problem domain and breeding them together using operators borrowed from natural genetics [6]. This process leads to the evolution of populations of individuals that are better suited to their environment than the individuals that they were created from. Individuals are usually encoded as strings of numbers, called chromosomes that hold possible solutions for a given optimization problem. Most commonly used representation in GAs is the binary string or vector although other representations can also be used. The search process operates directly on this encoding of the decision variables rather than the parameter value themselves. It also uses objective function information without any gradient information. To assess the performance of the individuals they have to be decoded first. The performance of the strings, often called fitness, is then evaluated by using an objective function, representing the constraints of the problem. That way, the fitness function establishes the basis for selection of individuals that will be paired during reproduction and the process continues for different generations. The selection process is mainly responsible for assuring survival of the best-fit individuals. Highly fit solutions are given more opportunities to reproduce, while less fit individuals have a low probability to survive and produce offspring. Crossover and mutation are two basic operators of GA. Genetic operators manipulate the characters (genes) of the chromosomes directly and performance of GA very depends on them. The recombina- function GA n'n i = 0 initialize random population of PID parameters P(i) evaluate every individual, i.e. set of parameters in P(i) while (termination condition is not true) do begin i = i + 1 select best individual from population P(i - 1) reproduce pairs of individuals to generate P(i) execute mutation operator if necessary evaluate every individual in P(i) end return (individual with best set of parameters) end Figure 2. A pseudo-code outline of the genetic algorithm tion operator (crossover) is used to exchange genetic information between pairs, or larger groups of individuals and the mutation is viewed as a background operator to maintain genetic diversity in the population and prevents the algorithm to be trapped in a local minimum. It ensures that the probability of searching a particular subspace of the problem space is never zero. GA does not necessarily guarantee that the global optimum solution will be reached, although experience indicates that they will give near-optimal solutions after a reasonable number of evaluations. It provides a number of potential solutions to a given problem and the choice of final solution is left to the user. GA differs substantially from more traditional search and optimization methods. The four most significant differences are [6]: • The GA performs a parallel, random search for the fittest element of a population within the search space, not a single point. Therefore, it has the ability to avoid being trapped in local optimal solution like traditional methods, which search from a single point. • The GA use fitness score, which is obtained from objective func- tions, without other derivative or auxiliary information. • The transition scheme of the genetic algorithm is probabilistic, whereas traditional methods use gradient information. • The GA work on an encoding of the parameter set rather than the parameter set itself (except in where real-valued individuals are used). ■ 4 Optimization method To optimize the parameters of PID controller GA Toolbox for Matlab was used for basic operators like selection, crossover and mutation, but fitness function and termination criteria were user defined based on the desired results for the position control of EHSS [7]. Once the optimization is started GA generates the initial population and the user defined fitness function evaluates the performance of each individual in the population. In this case, every individual consist of three parameters required for the PID controller. The fitness function sends that parameters to Simulink/ RTW model which then connects to the EHSS and moves the hydraulic cylinder into the required position. That way, the control error over time is generated, returned to fitness function and the fitness of each individual is calculated. GA then continues to select individuals for crossovers and reinsertion based on the calculated fitness values and executes the mutation operator when necessary. After a new generation of individuals is created the process of evaluation and selection is repeated until predefined number of generations is reached or relative difference between individuals is too small or demanded conditions are met. A pseudo code outline of the optimization algorithm is given below (Figure 2): Fitness values Fß^^g^^ is calculated as a sum of control error e(t), overshoot error OSe(i) in the first half and steady-state error SSe(i) in the second half of the process. Each of those errors also has a weighting factor added to them which determines the impact of each type of error on the individual's fitness value. The fitness function uses the following formula to calculate the output value: Figure 3. Simulink/RTW model used for experimental testing 0 t/2 F fitness = j e{t) H + W2 ^ O^^e^i) i=0 t + W3 X SSeii) i=t /2 (1) The control algorithm is realized in widely used Matlab/Simulink program and the Real-Time Workshop platform, shown in Figure 3, which allow using a familiar GUI (graphical user interface) to perform real-time control of the system. The command voltage to the proportional valve is generated by analogue output and to the solenoid valves by digital outputs on the DAQ board. ■ 5 Experimental results The experimental tests on position control of the hydraulic cylinder is realized by using a laptop PC with NI DAQCard-6024E (for PCMCIA), which offers both 12-bit analogue input and analogue output. The implementation of PID controller tuning using genetic algorithm technique is depicted in Figure 4 as well as the response of the EHSS when those parameters are used to control the position of the hydraulic cylinder. The responses of the EHSS trough iteration obtained by using the controller gains found by GA are shown in Figure 5. In early stages of GA optimization the obtained responses were unsatisfactory with a large overshoot, but in the later iterations they were clearly starting to converge and finally achieved the desired shape with no overshoot and steady state error. The evaluation of PID parameters and the convergence profile of the controller gains, Kp, K. and Kd with their fitness values over all the iterations of the GA along with their trend lines are shown in Figure 6. It can be seen how the GA converges to an optimal solution. Initially, the values of controller gains were all in the same range, but as the iterations of the GA progressed the value of the proportional gain started to rise and led to a faster response and a more precise final position of the cylinder. The numerical values of integral gain tend to decrease which confirms the existence of an inherent integral action in the system structure in the case of cylinder po- sition control task. The values of the derivative gain also started converging towards smaller values. Since the objective function was to minimize the control error, it can be seen that in the latter iterations of the optimization procedure the values of fitness were much smaller than at the beginning of the process, i.e. the fitness function of individuals was better. ■ 6 Conclusion An optimization method by using a genetic algorithm for tuning the PID controller gains has been presented in this paper. The search technique requires a minimum information specific to the control system such as the defined fitness function. To demonstrate the effectiveness of the control algorithm the experiments have been performed and evaluated on the laboratory model for position control of EHSS. The results demonstrate that the optimal PID parameters were successfully found in order to achieve the response without overshoot, with minimal settling time and with ne- Figure 4. Optimization procedure and the transient responses Figure 5. Position control of the hydraulic cylinder with PID controller optimized by GA arly zero steady state error. Disadvantages of this method are possible long times needed to complete all the tests in optimization process and possible problems on sensitive system since the tested PID parameters are selected randomly. This method of optimization could also be used for other systems with similar control demands or, with some modifications, could be used to tune other types of controllers where some kind of optimization process is involved. References [1] Sohl, G.A., Bobrow, J.E., Experiments and Simulations on the Nonlinear Control of a Hydraulic Servosystem, IEEE Trans. on Control Systems Technology 7, No. 2, pp. 238-247, (1999). [2] Knohl, T., Unbehauen, H., Adaptive position control of electro-hydraulic servo systems using ANN, Mechatronics 10, pp. 127-143, (2000). Figure 6. Parameter values with their trend lines and overall fitness [3] [4] Chen, H.M., Renn, J.C., Su, J.P., Sliding mode control with varying boundary layers for an electro-hydraulic position servo system, International [5] Journal of Advanced Manufacturing Technology 26, pp. 117-123, (2005). Lee, S.Y., Cho, H.S., A fuzzy con [6] troller for an electro-hydraulic fin actuator using phase plane method, Control Engineering Practice 11, pp. 697-708, (2003). Mitchell, M.: An Introduction to Genetic Algorithms, A Bradford Book The MIT Press, Fifth printing, London, (1999). Chipperfield, A., Fleming, P., Pohlheim, H., Fonseca, C.: Ge- netic Algorithm Toolbox for use with Matlab, University of Sheffield, UK, (1994). [7] Ayman A. A.: PID Parameters Optimization Using Genetic Algorithm Technique for Elec-trohydraulic Servo Control System, Intelligent Control and Automation, 2, pp. 69-76, (2011). Optimiranje parametrov regulacije servohidravličnega sistema z uporabo generičnega algoritma Razširjeni povzetek Dinamične karakteristike elektrohidravličnih servosistemov so kompleksne in izrazito nelinearne, ker prinašajo značilne negotovosti pri postopku projektiranja regulatorja. Določitev ustreznega in dovolj natančnega matematičnega modela za reguliranje takšnega hidravličnega pogona zato predstavlja zahtevno delo. V tem delu je predstavljena optimizacija PID-regulatorja z uporabo generičnega algoritma za regulacijo hidravličnega sistema z dvostransko delujočim diferencialnim hidravličnim valjem. Učinkovitost razvitega regulacijskega algoritma je eksperimentalno potrjena na laboratorijskem modelu z regulacijo translatornega gibanja.