|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
PID
Using LabVIEW I can use a auto PID where it fixes the PID as it is being ran. Can I do this with C++ and how do I use a C++ PID loop. I have used a PID loop before in LabVIEW but I can't understand how to do it on c++ using the wpiLIB. If you can provide simple code to help or give a website other than wpiLIB that would be appreciated. Thanks!
|
|
#2
|
||||
|
||||
|
Re: PID
I know you said site that is not WPILib but it actually has some useful info
http://wpilib.screenstepslive.com/s/...rs-pid-control Make sure you've read this. It has extensive information and example code |
|
#3
|
|||
|
|||
|
Re: PID
Quote:
|
|
#4
|
||||
|
||||
|
Re: PID
Quote:
|
|
#5
|
|||
|
|||
|
Re: PID
This code isn't as smooth as a perfectly tuned PID but we couldnt use that because the thing we used the PID rotated vertically on a shaft so the PID needed to constantly update because based on the angle of our shooter gravity would effect it differently.
|
|
#6
|
||||
|
||||
|
Re: PID
Quote:
Normally I wouldn't post (relatively) untested code, but if simple is what you want the attached may work for your needs. I just tossed this together the other day (I intend to make this a development task for some of our software kids, if you're on Team 230 stop looking!). BTW, we use the simple robot class with C++ and do our own loops, just seems to be easier that way. Cheers, Steve. P.S. Don't tell MamaSpoldi I'm posting code, I'll get in trouble ![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|