Why a manually made PID controller in Simulink will show a different value when compared to the default PID controller Simulink black with both having the same Kp,Ki and Kd?

조회 수: 11 (최근 30일)
So I wanted to implement a manually PID controller with Ki,Kp,and Kp which are made using elementary Simulink Blocks. I attached this PID controller in a forward fashion with feedback for a 2nd order system. I had a similar system but I used the default PID controller and I used the tune feature to automatically obtain my Kp Kd and Ki values. I then used these automatically tuned Ki Kd and Kp values and inputted them into my manually created PID controller and I obtained two different graphs. Is there a reason why? My manually created PID had a transient response plot that was slower in response in comparison to my default PID controller in Simulink. I have no idea as to why this is occurring. Is there a reason why?.

채택된 답변

Sam Chak
Sam Chak 2022년 10월 8일
편집: Sam Chak 2022년 10월 8일
Hi @Ian
It's because the PID block in Simulink implements a PID controller in this form:
where a first-order transfer function filters the derivative action.
The continuous-time PID Formula is given by
where .
If you manually construct the PID action with the pure derivative term
using the Derivative block where the derivative term is approximated using the numerical difference method, then it is obvious that both will give different responses. It is important to note that the pure derivative term exists in math only and it cannot be physically realizable.
Even if the Derivative block is used, it is, in fact, just an approximation. Moreover, when there is an abrupt change in the setpoint, it would cause a sudden spike in the output of the controller. To circumvent this issue, the first-order filter is introduced:
.
% ---------------------------------
Reading your description the second time, if your 2nd-order system is linear, and it is assumed that the derivative state can be measured and noise-free, then you can still implement the manually designed PID controller using the rate feedback approach. The second output port 'dx' can be connected to the Gain block on the feedback loop.
The response should give the same result as predicted by the closed-loop transfer function that uses the pure PID form:
  댓글 수: 2
Ian
Ian 2022년 10월 10일
Thank you so much!. Sorry for the late reply. You've helped me tremendously!. I can see the why now.
Sam Chak
Sam Chak 2022년 10월 11일
You are welcome, @Ian. If you find the explanation is helpful, please consider accepting ✔ and voting 👍 the Answer. Thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 PID Controller Tuning에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by