1
\$\begingroup\$

What is the relation between filter coefficient (N) of Simulink pid block and filter time constant of MATLAB pid command? According to my experience they are not same or equal, there is some other relation between them

According to my understanding based upon simulation experiences,they both are almost inversely related. Is my understanding correct?

I have attached snapshots of both simulink pid model and MATLAB pid command and highlighted the confusing terms

enter image description here enter image description here enter image description here

\$\endgroup\$

2 Answers 2

3
+50
\$\begingroup\$

\$N\$ equals \$\frac{1}{T_f}\$, to see this start with the third term of the block equation:

$$ \frac{DN}{1 + \frac{N}{s}} $$

rewrite the denominator:

$$ \frac{DN}{\frac{s+N}{s}} $$

this equals

$$ \frac{DNs}{s+N} $$

divide numerator and denominator by N and finally you get:

$$ \frac{Ds}{\frac{s}{N}+1} $$

now compare that with the other formula

$$ \frac{K_d s}{T_fs+1} $$

and you can identify \$K_d = D\$ and \$N = \frac{1}{T_f}\$

\$\endgroup\$
1
\$\begingroup\$

The derivative term in practical situations often needs some low-pass filtering. If you look at the equation to the right bottom you'll see that the right-hand term is the derivative of a low-pass filtered input, where N = \$\omega_0\$ of the LPF.

You would want the time constant of the filter (1/\$\omega_0\$) to be longer than the derivative time, but not too much longer, to keep the effect of noise in the error signal in check, but in the end it's another controller parameter, and as such the optimal setting is related to your situation (the amount and nature of noise in relation to the required derivative time constant for tuned response).

\$\endgroup\$
4
  • \$\begingroup\$ So in nutshell we can say that filter coefficient (N) is inversely proportional to filter time constant ?? \$\endgroup\$
    – DSP_CS
    Commented Oct 4, 2022 at 5:54
  • \$\begingroup\$ You can say it, but it's not exactly right. \$\endgroup\$ Commented Oct 4, 2022 at 6:26
  • \$\begingroup\$ Thanks for your helpful answer and comment. Can you please also update your answer and mention the scenarios where it can be safely said that filter coefficient (N) is inversely proportional to filter time constant and also mention the scenario where it is not as you hinted in your comment \$\endgroup\$
    – DSP_CS
    Commented Oct 4, 2022 at 7:48
  • \$\begingroup\$ @engr I think my answer stands as-is. They are two independent parameters, though it makes sense to decrease one as the other increases when tuning and adjusting the filter cutoffs in a controller for the plant characteristics and noise encountered. If it was as simple as inverse proportional we would not need to add the significant additional complexity of another parameter. \$\endgroup\$ Commented Oct 4, 2022 at 8:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.