How to apply step disturbance on one output at specific time in MPC?

4 views (last 30 days)
I want to apply a step change of 70 in set point of one CV at minute 200 and a step disturbance of -70 at minute 600 on the same controlled variable (output) and use a MPC controller. I have 10 CVs (outputs) and 7 MVs (inputs). I have transfer function for each MV-CV set. I specified my transfer fucntions and converted them to state space and then used mpc functon in MATLAB and set the signals specifying the disturance as unmesured disturbance in mpc:
D = tf( 70, [1 0], 'IOdelay', (0),'TimeUnit','min');
DT = ss([D; 0; 0; 0; 0; 0;0;0;0;0;0;0]);
%from continous to discrete
SYS = c2d([sys1 DT],1);
Ts=1;
Pr = 240;
Tfinal =1000;
mpc1 = mpc(SYS, Ts);
How can I apply a step change (of 70) in set point of CV #1 in my system at minute 200 and another step disturbance(of -70) at minute 600?
Any help is apperciated!

Accepted Answer

Sam Chak
Sam Chak on 18 Oct 2023
Hi @HN
I believe your algorithmic-based MPC can automatically handle the step change at 200 minutes, thanks to its built-in self-recovery prediction/correction mechanism at each time step, until the steady-state error is eliminated.
Have you attempted injecting step changes into the MPC-controlled system using the sim(mpcobj, numSimSteps, r, d) command? Here is a simple example demonstrated in minutes; you can convert it to seconds.
Ts = 0.2; % sampling time
Tstop = 1000; % minutes
numSimSteps = round(Tstop/Ts);
t = linspace(0, Tstop, numSimSteps);
rValue = 70; % reference value
rStartTime = 200; % minutes
rStartStep = rStartTime*numSimSteps/Tstop;
r = [zeros(rStartStep, 1); rValue*ones(numSimSteps-rStartStep, 1)];
dValue = -70; % disturbance value
dStartTime = 600; % minutes
dStartStep = dStartTime*numSimSteps/Tstop;
d = [zeros(dStartStep, 1); dValue*ones(numSimSteps-dStartStep, 1)];
subplot(211), plot(t, r), grid on, title('Reference signal')
subplot(212), plot(t, d), grid on, title('Disturbance signal'), xlabel('Time (minutes)')

More Answers (0)

Categories

Find more on Model Predictive Control Toolbox in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!