Chief Delphi

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

Tem1514 Mentor 01-15-2015 09:20 AM

PID programming help
 
We are reaching out to the CD community for with using the PID Eclipse C++ function for our bot. After spending the entire night with two students and two mentors we learned that the PID function has so many setups and sub functions that without any real examples we just don’t know what to code. So a lot of help would be greatly appreciated.

I can not post any of our code as it just doesn’t work but we will be using a Gyro as the normal input sensor but all we what back from the PID is a variable only as we will be using that variable in another part of our code that is not a motor function.

A sample of all the setup steps and a better explanation of what every thing does would be very helpful in understanding how a PID works.

Many thanks

Ether 01-15-2015 10:08 AM

Re: PID programming help
 

While you are waiting for responses, here are some links where you might find useful information:

https://www.google.com/?gws_rd=ssl#q....com+%22PID%22

http://www.ni.com/white-paper/3782/en/

http://www.chiefdelphi.com/forums/sh...45&postcount=6

http://brettbeauregard.com/blog/2011...-introduction/

https://decibel.ni.com/content/servl...20Tutorial.pdf

http://www.controlguru.com/pages/table.html

http://www.inpharmix.com/jps/PID_Con...ms_Robots.html

http://www.chiefdelphi.com/forums/sh...2&postcount=12

http://brettbeauregard.com/blog/2011...-introduction/

http://www.education.rec.ri.cmu.edu/...edmovement.pdf

If you would give some details about what you are seeking to control with PID you will likely get more targeted answers here. For example, you mentioned the gyro. Are you trying to do field-centric control? Or are you trying the correct for drivetrain anomalies to make the bot travel in a straight line? etc.



Tem1514 Mentor 01-15-2015 10:40 AM

Re: PID programming help
 
Ether, thank you for all links. We will review the ones that we haven’t looked at yet.

The best application would be very close to your example of correcting a drivetrain to travel in a straight line but we can not have the PID directly feed the device hence the reason we just what the value from the PID. We have yet to find a way to just retrieve the PID correction value.

From a pure teaching point of view, it would be nice to see what the result would be with given input values.

Ether 01-15-2015 10:46 AM

Re: PID programming help
 
Quote:

Originally Posted by Tem1514 Mentor (Post 1428646)
The best application would be very close to your example of correcting a drivetrain to travel in a straight line

What kind of drivetrain?

Quote:

we can not have the PID directly feed the device
Can you explain why not? What device are you referring to?



Joe Ross 01-15-2015 10:52 PM

Re: PID programming help
 
Quote:

Originally Posted by Tem1514 Mentor (Post 1428646)
The best application would be very close to your example of correcting a drivetrain to travel in a straight line but we can not have the PID directly feed the device hence the reason we just what the value from the PID. We have yet to find a way to just retrieve the PID correction value.

See this thread. http://www.chiefdelphi.com/forums/sh...ight=pidoutput

Tem1514 Mentor 01-18-2015 10:11 AM

Re: PID programming help
 
Quote:

Originally Posted by Ether (Post 1428650)
What kind of drivetrain?

Hex or co-axial

Can you explain why not? What device are you referring to?



Given the very nature of the design "device" It would take a novel to explain.

Tem1514 Mentor 01-18-2015 10:24 AM

Re: PID programming help
 
To Ether and Ross,
Thank you for the links and information, it helped up to a point but we have found, like many others that our single very precious resource was being used up at an alarming rate. So we have chalk this one up to; yes failure is an option but lets learn from it and move forward. Perhaps after regional’s we might re-visit the task but a “101 Programming a PID function with examples” would sure help.

Just in case, the “precious resource” is TIME. Five weeks is just to short. We lose a week for exams ::ouch::

Post #12 http://www.chiefdelphi.com/forums/sh...hreadid=133100 also has a very nice to help understand what a PID does.

Jefferson 01-18-2015 12:37 PM

Re: PID programming help
 
Look at the crab speed class in our code from last year. I think it does what you are looking for. Crates a generic class that he PIDController will write to that you can get with something else.
https://github.com/FRCTeam16/TMW2014


All times are GMT -5. The time now is 09:55 AM.

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