View Single Post
  #14   Spotlight this post!  
Unread 01-02-2013, 09:52
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: 258
Jefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond repute
Re: Gyro PID Programming

Quote:
Originally Posted by UriF View Post

[+] About the PID Gains, I'm totally clueless as to what to set them to, so I just set the P variable to 0.1 and zeroed out the others. (Perhaps this was causing the unexpected results when I directly used the Gyro as input, because the output was always @ 100% all the time); Could I set them to something more appropriate?
A p of .1 would take an error of 10 to create a 1.0 (100%) output. The error is calculated by subtracting the setpoint from the current position. If you are using,
As Ether suggested, -180 to 180 range, that may be a little high. It would only take an error of 10 degrees to create full motor output.
So, get the input corrected to match the suggested range. This isn't just scaling or constraining, btw. You will need to add or subtract the extra turns if they are in there (fmod).
Make sure your setpoint is in the same terms as the input, degrees.
And then start tuning your p gain. Don't worry about the others for now.
Reply With Quote