Reputation: 402
I have a problem in producing the algorithm of a PID with Filter Coefficient. The block diagram of the PID with Filter Coefficient looks like this.
I found an algorithm/code in this link. https://www.mathworks.com/matlabcentral/answers/63762-filter-coefficient-n-in-pid-block
Question: Why is that the FilterCoefficient has an unknown variable Filter_DSTATE which has an unknown variable of FilterCoefficient? The code of FilterCoefficient has an unknown variable of Filter_DSTATE and the code of Filter_DSTATE has an unknown variable of FilterCoefficient?
Hypothesis. Is it one of them supposed to be initialize by some value?
Upvotes: 1
Views: 7709
Reputation: 3106
If you open a blank simulink model and add PID controller
you will get a dialog after double-click
The derivative term of the PID controller is never implemented as a pure derivative because that would be extremely sensitive to noise. Hence, a cutoff frequency is added.
So, the D term will act like almost a derivative up to a frequency via
Ns
s ---> --------
s + N
N being the filter coefficient you mention. This also makes it possible to implement a D term using an integrator avoiding a noisy derivative operation.
Upvotes: 5