Hi all! We have a CANSparkMax attatched to our wheel intake called “wheelMotor”. This motor is called by a simple whenHeld button that executes a method which just turns on the motor (.set(0.85)). However, the motor will only turn on for a couple seconds before the robot disables itself and the driver station reads no comms and no code. We ran it on the Rev client and the libraries are up to date and we reflashed the RIO as a precaution. Additionally, we put in a different CANSparkMax motor into wheelMotor’s place and it worked fine (though of course where that motor is on the robot). We are completely lost on the problem, any help is appreciated.
The relevant classes are: RobotContainer, Constants, IntakeCommand, IntakeSubsystem.
LMK if there is anything I can do to help you out!
Quick Edit: Forgot to mention that if we reenable the motor will turn on without input and disable the robot again, we need to powercycle in order to fix this.
The last two lines in the second image show a complete loss of communications to the roborio, but the radio is still connected. This could be caused by a few things:
Roborio loses power: could turning on that motor cause the roborio to lose or interrupt power for any reason? Think wheels rubbing against wires, mechanisms shifting wire positions, etc.
Roborio loses ethernet connection: Same as above, could the ethernet cable (at any point on its path between radio and rio) be disconnected?
Roborio lockup: unlikely, but possible. Are you using any I2C sensors on your robot?
We do not use I2C sensors, the connection answers seem like the most likely culprit. This motor is relatively far from our roboRIO. Thanks for the tip! I will update this post if it works (and if it doesn’t I suppose)