Flywheel simulation in WPILib using Shuffleboard

Howdy y’all!

I’m putting together a set of simulators of various robot subsystems to help teams practice with programming during the off-season when they may not have easy access to their robot.

The first one is a simple one-motor, one-encoder flywheel. It’s available at https://github.com/fixermark/frc-component-simulators-wpilib-java. It uses Shuffleboard both to visualize the flywheel RPM and to let you adjust the physical properties of the simulation (friction, motor torque, gear ratio, etc.).

The default controller just runs the motor at maximum power when you hold down the button; feel free to play around with it, then try writing an autonomous controller to hold the RPMs at a set value.

Enjoy, and let me know what you think!

2 Likes

Did you consider using the FlywheelSim class? FlywheelSim (WPILib API 2022.4.1)

2 Likes