1
\$\begingroup\$

I am building my first PID controller.

My process variable and my actuator value are inversly related, meaning if actuator value increases process variable decreases, and vice versa.

So I have tried with a negative value of P and positive value of I.

It works fine for a while and then process variable keeps increasing with actuator becoming as 0.

Can some one help me with what might be the reason for this? Is it okay to have P as negative and I as postive?

\$\endgroup\$
  • 2
    \$\begingroup\$ Could you keep the gains positive, but simply invert the output of your controller at the end? \$\endgroup\$ – gregb212 Aug 20 at 14:27
  • 2
    \$\begingroup\$ Likely if P has to be negative then I does also. But there may be more going on than just that. Suggest adding a lot more info to the question. \$\endgroup\$ – scorpdaddy Aug 20 at 14:39
1
\$\begingroup\$

Except when you're driving a very strange plant, you want the sign of all of your gains to be the same -- all positive, or all negative.

If you have a fairly normal plant (i.e. it has a minimum phase response in dynamic systems terms, meaning that all of its poles and zeros are in the left-half plane) then you need to use negative gains for both proportional and integral gains, or you need to take @gregb212's suggestion and do your calculation, then multiply it by -1 at the end.

\$\endgroup\$
  • \$\begingroup\$ In literature and google - positive and negative are called direct vs reverse acting pid. You could google that. \$\endgroup\$ – scorpdaddy Aug 20 at 18:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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