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?

9 views (last 30 days)
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?.

Accepted Answer

Sam Chak
Sam Chak on 8 Oct 2022
Edited: Sam Chak on 8 Oct 2022
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:

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!