Desktop simulation in WPILib is not just a software unit-testing tool; it is a full numerical physics engine running on your laptop. By pairing physical gear ratios, carriage masses, and arm lengths with accurate DC motor back-EMF and torque models, simulated mechanisms exhibit the same inertia, gravity sag, and current draw as the real robot.
Lessons in This Module
Section titled “Lessons in This Module”-
Mechanism Physics Models with DCMotor (35 min): Construct simulation models for elevators, arms, and flywheels using
ElevatorSim,SingleJointedArmSim, andFlywheelSim. Configure brushless motor curves including Kraken X60, Minion, and NEO. -
Simulated Hardware & AdvantageScope (35 min): Implement the virtual hardware loopback inside
simulationPeriodic(). Pass applied motor voltage into the physics engine, feed updated positions back into simulated sensors, and render animated mechanisms in Mechanism2d and AdvantageScope.
Verified Sources & Standards
- WPILib Physics Simulation Classesdocs.wpilib.orgWPILib Standard
- WPILib Mechanism2d Visualizationdocs.wpilib.orgWPILib Standard
Lessons
Mechanism Physics Models with DCMotor
Modeling single-jointed arms, cascading elevators, and high-inertia flywheels using WPILib physics simulators and brushless DCMotor models.
Simulated Hardware & AdvantageScope
Connecting physics models to production SubsystemBase classes, vendor SimState wrappers, Mechanism2d visualization, and AdvantageScope simulation replay.