We’ve noticed some odd behavior on our Spark MAXs while testing our practice bot drivetrain. “Our” (see 254 2018 code) trajectory follower loop is run every 10 ms by a Notifier. When running at this loop rate, the motors seem to “jitter” (quite violently). We have them in brake mode, so it appears that what’s actually happening is they’re stopping, getting a new command, and starting. This, of course, throws off the trajectory follower and is not pleasant to watch or hear.
Note that there is no feedback control on the Sparks themselves, the command is being applied entirely through the “arbitrary feedforward” slot in the setReference method. We are using Java (Kotlin) and our Notifier dt varies by at most 0.1 ms every cycle (no blips observed during jittering). Increasing the Notifier dt to 20 ms entirely solves the issue, but we’d like to run our loops faster. All motor controllers show no brushless encoder errors, and CAN usage is < 100%.
Edit: Should also mention we’re on latest firmware (1.1.31) and latest API (1.1.9)
Edit 2: The source of feedback data for the trajectory follower is two CTRE mag encoders connected to talons elsewhere on the CAN network. The data from these sensors is updated at the correct rate and shows no signs of error.
My question is this: is there a setting on the Spark MAX that can be changed to “speed up” its ability to receive frames over CAN, or is this a bug in the firmware?