Overview
System identification is the process of determining mathematical models for your robot’s physical systems. SysId automates data collection and analysis to generate accurate motor characterization values that can be used in your robot code for better control.What is System Identification?
System identification determines the relationship between voltage applied to motors and the resulting motion. The key values calculated are:- kS (Static Gain): Voltage needed to overcome static friction
- kV (Velocity Gain): Voltage needed per unit of velocity
- kA (Acceleration Gain): Voltage needed per unit of acceleration
- kG (Gravity Gain): Voltage needed to overcome gravity (for arms/elevators)
Running SysId
Navigate to the WPILib repository
Open a terminal and navigate to the root of the WPILib repository:
Create a robot project
In SysId, create a new project or use the built-in robot code generator to create a test project for your mechanism.
Run tests
Back in SysId, connect to your robot and run the following test types:
- Quasistatic Tests: Slowly ramp voltage to measure steady-state behavior
- Dynamic Tests: Apply a step voltage to measure transient response
Supported Mechanism Types
SysId supports characterization for:- Drivetrain: Linear and angular characterization
- Arm: Mechanisms that rotate against gravity
- Elevator: Mechanisms that translate against gravity
- Simple: Mechanisms without gravitational effects (flywheels, rollers, etc.)
Data Collection
NetworkTables Entries
SysId communicates with your robot program via NetworkTables:| Entry | Type | Description |
|---|---|---|
/SmartDashboard/SysIdTelemetry | string | Telemetry data sent from robot after test completes |
/SmartDashboard/SysIdVoltageCommand | double | Voltage command or ramp rate |
/SmartDashboard/SysIdTestType | string | ”Quasistatic” or “Dynamic” |
/SmartDashboard/SysIdRotate | bool | For drivetrain rotation tests |
Telemetry Format
Data is collected with the following format: Non-Drivetrain:timestamp, voltage, position, velocity
Drivetrain: timestamp, l voltage, r voltage, l position, r position, l velocity, r velocity, angle, angular rate
Supported Units
- Meters
- Feet
- Inches
- Radians
- Rotations
- Degrees
Troubleshooting
If SysId fails to generate plots or encounters errors:Check the data logs
SysId saves data in
.wpilog format. Use AdvantageScope to view these files for troubleshooting.Verify NetworkTables connection
Ensure your robot is connected and publishing to the correct NetworkTables entries.
Using Results
After characterization, SysId provides feedforward gains that can be used in your robot code:Building SysId
To build SysId from source:System Requirements
- Java Development Kit (JDK) 17 or later
- C++ Compiler:
- Linux: GCC 11 or greater
- Windows: Visual Studio 2022 with C++ support
- macOS: Xcode 14 or later command-line tools
Related Tools
- Glass - Visualization tool for robot data
- OutlineViewer - NetworkTables viewer