View Single Post
  #6   Spotlight this post!  
Unread 02-12-2016, 08:06 PM
slibert slibert is offline
Software Mentor
AKA: Scott Libert
FRC #2465 (Kauaibots)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2005
Location: Kauai, Hawaii
Posts: 337
slibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud of
Re: Problem with NavX to turn around.

Quote:
Originally Posted by team-4480 View Post
Oh I guess I just under the assumption we needed encoders to do PID. Cool that we don't!

So the online description is not the full code? If not, do you have a Github page or something because we use Python and don't have the necessary software to install nax-mxp example.
You would need encoders if you wanted to have PID control of each individual wheel's speed. Note that this can be a useful thing to have (kind of like traction control on a car).

But for rotate-to-angle, your feedback that drives the PID controller is the Yaw angle from the navX-MXP.

Anyways, the RotateToAngle Java example code is available on GitHub at:

https://github.com/kauailabs/navxmxp...team2465/robot

My understanding is that the java and python are very similar, so this should be a good starting point for you. There are some comments in the example code that discuss tuning the PID a bit.

PID is a _very_ useful thing to learn and get used to for programming control systems like those used in FIRST and in the real world, so I encourage you to spend the time to learn it. Focus first on understanding how the P (proportional) coefficient works. Then, once you understand that and the concept of undershoot and overshoot well, begin working on the I (integral) coefficient. Finally, if you find this is not good enough for your needs, begin looking at the D (derivative) coefficient.

A final bit of advice when tuning PID coefficients is to only change one coefficient at a time. The different coefficients "mix" together in ways that aren't always intuitive, so go slowly and take careful notes as you tune them.
Reply With Quote