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.
the part worth keeping
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.
Mechanical, Build & PneumaticsAdvanced Techniques & Case Studieslesson 2 of 5
Keep going
Take the quiz+10 XP with an accountMore in Advanced Techniques & Case Studies
where this came from
Sources and 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, in public, in the corrections log.
sources and further reading
- docs.wpilib.orgWPILib Physics Simulation (Drivetrain Model)
- frcskywalkers.orgFRC Skywalkers: Utilizing CAD and Physics to Validate a Design
- onshape.comOnshape for FIRST Robotics
clipped to this lesson
Articles that go further on this
The lesson gets you through the topic. These go wider on it, and they read in one sitting.
- 7 min readPractice FRC Programming Without a Robot: WPILib SimulationPractice FRC programming without a robot using WPILib simulation: run real robot code on your laptop, drive a virtual robot, model physics, and test./blogread it
- 16 min readFRC Elevator and Arm Design: Staging, Rigging, Motors, Gravity, and SafetyA primary-source FRC guide to designing elevators and arms: cascade vs continuous rigging, staging, motor and gear-ratio sizing, gravity math, and safe holding./blogread it
- 17 min readFRC Flywheel Shooter Design: Compression, Speed, Backspin, and HoodingHow to design an FRC flywheel shooter: exit velocity, compression, flywheel inertia and RPM recovery, single vs dual wheels, backspin, hooding, motors, and tuning./blogread it
answer sheet
Lesson quiz
All 3 right completes the lesson. Miss one and only that question comes back, anything you already answered correctly stays banked.
0 of 3 answered
01In WPILib physics simulation, what does the DCMotor model encode as the building block for the mechanism sims?
02Which inputs should be pulled straight from a robot's Onshape/CAD model's mass properties when building a physics simulation?
03What 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 & Pneumaticsopenclose
01 / prerequisites
02 / drivetrains
03 / power-transmission
04 / structure-materials-fasteners
05 / mechanisms-fabrication-assembly
06 / pneumatics-fundamentals
07 / pneumatic-components
08 / build-wire-program
09 / safety-rules-testing
10 / worked-examples-mini-projects
- Not read yet:Mini-Project 1: A Single-Jointed Arm From Math to Motion
- Not read yet:Mini-Project 2: A Two-Stage Cascade Elevator
- Not read yet:Mini-Project 3: A Velocity-Controlled Flywheel Shooter
- Not read yet:Mini-Project 4: A Pivoting Roller Intake
- Not read yet:Mini-Project 5: Integrating a COTS Swerve Module
11 / common-mistakes-troubleshooting
- Not read yet:Pneumatics Won't Fire: A Full Diagnostic Tree
- Not read yet:The Robot Won't Drive Straight (and Other Drivetrain Sins)
- Not read yet:Gearboxes That Grenade and Fasteners That Vibrate Loose
- Not read yet:Closed-Loop Mechanisms That Oscillate, Sag, or Stall
- Not read yet:Field-Ready Reliability: Inspection, Spares, and the Pit Checklist
12 / advanced-techniques-case-studies
- Not read yet:Characterizing Any Mechanism with SysId
- Not read yet:Simulation-Driven Design with WPILib Physics Models
- Not read yet:Motion Profiling and Superstructure Coordination
- Not read yet:Designing for Weight, Stiffness, and Manufacturability
- Not read yet:Case Studies: Learning From Open Alliance Robots