AP02_3.vp 1 Introduction Hydraulic actuators are used for delivering high actuation forces and high power density. Due to their simple construc- tion and low cost, hydraulic actuators are widely used. These actuators have highly nonlinear model characteristics. Two types of actuators are used, differential (single-rod) and syn- chronizing (double-rod). From the control engineering point of view, synchronizing or symmetric actuators are preferred because there is no piston area difference and this fact reduces non-linearities, but on the other hand, the construction of these types of actuators is difficult and expensive. Also in some situations, e.g., robots, cranes, etc., due to limited space symmetric actuators cannot be used. In the literature [13, 6, 11, etc.] various models of hydrau- lic actuators are presented. Some are linear models, mostly applied to synchronizing cylinders. Many authors have ne- glected the leakage; also the friction forces are not completely modeled. These factors are all included in the derivation of our model that provides the basis for creating object oriented library blocks. The schematic diagram of a differential actuator, as shown in Fig. 1, consists of a constant pressure supply pump, a mag- netically controlled spool valve and a differential hydraulic cylinder. All the variables are explained in the list of symbols (Table 2). The model is derived in the next section. The moti- vation is to prepare the relations and parameter definitions for object-oriented blocks that are suitable for programming in special Matlab S-functions. 2 Mathematical Modelling Let the flow areas to the supply and return port of the spool valve be proportional to the spool displacement xs, (i.e., A K x0 0� s). Then the flow rate of oil across the spool valve can be given as: Q C x p� 0 0 � (1) where C C K A A 0 0 2 1 2 1 1 2 � � � � � � � d � At the nominal pressure drop (�pN) and nominal flow (QN), this constant can be estimated as C Q x p 0 0 5 � N s N, max . � (2) Applying the continuity equation to both chambers 1 and 2 � � � � � � d d d d oil c oil oil c t p V A x p Q Q t p V A x � � � 1 0 1 1 1 1 2 0 2 2 , int , � � � � � �� � �� oil ext 2p Q Q Q2 int (3) and considering the compressibility of oil Eoil as � � �E p p p poil oil oil �� � �� © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ 41 Acta Polytechnica Vol. 42 No. 3/2002 Non Linear Modelling and Control of Hydraulic Actuators B. Šulc, J. A. Jan This paper deals with non-linear modelling and control of a differential hydraulic actuator. The nonlinear state space equations are derived from basic physical laws. They are more powerful than the transfer function in the case of linear models, and they allow the application of an object oriented approach in simulation programs. The effects of all friction forces (static, Coulomb and viscous) have been modelled, and many phenomena that are usually neglected are taken into account, e.g., the static term of friction, the leakage between the two chambers and external space. Proportional Differential (PD) and Fuzzy Logic Controllers (FLC) have been applied in order to make a comparison by means of simulation. Simulation is performed using Matlab/Simulink, and some of the results are compared graphically. FLC is tuned in a such way that it produces a constant control signal close to its maximum (or minimum), where possible. In the case of PD control the occurrence of peaks cannot be avoided. These peaks produce a very high velocity that oversteps the allowed values. Keywords: modelling, simulation, fluid dynamics, robotics, fuzzy control, proportional-derivative control. u xs p0ps Q2Q1 A2 FF V1p1 p2 F dist A1 V2 Q int Q ext, 2 xc Fig. 1: Schematic diagram of a differential hydraulic actuator after putting this formula into Eq. (3) we obtain the equations � � � � � �� � � oil c c oil 1 oil d d d d p A x t V A x p p p t p Q Q 1 1 0 1 1 1 1 1 � � � � � , i � � � � � nt , i � � � � � � �� � � oil c c oil 2 oil d d d d p A x t V A x p p p t p Q 2 2 0 2 2 2 2 �nt � �Q Qext 2 (4) � � d d d d d d 1 oil c c 2 o p t p V A x Q A x t Q p t � � � 1 0 1 1 1 1 , int � � � �� � �� � � � il c ext c 2 d d p V A x Q Q A x t Q2 0 2 2 2 , int � � � � �� � �� (5) where � � � � Q C x p p p p x p p p p Q C 1 0 1 1 0 0 2 0 � � � � � � � � � ( ) ( sgn sgn sg sg s s s s 1 1 � � � � sg sg s 2 2 s s s x p p p p x p p p p sgn sgn ) � � � � � � � 0 0 2 2 (6) � � Q k p p Q k p int int , , � � � 1 2 2 2 2ext ext where coefficients kint and kext, 2 can be evaluated by means of the general formula by [12] k d r r L C Q p leak i c c 3 N N 6 � �� � � � � � � � 2 0 5 0 . � Eoil [1] can be given as: �E p E C p p Coil oil, max� � � � � � � � 1 2 10 1 2log max (7) and the following notification is used �sgn x x x x � � � � � 1 0 0 0 1 0 �sg x x x x � � � 0 0 0 The forces on the cylinder can be expressed as (using Newton’s Second Law of Motion) � �m x t p A p A F v F d d c F c dist 2 2 1 1 2 2 � � � � (8) where v x t c cd d � . The friction forces �F vF c are viscous friction, Coulomb friction and static friction, i.e., � �F v k v v F F v C F c v c c c s c s � � � �� � � � � � � � � �sgn exp The plot of friction versus velocity is shown in Fig. 2. The factors of friction forces Fv (viscous), Fc (Coulomb) and Fs (static) can be identified from the total friction (FF) and veloc- ity (vc). These (FF and vc) can be estimated from the values of the position, and pressures in both chambers of the cylinders experimentally with zero load, and using then numerical inte- gration of the position for determing velocity. Spool valve Spool valve dynamics can be derived in a similar way as for a cylinder, but the following linear second order differential equation is a widely used and sufficient approximation: � � � d d d d s n s n 2 n 2 2 2 2 x t t B x t t u t� � � (9) Typical values of spool valve parameters are: natural fre- quency n � 300–500 s 1 and damping factor B � 0.7–1.0. Correct modelling of a spool valve requires resetting of the integrators by bringing their inputs to zero as soon as the end positions of the spool valve are overstepped. This precaution is shown in Fig. 4. State space form of the hydraulic actuator Let x x x x t x p x p x x x x t 1 2 3 1 4 2 5 6� � � � � �c c s sd d d d , , , , , then from Eq. (5–9) we get: � �� � � � � � , x x x m x A x A F x F x E x V A x 1 2 2 3 1 4 2 2 3 3 0 1 1 1 � � � � � � � F Load oil � � �� � � � 1 2 oil 1 � � � � � � � � Q x x A x Q x x x E x V A x Q 1 3 5 1 3 4 4 4 0 2 2 , , � int , int � � �� �x x Q x A x Q x x x x x u B x 4 5 4 2 4 5 5 6 6 2 , , � � � � � � � � � ext 2 2 n 2 n 6 n 2 x5 (10) 42 © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ Acta Polytechnica Vol. 42 No. 3/2002 - 0.25 - 0.2 - 0.15 - 0.1 - 0.05 0 0.05 0.1 0.15 0.2 0.25 - 200 - 150 - 100 - 50 0 50 100 150 200 Velocity [m/s] Friction Force [N] Fig. 2: Friction verses velocity profile 3 Modelling in MATLAB/Simulink The model has been implemented in versatile software Matlab/Simulink, which is widely used in control engineer- ing communities around the world. Cylinder, spool valve and controller models are shown in Fig. 3. These blocks were created using the above derived equations, and a GUI (graphical user interface) will appear by clicking the block. Parameters can be entered through these menus. Fig. 4 shows the spool valve model, where anti-windup has been included. Fig. 5 shows the cylinder model, which is modeled using four state variables, and the cylinder stops at the ends have been introduced. © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ 43 Acta Polytechnica Vol. 42 No. 3/2002 Fig. 3: Simulink block diagram of the hydraulic actuator model Sign Product 0 Constant 1/w0/w01 In1 Fig. 4: Simulink spool valve model with end position stops Fig. 5: Simulink block diagram of the hydraulic cylinder model 4 Fuzzy Logic Controller (FLC) Looking for an algorithm that would be closer to the time optimal controller (bang-bang control), we tried using non- -linear Fuzzy Logic Control design techniques. The basic structure of a Fuzzy Logic Controller is shown in Fig. 6. From the many types of fuzzy controllers, e.g., PID-like, sliding mode, Takagi-Sugeno etc., we selected Mamdani type Fuzzy Logic Controller. This controller uses two inputs (control error and its derivate) and one output (control signal). For both inputs, three fuzzy sets (two Sigmoid and one Gaussian membership functions), and for output five fuzzy sets (two Sigmoid and three Gaussian membership functions) have been taken, as shown in Fig. 6. Rules are defined such that for the region where we have large errors, a constant and maximum allowable control signal will be delivered, whereas in the small error region it will behaves as a non-linear PD-like controller, see Table 1. Two types of Inference Engines are used; one is composi- tion-based inference and the other is individual-rule-based inference. In the defuzzification, the set of modified control output values in the form of fuzzy sets is converted into single point-wise values or crisp values. Various defuzzifica- tion methods can be used; we used the centre of gravity or centre of area method. Fuzzy controllers have the disadvantage that it is difficult to tune the large number of parameters, in contrast to the proportional derivative (PD) controller, which can be expres- sed by the equation: u K e K ePD P D� � � (11) where uPD is the control signal, e the control error, and the constants KP, KD represent proportional and derivate constants. The controller parameters can be optimised heuristically, but good support for optimising these para- meters is provided by the Matlab toolbox called the NCD Block set. Even in the presented case of a fuzzy logic controller when a minimum number of fuzzy variables and rules have been used, better results than with a PD controller have been achieved. As a fuzzifier, three fuzzy sets (two sigmoid and one Gaussian membership functions) have been used to convert the crisp values of the inputs into fuzzy linguistic variables, see Fig. 9. Similarly five fuzzy sets (two sigmoid and three Gaussi- an membership functions) have been used to convert fuzzy linguistic variables into crisp values of the outputs as a control signal. 44 © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ Acta Polytechnica Vol. 42 No. 3/2002 Normalization Crisp process-state values Fig. 6: The structure of a Fuzzy Knowledge Based Controller Control error N Z P Change of control error N .. .. P Z .. Z .. P N .. .. .. NL .. PL Table 1: Lookup Table (explaining rules) Fig. 7: Inserting FLC into the Simulink Model Fig. 8: GUI for Output in Matlab for FLC Fig. 9: Schematic diagram of fuzzy inference system The whole process of fuzzy control can be expressed in the following steps, considering x as input and y as output for each step. Also two types of membership functions are used as given below: Sigmoid membership function: � � f x a c e a x c ; , � � � � 1 1 Gaussian membership function: � � f x a c e x c a; , � � � 2 2 Step 1: Fuzzifier: Conversion of crisp values to fuzzy variables: For Input 1, i.e., error, conversion has been done using three fuzzy variables (Negative (N) using the sigmoid mem- bership function of parameters [ 250 0.02], Zero (Z) using the Gaussian membership function of parameters [0.015 0], and Positive (P) using the sigmoid membership function of parameters [250 0.02]). The same procedure was followed for Input 2, i.e., change of error with parameters ([ 90 0.05], [0.04 0], [90 0.05]). Step 2: Logical Operators The logical operator AND used in the rules is described as: �y x x� �min , ,1 2 Step 3: Implication The implication used in rules is as follows: if error is P AND change of error is N then control signal is P. Step 4: Aggregation: In Aggregation, the rules directed towards one output are combined together. We used the logical operator OR with max function as given below: �y x x� �max , ,1 2 In our case we had one output and five rules. Step 5: Defuzzification: Defuzzification is the process of converting fuzzy variables to crisp values. The center of gravity method has been used to obtain crisp values of the output from the reference output fuzzy sets. The reference fuzzy sets consist of five fuzzy vari- ables (negative large (NL) using the sigmoid membership function [ 175 0.12], negative (N) using the Gaussian mem- bership function [0.008 0.05], zero (Z) using the Gaussian membership function [0.008 0], positive (P) using the Gaus- sian membership function [0.008 0.05] and positive large (PL) using the sigmoid membership function [175 0.12]). The following formula has been used to convert the fuzzy variables to crisp values. � y c a x a x ij ij i i p ij i i p � � � � � 1 1 As shown in Fig. 8, GUIs has been used in Matlab, where all the input and output fuzzy variables, inference system, fuzzifier and defuzzifier can be defined very easily by setting the corresponding parameters. Then the controller is con- nected to the model in Simulink, as shown in Fig. 7. 5 Results and conclusions This work has two aims: the first is to elaborate a way of non-linear modelling of a differential hydraulic actuator suit- 45 Acta Polytechnica Vol. 42 No. 3/2002 Fig. 10: GUI for defining Rules in Matlab for FLC 0 0.5 1 1.5 0 10 20 30 40 50 60 70 80 90 100 110 Position [mm] with Small Gain Time [s] X - Desired X - PD X - FLC 0 0.5 1 1.5 0 10 20 30 40 50 60 70 80 90 100 110 Position [mm] with Large Gain Time [s] X - Desired X - PD X - FLC Fig. 11: Position trajectory of hydraulic actuator for FLC and PD control able for programming in Simulink. The second goal is to use this model for comparing a classical and a non-linear fuzzy logic control loop design. The obtained results do not show any discrepancy with our experience or with the available experimental data. The responses that we obtained confirm the general advantage of FLC in quicker responses, due to the fact that only FLC is able to produce control signals that are not only proportionally dependent on control error as in the case of a PD controller. The fundamental import- ance of a proper choice of the gain in the PD controller is demonstrated in by the columns in Fig. 13, where the left column shows responses with half of the gain used in the experiments depicted in the right column. PD for small step changes surprisingly achieved worse control responses than for larger step changes. The anti-windup problem has been solved, as shown in Fig. 15, which explains the importance of 46 © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ Acta Polytechnica Vol. 42 No. 3/2002 0 0.5 1 1.5 - 50 0 50 100 150 200 250 300 350 400 450 Velocity [mm/s] with Large Gain Time [s] V - PD V - FLC 0 0.5 1 1.5 - 50 0 50 100 150 200 250 300 350 400 450 Velocity [mm/s] with Small Gain Time [s] V - PD V - FLC Fig. 12: Velocity trajectory of hydraulic actuator for FLC and PD control 0 0.5 1 1.5 - 50 0 50 100 150 200 250 300 Control Signal [mm] with Large Gain Time [s] U - PD U - FLC Limit (160 mm) 0 0.5 1 1.5 - 50 0 50 100 150 200 250 300 Control Signal [mm] with Small Gain Time [s] U - PD U - FLC Limit (160 mm) Fig. 13: Control signal for a hydraulic actuator applying FLC and PD control 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 - 0.03 - 0.025 - 0.02 - 0.015 - 0.01 - 0.005 0 0.005 0.01 0.015 Velocity [mm/s] with and without anti-windup Time [s] With Anti-windup without Anti-windup with no Matlab limits Fig. 14: Velocity profile with windup problems 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 - 2 - 1.5 - 1 - 0.5 0 0.5 1 1.5 2 ×10 - 3 Position [mm] with and without Anti-windup Time [s] With Anti-windup without Anti-windup with no Matlab limits Fig. 15: Position curves with windup problems respecting the limits in the model. However in this case less difference is shown between with and without antiwindup, due to the unsuitability of the parameters. Acknowledgement This work has been supported by GA ČR, Research Project No: 102/01/1347; “Numerical methods for optimal control system design”. References [1] Berzen, W.: Nonlinear Control of Hydraulic Cylinders. Pro- ceedings of the 6th IEEE Mediterranean Conference on Control and Systems (MCCS’98), Italy, 1998. [2] Blackburn, J. F., Reethof, G., Shearer J. L.: Fluid Power Control. Massachusetts, (U.S.A.): The MIT Press, 1960. [3] Costa Branco, P. J., Dente, J. A.: The Application of Fuzzy Logic in Automatic Modelling Electromechanical Sys- tems. Fuzzy Sets and Systems, 1998, Vol. 95, No. 3, p. 273–293. [4] Daugherty, R. L., Franzini, J. B., Finnemore, E. J.: Fluid Mechanics with Engineering Applications. Singapore: Mc Graw-Hill Book Company, 1989. [5] Dimiter, D., Hans, H., Michael, R.: An Introduction to Fuzzy Control. Berlin: Springer-Verlag, 1996, ISBN 3-540-60691-2. [6] Horacek, P., Binder, Z.: An Approach for Design and Imple- mentation of Fuzzy Controller. In: Proceedings of Euro- pean Congress on Fuzzy and Intelligent Technologies EUFIT’93, Germany, September 1993, Vol. 2, p. 163–169, ISBN 3-86073-176-9. [7] Jan, J. A., Šulc, B.: Conventional and Fuzzy Logic Control of Non Linear Hydraulic Actuators For Flexible Robots. IASTED International Conference Applied Simulation and Modelling (ASM 2001), Marbella, Spain, 2001, p. 302–307, ISBN 0-88986-311-3. [8] Jan, J. A., Šulc, B.: Fuzzy Logic Control in Hydraulic Actua- tor Modelled from Own-built Simulink Block Library. Pro- ceedings of the Conference on Information Engineering and Process Control, CTU, Prague, Czech Republic, 2001, p. 73–74, ISBN 80-902131-7-0. [9] Jan, J. A., Šulc, B.: Modelling and Simulation of Non- linear Hydraulic Actuator Using Conventional and Fuzzy Logic Control. 16th International Conference on Produc- tion Research (ICPR-16), Prague, Czech Republic, 2001, ISBN 80-02-01438-3. [10] Jan, J. A., Šulc, B.: Fuzzy Logic Control in Differential Hydraulic Cylinders driven by Servo-valves: Simulation and Visualization. 5th International Student Conference, CTU in Prague, Prague (Czech Republic): Poster 2001. [11] Kugi, A., Schlacher, K., Keintzel, G.: Position Control and Active Eccentricity Compensation in Rolling Mills. Automatisierungstechnik Germany, 1999, at 8/99, ISBN 3-486-23477-3. [12] Merrit, H. E.: Hydraulic Control Systems. New York: John Wiley & Sons, 1967. 13] Noskievič, P.: Modelling and System Identification. (In Czech), Ostrava (Czech Republic): Montanex a.s., 1999, ISBN 80-7225-030-2. [14] Stadler, W.: Analytical Robotics and Mechatronics. New York: McGraw-Hill Inc., 1995, ISBN 0-07-0060608-0. [15] Sugeno, M., Yasukawa, T.: A Fuzzy-Logic-Based Approach to Qualitative Modeling. IEEE Trans. on Fuzzy Systems, February 1993, Vol. 1, No. 1, p. 7–31. [16] Šulc, B.: Integral Wind-Up in Control and System Simula- tion. In: Control Engineering Solutions. A Practical Ap- proach (P. Albertos, R. Strietzel and N. Mort (Editors)), IEE, London 1997, p. 61–76, ISBN 0-85296-829-9. Bohumil Šulc phone:+420 224 352 531 fax: +420 233 336 414 e-mail: sulc@fsid.cvut.cz Ing. Javed Alam Jan, Ph.D. e-mail: javed@student.fsid.cvut.cz Department of Instrumentation and Control Engineering Czech Technical University in Prague Faculty of Mechanical Engineering Technická 4 166 07 Prague 6, Czech Republic © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ 47 Acta Polytechnica Vol. 42 No. 3/2002 x1, xc position of cylinder piston [m] x2, vc velocity of cylinder piston [m/s] x3, p1 pressure of oil in chamber 1 [Pa] x4, p2 pressure of oil in chamber 2 [Pa] x5, xs position of valve piston [m] x6, vs velocity of valve piston [m/s] Q1/2 flow in pipe 1 and 2 [m 3/s] V0,1/2 volume of Oil in chamber at xc � 0 [m 3] FF friction force [N] Eoil bulk modulus of oil [Pa] A1 piston area in chamber 1 [m 2] A2 piston area in chamber 2 [m 2] d diameter of piston of cylinder [m] rc radial clearance between piston and cylinder [m] L length of piston head [m] B spool valve damping [1] �n spool valve natural frequency [s �1] � dynamic viscosity [Pa � s] Table 2: Lists of Symbols