-
Notifications
You must be signed in to change notification settings - Fork 50
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
Wrong sign on the derivative term. #4
Comments
Are you sure about this? I just cheked and the formula looks fine to me but i'm new on PIDs I was just looking for a implementation for a project! |
Hi. Yes. Take a look Brett's PID in the second link. He's a PID expert. |
Uhm... Still cant figure it out. The formula he used looks similar to the one you found on Wikipedia |
To me still looks fine: May it be a different formula? So I don't see where the problem is :( I only want to learn, i'm new on PIDs! |
Also on your implementation I see the same formula (You only compensate for the |
The division by 1000 is wrong. It should multiply by 1000. Should be: |
I'm definitly dumb, still cant see the issue. But @mike-matera was talink about a wrong sign. So no idea. |
Just do the equation yourself with some numbers. Say:
Now look at the code line in question: There is nothing wrong with the sign. The division should be a multiplication. |
see also #11 |
Hello! While validating my own PID controller I've been testing against other PIDs available for Arduino. Here's a plot of AutoPID vs. a reference that matches the excellent work done here:
https://github.com/br3ttb/Arduino-PID-Library
The difference is that your D-term has the wrong sign:
https://github.com/r-downing/AutoPID/blob/master/AutoPID.cpp#L62
Compare that to Brett's ArduinoPID:
https://github.com/br3ttb/Arduino-PID-Library/blob/master/PID_v1.cpp#L83
And my FastPID:
https://github.com/mike-matera/FastPID/blob/master/src/FastPID.cpp#L96
The text was updated successfully, but these errors were encountered: