How can I obtain the controller output via the command line?

7 ビュー (過去 30 日間)
bt
bt 2022 年 1 月 18 日
回答済み: Max Heimann 2022 年 1 月 18 日
Using the Control Systems Toolbox, I have designed and tuned a PI controller C which is controlling a plant G. I want to know how to simulate the output from C (driven by sp) via the command line.
sp = 2.5*ones(101,1);
t = ([0:1:100])';
at = [1 -1.08 0.12 -0.23] % denominator polynomial of G
bt = [0 0.27] % numerator polynomial of G
G = tf(bt,at,1,'Variable','z^-1')
[C_pi,info] = pidtune(G,'PI');
T_pi = feedback(C_pi*G,1); % obtain closed-loop transfer function
Y = lsim(T_pi,sp,t) % closed-loop system response
stairs(t,Y,'k','linewidth',2)

回答 (1 件)

Max Heimann
Max Heimann 2022 年 1 月 18 日
You could use "step" to simulate a step response.
Or lsim to simulate other inputs.

カテゴリ

Help Center および File ExchangePID Controller Tuning についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by