View Single Post
  #6   Spotlight this post!  
Unread 20-01-2007, 00:24
Eric Yahrmatter's Avatar
Eric Yahrmatter Eric Yahrmatter is offline
Registered User
FRC #0033 (Killer Bees)
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2003
Location: Ortonville, MI
Posts: 65
Eric Yahrmatter has a spectacular aura aboutEric Yahrmatter has a spectacular aura about
Re: Swerve drive control system

You could use a proportional feedback controller to drive your turret motor. We normally use them to control arm movements and prevent overshooting, but one can and will work in your case.
This presentation should help:
http://www.chiefdelphi.com/media/papers/1754

You can add a segment to the sample code provided in the presentation to prevent turret movement due to shaky driver inputs. Try something like this:
Code:
if (error > DEADBAND || error < -DEADBAND)
    {error = 127;}
'set DEADBAND to represent your +/- 2 degree margin of error