a unit step disturbance

8 views (last 30 days)
Toby Russell
Toby Russell on 20 Jul 2020
Commented: Toby Russell on 23 Aug 2020
Hi All,
I need to Simulate a controllers with a unit step change in set-point followed by a unit step
disturbance at a time of 40 seconds.
My question is, what ways are there of going about implementing the unit step disturbance?
Some guidance with this would be appreciated.
Some of the code is below
K = 2;
tau = 3;
den = [tau 1];
sysmod = tf(K,den,'inputdelay',1)
plot (time,response,'g');
hold on
step (sysmod,'k')
hold off
Hagglund-Astrom
Kc = 0.175;
tauI = 2;
theta = 0; %Defines the dead time in the process
haggast1 = feedback((tf(Kc*exp(-theta*s)/s)*sysmod),0.5);
step (haggast1,'g')
hold on
step (sysmod,'k')
legend ('haggast1','sysmod')
hold off
Thanks
Toby
  1 Comment
Toby Russell
Toby Russell on 23 Aug 2020
Is anyone here able to help me out with this?
I am looking for how to code a unit step disturbance at 40 seconds.
my code is as follows
(live script)
oad response.dat
plot (time,response,'g');
title ('Actual response')
xlabel ('Time')
ylabel ('Amplitude')
hold on
s=tf('s')
K = 2;
tau = 3;
sysmod = exp(-s)*(K/(tau*s+1))
plot (time,response,'g');
hold on
step (sysmod,'k')
title ('System Model Step Response')
hold off
Applying the Hagglund-Astrom Tuning
theta = 0.27; % Defines the dead time in the process
kp = (0.14/K)+((0.28*tau)/(theta*K)) % Defines the Proportional element CORRECT
ki = ((0.33*theta) + ((6.8*theta*tau)/(10*theta+tau))) % Defines the Integral element CORRECT
haggast1 = feedback((kp + (ki/s))*sysmod,1); % Applying the Hagglund-Astrom tuning
step (haggast1,'g')
hold on
step (sysmod,'k')
%step (haggast1,40)
title ('Haggland-Astrom Tuning')
legend ('haggast1','sysmod')
hold off
Applying the Cohen and coon PI Tuning
theta1 = 0.275;
kp1 = (1/K)*(tau/theta1)*(0.9+(theta1/(12*tau))) % Defines the Proportional element CORRECT
ki1 = (theta1*(30+(3*(theta1/tau))) / (9+(20*(theta1/tau))))% Defines the Integral element CORRECT
CC = feedback((kp1 + (ki1/s))*sysmod,1); % Applying the Cohen Coon tuning
step (CC,'g')
hold on
step (sysmod,'k')
title ('Cohen Coon Tuning')
legend ('CC','sysmod')
hold off

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!