8" mecanums -> Nano Box -> CIM Motor -> Jag -> PWM -> DSC
Programming in C++ using the FRC library (using polar plane)
Problem:
When the robot is up on blocks for testing purposes:
Slow reverse - one set of wheels spins forward [light on jag indicates forward code (light is green)] and one set spins backwards (light is red)
Full-speed reverse - both sets spin backwards
Things we have already tried:
Calibrated jags
Swapped PWMs between ports - same problem occured on other side
Put on new PWMs
Put on different jags
Same problem occurs on different DSC (so both sets of ports on both DSCs would have to be bad if this is the problem)
Changed code to Cartesian plane
Also, when we drive forward all works as expected (lights are green on jags and all wheels spin in the same expected direction)
Could this possibly be a coding issue or are we missing something else?
From what you describe, I’m inclined to settle on a coding issue. To conclusively determine whether it is, I suggest uploading skeleton code (my choice of preference would be tank drive) and comparing it with joystick input to see how it responds. If wheels turn forward and backward in response to forward and backward joystick motion, then you know it’s a code problem.
If that isn’t the case, however, I would suggest checking the neutral on your joysticks. An inconsistent neutral could possibly produce the symptoms you’re observing (I know we’ve had problems with Logitech gamepads in this area before).
One side of your drive should be green and the other side red when going backwards. The reason is the change in orientation of the motors; telling two motors to go forward will always turn their shafts in the same direction with respect to the output face, but not necessarily the same direction with respect to the frame due to changes in orientation. As such, full-speed reverse should turn one side of your drive green and the other red, but one side going forwards and the other backwards should be indicated by one consistent color (either all green or all red).
Just for clarification, I assume driving forward slowly and slamming the joysticks forward produce the appropriate responses?
Ok, so you know the old saying that the person who created a problem can’t fix the problem? If we post code can you take a look and see if you see anything glaring out at you?