Go to Post I guess everyone cant play real defense, like actually pushing the other robot instead of ramming it with the intent to destroy. - Dillon Compton [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 46 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #8   Spotlight this post!  
Unread 05-12-2014, 02:47 PM
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,069
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Turning Robot with PID Feedback from Gyro

Quote:
Originally Posted by ArzaanK View Post
I will take that into account. So if I want the robot to turn at half speed I set P to 0.5, correct?
PID gains have real world units attached to them. They aren't just made up numbers.

Consider a simple P controller. It has the form:

Code:
output = Kp * error
What are the units of Kp? Rearrange the equation.

Code:
Kp = output / error
So Kp is a ratio between your output (in this case, the "turn" power from -1 to 1) and your error (in this case, degrees).

Commanding an output of -1 or +1 is like commanding a full speed turn with your joysticks during teleop. For most robots, that's probably pretty fast. Probably way, way too fast to accurately turn only 1 degree.

I would start with a really tiny gain and then move up from there. Try (1/90) or so. This would give full power when you are 90 degrees (or more) off of your goal, half power at 45 degrees off, etc.

What you will likely see is that your robot moves in the general direction of your goal, but stops a little short or overshoots a bit. At this point, you can try upping your P gain, or adding Ki or Kd gains (and by the way, the same principle applies: These gains also have units, and their units involve time as well). You may also find that limiting the maximum output of your PID controller is necessary to prevent overshoots (for example, no matter what, never go more than 50% of top speed).
Reply With Quote
 


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 08:18 AM.

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