View Single Post
  #2   Spotlight this post!  
Unread 10-31-2016, 05:01 PM
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 429
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Gyro vs. Encoders for Driving Straight

Simplest place to start is to perform your moves as a series of straight driving or turns in place.

Use the gyros heading to rotate to a speficoed angle, then use your encoders to drive set distances in straight lines.

All you have to develop are two commands/methods.
One that drives straight some arbitrary distance. And another that rotates to some arbitrary heading. Develop both of these and time them independently. Once they both get you to your destination position/heading within your acceptable error, you can create command groups that combine driving straight and rotating in the right order to perform more complex actions.

Your drive straight command/method should use the encoder ticks to determine distance traveled, did you go as far as needed. The gyro will be used to control to the heading the robot was at when the drive straight command begun. If heading slips off zero (or whatever it was at the begging of the move) adjust the relative speed of each side of the drivetrains to get back to zero.

You should be able to get both of these working pretty well with a simple proportional controller.
__________________
http://team2168.org

Last edited by otherguy : 10-31-2016 at 05:06 PM.
Reply With Quote