TWO DEGREE OF FREEDOM PID CONTROLLER DESIGN USING GENETIC ALGORITHMS Daniel Czarkowski Polish Register of Shipping, Gdańsk, POLAND d.czarkowski@prs.pl Tom O’Mahony Cork Institute of Technology, Department of Electronic Engineering, Cork, IRELAND © 2005 PRS S.A. Overview 2- DOF PID controller Design strategy Genetic Algorithms – A solution of reduction computation time Models Results Summary of work Conclusions 2 © 2005 PRS S.A. 11th IEEE International Conference on Methods and Models in Automation and Robotics, MMAR 2005 2-DOF PID controller Controller structure R(s) D(s) U(s) F(s) G(s) Y(s) H(s) Control law sK d c R(s) Y (s) Ki U ( s ) K p b R( s ) Y ( s ) R( s ) Y ( s ) sK s 1 d KpN 6 variables to tune K p , Ki , Kd , b, c, N 3 © 2005 PRS S.A. 11th IEEE International Conference on Methods and Models in Automation and Robotics, MMAR 2005 Design strategy Performance & robustness Performance – IAE servo + regulator t1 1 t2 k 0 k t1 IAE e(k ) e(k ) Robustness 1) Gain and phase margin Am = 6dB j m = 45° 2) Gain and phase margin Am = 14dB j m = 45° MM = 0.6 3) Modulus margin 4) Maximum value of the input sensitivity function M u = var 4 © 2005 PRS S.A. 11th IEEE International Conference on Methods and Models in Automation and Robotics, MMAR 2005 Why Genetic Algorithms? 1 100 0.5 Objf MM 80 60 local min. 40 global min. 0 0.4 20 0.4 0.4 0.2 Ki 0.2 0 0 0.4 0.3 0.2 Ki Kp 0.2 0 0.1 0 Kp Avoid your local minimum! 1 e15 s 3 ( s 1) J min IAE MM s.t. MM 0.6, K d 1.24, b 1, c 1, N 29 G2 ( s) K p , Ki 5 © 2005 PRS S.A. 11th IEEE International Conference on Methods and Models in Automation and Robotics, MMAR 2005 Direct the GA GA optimisation problem J min IAE Am m Penalty factors on gain and phase margins 10 8 8 6 6 Am m 10 4 4 2 2 0 0 s.t. Am 6dB, m 45 2 4 Am (dB) 6 8 0 0 10 20 30 m (deg) 40 50 60 6 © 2005 PRS S.A. 11th IEEE International Conference on Methods and Models in Automation and Robotics, MMAR 2005 Flow diagram of optimisation environment MATLAB GA 1) Initial population Objective function 1) Change chromosomes into controller parameters Controller parameters IAE Simulink Calculate IAE 2) Calculate robustness factors 3) Calculate objective function 2) Ranking 3) Selection 4) Crossover 5) Mutation 6) Evaluation of the fitness function 7) Reinsertion of offspring in the population 8) Are the termination criteria satisfied? 9) If conditions satisfied pass the controller variables outside the function 7 © 2005 PRS S.A. 11th IEEE International Conference on Methods and Models in Automation and Robotics, MMAR 2005 GA with look up table 30 25 G2 ( s) 1 15 s e ( s 1)3 time (sec) 20 15 10 Gray coding 5 Population of 100 Single Point Crossover 0 0 Stochastic Universal Sampling Matrix: 2342 rows and 7 columns MATLAB find function 20 40 60 80 100 Generations Reduced the execution time up to 60%! 8 © 2005 PRS S.A. 11th IEEE International Conference on Methods and Models in Automation and Robotics, MMAR 2005 Models Benchmark test – – – – – (K. J. Åström 1998, 2000) Inverse unstable system Integrating systems Underdamped system Conditionally stable system 3 models with time delay 11 models were evaluated 9 © 2005 PRS S.A. 11th IEEE International Conference on Methods and Models in Automation and Robotics, MMAR 2005 Results, I 1.5 1 G1(s ) = (s + 1)3 J1 min IAE Am m J 2 min IAE Am m s.t. Am 6dB, m 45 y(t) 1 0.5 s.t. Am 14dB, m 45 J3 min IAE MM s.t. MM 0.6 J 4 min IAE Mu s.t. M u 20 0 0 5 10 15 20 0 5 10 time (sec) 15 20 10 u(t) 5 0 The fourth design gives sluggish response? -5 10 © 2005 PRS S.A. 11th IEEE International Conference on Methods and Models in Automation and Robotics, MMAR 2005 Results, II 1.5 1 s(s + 1)2 1 y(t) G 4 (s ) = J1 min IAE Am m J 2 min IAE Am m J3 min IAE MM J 4 min IAE Mu 0.5 s.t. Am 6dB, m 45 s.t. Am 14dB, m 45 0 0 5 10 15 20 25 30 0 5 10 15 time (sec) 20 25 30 s.t. MM 0.6 10 s.t. M u 20 u(t) 5 0 -5 11 © 2005 PRS S.A. 11th IEEE International Conference on Methods and Models in Automation and Robotics, MMAR 2005 Summary of work Four robust designs have been proposed – Direct the GA Eleven models evaluated A solution to speed up the GA optimisation The two degree of freedom controller well performs for systems such as: stable, inverse unstable, non-minimum phase, integrating long time-delay. Model uncertainty has not been discussed, however from my experience the fourth design performs well in this case as well as implemented to real-time systems. 12 © 2005 PRS S.A. 11th IEEE International Conference on Methods and Models in Automation and Robotics, MMAR 2005 Conclusions None of the proposed methods performs significantly better. However, even though the responses from the third design are not as fast as from the first design, it can be summarised that this design gives slightly better results than the other counterparts. The fourth design directly penalises the impact of the high frequency measurement noise on the closed-loop system. The GA with look up table significantly reduced the computation time. 13 © 2005 PRS S.A. 11th IEEE International Conference on Methods and Models in Automation and Robotics, MMAR 2005 Questions? Daniel Czarkowski my e-mail: d.czarkowski@prs.pl © 2005 PRS S.A.