Why is the command of the PID class defined as the negative summation of the gains?

asked 2019-07-29 15:06:16 -0500

bhej gravatar image

In reference to this: https://github.com/arpg/Gazebo/blob/m...

The command of the PID controller is defined as follows:

this->cmd = -pTerm - iTerm - dTerm;

Instead of

this->cmd = pTerm + iTerm + dTerm;

I assume it takes the error as e = current_value - desired_value, but why does it seem to go against the convention which is e = desired_value - current_value?

edit retag flag offensive close merge delete