![]() |
Swerve drive control system
Sorry if this was posted already, I did some searching and couldn't find it.
This year my team is doing a crab drive. I was wondering how when programming it you deal with a driver who isn't maintaining a constant position. We don't want our robot to start traveling on a curve but we want our wheels to turn fairly fast. My first idea is to have something in the code that says if the joystick doesn't change its position by more than 2 degrees don't move the wheels, but I don't think this will be good enough to fix the problem. :ahh: Any help would be great. Thanks. |
Re: Swerve drive control system
Note: I am not a programming expert!
But I do remember that many teams program in a "dead zone" into their code that ignores a certain percentage of any joystick movement outside of center. For example if you move all the way to the right, your motor input value will be 255. All the way to the left is 0. So if you program a deadzone of 10% in either direction, you just ignore any motor signals (or make it zero) for joystick outputs 100 - 140 or so. Maybe this could solve part of your problem, maybe not. Hope my non-expert advice could help! |
Re: Swerve drive control system
Thanks, I was thinking something along those lines. Right now i'm thinking of splitting the joystick output into sections and only letting the robot drive a certain number of angles. This way I can say if the joystick is in x region put the wheel at y angle.
|
Re: Swerve drive control system
the wheel button on the joystick has 8 discrete positions, well 9 if you consider not pressing the button = neutral position.
the default code maps this signal from joystick to port, just keyword search for "wheel" and see what you find. maybe this is how you want to control your robot? wouldn't be smooth, but sounds like this is what you are asking for. slloyd |
Re: Swerve drive control system
We've considered working up a crab-steer in the off-season. Our thoughts were to use a potentiometer/knob on a custom control box to steer a crab. If one uses a self-centering joystick, one will have to constantly maintain stick position to steer in that direction. Maybe you have a joystick with a twist or rotation option and momentary twists CW or CCW will jog the steer motor CW or CCW instead of going to set rotation...
APS |
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) |
Re: Swerve drive control system
I'll give that a try and see how it works. Thanks.
|
Re: Swerve drive control system
Quote:
|
Re: Swerve drive control system
Yeah I was planning on just putting in some code so when the trigger was pressed if the joystick was moved forward or backward the robot would spin like it was a tank drive system. I've now just about finished the code for the drive system. It actually ended up being easier than I thought it would. :)
|
| All times are GMT -5. The time now is 04:52. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi