Go to Post I love the smell of a upcoming FRC build season in the morning. The sleepless night; the drills; welding; cutting of metal. I wait all yr. for this. - midway78224 [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 18 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 15-01-2015, 09:20
Tem1514 Mentor's Avatar
Tem1514 Mentor Tem1514 Mentor is offline
Registered User
FRC #1514
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Toronto
Posts: 238
Tem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to behold
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
Reply With Quote
  #2   Spotlight this post!  
Unread 15-01-2015, 10:08
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,015
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
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.



Last edited by Ether : 15-01-2015 at 10:18.
Reply With Quote
  #3   Spotlight this post!  
Unread 15-01-2015, 10:40
Tem1514 Mentor's Avatar
Tem1514 Mentor Tem1514 Mentor is offline
Registered User
FRC #1514
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Toronto
Posts: 238
Tem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to behold
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.
Reply With Quote
  #4   Spotlight this post!  
Unread 15-01-2015, 10:46
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,015
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: PID programming help

Quote:
Originally Posted by Tem1514 Mentor View Post
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?


Reply With Quote
  #5   Spotlight this post!  
Unread 15-01-2015, 22:52
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,557
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: PID programming help

Quote:
Originally Posted by Tem1514 Mentor View Post
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
Reply With Quote
  #6   Spotlight this post!  
Unread 18-01-2015, 10:11
Tem1514 Mentor's Avatar
Tem1514 Mentor Tem1514 Mentor is offline
Registered User
FRC #1514
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Toronto
Posts: 238
Tem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to behold
Re: PID programming help

Quote:
Originally Posted by Ether View Post
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.
Reply With Quote
  #7   Spotlight this post!  
Unread 18-01-2015, 10:24
Tem1514 Mentor's Avatar
Tem1514 Mentor Tem1514 Mentor is offline
Registered User
FRC #1514
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Toronto
Posts: 238
Tem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to behold
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

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

Last edited by Tem1514 Mentor : 18-01-2015 at 10:33. Reason: more info found
Reply With Quote
  #8   Spotlight this post!  
Unread 18-01-2015, 12:37
Jefferson Jefferson is offline
Registered User
AKA: Jeff Clements
FRC #0016 (Bomb Squad)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Mountain Home, AR
Posts: 257
Jefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant future
Talking 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
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:45.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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