Disturbance observer and prescribed time controller
26 views (last 30 days)
Show older comments
Hi, I simulated a disturbance observer based prescribed time controller, but I'm facing two problems :
1- When I choose a really small Tfc in the follwoing code, a singularity is resulted in the second state.
2- I wanted to see the performance of the disturbance observer. Unfortunately, it doesn't change. No matter what I choose as its settling time.
clear all
close all
clc
t0 = 0;
tf = 10;
dt = 0.001;
t = t0:dt:tf;
a = 0.01;
tau = 6.65/7;
h = 3;
delay = h/dt;
Tfc = 5;
eps1 = -2;
eps2 = 3;
d = 2*sin(0.2*pi*t)+0.15*sin(2*pi*t);
% d = 0*ones(1,length(t));
D1 = 0.7*pi;
x10 = 1;
x20 = -1;
d_hat(1) = -2;
x1(1) = x10;
x2(1) = x20;
mu(1) = 0.3;
mu0 = mu(1);
b1 = 2;
b2 = 3;
phi(1) = mu(1)+x2(1);
phi1(1) = -b1*(1-exp(-x1(1)))/(Tfc-t(1));
Sd0 = 8;
W = @(s) exp(a*s).*(s-h).^5.*(2*h-s).^5;
Wc = 1/(integral(W,h,2*h));
for i=1:length(t)-1
if t(i)<h
Rh(i) = 0;
elseif t(i)>=h && t(i)<= 2*h
% Rh(i) = sin(pi*t(i)/h)^2;
Rh(i) = (t(i)-h).^5*(2*h-t(i)).^5;
else
Rh(i) = 0;
end
if (i-delay)<=0
mud(i) = mu0;
Sdd(i) = Sd0;
else
Sdd(i) = Sd(i-delay);
mud(i) = mu(i-delay);
end
z2(i) = x2(i)-phi1(i);
%% Predefined-time Backstepping controller
if t(i)<Tfc-0.0001
dphi1_dt(i) = -b1*(1-exp(-x1(i)))/(Tfc - t(i))^2-b1*x2(i)*exp(-x1(i))/(Tfc - t(i));
phi1(i+1) = phi1(i)+dphi1_dt(i)*(t(i+1)-t(i));
dphi1_dx1(i) = -b1*exp(-x1(i))/(Tfc - t(i));
phi2(i) = -b2*1/(Tfc - t(i))*(1-exp(-z2(i)));
else
dphi1_dt(i) = 0;
dphi1_dx1(i) = -1500;
phi1(i+1) = 0;
phi2(i) = 0;
end
u(i) = -(x1(i)+eps1*x1(i)+eps2*x2(i)*(1-(x1(i))^2)+d_hat(i)-dphi1_dt(i)-dphi1_dx1(i)*x2(i)-phi2(i));
K(i) = Rh(i)*Wc*exp(-a*(h-2*t(i)));
dx1(i) = x2(i);
x1(i+1) = x1(i)+dx1(i)*(t(i+1)-t(i));
dx2(i) = eps1*x1(i)+eps2*(1-x1(i)^2)*x2(i)+d(i)+u(i);
x2(i+1) = x2(i)+(t(i+1)-t(i))*dx2(i);
dphi(i) = eps1*x1(i)+eps2*(1-x1(i)^2)*x2(i)+u(i)+d_hat(i)-(a/(2*(1-tau))*mu(i)+K(i)/(2*(1-tau))*sign(mu(i))*(abs(mu(i)))^(2*tau-1)*abs(mud(i))^(2*(1-tau)));
phi(i+1) = phi(i)+dphi(i)*(t(i+1)-t(i));
mu(i+1) = phi(i+1)-x2(i+1);
%% Arbitrary Time Sliding Mode Disturbance Observer
dmu(i) = (mu(i+1)-mu(i))/dt;
Sd(i) = dmu(i)+a/(2*(1-tau))*mu(i)+K(i)/(2*(1-tau))*sign(mu(i))*(abs(mu(i)))^(2*tau-1)*abs(mud(i))^(2*(1-tau));
%dd_hat(i) = -(D1*sign(Sd(i))+a/(1-tau)*Sd(i)+K(i)/(1-tau)*abs(Sd(i))^(2*tau-1)*sign(Sd(i))*abs(Sdd(i))^(2*(1-tau)));
dd_hat(i) = -(D1+a/(2*(1-tau))*abs(Sd(i))+K(i)/(2*(1-tau))*abs(Sd(i))^(2*tau-1)*sign(Sd(i))*abs((Sdd(i)))^(2*(1-tau)))*sign(Sd(i));
d_hat(i+1) = d_hat(i)+(t(i+1)-t(i))*dd_hat(i);
end
set(gcf,'color','white')
subplot(2,2,1)
plot(t,x1,'r','LineWidth',1.2);grid minor
leg1 = legend({'$x_1(t)$'});
set(leg1,'Interpreter','latex');
xlabel('t(s)')
ylabel('x1')
ylim([-1 1])
subplot(2,2,2)
plot(t,x2,'b','LineWidth',1.2);grid minor
leg2 = legend({'$x_2(t)$'});
set(leg2,'Interpreter','latex');
xlabel('t(s)')
ylabel('x2')
ylim([-1 1])
subplot(2,2,3)
plot(t,d,'c',t,d_hat,'m','LineWidth',1.2);grid minor
leg3 = legend({'$d(t)$';'$\hat{d}(t)$'});
set(leg3,'Interpreter','latex');
xlabel('t(s)')
ylabel('d(t)')
subplot(2,2,4)
plot(t(1:end-1),Sd,'LineWidth',1.2);grid minor
leg4 = legend({'$S_d(t)$'});
set(leg4,'Interpreter','latex');
xlabel('t(s)')
ylabel('Sd(t)')
leg = [leg1 leg2 leg3 leg4];
set(leg, 'FontSize', 12)
0 Comments
Answers (1)
CHANDRA BABU GUTTIKONDA
on 11 Feb 2026 at 6:47
Prescribed-time terms 1/(Tfc−t)1/(T_{fc}-t)1/(Tfc−t) blow up near TfcT_{fc}Tfc in discrete simulation, creating an impulsive control that drives x2x_2x2 unstable.
0 Comments
See Also
Categories
Find more on Switches and Breakers in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!