Sliding Mode Control (SMC) + PID Cascade Loop

Greetings,
I am struggling to tune the PID controller in an SMC implementation to control high frequency oscillations in a nonlinear plant.
I have a specific task I need to track slip speed of a 3-DOF clutch system by controlling its clamping force through SMC which I successfully achieved. However, the clamping force (i.e. the SMC control output) cant be fed directly to plant because in real system it must follow a specified tracjectory or profile. So I am providing clamping force profile and calculating its error with SMC output and feeding it to PID and the output of PID is fed into plant. But PID is unable to track the output properly.
I have attached my model here. If anyone has any insights please help.
I am able to achieve this task with cascade PID approach but it is not robust.
Results with Cascade PID and MPC. Both are not robust.

4 Comments

From the output matrix of the state-space in clutchStateFcn(), the clutch slip velocity is defined as the difference between the first and second state variables, as shown in, .
However, this output vector is fed back to the Sliding Mode Controller block, specifically into the sliding surface as , where is the sliding coefficient matrix and represents the system states. In your case, and the third state variable, , is missing.
Have you verified whether the sliding surface is Hurwitz-stable when ?
%% output matrix, C
% x1 x2 x3 x4
C = [1 -1 0 0; % y1 = x1 - x2 (slip velocity)
1 0 0 0; % y2 = x1
0 1 0 0; % y3 = x2
0 0 0 1]; % y4 = x4
Block diagram in clutch_SlidingModeControl.slx
Thank you @Sam Chak for your response. The Output matrix C is yielding y vector which is indeed not same as x vector which is the state vector. The reason why I am using y vector as an input to Sliding Mode block because I need to track slip speed which is x1-x2. Slip speed is not my direct state thats why I created this observer matrix C for the output vector y so that I can feed it into my Sliding Mode Controller block for reference tracking. And this works well and the system behaves as it should, robustly.
Now the challenge I am facing is bit unsual and tedious. I need to implement a PID in parallel to SMC block. This PID is trying to force the SMC output to follow a desired profile provided as reference. Which is difficult because reference tracking by PID in this case is very poor. I tried putting another SMC block instead of PID to track clamping force (output of first SMC) but it doesn,t work.
MPC gives me really great results but its not robust like SMC. And I dont want to use MPC because its not suitable for real world applications in automotives because of computational limitations.
I conducted an extraordinarily simple test.
When the ideal clamping force (r_Fn) is applied to the clutch system, is the response for the actual slip speed (v_slip) satisfactory?
Please keep in mind that this is the best achievable slip speed from the desired force. Otherwise, are you willing to accept anything less than the so-called ideal force to achieve tracking of the desired slip speed (r_slip)?
t = linspace(0, 1.2, 1201);
[r_slip, r_Fn] = Reference(t);
subplot(211)
plot(t, r_slip(1,:)), grid on, title('Reference trajectory for Slip speed, r_{slip}')
subplot(212)
plot(t, r_Fn), grid on, title('Reference trajectory for Clamping force, Fn')
Block Diagram: The ideal clamping force (r_Fn) is applied to the clutch system.
Comparison between the Reference Slip speed (yellow) and the Measured Slip speed (blue).
%% Function for Reference signals
function [r_slip, r_Fn] = Reference(t)
% Reference trajectory for Slip speed
r_s = 70 - 70*(t + 0.45);
r_s(r_s < 0) = 0;
r_slip = [r_s' zeros(length(r_s), 3)]';
% Reference trajectory for Clamping force
r_Fnn = 0*ones(size(t));
r_Fnn(t >= 0.3 & t < 0.45) = 1500;
r_Fnn(t >= 0.45 & t < 0.8) = 4000;
r_Fnn(t >= 0.8) = 6000;
r_Fn = r_Fnn;
end
Dynamo
Dynamo on 17 Mar 2025
Edited: Dynamo on 17 Mar 2025
Hello @Sam Chak,
Your Question: When the ideal clamping force (r_Fn) is applied to the clutch system, is the response for the actual slip speed (v_slip) satisfactory?
Answer: No, there is no ideal clamping force profile here. The reference trajectory need not be required to be perfectly tracked. However, it is important that the clamping force increase in steps as shown in reference trajectory of clamping force. And maximum clamping force never exceeds more than 6000 N.
We need to loosely follow the reference profile for this clamping force.
I hope this makes it clear.
Right now I am trying to create my own Sliding Mode function in Simulink, where I am defining a Sliding Surface which is a combination of errors of slip speed and clamping force.
E.g.:
S(x)=e ̇_(slip )+λ_1 e_slip+α(e ̇_(F_n )+λ_2 e_(F_n ) )

Sign in to comment.

Answers (1)

I understand that the clamping force must be increased incrementally from 0 kN and must not exceed 6 kN. You aim to track the reference trajectory for slip speed using the clamping force; however, the force must also be delivered in accordance with a desired profile and is subject to constraints. There are two control objectives, yet only one actuation signal is available, which is considered a form of underactuation. Only one objective can be beautifully achieved.
If following a predefined profile for the clamping force is the primary requirement, then delivering an open-loop clamping force signal is sufficient, as the slip velocity will eventually decrease and converge to a steady-state value. It is important to note that the open-loop clamping force does not depend on the reference trajectory for slip speed.
However, if no force is applied during the first 0.3 seconds, and the slip velocity error at time t = 0 is signficant (70 - 38.5 = 31.5), the transient response will be slow. Furthermore, a discontinuous force signal will generate high-frequency oscillations when the force changes rapidly.
I am uncertain whether your proposed sliding surface will work, as it creates a form of algebraic loop. Consider that you want to deliver the SMC-based clamping force F to the clutch system. However, the force itself is circularly dependent, expressed as
F = smc(Vslip, F).
tspan = linspace(0, 1.2, 12001);
x0 = [70; 0; 0; 0];
[t, x] = ode45(@clutchStateFcn, tspan, x0);
u = zeros(1, numel(t));
for j = 1:numel(t)
[~, u(j)] = clutchStateFcn(t(j), x(j,:).');
end
%% reference trajectory for slip speed
r_slip = max(0, 70 - 70*(t + 0.45)); % as in Simulink model
v_slip = x(:,1) - x(:,2);
%% plot results
tL = tiledlayout(2, 1, 'TileSpacing', 'Compact');
nexttile
plot(t, u), grid on, ylim([-1000, 7000])
title('Open-loop Discontinuous Clamping Force (Input)')
nexttile
plot(t, [r_slip, v_slip]), grid on
xline(0.30, '--')
xline(0.45, '--')
xline(0.80, '--')
legend('Reference', 'Actual')
xlabel(tL, 'Time / s'), title('Slip Velocity (Output)')
text(0.10, 60, '\leftarrow 0.0 kN')
text(0.32, 40, '\downarrow 1.5 kN')
text(0.55, 20, '\downarrow 4.0 kN')
text(0.93, 20, '\downarrow 6.0 kN')
%% Clutch System Dynamics
function [dxdt, u] = clutchStateFcn(t, x)
%% Parameters
je = 1.57;
jd = 0.0066;
jv = 4;
ks = 56665.5;
zeta = 0.01;
de = 2*zeta*sqrt(ks*je);
ds = 2*zeta*sqrt(ks*jd*jv/(jd+jv));
mu0 = 0.136;
muk = -0.0001;
np = 14;
Rm = 0.0506;
Te = 100;
Vslip = x(1) - x(2);
g1 = (np*Rm*(mu0 + muk*Vslip)*tanh(2*Vslip))/je;
g2 = (np*Rm*(mu0 + muk*Vslip)*tanh(2*Vslip))/jd;
f1 = - de/je*x(1);
f2 = - ds/jd*x(2) + ds/jd*x(3) + ks/jd*x(4);
%% State matrix
% x1 x2 x3 x4
A = [-de/je 0 0 0;
0 -ds/jd ds/jd ks/jd;
0 ds/jv -ds/jv -ks/jv;
0 -1 1 0];
%% Input matrix
Bo = [Te/je -g1;
0 g2;
0 0;
0 0];
Bd = Bo(:,1); % external disturbance
B = Bo(:,2); % control input matrix
%% Output matrix
C = [1 -1 0 0;
1 0 0 0;
0 1 0 0;
0 0 0 1];
%% Clamping Force (Open-loop Control signal)
r_Fnn = 0*ones(size(t));
r_Fnn(t >= 0.3 & t < 0.45) = 1500;
r_Fnn(t >= 0.45 & t < 0.8) = 4000;
r_Fnn(t >= 0.8) = 6000;
u = r_Fnn;
%% state-space model
dxdt= A*x + B*u + Bd; % state equation
y = C*x; % output equation
end

3 Comments

Hello @Sam Chak,
Thanks again for your response.
I understand there is an algebraic loop in the control structure. And for some reason I dont know how to get rid of it at the moment, as I need to attenuate the oscillations in slip speed and keep the clamping force in desired trajectory.
Here is something interesting I got to do with SMC+PID approach I mentioned aboved. I was able to tune PID enough that, my SMC output was in accordance with what I was desiring from PID. Which is weird to me! I dont understand why SMC is filling in for the deificiencies of the PID?
I am providing the PID output as input to my plant. And here is how my slip speed looks like:
This is the control architecture I am following for this:
I believe there has to be something that can be done to make this work. PID is indeed assisting SMC to follow a trajectory implicitly. If I can add a relaxation parameter on the control output of SMC+PID combined then may be I can achieve robustness as well with this cascade structure at expense of clamping force reference tracking.
What are your thoughts?
Kudos! Your results are remarkably impressive. How did you achieve that with a modified SMC + PID configuration? Although the reference slip velocity is slightly not perfectly tracked, the clamping force is delivered to the clutch system as desired, following the reference three-step profile.
In my experiments, I am only able to achieve effective slip velocity tracking with a basic nonlinear Proportional Controller when the clamping force is unconstrained. My 600,000 N is 100 times larger than the max limit 6,000 N!
tspan = linspace(0, 1.2, 12001);
x0 = [70; 0; 0; 0];
[t, x] = ode45(@clutchStateFcn, tspan, x0);
% Pre-allocate for the control signal u
u = zeros(1, numel(t));
% Using for-loop indexing method to call odefcn() and return u
for j = 1:numel(t)
[~, u(j)] = clutchStateFcn(t(j), x(j,:).');
end
r_slip = max(0, 70 - 70*(t + 0.45));
v_slip = x(:,1) - x(:,2);
% x1out = x(:,1);
% x2out = x(:,2);
% x1out(end)
% x2out(end)
figure
plot(t, [r_slip, v_slip]), grid on
xlabel('Time / s'), title('Slip Velocity')
legend('Reference slip velocity', 'Actual slip velocity', 'fontsize', 11)
figure
plot(t, u), grid on, % xlim([0.8, 1])
xlabel('Time / s'), title('Clamping Force')
%% Dynamics
function [dxdt, u] = clutchStateFcn(t, x)
%% Parameters
je = 1.57;
jd = 0.0066;
jv = 4;
ks = 56665.5;
zeta = 0.01;
de = 2*zeta*sqrt(ks*je);
ds = 2*zeta*sqrt(ks*jd*jv/(jd+jv));
mu0 = 0.136;
muk = -0.0001;
np = 14;
Rm = 0.0506;
Te = 100;
Vslip = x(1) - x(2);
g1 = (np*Rm*(mu0 + muk*Vslip)*tanh(2*Vslip))/je;
g2 = (np*Rm*(mu0 + muk*Vslip)*tanh(2*Vslip))/jd;
f1 = - de/je*x(1);
f2 = - ds/jd*x(2) + ds/jd*x(3) + ks/jd*x(4);
%% State matrix
% x1 x2 x3 x4
A = [-de/je 0 0 0;
0 -ds/jd ds/jd ks/jd;
0 ds/jv -ds/jv -ks/jv;
0 -1 1 0];
%% Input matrix
Bo = [Te/je -g1;
0 g2;
0 0;
0 0];
Bd = Bo(:,1); % external disturbance
B = Bo(:,2); % control input matrix
%% Output matrix
C = [1 -1 0 0;
1 0 0 0;
0 1 0 0;
0 0 0 1];
%% Reference trajectory for Slip speed
r_slip = max(0, 70 - 70*(t + 0.45));
dr_slip = 70*heaviside(t - 11/20) - 70;
%% Unconstrained Clamping Force
K = max(5, 30 - 60*t);
u = (f1 - f2 + Te/je + K*(Vslip - r_slip) - dr_slip)/(g1 + g2);
%% state-space model
dxdt= A*x + B*u + Bd; % state equation
y = C*x; % output equation
end
Hello @Sam Chak,
Thanks!
I did something different this time to make it work. Following are robust SMC results with slip speed and clamping force tracking without needing the PID in loop.
I converted the system dynamics as a function of error.
e = func(omega_slip, u);
t-> inf, e->0
and I build my SMC controller for the error dynamics instead of actual plant dynamics. and Voila!
I still need to tune the controller more to get robustness.

Sign in to comment.

Products

Release

R2024b

Asked:

on 13 Mar 2025

Commented:

on 21 Mar 2025

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!