Use a velocity based simple motor feedforward and a PID controller to run flywheel at a given speed.
PID velocity loops for things that spin really fast are notoriously unstable. Try using the built in SparkMax PID methods to run the PID loop on the SparkMax itself instead of on the Rio (it'll be running at like 1kHz instead of 50 Hz), and take a look here for how to improve the default velocity filtering.
Use a velocity based simple motor feedforward and a PID controller to run flywheel at a given speed.
PID velocity loops for things that spin really fast are notoriously unstable. Try using the built in SparkMax PID methods to run the PID loop on the SparkMax itself instead of on the Rio (it'll be running at like 1kHz instead of 50 Hz), and take a look here for how to improve the default velocity filtering.