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

How to set P/I/D parameters #7

Closed
ArtlyStyles opened this issue May 4, 2020 · 1 comment
Closed

How to set P/I/D parameters #7

ArtlyStyles opened this issue May 4, 2020 · 1 comment

Comments

@ArtlyStyles
Copy link

Hi, I am using this code as my autocar steering PID. Imagine I sit inside the car. My steering target is center of the road 5 meters in front me. I want to steer my car so it points to the target. I use sensor to measure my car current orientation. The different of these two, let's call it D, is how much I want to steer my car. So when I call getOuput, I should use:

steer = getOutput(D, 0)

Correct?

@ghost
Copy link

ghost commented May 27, 2020

@ArtlyStyles

While this is quite an unconventional use of a PID loop, yes, that's exactly what you would do. I know because I did something very similar to this for a while in my SwerveIO API. I can't find the exact commit in which it was removed, but at one point in the history of MK2SwerveModule.java, I did exactly what you are doing here, and it does work just fine.

@tekdemo tekdemo closed this as completed May 27, 2020
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