Rev Spark Max CAN and Control Errors

When running a CAN with multiple Spark Max motors, we are seeing a periodic Red Flash on the PCM. With all Spark Max motors removed or single Spark Max, we do not have this issue.
(Our bot is designed to run with 7 Spark Max and 4 Talon SRX all on CAN. All have unique CAN ID numbers.)

We have increased the periodic frame rate to max. This helps in that the errors are less frequent, but they do not disappear.

A very easy way for us to see the problem is plotting the velocity and sending a steady signal. We then get an intermittent time when the input is still full, but the motor stops. When the brake is on, you hear and see the motor jump. (Fastened down next to our test fixture.)
We are minimizing this currently in the drive system by having the motor in coast mode. For our lift system, it needs to be in brake mode.

We are coding in C++. We have the latest Rev Spark Max client version 1.0.0. We have the latest firmware loaded (1.1.31). Lastest C++ API version 1.1.9.
You can find our source code here:
The LiftAndShuttleSubsystem and DriveTrain with VelocityDriveTrain use the Spark Max.

Thank you for the help!
Kevin Russell
Software Mentor
FRC #2959 CW Tech Robotarians

How long are your CAN bus wires? If any of the runs are longer than 1 foot, you’ll probably start to see some bad signal degradation.

On our test board, the runs are all short (MCs wired into PDP with motors rights next to MCs) and the problem still shows there.

On the bot, we have some 4’ - 6’ runs, since the Talon SRX MCs are by the motors (with encoders) on the lift travel system (which also has a horizontal travel system). When we isolated the CAN to just the Spark Maxes in the bottom of the bot, without the long runs, still had issues.

We will keep the long run problem in mind.

Thanks for the thought.

What are you basing this statement on?

It looks to be the debug code of reading and writing to the SmartDashboard. When this is commented out, the intermittent red flash goes away.
We can live with it for debugging/tuning the motors. Final test Monday, with the debug stuff commented out, to ensure things run smoothly.


Oh, yeah, you definitely should never be calling the Get methods in CANSparkMax regularly. Those involve a read from the CAN bus, as per the documentation.