Sliding Mode Control (SMC) + PID Cascade Loop

12 ビュー (過去 30 日間)
Junaid
Junaid 2025 年 3 月 13 日
コメント済み: Junaid 2025 年 3 月 21 日
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 件のコメント
Sam Chak
Sam Chak 2025 年 3 月 17 日
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
Junaid
Junaid 2025 年 3 月 17 日
編集済み: Junaid 2025 年 3 月 17 日
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 ) )

サインインしてコメントする。

回答 (1 件)

Sam Chak
Sam Chak 2025 年 3 月 18 日
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 件のコメント
Sam Chak
Sam Chak 2025 年 3 月 20 日
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
Junaid
Junaid 2025 年 3 月 21 日
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.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeController Creation についてさらに検索

製品


リリース

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by