Arcade Single Stick Drive

I’m working on some arcade single stick control for our chassis. I see a problem is the turning is weird. It seems like one side is getting more power than the other, which actually may be the user control. I tried modifying the code to create some kind of ‘dead band’ for both x and y axes. It looks like this:

driveLeftChassisSide(((fabs(vexRT[Ch3]) >= 30) ? (vexRT[Ch3]) : (0)) + ((fabs(vexRT[Ch4]) >= 30) ? (vexRT[Ch4]) : (0)));
driveRightChassisSide(((fabs(vexRT[Ch3]) >= 30) ? (vexRT[Ch3]) : (0)) - ((fabs(vexRT[Ch4]) >= 30) ? (vexRT[Ch4]) : (0)));

Basically, if my driver wants to turn to the right, they move the joystick to the right (no duh, captain obvious). Let’s say the value all the way to the right is +127 (for the x value) and +15 (for the y value). The code says if the joystick value is under a minimum (in this case 30), then set the value to 0. This gives a value of +127 to the left side and -127 to the right side to create a nice pivot. I made this because my driver can’t perfectly line the joystick to an x or y value of exactly 0. I don’t have a robot to test this on, so could this work? Thank you in advance.

(Sorry for the parentheses overload)

Yes, that should work. 30 is a fairly large deadband, so fine, slow motion could be impossible. You might consider setting a DEADBAND constant, putting it in place of all those 30s, and tuning it down to the minimum value at which your bot will move.

I’m pretty sure that according to the MC29 power curve, the motors usually don’t start moving until they are given a command >= 20, so that may be a better value for the deadband.

Yeah, I chose 30 as some random number but should probably make it a constant of 20 like @Easton said.