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.
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.
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.
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…
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:
if (error > DEADBAND || error < -DEADBAND)
{error = 127;}
'set DEADBAND to represent your +/- 2 degree margin of error
I agree with APS on this one. We did a crab drive for triple play, and tried to control the swivel by moving the joystick from side to side. Long story short, bad idea. A joystick that can rotate around the vertical would work, we also tried looking for one of those jog wheels that you find on remotes, the ones that return to center when you let go. I wold also recommend that you put a three position toggle switch on your control board that when you press it, centers your wheels so they all face foreward, and then turns the robot tank-style. This was a helpful feature for us, and allowed us to make turns that orient the entire robot that would have otherwise taken some wicked driving and some time. If there is any more help I or any of my team members can give you, let me know!
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.