Design and Implementation of a Microcontroller Based Active Controller for the Synchronization of the Petrzela Chaotic System

This paper presents an active control design for the synchronization of two identical Petrzela chaotic systems (Petrzela, J.; Gotthans, T. New chaotic dynamical system with a conic-shaped equilibrium located on the plane structure. Applied Sciences. 2017, 7, 976) on master-slave configuration. For the active control, the parameters of both systems are assumed to be a priori known, the control law by means of the dynamic of the error synchronization is designed to guarantee the convergence to zero of error states and the synchronization process is verified by numerical simulation. By taking advantage of the execution and implementation facilities of microcontroller based chaotic systems in digital devices, the active controller is implemented in a 32 bits ARM microcontroller. The experimental results were obtained by using the fourth order Runge-Kutta numerical method to integrate the differential equations of the controller, where the results were measured with a digital oscilloscope.


Introduction
In recent decades, chaotic systems have been studied due to their nonlinear dynamic properties and for the possible applications they have in different fields of science.This began due to the work of references [1,2] in which they showed that synchronization of chaotic systems is possible; this development has been utilized in areas such as secure communications [3][4][5], cryptography [6,7], medical applications, mechanisms, and robotics [8][9][10][11][12][13][14][15].Some of the synchronization schemes that have been successfully developed and applied include linear and nonlinear feedback control [16][17][18][19][20][21][22][23][24][25], where a Lyapunov candidate function V is proposed in such a way that the control law selected from the first derivative of V must be defined as negative [25].Adaptable control [16][17][18][19]26,27] is of interest for the synchronization of chaotic systems because of the presence of unknown parameters since the learning laws are continuously updated for maintaining the performance of the system.Other controls are also applied, for example the control by state feedback [28][29][30][31][32][33][34], feedback control with delays [35][36][37][38] or active control [39][40][41][42] which works by considering the error synchronization, here the nonlinearities are eliminated, and the dynamic error equations are decoupled.Finally, synchronization has been used through neural networks [43].
It is often thought that chaotic systems have a combination of several chair-type equilibrium points that produce the evolution of the chaotic attractor.However, systems with infinite points of equilibrium can be observed, located along a line [44,45], surface [46], or in closed curves [47] which fall into a new category of chaotic systems with a hidden attractor.In general, to be able to use chaotic systems in engineering applications, it is necessary to have a real implementation of them by means of analog electronic devices [48,49] or embedded systems [50].The implementation of chaotic systems in embedded devices such as microcontrollers [50][51][52][53], digital signal processors (DSP), or field programmable gate array (FPGA) [4,[54][55][56], have advantages in comparison with the implementation of circuits with analog components such as operational amplifiers and multipliers.Some of the advantages include a higher velocity of implementation, high computational power, low power consumption and precision because the resistors and capacitors have tolerance problems, which do not greatly change their value with respect to temperature [50].In addition, working with digital devices allows us to specify delays in the implementation, opening the possibility of investigating differential equations with chaotic delays [55,57].Authors in reference [52] perform the synchronization of Genesio & Tesi multi-scroll chaotic systems by neural network identifier into a microcontroller Arduino UNO ® .One advantage of this method is that the plant model to be synchronized and its parameters are unknown.Although a small error value persists, the synchronization holds the error signals bounded in a very small region.
In robotic, the chaotic systems applications are focused on mobile robotic and collaborative systems.For mobile robotics applications, robots are used for exploration and search for civil and military applications.The tasks they perform are target identifications, robot positioning on the ground, or updating maps.In the monitoring of security systems, chaotic paths are induced to the mobile in such a way that knowing its future position become unpredictable.In search and rescue applications (natural disasters), the robot must navigate in highly irregular and erratic environments, using chaotic motion planning techniques to ensure a quick search in the entire workspace.Therefore, the possibility of proposing navigation paths based on chaotic systems and their implementation in analog and embedded electronic systems remains open [12][13][14].
Considering the above, this article presents the design and implementation of an active controller in a 32-bit microcontroller for the synchronization in a master-slave configuration of the Petrzela chaotic system.To the best knowledge of the authors, this type of synchronization and neither this type of control has been used for this new system.Then, the article is organized as follows: Section 2 describes the characteristics of the chaotic system, Section 3 explains the active control and demonstrates by means of numerical simulations the successful synchronization of the dynamic system.In Section 4 the results of the microcontroller implementation are discussed and the conclusions of the paper are provided.

Petrzela Chaotic System
The chaotic system is presented with the following differential equations: .
where a and b are the internal parameters of the system, they are used to observe different routes and the evolution of the strange attractor, while r represents the displacement of the hyperbolic equilibrium structure, it could be a fixed value.
Through the Jacobian matrix (2), it is possible to find the characteristic Equation (3) as a function of points on a hyperbolic equilibrium structure; Computation 2019, 7, 40 3 of 16 Considering the equilibrium plane z = 0 and by using the parameterization curve, the following simplified characteristic equation with its eigenvalues is obtained: In this case λ 1 is always zero, λ 2,3 are real with opposite signs when y < 1/ √ 2a; it is a complex conjugate imaginary pair if y > 1/ √ 2a, and equal to zero if y = 1/ √ 2a.Depending on the initial conditions near the equilibrium, the system can be leads to periodic oscillations.In this case, there is a coexistence of three types of solutions which are: limit cycles, chaos and unbounded.In addition, the dynamic movement is invariant under changes of coordinates y ↔ −y and z ↔ −z .

Numerical Analysis of the Chaotic System
Two of the most used methods to resolve differential equations of chaotic systems are Euler 1st order and Runge-Kutta 4th order numerical algorithms [4,[50][51][52][53][54][55][56].Euler is a straight-forward method, quick and it is easy to code, although its accuracy is poor.The Runge-Kutta method is not as fast but offers good computational performance and more accurate solutions than Euler method, because the truncation error is reduced in higher orders methods.With the fourth order numerical Runge-Kutta integration method the solution of the system (1) can be found, for an initial condition in which it was considered; x 0 = (0 0 0) T , a simulation time t max = 150 s, a time step of ∆ t = 0.01, and constant values of a = 12, b = 0.4 and r = 1, the behavior of the Petrzela system is shown in Figure 1.Considering the equilibrium plane  = 0 and by using the parameterization curve, the following simplified characteristic equation with its eigenvalues is obtained: = + (2 − 1) = ( + 2 − 1) = 0, In this case  is always zero,  , are real with opposite signs when  < 1 √2 ⁄ ; it is a complex conjugate imaginary pair if  > 1 √2 ⁄ , and equal to zero if  = 1 √2 ⁄ .Depending on the initial conditions near the equilibrium, the system can be leads to periodic oscillations.In this case, there is a coexistence of three types of solutions which are: limit cycles, chaos and unbounded.In addition, the dynamic movement is invariant under changes of coordinates  ⟷ − and  ⟷ −.

Numerical Analysis of the Chaotic System
Two of the most used methods to resolve differential equations of chaotic systems are Euler 1st order and Runge-Kutta 4th order numerical algorithms [4,[50][51][52][53][54][55][56].Euler is a straight-forward method, quick and it is easy to code, although its accuracy is poor.The Runge-Kutta method is not as fast but offers good computational performance and more accurate solutions than Euler method, because the truncation error is reduced in higher orders methods.With the fourth order numerical Runge-Kutta integration method the solution of the system (1) can be found, for an initial condition in which it was considered;  = (0 0 0) , a simulation time  = 150 s, a time step of ∆ = 0.01, and constant values of  = 12,  = 0.4 and  = 1, the behavior of the Petrzela system is shown in Figure 1.

Synchronization with Active Control
In this section, the active control is applied to synchronize two identical chaotic systems type (1) with different initial conditions between them.The aim of the synchronization is that the slave system

Synchronization with Active Control
In this section, the active control is applied to synchronize two identical chaotic systems type (1) with different initial conditions between them.The aim of the synchronization is that the slave system follows the dynamic behavior of the master system, which is achieved by applying an appropriate control law u = [u 1 u 2 u 3 ] T to the slave system; therefore, the master system is given as follows: .
The master slave is given by: .
The synchronization process is performed by calculating the synchronization error e = [e 1 e 2 e 3 ] T , which is defined as the difference between the state of the master system (5) and the state of the slave system (6), represented by: By applying the derivative to the synchronization errors in (7) and substituting the Equations ( 5) and ( 6), the dynamics of the synchronization error is obtained by: .
Rearranging the terms to be expressed as a function of the errors, taken from (7), and substituting y s z s = (e 2 + y m )(e 3 + z m ); x s z 2 s = (e 1 + x m )(e 3 + z m ) 2 , Equation ( 8) is simplified to obtain the following: .
From this Equation (9), in order to eliminate the nonlinearities and to uncouple the equations of the dynamics error, the control laws are deduced as follows: Substituting the control laws (10) in (9), the synchronization error dynamic is simplified as shown in (11): .
A linear system is obtained as a function of the state errors e = [e 1 e 2 e 3 ] T .There are many possible options for the selection of the gains k 1 , k 2 and k 3 that allows us to control the speed of convergence and to make stabilization of the system possible (11).By using the characteristic matrix of the closed loop system, the gains can be selected in such a way that all the eigenvalues are negative real parts as shown in (12).
In this way, the state errors converge to zero e → 0 , while the time tends to infinity t → ∞ , implying that the chaotic systems ( 5) and ( 6) reach synchronization with the active control.

Stability Proof
The stability of the error dynamic ( 11) is determined by Lyapunov analysis.To achieve this, a positive defined function is proposed: The first derivative is given by .
The objective is that .
V be negative defined .
V < 0 to guarantee the asymptotic convergence to zero of the error synchronization.It can be seen in ( 15) that if k 1 > 0, k 2 > 0 and k 3 > 0 then .V < 0 the objective will be achieved according with the stability theorem of Lyapunov.By another hand, if k 1 ≥ 1 2 , k 2 ≥ 1 2 and k 3 ≥ 1 2 then the following inequality is correct In the right hand of the inequality ( 16), the same candidate Lyapunov function can be seen, but this version is negative. .
That shows than .
V is bounded by the negative function of V. Solving the inequality ( 17) and making some algebraic operations, the Equation ( 18) is obtained: By applying square root to both members of (19) e ≤ e(0)exp where e is the Euclidean norm of e = [e 1 e 2 e 3 ] T .In this way, the exponential converge of error synchronization is guaranteed.

Numerical Results
This section presents the numerical simulation of the master-slave configuration for the systems ( 5) and (6). Figure 2a shows the attractor of the master system with initial condition x m 0 = (0 0 0) T , while the attractor of the slave system is shown in Figure 2b, which considers x s 0 = (−0.Using the control laws of (10) and solving the system (11) of the synchronization error dynamics for  = 2,  = 5 and  = 5, Figure 3 shows the synchronization process between the states of the master and slave systems.During the first seconds t ≤ 4 s, it is observed how the evolution of each state is different, after four seconds t > 4 s the control laws are activated, then the states of slave system begins to follow the states of the master system, achieving synchronization in approximately 2 s (t = 6 s).Using the control laws of (10) and solving the system (11) of the synchronization error dynamics for k 1 = 2, k 2 = 5 and k 3 = 5, Figure 3 shows the synchronization process between the states of the master and slave systems.During the first seconds t ≤ 4 s, it is observed how the evolution of each state is different, after four seconds t > 4 s the control laws are activated, then the states of slave system begins to follow the states of the master system, achieving synchronization in approximately 2 s (t = 6 s).
The right side of Figure 3a-c is like a zoomed-in version to more clearly visualize when the synchronization process begins.Using the control laws of (10) and solving the system (11) of the synchronization error dynamics for  = 2,  = 5 and  = 5, Figure 3 shows the synchronization process between the states of the master and slave systems.During the first seconds t ≤ 4 s, it is observed how the evolution of each state is different, after four seconds t > 4 s the control laws are activated, then the states of slave system begins to follow the states of the master system, achieving synchronization in approximately 2 s (t = 6 s).In Figure 4, while t ≤ 4 s the synchronization errors have chaotic behavior, when t > 4 s the control laws begin to work, and the errors converge to zero.
In Figure 5 the input controls are shown, the value of u = [u 1 u 2 u 3 ] T = 0 for t ≤ 4 s.Once t > 4 s the input control tends to zero.The right side of Figure 3a-c is like a zoomed-in version to more clearly visualize when the synchronization process begins.
In Figure 4, while t ≤ 4 s the synchronization errors have chaotic behavior, when t > 4 s the control laws begin to work, and the errors converge to zero.In Figure 5 the input controls are shown, the value of  =    = 0 for t ≤ 4 s.Once t > 4 s the input control tends to zero.In Figure 5 the input controls are shown, the value of  =    = 0 for t ≤ 4 s.Once t > 4 s the input control tends to zero.

Hardware Implementation
The active controller was implemented in the Arduino DUE ® board, based on the Atmel SAM3X8E ARM ® Cortex ® -M3 CPU (manufactured by Arduino, made in Italy), because is open source.That has a processing speed up to 84 MHz.The main feature to choose the microcontroller was the two digital to analog converter peripherals DAC0 and DAC1 with 12 bits of resolution, in addition to its attractive cost benefit outcomes compared to FPGA or DSP devices.The hardware used for the active controller implementation is shown in Figure 6.For the synchronization process of the Petrzela systems, the synchronization error and the control law are calculated; later, the master and slave differential equations are solved by the Runge-Kutta method and are sent from the DAC's to the oscilloscope.

Hardware Implementation
The active controller was implemented in the Arduino DUE ® board, based on the Atmel SAM3X8E ARM ® Cortex ® -M3 CPU (manufactured by Arduino, made in Italy), because is open source.That has a processing speed up to 84 MHz.The main feature to choose the microcontroller was the two digital to analog converter peripherals DAC0 and DAC1 with 12 bits of resolution, in addition to its attractive cost benefit outcomes compared to FPGA or DSP devices.The hardware used for the active controller implementation is shown in Figure 6.For the synchronization process of the Petrzela systems, the synchronization error and the control law are calculated; later, the master and slave differential equations are solved by the Runge-Kutta method and are sent from the DAC's to the oscilloscope.To perform the implementation of the chaotic systems ( 5) and ( 6), the differential equations must be discretized, as is shown in Equation (21).The code is programmed inside the ARM microcontroller with its own language, which is based in processing programming language that is similar to C++.Arduino uses the IEEE 754 single precision floating point, one bit is used for the sign, eight bits are used for the exponent and, 23 bits are used as the fraction that allows 6-7 decimal digits of precision.But for the user, the operations are performed automatically.To perform the implementation of the chaotic systems ( 5) and ( 6), the differential equations must be discretized, as is shown in Equation (21).The code is programmed inside the ARM microcontroller with its own language, which is based in processing programming language that is similar to C++. experimental and numerical.The values of y m , y s and z m , z s are shown in Figure 8b,c, they do not have the same amplitude that values obtained by simulation, but they have the same behavior.All signals have an offset due to the DAC operating range, it cannot be zero.The main idea of this experimental test is to see the feasibility to implement the active controller in a microcontroller, analyzing the synchronization behavior of the chaotic system and the performance of the active controller.For implementing the active controller in a real application, the offset produced by the DAC must be eliminated, and the state values of the chaotic differential equations must be scaled by using an external stage of operational amplifiers.All signals have an offset due to the DAC operating range, it cannot be zero.The main idea of this experimental test is to see the feasibility to implement the active controller in a microcontroller, analyzing the synchronization behavior of the chaotic system and the performance of the active controller.For implementing the active controller in a real application, the offset produced by the DAC must be eliminated, and the state values of the chaotic differential equations must be scaled by using an external stage of operational amplifiers.

Conclusions
In this paper, an active controller was designed for the synchronization of the chaotic system of Petrzela.By using Lyapunov analysis, the exponential convergence to zero of the synchronization error was demonstrated.The gains used for k 1 , k 2 and k 3 were selected by trial and error to guarantee system stability and, the feasibility of the controller was realized by numerical simulation and for the hardware implementation in a 32 bits ARM microcontroller.For future work, the controller can be optimized to find gains that do not compromise the speed of convergence with the magnitude of the input control.

Figure 3 .
Figure 3. Synchronization process between master-slave systems by numerical simulation; (a) Synchronization process for first state; (b) Synchronization process for second state; (c) Synchronization process for third state.

Figure 6 .
Figure 6.Hardware of microcontroller based active controller implementation.

Figure 6 .
Figure 6.Hardware of microcontroller based active controller implementation.

Figure 8 .
Figure 8. Synchronization process between master-slave systems by experimental result; (a) Synchronization process for first state; (b) Synchronization process for second state; (c) Synchronization process for third state.
Finally, in Figure 9 is shown the behavior of the synchronization error obtained experimentally in the oscilloscope, by comparing this with the synchronization errors obtained in Figure 4 by simulation, it is possible to see that they have the same behavior, which implies that the synchronization process of the master-slave systems is achieved by the active control.The synchronization times after the control laws begin to work and the error values tend to zero are approximately  = 1;  = 0.8;  = 0.9.Regarding to the time evolution of synchronization errors in Figure 9, all signals have offset due to the DAC operating range, the authors only placed the error signals in the center of the oscilloscope screen to see the behavior.

Figure 8 .
Figure 8. Synchronization process between master-slave systems by experimental result; (a) Synchronization process for first state; (b) Synchronization process for second state; (c) Synchronization process for third state.

Figure 8 .
Figure 8. Synchronization process between master-slave systems by experimental result; (a) Synchronization process for first state; (b) Synchronization process for second state; (c) Synchronization process for third state.

Figure 9 .
Figure 9.Time evolution of synchronization error signals by experimental results; (a) synchronization error of e 1 (t) = x s − x m ; (b) synchronization error of e 2 (t) = y s − y m ; (c) synchronization error of e 3 (t) = z s − z m .

Table 1 .
Scaling values of the experimental test using map function.