Spark Max randomly go max speed while driving

Hello,
I’ve been working on programming my groups robot and while implementing deadzones on the joysticks I ran into an issue where the robot will randomly go full speed forwards or backwards. I commented out the deadzone code and still have the issue. What could be causing the motor controllers to go full speed randomly, overriding the current input?
I can upload the full code if you need it, but I did do this with the SparkMax classes:

class BoomMax : public rev::CANSparkMax{

public:

BoomMax(int deviceID, bool backward)

  : CANSparkMax(deviceID, rev::CANSparkMax::MotorType::kBrushed){

    SetClosedLoopRampRate(.5);

    SetOpenLoopRampRate(.5);

    SetInverted(backward);

    SetCANTimeout(0);

    }
 };

This could also be a software bug. If you want to rule that in or out, try creating a fresh project with just the absolute minimum code to drive – avoid anything at all fancy. Even easier, see if this happens when the robot is up on blocks and you are only asking for very little power. There should be very little vibration, and if/how the problem shows up under these conditions can often provide some insight. If you suspect wiring, you can (be careful) wiggle wires when things are set up this way.

This is not accurate. If the encoder cable is not plugged in, the controller will display a sensor fault blink code, set the corresponding bit in software, and turn off the motor entirely.

2 Likes