Go to Post ...playing hard and impressing teams is way more valuable than trying to play god with the rankings. - JamesBrown [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-02-2013, 16:32
joemost joemost is offline
Registered User
no team
Team Role: Engineer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: New Hampshire
Posts: 39
joemost will become famous soon enough
PID Controller Class WPI

Hey All,

My team has reached the point where are camera can output an x and y coordinate and the distance from the rectangle we are tracking we are. I was talking with one of the Electrical Masters on our team, and he dosen't understand the PID controller at all obivously, but he kept talking about the jaguar.

What does the PID Controller export to the Jaguar or whatever motor controllor? is it in a specific format? how does that work?

Any Help you guys can give me would be amazing

http://users.wpi.edu/~bamiller/WPIRo...ontroller.html
Reply With Quote
  #2   Spotlight this post!  
Unread 04-02-2013, 18:44
IDKnow IDKnow is offline
Registered User
FRC #1671
 
Join Date: Feb 2013
Location: California
Posts: 8
IDKnow is an unknown quantity at this point
Re: PID Controller Class WPI

The following is an approximation of how PID works.

Situation:
Say you have a motor you need running at 2000 rpm. You use an encoder to check the speed of the motor and if it's too high you lower the voltage; if it is too low you raise the voltage. Say I do so by 1 V every time. This will most likely result in fluctuating above and below the target speed.
Proportion:
To avoid the above issue, proportion takes the 'error,' or difference from the target speed and 'proportionally' approaches it. For example, a 'P' value of .5 with an error of 1000rpm at 0V will ramp up in the next cycle to half the required power to make up the difference, and the cycle after, and so on.
Integral:
The proportion will only make you approach the target speed. It's like Zeno's Paradox. Integral will solve this by adjusting the proportion up.
Derivative:
This is a response value. If the speed drops, or rises suddenly then this will rapidly make up the drop or lower V to counter a rise. This will not, however, assist in the initial approach to the target speed.

Not all of the control options are required in a PID loop.

Obviously you could code one yourself but it'd be slow.

To find good PID values I suggest you use the BDC Com provided by first. The class you need can be found in the WPI library. If after significant trial with this you need help, inform me and I'll drop some hints. Finally, the CANJaguar class allows you to do PID without using the CIRO to do it. This is the primary benefit of jaguars. CANJags are hooked up differently than Jags are otherwise. Also, they are coded different and need to be imaged. The class is available in the WPI Library and you can ask someone else about imaging it.

Rather you use your own PID code, the PID Class, or PID with CANJags, best of luck. Again, the CANjags are probably the best option.
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 14:40.

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