Design it, then prove it, before you build it
Top teams validate mechanisms in CAD and simulation before committing material and time. WPILib ships physics simulation classes that model your mechanism from real inputs: motor type/count, gear ratio, mass or moment of inertia, and travel.
The building block: DCMotor
Everything starts with a DCMotor model that encodes a real motor's stall torque, free speed, and stall current. For example, DCMotor.getNEO(1) or DCMotor.getKrakenX60(2) describes the motor(s) driving your mechanism, the same published curves you used to size the reduction (NEO Vortex: 6784 RPM free, 3.6 Nm stall; Kraken X60: 6000 RPM free trapezoidal, 7.09 Nm stall).
Mechanism models
ElevatorSim(motor, gearing, carriageMassKg, drumRadiusM, minHeightM, maxHeightM, simulateGravity, startingHeight, ...)— predicts whether your motor count and ratio can actually lift the carriage and how fast.SingleJointedArmSim(motor, gearing, jKgMetersSquared, armLengthM, minAngle, maxAngle, simulateGravity, startingAngle, ...)— checks if your arm can hold and move under gravity.FlywheelSim— predicts spin-up time and recovery for a shooter.
Getting the inputs from CAD
The key advanced move: pull moment of inertia (MOI) and center of mass straight from your Onshape/CAD model's mass properties instead of estimating. FRC teams combine free-body diagrams with CAD mass data to compute net torque and validate a mechanism, exactly the workflow case-study teams document. Garbage MOI in = misleading sim out, so model the real materials and parts.
A validation loop
- Size reduction by hand (torque math).
- Build the CAD; read MOI/CoM from mass properties.
- Plug into the matching WPILib sim class.
- Command a profile and watch: does it hold? Does it reach the setpoint in time? Does current stay under your limit?
- If it fails in sim, change the ratio/motor count/mass before cutting metal.
Why this wins
Simulation catches under-geared mechanisms, over-current designs, and impossible motion-profile targets in minutes, not after a week of fabrication. It also lets programmers develop and tune control code against a realistic model before the mechanism physically exists, so software is ready when hardware arrives.
Caveats
Sim models friction crudely; real kS will differ. Treat sim as a design filter and a software head-start, then confirm on hardware with SysId. The combination, CAD mass properties feeding a physics sim, then SysId on the real build, is how strong teams arrive at competition with mechanisms that already work.
Key takeaways
- WPILib sim classes (ElevatorSim, SingleJointedArmSim, FlywheelSim) validate motor count, gear ratio, and mass before fabrication.
- Pull moment of inertia and center of mass from CAD mass properties so the simulation reflects the real mechanism.
- Use sim as a design filter and a software head-start, then confirm friction-dependent terms (kS) on hardware with SysId.
Keep going
Take the quiz · +10 XP with an accountMore in Advanced Techniques & Case Studies
Sources & corrections
This lesson is AI-assisted: drafted from primary sources, then reviewed and edited by hand. Errors still get through. When one is reported we fix it and write down what changed — publicly, in the corrections log.
Sources and further reading
- WPILib Physics Simulation (Drivetrain Model)docs.wpilib.org
- FRC Skywalkers: Utilizing CAD and Physics to Validate a Designfrcskywalkers.org
- Onshape for FIRST Roboticsonshape.com
Read next
Articles on this, for competition day
The lesson covers how it works. These cover what to do when it breaks.
- 7 min read
Practice FRC Programming Without a Robot: WPILib Simulation
Practice FRC programming without a robot using WPILib simulation: run real robot code on your laptop, drive a virtual robot, model physics, and test.
Read - 16 min read
FRC Elevator and Arm Design: Staging, Rigging, Motors, Gravity, and Safety
A primary-source FRC guide to designing elevators and arms: cascade vs continuous rigging, staging, motor and gear-ratio sizing, gravity math, and safe holding.
Read - 17 min read
FRC Flywheel Shooter Design: Compression, Speed, Backspin, and Hooding
How to design an FRC flywheel shooter: exit velocity, compression, flywheel inertia and RPM recovery, single vs dual wheels, backspin, hooding, motors, and tuning.
Read
Lesson quiz
RequiredAll 3 right completes the lesson. Miss one and only that question comes back — anything you already answered correctly stays banked.
0 of 3 answered
01.In WPILib physics simulation, what does the DCMotor model encode as the building block for the mechanism sims?
02.Which inputs should be pulled straight from a robot's Onshape/CAD model's mass properties when building a physics simulation?
03.What is a key caveat about trusting WPILib physics-sim results, and how should it be addressed?
Answer every question to submit.
All 47 lessons in Mechanical, Build & Pneumatics
- Not started:Mini-Project 1: A Single-Jointed Arm From Math to Motion
- Not started:Mini-Project 2: A Two-Stage Cascade Elevator
- Not started:Mini-Project 3: A Velocity-Controlled Flywheel Shooter
- Not started:Mini-Project 4: A Pivoting Roller Intake
- Not started:Mini-Project 5: Integrating a COTS Swerve Module
- Not started:Pneumatics Won't Fire: A Full Diagnostic Tree
- Not started:The Robot Won't Drive Straight (and Other Drivetrain Sins)
- Not started:Gearboxes That Grenade and Fasteners That Vibrate Loose
- Not started:Closed-Loop Mechanisms That Oscillate, Sag, or Stall
- Not started:Field-Ready Reliability: Inspection, Spares, and the Pit Checklist
- Not started:Characterizing Any Mechanism with SysId
- Not started:Simulation-Driven Design with WPILib Physics Models
- Not started:Motion Profiling and Superstructure Coordination
- Not started:Designing for Weight, Stiffness, and Manufacturability
- Not started:Case Studies: Learning From Open Alliance Robots