Matlab PI control first order system
116 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone. Iam quite new to Control theory and I have a question regarding PI Control using Matlab.
I have a first order transfer function :
G(s) = 5/(s+1)
and I try to use Matlab to form a feedback loop using a PI controller with the following code:
s = tf('s');
Kp = 1;
Ki = 1;
C = Kp + Ki/s
G = tf([5],[1 1])
figure(1)
step(G)
H = feedback(C*G,1)
figure(2)
step(H)
When I plot the step response of G, it goes from zero to five like expected, but when I plot the feedback response it only goes from zero to 1. Changing Kp and Ki does not have any effect.
Any help would be great!
Thanks in advance,
/M
1 件のコメント
Divyani Rathod
2019 年 2 月 1 日
How can i calculate Kp ki value for Peak overshoot <=11%, settling time<=5s. Transfer function is 3.24/15.24s+1 (My calculated value is, kp = 7.2152 and ki = 9.1061, zeta = 0.5749, w_n = 1.3916); (using state space and without state space) and also How can i calculate Fractional kp and ki.
回答 (3 件)
Robert U
2017 年 11 月 13 日
編集済み: Robert U
2017 年 11 月 13 日
Hello MikeSv:
The system response is correct from my point of view. The desired response value of step-function is "1". The uncontrolled system G is responding with a gain of "5". The controlled system instead is responding with "1" as desired.
Edit:
The change of Kp and Ki have - of course - an effect. Due to automatic scaling it might be you did not mention.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/179356/image.png)
Kind regards,
Robert
2 件のコメント
Robert U
2019 年 8 月 14 日
% define transfer functions
s = tf('s');
C =@(Kp,Ki) Kp + Ki/s;
G = tf([5],[1 1]);
% define parameter combinations
Kp = [1,2,4,1,1];
Ki = [1,1,1,2,4];
% create figure
figure
ah = axes;
hold(ah,'on');
% loop through given combinations of Kp and Ki
for ik = 1:length(Kp)
H = feedback(C(Kp(ik),Ki(ik))*G,1);
step(H)
end
% create cell array of legend entries
cLegend = arrayfun(@(Kp,Ki) sprintf('Kp = %i, Ki = %i',Kp,Ki),Kp,Ki,'UniformOutput',false);
% add legend to figure
legend(ah,cLegend)
partha das
2019 年 2 月 5 日
編集済み: partha das
2019 年 2 月 5 日
OLTF is 5/(s+1). In this case DC gain is 5 (obtained by setting s=0 in the OLTF).
Your CLTF is 5/(s+1) when you use Kp=1 and Ki=1. So in this case DC gain is 1. As a result when you apply an unit step input to this CLTF, your steady state output will be 1 i.e. the steady state error (reference step input of magnitude 1 - steady output of 1) is 0. In fact for any values of Kp and Ki, you will get a steady state error of 0 because the PI controller always tracks the reference input perfectly.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で PID Controller Tuning についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!