# Nonlinear Electrical Circuit Oscillator Control Based on Backstepping Method: A Genetic Algorithm Approach

Authors: Mahsa Khoeiniha; Hasan Zarabadipour; Ahmad Fakharian
Journal: Mathematical Problems in Engineering
 (2012)

---

## Abstract

This paper investigated study of dynamics of nonlinear electrical circuit by means of modern nonlinear techniques and the control of a class of chaotic system by using backstepping method based on Lyapunov function. The behavior of such nonlinear system when they are under the influence of external sinusoidal disturbances with unknown amplitudes has been considered. The objective is to analyze the performance of this system at different amplitudes of disturbances. We illustrate the proposed approach for controlling duffing oscillator problem to stabilize this system at the equilibrium point. Also Genetic Algorithm method (GA) for computing the parameters of controller has been used. GA can be successfully applied to achieve a better controller. Simulation results have shown the effectiveness of the proposed method.


---

## Body

## 1. Introduction

During the past years, many people have assigned a lot of endeavor in both theoretical research and implementation techniques fields to study nonlinear control problems. The chaotic dynamic systems can be observed in many nonlinear circuits and mechanical systems. Recently, more knowledge is obtained about the nature of chaos and number of possible applications of chaotic system increases, and scientific interests are directed to problem of controlling a chaotic system [1, 2]. Control of the chaotic dynamical systems has been a significant research topic in physics, mathematics, and engineering communities [3–8]; however, some of them cannot gain desirable control performance, and some of them need consumedly complex design methods.The backstepping method is a technique for stabilizing control of a special class of nonlinear dynamical systems that has been developed in 1990 by Petar V. Kokotovie and others. Lyapunov techniques have been proven to be the most efficient for investigating stability of equilibrium point. Asymptotic stability can be also used to show boundedness of the solutions even when the system has no equilibrium point. In this paper, a combination of the backstepping method and Lyapunov-based techniques is presented to yield a flexible controller.In recent years, an optimization method called Genetic Algorithm has been introduced, due to the flexibility, versatility, and robustness in solving optimization problems. The main advantages of Genetic Algorithm are (i) fast convergence to near global optimum, (ii) super global searching capability in complicated search space, and (iii) applicability even when gradient information is not readily achievable [9]. In this work the Genetic Algorithms are applied to determine the optimal values of the parameters of the controller.The organization of paper is as follows: in Section2, the mathematical model of Duffing oscillator is presented. In Section 3, a flexible controller is designed that can be tailored to serve slightly target. In Section 4, Genetic Algorithm is used to give the best controller’s parameters that need to be carefully chosen for obtaining the best performance. Finally, conclusions are presented in Section 5.


## 2. Mathematical Model of Electrical Circuit

A nonlinear electric circuit is shown in Figure1 derived by a sinusoidal voltage source. The Duffing electrical oscillator consists of the linear resistor, in series with a sinusoidal source, and both of them are connected in parallel with a capacitor and a nonlinear inductor. According to [10] the nonlinear inductor has ferromagnetic core, which can be modeled, if an abstraction of the hysteresis phenomenon is made, by using i-φ nonlinear characteristic. Nonlinear inductance characteristics described by the following relation:(2.1)i=a1φ+a3φ3,
where a1 and a3 are constants that depend on the type of the inductor [11], and φ is the flux over inductor. The nonlinear differential equation of the circuit is given by(2.2)VR+VL=Ecos⁡ωτ,iR=i+ic,
where ir and ic are, respectively, the currents of the resistor and capacitor, and the voltage of the resistance and the inductor VR and VL is:(2.3)VR=Rir,VL=dφdτ,ic=Cdφdτ.
By substituting (2.1) and (2.3) in (2.2), the following differential equation can be obtained:(2.4)d2φdτ2+1RCdφdτ+a1Cφ+a3Cφ3=E0RCcos⁡ωτ.
By setting t=ωeτ, φ=φ0x, ε=1/RCωe, ωe2=a1/C, b2=a3φ02/Cωe, u=E0/Ra1φ0cosωt, electrical circuit is described by the following equation:(2.5)d2φdt2+εdφdt+φ+bφ3=u.
The following control law, u=f(x1,x2)  is proposed, where f is a nonlinear function that shall be found to stabilize the closed-loop system. The state space formulation is as follows:(2.6)[x1x2]=[φφ̇]⟹[ẋ1ẋ2]=[x2g(x1,x2)+u],g(x1,x2)=-εx2-x1-b2x13.
And equilibrium points are, x1=0,1/b and x2=0.Figure 1
The electric circuit obeying to the Duffing equation.The system dynamics near equilibrium points by using linearization techniques [12] are given by(2.7)[ẋ1ẋ2]≅[01-1-3bx12-ε][x1x2]+[01]u,Ẋ≅AX+BU.
Eigenvalue of resulting A is(2.8)λ=12(-ε±ε2-4-12bx12).
Since ε<2, the origin equilibrium point will have complex conjugate eigenvalue with negative real parts indicating stable focus.The objective of this paper is to design a control law such that the origin is a globally stable equilibrium point and to force the system to approach the origin from any initial condition while exhibiting a satisfactory transient performance. In the following section, we introduce a strategy to design a nonlinear recursive control law.


## 3. Controller Design

### 3.1. Preliminary Controller Design

In this paper, the backstepping method is used such that the closed-loop system is stabilized in the origin. The second state of the system (2.6) x2 is used as a virtual control signal for the system output x1. The following nonlinear dynamics will be considered for the desired virtual control signal [13]:(3.1)x2d=-C1x1-C2x23,
where C1 and C2 are design parameters that must be carefully selected such that closed-loop system is stable. The nonlinear term C2 introduces a nonlinear spring-like action. It should be chosen such that little effect for small output deviation, and a considerable effect when the deviation from the origin is large. The signal x2d acts as a reference model for the system state x2, the difference between them will be derived to zero in a finite time. The virtual error is given by(3.2)e=x2-x2d=x2+x2(C1+C2x22).
By substituting (3.1) and (3.2) in (2.6), new state-space presentation of system will be(3.3)[ẋ1ė]=[e-C1x1-C3x13ẋ2+x2(C1+C2x12)]=[e-C1x1-C3x13g(x1,x2)+u+x2(C1+C2x12)].
The stability is investigated by using the Lyapunov second method. By introducing the following positive definite Lyapunov function as(3.4)V=12x12+12e2,
results (3.5)V̇=x1ẋ1+eė=-C1x12-C2x14+e{x1+g(x1,x2)+u+x2(C1+C2x12)}.
If we have(3.6)C3e=-{x1+g(x1,x2)+u+x2(C1+C2x12)},the result is(3.7)V̇=-C1x12-C2x14-C3e2,
where C3 is a design parameter, and the control law u is selected such that V̇ is ensured to be negative definite. By using (3.2) and (3.7), we have(3.8)x1+g(x1,x2)+u+x2(C1+C2x12)=-C3(x2+C1x1+C2x13).
This can be rewritten in the following form:(3.9)g(x1,x2)+u=-x1(1+C1C3)-x2(C1+C3)-x12C2(3x2+C3x1)=W(x1,x2).
The following control law is chosen(3.10)u(x1,x2)=W(x1,x2)-g(x1,x2).
Because of the special dynamical structure of the system, the designed control u is causal and can be easily executed by careful choose of the design parameters.The resulting closed-loop system by using this controller is given by(3.11)[ẏė]=[-C1-C2y2-11-C3][ye].
By substituting e=ẏ+C1y+C2y3,ė=-y-C3e in (3.11), the output dynamics is(3.12)ÿ+ẏ(C1+C3)+y(1+C1C3)+C2(3y2ẏ+C3y3)=0.


### 3.2. Choosing the Controller Parameters

With reference to (3.12), there are no constraints on choosing the proposed design parameters Ci>0, i = 1, 2, and 3. This lets us more flexibile in design criteria in transient behavior of the system for satisfying a certain performance criterion for the closed-loop system. However, when choosing the best values for the parameters, we should also consider the nonlinearities of the system that has been studied and the maximum control effort that can be used to avoid having a poor performance. To show this idea, a linear reference model is used by letting C2=0 (the closed-loop system can be made linear, but this will be on the expense of losing the useful cubic nonlinearity in (3.1)), which can be made a standard linear second-order system whose performance is characterized by two parameters: damping ratio ξ and natural damping frequency ωn. So we have(3.13)C2=0⟹ÿ+ẏ(C1+C3)+y(1+C1C3)=ÿd+2ζωnẏd+ωn2y=0,ζ=C1+C321+C1C3,ωn=1+C1C3.
Hence, there are more constraints on the choice of the remaining control parameters, C1 and C3, depending on the required values of both ξ and ωn.Practical and simple solution to this problem is to try to pattern the behavior of the well-known PID controllers. Since the required equilibrium point is the origin, a PD controller is sufficient. By using (2.6), (3.7), and (3.10), an explicit form for the control law is given by(3.14)u={x1(-C1C3)+x2(-C1-C3+ε)}+{b2x13-C2C3x13-3C2x2x12}=uPD+uNL,
where uPD is the linear PD controller with KP=x1(-C1C3), and KD=(-C1-C3+ε). uNL, is the nonlinear term that has a little effect provided that ∥xi∥≤1, i = 1 and 2. For a given region of initial conditions, the control parameters can be chosen such that uPD will always dominate uNL, thus ensuring a self-corrective action that will add robustness to the control law design when the system dynamics are partially known. This will indeed be the case when the system operates near the origin, and the control law is smooth enough so not to inject sharp incursions in the system states [13].


### 3.3. Simulation Results

In this section, we depict some simulation results by using different type of controllers in different disturbance conditions.Figure2 illustrates Duffing system without any disturbance. The origin has stable focus and the states after about 50 second converge to the zero with 2% tolerance. Now disturbance is applied to the system with amplitude 0.01, which is shown in Figure 3. Phase portrait shows that the origin is stable focus, but the states have tolerance 4%. Then amplitude of disturbance increases to 0.1. Phase portrait has a little change to limit cycle, and we have periodical response, which is shown in Figure 4 (simulations have been done for ε=0.18,b=1, initial conditions =(1,0)).(a) Phase portrait, (b) states without input.
(a)(b)(a) Phase portrait, (b) states. disturbance with amplitude 0.01.
(a)(b)(a) Phase portrait, (b) states, and disturbance with amplitude 0.1.
(a)(b)Our controller has two sections, linear and nonlinear parts. The effect of disturbance and controller(uPD,uNL) is shown in Figure 5 for disturbance 0.1 when the controller parameters are C1=4, C2=0, C3=2. Figures 5(a-1) and 5(b-1) show the states without disturbance and controller. Figures 5(a-2) and 5(b-2) show the states with disturbance that causes increasing tolerance, and we have periodic response. Figures 5(a-3) and 5(b-2) show the states with nonlinear control. Unfortunately, it is seen that the nonlinear controller cannot decrease tolerance well, but it can decrease amplitude of tolerance. Figures 5(a-4) and 5(b-2) show the effects of nonlinear and linear controllers. Tolerance, settling time, rise time, and error have been decreased.The effects of linear, nonlinear, and disturbance with amplitude 0.1 (a) phase portrait, (b) states.
(a)(b)Now, the amplitude of disturbance increases to 1, and the previous parameters of controller are applied to the system. This result is shown in Figure6. This controller cannot force system’s states to converge to origin and decrease tolerance. The result shows that the controller does not have a good ability to control disturbance with this parameters. We choose another parameters such that C1=4, C2=1, C3=2. The result has been improved but is not satisfactory yet. This is shown in Figure 7. In the next section, we will see that the Genetic Algorithm can be employed for choosing appropriate parameters.The effects of linear, nonlinear, and disturbance with amplitude 1 (a) phase portrait, (b) states.
(a)(b)Figure 7
The effects of linear, nonlinear, and disturbance with amplitude 1 (a) phase portrait, (b) states.


## 3.1. Preliminary Controller Design

In this paper, the backstepping method is used such that the closed-loop system is stabilized in the origin. The second state of the system (2.6) x2 is used as a virtual control signal for the system output x1. The following nonlinear dynamics will be considered for the desired virtual control signal [13]:(3.1)x2d=-C1x1-C2x23,
where C1 and C2 are design parameters that must be carefully selected such that closed-loop system is stable. The nonlinear term C2 introduces a nonlinear spring-like action. It should be chosen such that little effect for small output deviation, and a considerable effect when the deviation from the origin is large. The signal x2d acts as a reference model for the system state x2, the difference between them will be derived to zero in a finite time. The virtual error is given by(3.2)e=x2-x2d=x2+x2(C1+C2x22).
By substituting (3.1) and (3.2) in (2.6), new state-space presentation of system will be(3.3)[ẋ1ė]=[e-C1x1-C3x13ẋ2+x2(C1+C2x12)]=[e-C1x1-C3x13g(x1,x2)+u+x2(C1+C2x12)].
The stability is investigated by using the Lyapunov second method. By introducing the following positive definite Lyapunov function as(3.4)V=12x12+12e2,
results (3.5)V̇=x1ẋ1+eė=-C1x12-C2x14+e{x1+g(x1,x2)+u+x2(C1+C2x12)}.
If we have(3.6)C3e=-{x1+g(x1,x2)+u+x2(C1+C2x12)},the result is(3.7)V̇=-C1x12-C2x14-C3e2,
where C3 is a design parameter, and the control law u is selected such that V̇ is ensured to be negative definite. By using (3.2) and (3.7), we have(3.8)x1+g(x1,x2)+u+x2(C1+C2x12)=-C3(x2+C1x1+C2x13).
This can be rewritten in the following form:(3.9)g(x1,x2)+u=-x1(1+C1C3)-x2(C1+C3)-x12C2(3x2+C3x1)=W(x1,x2).
The following control law is chosen(3.10)u(x1,x2)=W(x1,x2)-g(x1,x2).
Because of the special dynamical structure of the system, the designed control u is causal and can be easily executed by careful choose of the design parameters.The resulting closed-loop system by using this controller is given by(3.11)[ẏė]=[-C1-C2y2-11-C3][ye].
By substituting e=ẏ+C1y+C2y3,ė=-y-C3e in (3.11), the output dynamics is(3.12)ÿ+ẏ(C1+C3)+y(1+C1C3)+C2(3y2ẏ+C3y3)=0.


## 3.2. Choosing the Controller Parameters

With reference to (3.12), there are no constraints on choosing the proposed design parameters Ci>0, i = 1, 2, and 3. This lets us more flexibile in design criteria in transient behavior of the system for satisfying a certain performance criterion for the closed-loop system. However, when choosing the best values for the parameters, we should also consider the nonlinearities of the system that has been studied and the maximum control effort that can be used to avoid having a poor performance. To show this idea, a linear reference model is used by letting C2=0 (the closed-loop system can be made linear, but this will be on the expense of losing the useful cubic nonlinearity in (3.1)), which can be made a standard linear second-order system whose performance is characterized by two parameters: damping ratio ξ and natural damping frequency ωn. So we have(3.13)C2=0⟹ÿ+ẏ(C1+C3)+y(1+C1C3)=ÿd+2ζωnẏd+ωn2y=0,ζ=C1+C321+C1C3,ωn=1+C1C3.
Hence, there are more constraints on the choice of the remaining control parameters, C1 and C3, depending on the required values of both ξ and ωn.Practical and simple solution to this problem is to try to pattern the behavior of the well-known PID controllers. Since the required equilibrium point is the origin, a PD controller is sufficient. By using (2.6), (3.7), and (3.10), an explicit form for the control law is given by(3.14)u={x1(-C1C3)+x2(-C1-C3+ε)}+{b2x13-C2C3x13-3C2x2x12}=uPD+uNL,
where uPD is the linear PD controller with KP=x1(-C1C3), and KD=(-C1-C3+ε). uNL, is the nonlinear term that has a little effect provided that ∥xi∥≤1, i = 1 and 2. For a given region of initial conditions, the control parameters can be chosen such that uPD will always dominate uNL, thus ensuring a self-corrective action that will add robustness to the control law design when the system dynamics are partially known. This will indeed be the case when the system operates near the origin, and the control law is smooth enough so not to inject sharp incursions in the system states [13].


## 3.3. Simulation Results

In this section, we depict some simulation results by using different type of controllers in different disturbance conditions.Figure2 illustrates Duffing system without any disturbance. The origin has stable focus and the states after about 50 second converge to the zero with 2% tolerance. Now disturbance is applied to the system with amplitude 0.01, which is shown in Figure 3. Phase portrait shows that the origin is stable focus, but the states have tolerance 4%. Then amplitude of disturbance increases to 0.1. Phase portrait has a little change to limit cycle, and we have periodical response, which is shown in Figure 4 (simulations have been done for ε=0.18,b=1, initial conditions =(1,0)).(a) Phase portrait, (b) states without input.
(a)(b)(a) Phase portrait, (b) states. disturbance with amplitude 0.01.
(a)(b)(a) Phase portrait, (b) states, and disturbance with amplitude 0.1.
(a)(b)Our controller has two sections, linear and nonlinear parts. The effect of disturbance and controller(uPD,uNL) is shown in Figure 5 for disturbance 0.1 when the controller parameters are C1=4, C2=0, C3=2. Figures 5(a-1) and 5(b-1) show the states without disturbance and controller. Figures 5(a-2) and 5(b-2) show the states with disturbance that causes increasing tolerance, and we have periodic response. Figures 5(a-3) and 5(b-2) show the states with nonlinear control. Unfortunately, it is seen that the nonlinear controller cannot decrease tolerance well, but it can decrease amplitude of tolerance. Figures 5(a-4) and 5(b-2) show the effects of nonlinear and linear controllers. Tolerance, settling time, rise time, and error have been decreased.The effects of linear, nonlinear, and disturbance with amplitude 0.1 (a) phase portrait, (b) states.
(a)(b)Now, the amplitude of disturbance increases to 1, and the previous parameters of controller are applied to the system. This result is shown in Figure6. This controller cannot force system’s states to converge to origin and decrease tolerance. The result shows that the controller does not have a good ability to control disturbance with this parameters. We choose another parameters such that C1=4, C2=1, C3=2. The result has been improved but is not satisfactory yet. This is shown in Figure 7. In the next section, we will see that the Genetic Algorithm can be employed for choosing appropriate parameters.The effects of linear, nonlinear, and disturbance with amplitude 1 (a) phase portrait, (b) states.
(a)(b)Figure 7
The effects of linear, nonlinear, and disturbance with amplitude 1 (a) phase portrait, (b) states.


## 4. Genetic Algorithm

In this section, we propose a Genetic Algorithm optimization search to find the best parameters of controller. The terminology adopted in GAs contains many terms extracted from biology, suitably redefined to fit the algorithm context. Thus, GAs act on a set of (artificial) chromosomes, which are string of numbers, generally sequences of binary digits 0 and 1. If the objective function of the optimization has many arguments (typically called control factors or decision variables), each string is partitioned in as many substrings of assigned lengths, one for each argument and correspondingly, we say that each chromosome is partitioned in (artificial) genes. The genes constitute the so-called genotype of chromosome, and the substrings, when decoded in real numbers, constitute its phenotype. When the objective function is evaluated in a set of values of the control factors of chromosome, its value is called the fitness of chromosome. Thus, each chromosome gives rise to an exam solution to the problem in a set of values of its control factors. The GA search is done by constructing a consecutive of populations of chromosomes. The individuals of each population are the children of the previous population and the parents of the consecutive population.The initial population is generated by randomly sampling the bits of all string. At each step, the new population gets by manipulating the strings of the old population in order to arrive at afresh population characterized by an increased mean fitness. This sequence continues until termination criterion is achieved. As for the natural selection, the string manipulation consists in selecting and mating pair of chromosomes in order to groom chromosomes of next population. This is done by repeatedly performing on the strings of the four fundamental operations of reproduction, crossover, replacement, and mutation, all based on random sampling [14].In this work, parameters of controller have been found by a Genetic Algorithm considers a population of 100 chromosomes. Each chromosome of the three genes, each coding one of the three parametersC1, C2, C3 is made, and the fitness function is(4.1)f=800sum(error2).
After optimization, the parameters of controller will be found as C1=7.5209, C2=1.6764, C3=8.4173. Figure 8 shows the cost function after 10 iteration. Figure 9 shows that the results have been improved, and these parameters are the best one which there are to receive the goals.Figure 8
Cost function after 10 iteration.(a) Phase portrait and (b) states. The effects of linear, nonlinear, and disturbance with amplitude 1.
(a)(b)


## 5. Conclusion

Nonlinear control strategy was used for a nonlinear system which describes the dynamics of resistively Duffing oscillator. The study shows the effectiveness of the proposed technique for different amplitude of disturbance. The designed controller has two goals: first stabilizing the system and second decreasing the error. Usually a contradiction occurs if these two goals are to be achieved at the same time, but the designed controller resolves such contradiction by introducing a flexible set of controller parameters that adds more freedom in the design.In absence of disturbance, the phase portrait is focus, then the amplitude of disturbance is increased, the phase portrait is converted to limit cycle, and the responses are periodic.The controller includes two parts: linear and nonlinear. Pay attention that the nonlinear effect is weaker than linear effect, and when controller is used, there is tolerance 2%, and it runs to stability soon.



---

*Source: 597328-2012-04-01.xml*