Why does Simulink step response simulation not match step function output from MATLAB?
Mostra commenti meno recenti
Hey guys, I am designing a digital controller for my second order plant, its continuous open loop transfer function is as follows:
T = 0.2;
nums = [0.7297];
dens = [1 0.2606 0.4378];
Gps = tf(nums, dens);
Gpz = c2d(Gps, T, 'ZOH'); % For plant discretization and controller design

I am using a phase lead compensator, I arrive at the following controller discrete function:
Dz_lead = 10.2751*tf([1 -0.8196], [1 0.8541], T);

Plotting the step response of the controlled and uncontrolled systems (Gpz being the ZOH discretization mentiones before):
GDz_lead = Gpz*Dz_lead;
Cz = feedback(Gpz, 1);
Cz_lead = feedback(GDz_lead, 1);
step(Cz, 'r', Cz_lead, 'g', 50);
legend('Uncompensed system', 'Phase lead compensation');
grid on

Both systems stabilze at the same amplitude, and the settling time improved greatly.
However, when using Simulink:

I get the following output (for a step input of 5):

Why does it fall short with respect to the input? The step function used previously says it shoud follow nicely, or do I need to add a proportional gain before the compensator every time?
Risposte (1)
Les Beckham
il 31 Ott 2023
1 voto
It appears to have the same gain as your Matlab step response. The steady state response appears to be about 0.62 for a unit step input (which is what the step function uses), and 0.62 * 5 is 3.1 which is what it looks like you have in the Simulink scope output.
It looks to me like it is working just fine.
2 Commenti
RÓMULO PRIETO
il 1 Nov 2023
Les Beckham
il 2 Nov 2023
You are welcome.
Adding a controller to a system can definitely change the steady state gain of the closed loop system.
It is up to you when designing a controller to decide if you want the output/input gain to be unity or not.
If my answer (and comments) answered your question, please consider clicking Accept.
Categorie
Scopri di più su Classical Control Design in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
