Main Content

Stabilize Chua System Using Sliding Mode Controller

Since R2025a

This example show how to design a sliding mode controller (SMC) to stabilize a Chua system. Chua circuit is a well-known electronic circuit capable of exhibiting chaotic behavior, making it a fundamental component in chaos theory studies. The circuit consists of a nonlinear resistor (Chua diode), two capacitors, an inductor, and linear resistors, and was among the first circuits to generate chaotic signals.

Nonlinear Model

In this example, Chua diode is placed in parallel with capacitor C1, introducing the nonlinearity essential for chaos. The circuit also includes a resistor and a series combination of capacitor C2 and inductor L. These components interact to produce complex dynamics, with the voltages across C1 and C2 and the current through L evolving over time. The system behavior is highly sensitive to its parameters, providing a rich platform for exploring chaotic phenomena. The dynamics of the circuit are described by the following equations:

dv1dt=v2-v1RC1-g(v1)C1dv2dt=v1-v2RC2+iLdiLdt=-v2L+u

Here, the constitutive relation of the nonlinear resistor is defined as g(v1)=-15v1(1-v12)

Define the model parameters.

R  = 1/0.7; % Resistance in Ohms (Ω)
L  = 1/7;   % Inductance of L in Henrys (H)
C1 = 1/10;  % Capacitance of C1 in Farad (F)
C2 = 1/0.5; % Capacitance of C2 in Farad (F)

Simulation

To observe the open loop behavior of the system, set the initial state variables and simulate the dynamics.

Define the initial state of the circuit.

x0 = [0.4; 0.2; 0.5]; % [v1, v2, il]

Open the system and select the variant of the controller subsystem as OpenLoop.

open_system('smc_chua_system');
set_param('smc_chua_system/Variant Subsystem','OverrideUsingVariant','OpenLoop')

Simulate the model.

simOpenLoop = sim('smc_chua_system',100);

Plot the state responses onto (iL,V1), (iL,V2), and (V1,V2) planes.

plotResults('Open-Loop Simulation', simOpenLoop);

Figure contains 4 axes objects. Axes object 1 with title (i indexOf L baseline ,v indexOf 1 baseline )-plane, xlabel i_L, ylabel V_1 contains an object of type line. Axes object 2 with title (i indexOf L baseline ,v indexOf 2 baseline )-plane, xlabel i_L, ylabel V_2 contains an object of type line. Axes object 3 with title (v indexOf 2 baseline ,v indexOf 1 baseline )-plane, xlabel V_2, ylabel V_1 contains an object of type line. Axes object 4 with title (v indexOf 1 baseline ,v indexOf 2 baseline ,i indexOf L baseline )-plane, xlabel V_1, ylabel V_2 contains an object of type line.

SMC Controller

To implement SMC, this example uses the Linear Sliding Mode Controller (State Feedback) block. This block requires model parameters in the form of matrices A andB for a regulation problem. Considering the Chua's diode as a bounded disturbance, you can rewrite the model dynamics using a state-space representation,x˙(t)=Ax(t)+Bu(t)+d(x).

The state vector is x(t)=[v1v2iL]Tand the state space representation is defined as:

x˙(t)=[-1RC11RC101RC21RC210-1L0]Ax(t)+[001]Bu(t)+[-g(x1)C100]d

Here, the term d is considered as the disturbance for this example.

Define the matrices.

A = [-1/(C1*R), 1/(C1*R), 0; 1/(C2*R), -1/(C2*R), 1/C2; 0, -1/L, 0];
B = [0; 0; 1];

The model provided with this example is preconfigured to use the Linear Sliding Mode Controller block with the following parameter values:

  • Reaching Rate (η) = 4

  • Control Gain (κ) = 1

  • Weighted Matrix = diag([10 10 1])

Note that the Reaching Rate (η) and Control Gain (κ) are parameters related to the reaching law, which dictates how quickly the system states converge to the sliding surface. The Weighted Matrix, on the other hand, characterizes the system dynamics once it is on the sliding surface, influencing the system response and stability during sliding mode operation. These parameters collectively shape the controller's performance in stabilizing the chaotic behavior of the Chua circuit.

To enable the Sliding Mode Controller, set the subsystem to ClosedLoop.

set_param('smc_chua_system/Variant Subsystem','OverrideUsingVariant','ClosedLoop')

Simulate the model without a boundary layer:

set_param(['smc_chua_system/Variant Subsystem/Closed Loop/' ...
    'Linear Sliding Mode Controller (State Feedback)'], 'BoundaryLayer', 'Sign');
simNoBoundaryLayer = sim('smc_chua_system',5);

Plot the open-loop and closed-loop simulation results.

plotResults('Open/Closed-Loop Simulation', simOpenLoop, simNoBoundaryLayer);

Figure contains 4 axes objects. Axes object 1 with title (i indexOf L baseline ,v indexOf 1 baseline )-plane, xlabel i_L, ylabel V_1 contains 2 objects of type line. Axes object 2 with title (i indexOf L baseline ,v indexOf 2 baseline )-plane, xlabel i_L, ylabel V_2 contains 2 objects of type line. Axes object 3 with title (v indexOf 2 baseline ,v indexOf 1 baseline )-plane, xlabel V_2, ylabel V_1 contains 2 objects of type line. Axes object 4 with title (v indexOf 1 baseline ,v indexOf 2 baseline ,i indexOf L baseline )-plane, xlabel V_1, ylabel V_2 contains 2 objects of type line.

As illustrated in the plot, the sliding mode controller effectively drives the system state variables to zero from the initial conditions. This demonstrates the controller capability to stabilize the chaotic dynamics of the Chua circuit, ensuring that the states converge to the desired equilibrium point. The closed-loop response highlights the efficiency of the SMC in regulating the system behavior, contrasting with the open-loop scenario where the system exhibits chaotic characteristics.

Plot the state response.

figure;
simNoBoundaryLayer = simNoBoundaryLayer.logsout.extractTimetable;
simNoBoundaryLayer = splitvars(simNoBoundaryLayer,"x", "NewVariableNames",["V1", "V2", "iL"]);

s = stackedplot(simNoBoundaryLayer,["V1","V2","iL"]);
s.Title = 'State Reponse';
s.GridVisible = "on";

Figure contains an object of type stackedplot. The chart of type stackedplot has title State Reponse.

Plot the control input response.

s = stackedplot(simNoBoundaryLayer,["s","u"]);
s.Title = 'Control Input Reponse';
s.GridVisible = "on";

Figure contains an object of type stackedplot. The chart of type stackedplot has title Control Input Reponse.

Reducing Chattering with Hyperbolic Tangent Boundary Layer

In sliding mode control, a common issue is the phenomenon known as chattering. Chattering is characterized by high-frequency oscillations in the control input, which can lead to undesirable effects such as increased wear in mechanical systems or noise in electronic circuits. To mitigate this, you can use a boundary layer approach.

This example uses a hyperbolic tangent function as the boundary layer to smooth the control action and reduce chattering. The hyperbolic tangent function provides a continuous transition around the sliding surface, effectively acting as a saturation function that limits the control effort within a specified range.

Set the controller to use the hyperbolic tangent boundary layer:

set_param('smc_chua_system/Variant Subsystem/Closed Loop/Linear Sliding Mode Controller (State Feedback)',...
    'BoundaryLayer', 'Hyperbolic Tangent');

Simulate the model with the boundary layer:

simWithBoundaryLayer = sim('smc_chua_system',5);

After applying the boundary layer, the control input becomes smoother, and the chattering effects are significantly reduced. You can observe this by comparing the control input and state responses with and without the boundary layer.

Plot the results to visualize the effect of the hyperbolic tangent boundary layer:

figure;
simWithBoundaryLayer = simWithBoundaryLayer.logsout.extractTimetable;
simWithBoundaryLayer = splitvars(simWithBoundaryLayer,"x", "NewVariableNames",["V1", "V2", "iL"]);

s = stackedplot(simNoBoundaryLayer, simWithBoundaryLayer,["V1","V2","iL"]);
s.Title = 'State Input Reponse';
s.GridVisible = "on";

Figure contains an object of type stackedplot. The chart of type stackedplot has title State Input Reponse.

s = stackedplot(simNoBoundaryLayer, simWithBoundaryLayer,"u");
s.Title = 'Control Input Reponse';
s.GridVisible = "on";

Figure contains an object of type stackedplot. The chart of type stackedplot has title Control Input Reponse.

This example highlights the effectiveness of the sliding mode controller in regulating the states of Chua system to zero, considering the nonlinearity effect as a bounded disturbance in the controller design. Additionally, it underscores the use of a hyperbolic tangent boundary layer in sliding mode control, which effectively reduces chattering and leads to smoother control actions. This approach enhances the practical applicability of sliding mode controllers in real-world systems, where chattering can be detrimental to system performance and longevity.

See Also

Topics