Why does Simulink step response simulation not match step function output from MATLAB?
39 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(1 个)
Les Beckham
2023-10-31
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 个评论
Les Beckham
2023-11-2
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Classical Control Design 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!