|
Swerve Drive Control
Hello everyone,
Our team 876 has expressed some interest in building a swerve drive practice bot. Up to this point we have only done tank drive. While building a practice bot (on a budget of course) presents it's own set of challenges, as programmer I have a whole different set of issues. Let me bring you up to speed on what we can assume about this robot.
Drivetrain: Swerve, since this is our first time using swerve drive I decided to keep is simple. Each of the 4 swerve modules will be turned individually via window motor. They will turn 90 degrees (allowing for full swerve motion without using coaxial swerve). The modules will be synced via potentiometers, not encoders. The wheels will be driven in the classic swerve style of the CIM turning with the wheel on the "Z" axis. Over all motor count: 4 CIMs and 4 window motors.
Control: Here is where I am lost, we have always used tank drive and I would like to stick with a two joystick system as long as it is not outrageously complicated. I feel like most teams use a single joystick to control direction of travel and some other method to control the orientation of the robot. What is the best control scheme to drive in swerve? A joystick with rotation on the "Z" axis is an option, as is an Xbox controller. But I would like to use two regular joysticks how can this best be accomplished?
Here is my guess on how a 2 joystick system can work, I am sure there are flaws with this concept:
The values from both joysticks are averaged if they are both within a certain range of each other, when they are out of that range the program checks the "Y" values of the joysticks and turns at the appropriate speed based on the difference of those two values. For example:
Last edited by Skyehawk : 01-04-2014 at 20:27.
|