Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing sign Derivative factor #104

Open
DavyEHB opened this issue Apr 24, 2020 · 1 comment
Open

Changing sign Derivative factor #104

DavyEHB opened this issue Apr 24, 2020 · 1 comment

Comments

@DavyEHB
Copy link

DavyEHB commented Apr 24, 2020

I compared different versions of the PID library.
I noticed that the sign of the derivative factor changes between the versions.
In the code on your website
http://brettbeauregard.com/blog/2011/04/improving-the-beginners-pid-introduction/

/*Compute PID Output*/
   Output = kp * error + ki * errSum **+** kd * dErr;

http://brettbeauregard.com/blog/wp-content/uploads/2011/03/pidalgorithm.png
Also includes the addition of the derivative.

v 1.2.1
Here you subtract the derivative.

      /*Compute Rest of PID Output*/
      output += outputSum **-** kd * dInput;

Quite confusing to me. Since it is negative, won't it counteract the response?
Could you explain the logic for this?

Kind regards.

@AnderbergE
Copy link

I think what you are looking for is explained in the following post:
http://brettbeauregard.com/blog/2011/04/improving-the-beginner%e2%80%99s-pid-derivative-kick/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants