フィルターのクリア

purpose of state-space with pid

2 ビュー (過去 30 日間)
azan
azan 2012 年 10 月 11 日
Hi everyone! I am having problem that when I connect state space block to PID and take its output as feedback in simulink I get a plot that converges at reference value; now I have to do the same job in mfile I have done the coding for pid but I am not getting idea that; what is the purpose of state space connected with pid so that I can write code for it.

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 10 月 11 日
編集済み: Azzi Abdelmalek 2012 年 10 月 11 日
clear,close
%your model and its input output
mot=tf(1,[1 1]),
model=ss(mot);
[F,h,c,d]=ssdata(model);
model.u='u'
model.y='y'
%your pid controller
r=pid(5,1/0.05,10)
r.u='e'
r.y='u'
%adding a reference r with som2=r-y
som1 = sumblk('e = r - y');
%global model with all conneection
modelg=connect(som1,r,model,'r','y')
%simulation
step(modelg)
  27 件のコメント
azan
azan 2012 年 10 月 13 日
Sir code is working now and the issue was I had to write like this model.inputname='u' model.outputname='y'
azan
azan 2012 年 10 月 13 日
Sir can you now tell me where is that input(e.g 6 taken from image processing part) in this code which I have to compare with the reference value

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by