Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   PID (http://www.chiefdelphi.com/forums/showthread.php?t=152749)

Robodragons4630 20-12-2016 11:35

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!

euhlmann 20-12-2016 12:19

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

Robodragons4630 20-12-2016 13:07

Re: PID
 
Quote:

Originally Posted by euhlmann (Post 1622440)
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

Thank you . For some reason after 20 mintues of googling that page didn't show up for me.

Ether 20-12-2016 14:45

Re: PID
 
Quote:

Originally Posted by Robodragons4630 (Post 1622428)
Using LabVIEW I can use a auto PID where it fixes the PID as it is being ran.

I'm curious what you mean by this. Would you please explain?



Robodragons4630 20-12-2016 16:55

Re: PID
 
1 Attachment(s)
Quote:

Originally Posted by Ether (Post 1622469)
I'm curious what you mean by this. Would you please explain?



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.

sspoldi 26-12-2016 12:20

Re: PID
 
3 Attachment(s)
Quote:

Originally Posted by Robodragons4630 (Post 1622428)
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!

Hi Noah,
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:ahh:


All times are GMT -5. The time now is 10:03.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi