Matching step response from Simulink with Matlab

9 ビュー (過去 30 日間)
wda5
wda5 2015 年 3 月 17 日
コメント済み: wda5 2015 年 3 月 17 日
Hi I am new to Simulink and am trying to figure out how to get correct results. I modeled a simple control loop in Matlab and Simulink to see if the step response was the same. It's not. I'm guessing this has to do with the solver settings? I used the default for this.
Can anyone help me understand how to get Simulink to give better results? Thanks!
Here is the Matlab code:
sys = tf(1,[1 1 1]);
syscl = pid(4,2,1,0);
sys2 = series(syscl,sys);
sys3 = feedback(sys2,1);
[y,t] = step(sys3);
figure(2)
plot(t,y,ScopeData.time,ScopeData.signals.values)
Here is the simulink model:
And here is a plot of the results:

採用された回答

Arkadiy Turevskiy
Arkadiy Turevskiy 2015 年 3 月 17 日
No, it actually has to do with calculating the derivative of a signal. You don't want to use pure derivative block. To match results you see from MATLAB code, use PID Controller block from Simulink library or modify your own PID implementation in Simulink to replace pure derivative block with a feedback loop consisting of a gain in the forward path and an integrator in the feedback path.
This is explained in detail in this thread .
  1 件のコメント
wda5
wda5 2015 年 3 月 17 日
Thanks! That is exactly what was wrong. Switched to regular PID block. Initially I avoided it because I didn't want to deal with the filter in the system.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeClassical Control Design についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by