SparkMAX Voltage Compensation


Prior to today, Team 8 was running voltage compensation on all of its Spark MAXs. We had a pretty low current limit set, but we were occasionally having brownout/jittering issues. Furthermore, we were always having issues where our arm would brown out when moving down while the drivetrain was accelerating hard. It turns out that when we removed the low current limit on the drivetrain, the drivetrain would jitter to a point that would make it impossible to drive.

After working with the CSAs here at the Great Northern Regional for about an hour this morning, we were ultimately able to track down the issue to the voltage compensation running on the Spark MAXs. In the next few days, I’ll go ahead and send a full report in to Rev Robotics, but I just wanted to put out a warning for teams using voltage compensation on the Spark MAXs.


I already brought this up with you all, but this may be oscillation induced by voltage compensation and closed loop control.

If the bus voltage is sitting idle and suddenly a motor is switched on, the large inrush current will sink the bus voltage. The controller will respond by increasing the percent output, which will further sink the bus voltage. If the voltage rolling average window is not large enough (acts as a low pass filter), this interplay can introduce strange behavior.

The Spark MAX doesn’t seem to offer a method to configure this. The Talon SRX has configVoltageMeasurementFilter().


It’s also a little interesting that the arbitrary feed forward for closed loop control is offered in terms of target voltage. If this actually takes the bus voltage into account I could see it only further complicating the issue.


I agree it is a bit strange. I think the ideal behavior would be for arbitrary feedforward to be measured in output units, and be voltage compensated only if voltage compensation is enabled. I believe that’s how the Talon SRX works.