Prescribed time disturbance observer based on periodic delayed feedback does not estimate in prescribed settling time.

58 views (last 30 days)
Hi, I hope you are feeling well. I have designed a prescribed time disturbance observer based on the idea that was used to design a prescribed time controller. First, I have apllied the controller to a first order and then to a third order system.
This is the link of the previous question that I have asked here:
https://ch.mathworks.com/matlabcentral/answers/2095136-a-nonlinear-system-and-its-control-input-in-simulink?s_tid=srchtitle
The problem I have is that the disturbance observer does not work in a prescribed time, I change the settling time, but it still works in a fixed settling time that is around 1.5 seconds. I have attached the simulink model here. I really appreciate your help if you can tell me how I can solve the problem.
  4 Comments
Sam Chak
Sam Chak 20 minutes ago
I am still investigating the issue because it took considerable time to convert the unannotated, index‑style code into a mathematically interpretable form. Several parameters and equations in the code remain unclear to me. To facilitate the analysis, could you provide the equations that lead to the derivation of the rate of change of the disturbance error, , where ?
That analysis should allow us to find out why the estimated disturbance consistently converges between 1.0 s and 1.4 s as tau varies from 0 to 1, regardless of the observer’s prescribed‑time setting h.
Note that the effect of the prescribed‑time observer becomes insignificant for large values of tau, but becomes noticeable when tau is very small (approaching zero).
% Sam: related to simulation time
% ------------------------------
t0 = 0; % start time
tf = 10; % final time
dt = 0.001; % step size
t = t0:dt:tf; % time vector
% Sam: related to the control and estimation parameters
% ------------------------------
a = 0.01;
% tau = 6.65/7; % system is still stable in the range 0 < tau < 1
tau = 0;
h = 3; % prescribed settling time of the observer
delay = h/dt;
Tfc = 5; % prescribed settling time of the controller
eps1 = -2;
eps2 = 3;
% Sam: related to external disturbance
% ------------------------------
% d = 2*sin(0.2*pi*t) + 0.15*sin(2*pi*t); % time-varying disturbance
d = 1*ones(1, length(t)); % constant disturbance (easy to analyze)
% Sam: related to initial condition
% ------------------------------
D1 = 0.7*pi;
x10 = 1; % initial value of x1
x20 = -1; % initial value of x2
d_hat(1)= -2;
x1(1) = x10;
x2(1) = x20;
% Sam: related to delayed terms
% ------------------------------
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;
% Sam: related to prescribed-time
% ------------------------------
W = @(s) exp(a*s).*(s - h).^5.*(2*h - s).^5;
Wc = 1/(integral(W, h, 2*h));
% Sam: Main code
% ------------------------------
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
% Controller
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));
% the bell-shaped curve
K(i) = Rh(i)*Wc*exp(- a*(h - 2*t(i)));
% discretized differential equation for state x1
dx1(i) = x2(i);
x1(i+1) = x1(i) + dx1(i)*(t(i+1) - t(i));
% discretized differential equation for state x2
dx2(i) = eps1*x1(i) + eps2*(1 - x1(i)^2)*x2(i) + d(i) + u(i);
x2(i+1) = x2(i) + dx2(i)*(t(i+1) - t(i));
% discretized differential equation for state phi
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;
% Sam: Most probably a sliding variable related to the disturbance error?
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
figure
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');
title('Window 1'), 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');
title('Window 2'), 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');
title('Window 3'), 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');
title('Window 4'), xlabel('t(s)'), ylabel('Sd(t)')
leg = [leg1 leg2 leg3 leg4];
set(leg, 'FontSize', 12)
figure
plot(t(1:end-1), K), grid minor, ylim([-0.5, 1.5]),
title('Prescribed-time observer gain')
xlabel('t'), ylabel('K')
figure
plot(t, d_hat); grid minor
axis([1.0, 1.4, 0.9, 1.1])
title('Convergence of the Estimated disturbance')
xlabel('t'), ylabel({'$\hat{d}(t)$'}, 'Interpreter', 'latex')
figure
plot(t, d_hat); grid minor
axis([2.5, 5, 0.9, 1.1])
title('Anomaly in the Estimated disturbance (see Window 3)')
xlabel('t'), ylabel({'$\hat{d}(t)$'}, 'Interpreter', 'latex')

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!