PID controller design: How to plot control signal?
조회 수: 35 (최근 30일)
이전 댓글 표시
I'm using the Control System Toolbox in Matlab.
I have a plant P (an object of class idproc) and a PID controller C (class pid).
I can connect them using T = feedback(C*P, 1).
Now, I can use commands like step(T) to plot the response of the whole system to a step input.
What I would like to know is how to get access to the control signal that the PID controller came up with. So, given a particular input to the system in T, what is the control signal that the PID part of the system generated to yield the output plotted by step(T)?
Thanks, Matt
댓글 수: 4
Arkadiy Turevskiy
2016년 7월 20일
The transfer function from reference to controller effort is C/(1+CP), so you simply do: >>step(C/(1+C*P))
Also note that if you use PID Tuner app, it lets you plot all signals of interest in your loop by selecting options in drop down menus.
Suraporn Puangpanbut
2016년 8월 9일
Yes, @Arkadiy Turevskiy is right, I have tried it, thank you. But for matching the time vector, I think you should use the same timelenght,
y=step(C*P,1,t_final); mv=step(C,P,t_final);
or [y,t1]=step(C*P,1,t_final); [mv,t2]=step(C,P,t_final); if you want to get the time vector as well.
답변 (1개)
Mischa Kim
2016년 7월 14일
Matthias, for this simple configuration with C and P in the feed-forward path and unity feedback you can do the following:
The error signal in this configuration is the same as the output signal of a system that has C in the feed-forward path and P in the feedback path. In other words,
T1 = feedback(C,P)
e = step(T1)
댓글 수: 2
Suraporn Puangpanbut
2016년 8월 9일
T1 = feedback(C,P) e = step(T1)
The code should work well. The error you got comes from your total transfer function has more zero than pole, which is not casual, can not be implemented, try another controller structure.
참고 항목
카테고리
Help Center 및 File Exchange에서 Tuning with Control System Tuner에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!