Hindawi Publishing Corporation Discrete Dynamics in Nature and Society Volume 2011, Article ID 516031, 11 pages doi:10.1155/2011/516031 Research Article An FPGA-Based PID Controller Design for Chaos Synchronization by Evolutionary Programming Her-Terng Yau,1 Yu-Chi Pu,2 and Simon Cimin Li3 1 Department of Electrical Engineering, National Chin-Yi University of Technology, Taichung 411, Taiwan 2 Department of Electrical Engineering, Far-East University, No. 49, Zhonghua Rd., Xinshi Cist., Tainan 74448, Taiwan 3 Department of Electrical Engineering, National University of Tainan, Tainan 700, Taiwan Correspondence should be addressed to Her-Terng Yau, pan1012@ms52.hinet.net Received 7 April 2011; Accepted 26 June 2011 Academic Editor: Marko Robnik Copyright q 2011 Her-Terng Yau et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. This paper is concerned with the design of a field programmable gate arrays- FPGAs- based digital proportional-integral-derivative PID controller for synchronization of a continuous chaotic model. By using the evolutionary programming EP algorithm, optimal control gains in PID-controlled chaotic systems are derived such that a performance index of integrated absolute error IAE is as minimal as possible. To verify the system performance, basic electronic components, including OPA resistor and capacitor elements, were used to implement the chaotic Sprott circuits, and FPGA technology was used to implement the proposed digital PID controller. Numerical and experimental results confirmed the effectiveness of the proposed synchronization procedure. 1. Introduction In recent years, chaos synchronization has attracted the interest of researchers in various fields 1. Chaos synchronization has many potential applications in physics and engineering and particularly in secure communication 2. The idea of synchronizing two identical chaotic systems was first introduced by Pecora and Carroll 3. In continuous-time chaotic systems, synchronization is usually achieved by a master-slave or drive-response approach. Given a master drive and slave response in a chaotic system, the goal is synchronizing the behavior of the slave response system to that of the master drive system. To achieve the synchronization, a nonlinear controller must be designed to obtain signals from the master and slave systems and to manipulate the slave system. Recently developed control methods 2 Discrete Dynamics in Nature and Society can achieve chaos synchronization between two identical chaotic systems with different initial conditions 1. However, none of the proposed methods in our surveyed papers can obtain an optimal or near-optimal digital controller for synchronizing continuous chaotic systems according to a performance index specified by an FPGA chip. Conversely, evolutionary programming EP algorithms have proven effective and easy to implement for global optimization of complex functions and for solving complex control problems in engineering 4, 5. Generally, the four steps in the global optimization algorithm are initialization, mutation, competition, and reproduction. Furthermore, Cao 4 also developed a quasirandom sequence QRS for generating an initial EP population that avoids formulating clusters around an arbitrary local optimal. In fact, implementing this technique in digital electronic devices such as field programmable gate arrays FPGAs can accelerate the development of prototype circuits such as control and real-time simulation circuits 6. The FPGA comprises thousands of logic gates, some of which are grouped into a configurable logic block CLB to simplify higherlevel circuit design. Because of its simplicity and programmability, the FPGA is the preferred option for chip prototype design. The main objective of this work was to develop an EP-based digital PID control scheme for solving synchronization problems in FPGA-based chaotic systems. The EP algorithm derived optimal control gains in PID-controlled chaotic systems such that the performance index of integrated absolute error IAE was minimized and the master and slave chaotic systems were synchronized. The optimal architecture for digital controller was then implemented and simulated by very high-speed description language VHDL and ModelSim. The developed architectures for each component were then implemented and tested under the Xilinx Spartan-3 FPGA. Finally, simulation and experimental results were compared to confirm the effectiveness of the proposed EP-based digital PID scheme for chaos synchronization. 2. System Description and Problem Formulation First, consider two single-input single-output SISO master and slave systems described by the following differential equations: Master system: ẋm t ft, xm , ym t Cxm . 2.1 Slave system: ẋs t ft, xs But, ys t Cxs , 2.2 where xm t xm1 , xm2 , . . . , xmn ∈ Rn and xs t xs1 , xs2 , . . . , xsn ∈ Rn are the state vectors of master and slave systems, respectively. The f : R × Rn → Rn is a given nonlinear function. The ym t ∈ R and ys t ∈ R are the outputs of the master and slave systems, respectively. The B ∈ Rn×1 and C ∈ R1×n are the system matrices. The ut ∈ R is the control input included in Discrete Dynamics in Nature and Society 3 the slave system 2.2 to synchronize the master and slave systems. Generally, many chaotic systems can be expressed by 2.1. For example, the Sprott circuit, the modified Chua’s circuit, the Duffing-Holmes system, the Lorenz system, and the Lu system all belong to the class defined by 2.1. Let the error states be e1 xm1 − xs1 , e2 xm2 − xs2 , . . . , en xmn − xsn . The objective of this study was to use the EP algorithm to design a simple but effective PID controller ut that can synchronize coupled systems 2.1 and 2.2 under different initial conditions such that lim xm t − xs t −→ 0. t→∞ 2.3 The procedure for determining the PID controller u is to first define the output error signal ye ym − ys and then to define the continuous form of a PID controller with input ye · and output u·. The conventional equation is ut Kp 1 ye t Ti d ye tdt Td ye t , dt 0 t 2.4 where Kp is the proportional gain constant, Ti is the integral time constant, and Td is the derivative time constant. When using the FPGA chip to implement this controller, the continuous-type PID controller 2.4 is reformulated as a digital-type PID controller as shown below: Td 1 uk Kp ye k Sk ye k − ye k − 1 . Ti T 2.5 Here, uk is the kth sampling output data of the PID controller, Sk ye k is the error sum, and T is the sampling time constant. Therefore, 2.5 can be rewritten as uk Kp ye k Ki Sk Kd ye k − ye k − 1 , 2.6 where Ki Kp 1/Ti is the integral gain constant and Kd Kp Td /T is the derivative gain constant. The performance criterion or objective function of a controller design can generally be defined according to the desired specifications. The two performance criteria typically considered in the EP algorithm are the integrated squared error ISE and the integrated absolute error IAE. This study uses the IAE index as the objective function OF, which is given as OF IAE kf Ek, 2.7 k1 where Ek e1 , e2 , . . . , en , · is the Euclidean norm of a vector, k is the sampling time point, and kf is the total number of samples. Below, the EP algorithm is used to minimize 4 Discrete Dynamics in Nature and Society Master chaotic system ym + − ye (t) PID u(k) controller FPGA ye (k) T ZOH Slave chaotic system ys Kp Ki Kd Evolutionary programming algorithm Figure 1: Block diagram of chaos synchronization system. the objective function score 2.7 by tuning the digital PID controller and optimizing the gain parameters. 3. Evolutionary Programming (EP) Algorithm for Solving the Optimization Problem Since the EP algorithm is considered an easily implemented and promising technique for the global optimization of complex functions, this study introduces an EP algorithm for solving this problem. Figure 1 shows the proposed EP-based PID control system includes synchronized master and slave chaotic systems, a PID controller, and an EP algorithm. The ym is the output of the master system, ys is the output of the slave system, and u is the control input generated by the PID controller as defined in 2.5. The parameters of the proposed PID controller are derived by the EP algorithm such that the value of IAE given in 2.7 is minimized. This section proposes an extended EP algorithm for obtaining the digital PID controller with optimal gain parameters to minimize the following objective function OF score 2.6. Let g be the continuously differentiable matrix-valued function defined for g ∈ S, where S {g ∈ R3 | 0 ≤ gi ≤ Mi , i 1, 2, 3} and Mi is the bounded search space. The optimization problem is to find g ∗ Kp∗ , Ki∗ , Kd∗ ∈ S such that the OF performance index of the system is minimized. Mathematically, the optimization problem P1 can be formulated as follows. P1: To find g∗ ∈ S such that OF IAE kf Ek, for g ∗ ∈ S 3.1 k1 is minimized. Based on the simulation results obtained in 4, an extended EP algorithm for solving the above optimization problem is applied as follows. Step 1. Generate an initial population P0 p1 , p2 , . . . , pN of size N by randomly initializing each 3-dimensional solution vector pi ∈ S, i 1, 2, . . . , N according to the quasirandom sequence QRS. Discrete Dynamics in Nature and Society 5 0.94 0.92 0.9 0.88 IAE 0.86 0.84 0.82 0.8 0.78 0.76 0.74 0 50 100 150 200 250 300 Iteration Figure 2: Convergence curve of IAE. Step 2. Calculate the fitness score objective function fi fpi for each pi , i 1, 2, . . . , N, where f fi pi OF |EkT |. k 3.2 k1 Step 3. Mutate each pi , i 1, 2, . . . , N, based on the statistical data to double the population size from N to 2N, and generate piN by using fi piN,j pi,j N 0, β , fΣ ∀j 1, 2, 3, 3.3 where pi,j denotes the jth element of the ith individual, N0, βfi /fΣ represents a Gaussian random variable with a mean zero and variance βfi /fΣ , fΣ is the sum of all fitness scores, and β is a parameter to scale fi /fΣ . Step 4. Use 3.2 to calculate the fitness score fiN for every piN , i 1, 2, . . . , N. In the stochastic competition process, pi , i 1, 2, . . . , N randomly competes with pj , j N 1, . . . , 2N. If fi < fj , pi wins; otherwise, pj wins, and pi is replaced by pj . After completing the competition process, select N winners for the next generation, and let the individual with the minimum objective function in the winners be p1 . Step 5. If the value fΣ converges to a minimum value, then let g ∗ p1 be the global optimum value and g ∗ Kp∗ , Ki∗ , Kd∗ such that the OF performance index of the system is minimized. Otherwise, return to Step 3. 6 Discrete Dynamics in Nature and Society 25 20 Control gains 15 10 5 0 −5 0 50 100 150 200 250 300 Iteration Kp Ki Kd Figure 3: Iteration response of Kp , Ki , Kd . 4. Simulation and Experimental Results This section describes the proposed EP-based digital PID controller design for synchronizing Sprott circuits, which are the chaotic systems typically studied in the literature 7, 8. Now consider the following Sprott circuits: Master: ẋm1 xm2 , ẋm2 xm3 , 4.1 ẋm3 −1.2xm1 − xm2 − 0.6xm3 2 · signxm1 . Slave: ẋs1 xs2 , ẋs2 xs3 ut, 4.2 ẋs3 −1.2xs1 − xs2 − 0.6xs3 2 · signxs1 , where ẋm and ẋs denote the derivatives of xm and xs , respectively, with respect to time t. In this example, the initial conditions for master and slave are xm1 0, xm2 0, xm3 0 0.1 0.1 0.1 and xs1 0, xs2 0, xs3 0 −1 − 1 − 1, respectively. Matlab and Simulink are used to solve the optimization problem P1, where N 30 and β 0.001. The proposed EP algorithm generates P0 p1 , p2 , . . . , p30 according to the QRS. Several manipulations of the EP algorithm gets the convergence curve of IAE value versus iteration depicted in Figure 2. 5 4 3 2 1 0 −1 −2 −3 −4 −5 7 Control in action xm 2 , xs 2 xm 1 , xs 1 Discrete Dynamics in Nature and Society 0 5 10 15 20 25 30 35 40 5 4 3 2 1 0 −1 −2 −3 −4 −5 Control in action 0 5 10 15 Time (s) xm 1 xs 1 20 25 Time (s) 30 35 40 xm 2 xs 2 a b −1 −2 −3 −4 −5 6 Control in action 4 Control in action e1 , e2 , e3 xm 3 , xs 3 8 5 4 3 2 1 0 2 0 −2 −4 −6 −8 0 5 10 15 20 25 30 35 0 5 10 15 40 20 25 30 35 40 Time (s) Time (s) e1 e2 e3 xm 3 xs 3 c d 20 10 u(t) 0 −10 −20 −30 −40 Control in action 0 5 10 15 20 25 Time (s) 30 35 40 u(t) e Figure 4: Time responses using the EP-based PID controller. a xm1 versus xs1 . b xm2 versus xs2 . c xm3 versus xs3 . d The error states e1 , e2 , e3 . e The control input. The control ut is activated at t 20 sec.. 8 Discrete Dynamics in Nature and Society R23 10 k R24 10 meg R27 1 meg 3 R25 10 k C4 200 pF U12 UA741 VCC 1 − R35 1 meg 4 + R42 VEE 10 meg C6 200 pF 1 meg 6 8 − + 10 k + R31 16 40 k R32 1k R33 10 k 17 18 D4 D3 1N4148 1N4148 15 − + U16 UA741 R34 VCC 10 k VCC VEE 19 VEE R38 10 k R39 R40 10 k − V CC 20 VEE VEE U18 UA741 VCC U19 UA741 VCC R45 + R37 6k R29 14 VEE U15 UA741 VCC VCC VEE − R41 V2 12 10 k VEE xm 2 VEE + −V CC + −V CC V1 12 U13 UA741 VCC 13 U14 UA741 VCC + xm 1 R26 12 12 k 2 R30 V EE 10 meg C5 200 pF 5 + VCC VEE VEE R28 10 k VCC VEE + − 11 VCC U11 UA741 VCC VEE 10 k U21 UA741 V CC 21 VEE −V R46 10 k VCC V EE R47 10 k VEE CC U20 UA741 VCC −V CC 22 + VEE + VEE VEE xm 3 23 VEE a R24 10 meg R25 10 k 11 C4 200 pF R27 1 meg 3 1 R23 10 k U11 UA741 VCC −V CC + U12 UA741 V −V CC CC VEE 2 VEE VEE R28 10 k + xs 3 u(t) R12 10 k R13 10 k R30 V EE 10 meg C5 200 pF R1 10 k U21 UA741 VCC R35 −V 1 meg 24 CC VEE 5 4 + xs 2 R37 6k −V CC VEE 1 meg 8 6 −V CC + VEE VEE VEE U15 UA741 R32 V − VCC CC 1 K VEE 15 + VEE + U19 UA741 VCC R45 U13 UA741 R29 VCC − 10 k 13 VCC VEE 14 U18 R41 UA741 10 k R40 VCC − 10 k 20 VCC VEE 21 R42 VEE 10 meg C6 200 pF VEE R46 10 k 7 R47 10 k V1 12 12 R26 12 k + U14 UA741 VCC + VEE VCC + xs 1 U20 UA741 VCC − xs 3 22 VCC V EE 23 +V2 12 VEE 16 R31 40 k U16 UA741 R34 V CC − 10 k 17 18 VCC VEE D4 D3 19 1N4148 1N4148 + R33 10 k VEE R38 10 k R39 10 k U21x UA741 VCC −V CC VEE + VEE + VEE b Figure 5: Electronic implementations of Sprott circuits. a master system; b slave system. Discrete Dynamics in Nature and Society u(k) 9 ys Slave chaotic system DAC − FPGA + ADC ye (k) ym Master chaotic system PID control system a b Figure 6: The Black diagram a and the photograph b of the proposed chaos synchronization system. Figure 2 clearly shows that convergence occurs after about 170 iterations, and the final value of IAE is fg ∗ 0.7592. The corresponding PID control gains are g ∗ Kp∗ , Ki∗ , Kd∗ 20 0.0018 20. Figure 3 also shows the Kp , Ki , and Kd trajectories during the evolutionary procedure. Figure 4 shows the output response when using the resulting PID control gain z∗ . The simulation results confirm that the EP algorithm and proposed PID controller effectively synchronize Sprott chaotic systems. The proposed PID controller was then tested in an actual system. Figure 5 8 shows the experimental results when 4.1 and 4.2 were applied in a circuit connected in a master/slave configuration. Figure 6 shows how the controller was implemented with Xilinx Spartan-3 FPGA and AD/DA converters and a 1289 kHz sampling rate. Figure 7 shows that the slave circuit response was synchronized to the master circuit response after the control was activated at t 20 second. The experimental results of error dynamics in Figure 7d show the convergence to a very small synchronization error. 5. Conclusions A simple and successful digital PID controller for an FPGA chip was proposed for using an evolutionary programming algorithm to synchronize two chaotic systems. The derived 10 Discrete Dynamics in Nature and Society Tek Stop M Pos: 0.000 s xm 1 CH1 BW limit Off 200 MHz 1 xs 1 2 Tek Stop M Pos: 0.000 s xm 2 Coupling DC BW limit Off 200 MHz 1 Volts/Div Coarse Probe 1x Voltage xs 2 Invert Off CH1 0.00 V CH1 2.00 V CH2 2.00 V M 500 ms 28-May-10 21:24 <10 Hz b M Pos: 0.000 s Stop xm 3 CH1 xs 3 Tek M Pos: 0.000 s Stop Coupling DC BW limit Off 200 MHz 1 Volts/Div Coarse 1 Voltage e2 2 e3 c BW limit Off 200 MHz Volts/Div Coarse Probe 1x 3 Voltage Invert Off Invert Off CH1 0.00 V CH1 2.00 V CH2 2.00 V M 500 ms 28-May-10 20:52 < 10 Hz CH1 Coupling DC e1 Probe 1x 2 Probe Voltage a Tek Volts/Div Coarse 1x 2 Invert Off CH1 2.00 V CH2 2.00 V M 500 ms CH1 0.00 V 28-May-10 20:02 <10 Hz CH1 Coupling DC CH1 0.00 V CH1 5.00 V CH2 5.00 V M 500 ms CH3 5.00 V 28-May-10 21:24 <10 Hz d Figure 7: Experimental results of synchronization. a xm1 versus xs1 . b xm2 versus xs2 . c xm3 versus xs3 . d The error states e1 , e2 , e3 . EP algorithm efficiently obtains the gains for three PID controllers by solving specified optimization problems. Moreover, the effectiveness of the proposed EP-based PID scheme was then demonstrated in a chaotic circuit system. The simulation and experimental results confirm that the proposed methods are effective and practical. Compared to existing methods of chaotic synchronization, the proposed FPGA-based optimal PID controller is not only effective, but also simple in terms of design and implementation. Acknowledgment The authors would like to thank Y.-C. Pu for his contribution to this paper. References 1 G. Chen and X. Dong, From Chaos to Order: Methodologies, Perspectives and Applications, World Scientific Publishing Company, Singapore, 1998. 2 L. Kocarev and U. Parlitz, “General approach for chaotic synchronization with applications to communication,” Physical Review Letters, vol. 74, no. 25, pp. 5028–5031, 1995. 3 L. M. Pecora and T. L. Carroll, “Synchronization in chaotic systems,” Physical Review Letters, vol. 64, no. 8, pp. 821–824, 1990. 4 Y. J. Cao, “Eigenvalue optimization problems via evolutionary programming,” Electronics Letters, vol. 33, no. 7, pp. 642–643, 1997. Discrete Dynamics in Nature and Society 11 5 W. D. Chang and J. J. Yan, “Optimum setting of PID controllersbased on using evolutionary programming algorithm,” Journal of the Chinese lnstitute of Engineers, vol. 27, no. 3, pp. 439–442, 2004. 6 Z. Zhou, T. Li, T. Takahashi, and E. Ho, “FPGA realization of a high-performance servo controller for PMSM,” in Proceedings of the 9th IEEE Applied Power Electronics Conference and Exposition, vol. 3, pp. 1604–1609, 2004. 7 J. C. Sprott, “A new class of chaotic circuit,” Physics Letters, Section A, vol. 266, no. 1, pp. 19–23, 2000. 8 D. I. R. Almeida, J. Alvarez, and J. G. Barajas, “Robust synchronization of Sprott circuits using sliding mode control,” Chaos, Solitons & Fractals, vol. 30, no. 1, pp. 11–18, 2006. Advances in Operations Research Hindawi Publishing Corporation http://www.hindawi.com Volume 2014 Advances in Decision Sciences Hindawi Publishing Corporation http://www.hindawi.com Volume 2014 Mathematical Problems in Engineering Hindawi Publishing Corporation http://www.hindawi.com Volume 2014 Journal of Algebra Hindawi Publishing Corporation http://www.hindawi.com Probability and Statistics Volume 2014 The Scientific World Journal Hindawi Publishing Corporation http://www.hindawi.com Hindawi Publishing Corporation http://www.hindawi.com Volume 2014 International Journal of Differential Equations Hindawi Publishing Corporation http://www.hindawi.com Volume 2014 Volume 2014 Submit your manuscripts at http://www.hindawi.com International Journal of Advances in Combinatorics Hindawi Publishing Corporation http://www.hindawi.com Mathematical Physics Hindawi Publishing Corporation http://www.hindawi.com Volume 2014 Journal of Complex Analysis Hindawi Publishing Corporation http://www.hindawi.com Volume 2014 International Journal of Mathematics and Mathematical Sciences Journal of Hindawi Publishing Corporation http://www.hindawi.com Stochastic Analysis Abstract and Applied Analysis Hindawi Publishing Corporation http://www.hindawi.com Hindawi Publishing Corporation http://www.hindawi.com International Journal of Mathematics Volume 2014 Volume 2014 Discrete Dynamics in Nature and Society Volume 2014 Volume 2014 Journal of Journal of Discrete Mathematics Journal of Volume 2014 Hindawi Publishing Corporation http://www.hindawi.com Applied Mathematics Journal of Function Spaces Hindawi Publishing Corporation http://www.hindawi.com Volume 2014 Hindawi Publishing Corporation http://www.hindawi.com Volume 2014 Hindawi Publishing Corporation http://www.hindawi.com Volume 2014 Optimization Hindawi Publishing Corporation http://www.hindawi.com Volume 2014 Hindawi Publishing Corporation http://www.hindawi.com Volume 2014