View Single Post
  #8   Spotlight this post!  
Unread 15-02-2014, 23:48
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Gyro with Labview to drive straight

We usually use an I controller for straight driving. It's essentially an 'adaptive drift constant' in our application, as it finds a 'drift bias' between the two sides but it's treated as a constant to the rest of the distance based controls.

The integral eventually finds a happy place which causes the robot to drive straight, and holds it indefinitely. We also have some speed adaption of the output, so the same integral keeps the drive straight at various output speeds, and we inhibit the control loop (but latch the integral) at low speeds. We also hold the integral between runs of the function, so multiple drive steps can keep the integral. If we were really smart we would store the integral over power cycles, but we don't.

If the gain is good, it can come out of a turn with quite a lot of error (I tested it to around 15 degrees), and come back to the correct heading very quickly. Past a certain error the control loop was unstable, we did not worry about it because our turns were more reliable than the unstable threshold. But, you should take up turn error in the turn function, not the straight function.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack