What exactly is SparkMAX smart motion and velocity control?

Our team has been trying to figure out SparkMAX smart velocity control so we can run our shooter’s flywheels more effectively, but we can’t find any documentation about it online. The only thing that comes up is smart motion control, which seems to be a combination of PID and trapezoidal motion profiles, but its still not entirely clear. Has anyone been able to figure out what these control modes are?

The “Smart” part means it will take in to account options configured as part of “smart motion,” such as trapezoidal motion profiles.

Type setSmart in the search bar here to see the list of options.

Since a flywheel has only one state (velocity), a motion profile isn’t needed. Proportional feedback is enough to change the response of the velocity state to whatever you want. Assuming no measurement delay, you can’t overshoot or oscillate as long as you’re sampling your system fast enough to capture the acceleration dynamics.

The optimal controller configuration for a flywheel is a static friction feedforward and velocity feedforward for steady-state error caused by back-EMF (e.g., K_s + K_v \cdot \text{velocity}), and a proportional feedback controller on velocity.

If you get overshoot, that’s typically caused by measurement delay. I have a whole write-up about that here: Shooter Encoder? - #11 by calcmogul. The optimal controller in the presence of measurement delay is less proportional feedback, and in extreme cases, no feedback at all (i.e., adding any feedback will make it oscillate).

1 Like