Modern brushless motors (Kraken X60, Falcon 500, NEO Vortex) produce high stall torque, often exceeding 7 Nm per motor. Without software safeguards, an elevator or arm can shear gear teeth, bend aluminum tubing, or snap cables in fractions of a second.
Current Limits: Stator vs. Supply
Section titled “Current Limits: Stator vs. Supply”Every mechanism requires separate protection for internal motor coils and external battery wiring:
[ Battery (12V) ] ---> Supply Current (A) ---> [ Motor Controller ] ---> Stator Current (A) ---> [ Motor Coils ] | PWM / Voltage Step-down1. Stator Current Limits (Torque and Thermal Protection)
Section titled “1. Stator Current Limits (Torque and Thermal Protection)”- What it does: Limits the current circulating through the motor’s copper windings.
- Why it matters: Stator current directly generates motor torque and heat ().
- Rule of Thumb:
- Drivetrain (Kraken X60): 60A to 80A
- Elevators / Arms: 40A to 50A
- Intakes / Rollers: 30A to 40A
// Example: Phoenix 6 Current Limits ConfigurationTalonFXConfiguration config = new TalonFXConfiguration();config.CurrentLimits.StatorCurrentLimitEnable = true;config.CurrentLimits.StatorCurrentLimit = 40.0; // 40 Amps stator2. Supply Current Limits (Brownout & Breaker Protection)
Section titled “2. Supply Current Limits (Brownout & Breaker Protection)”- What it does: Limits current drawn from the battery through the PDP/PDH breaker.
- Why it matters: Prevents the main 120A breaker from tripping and stops the roboRIO from browning out (dropping below 6.8V).
Software Soft Limits
Section titled “Software Soft Limits”Always configure forward and reverse soft limits to prevent mechanisms from hitting hard stops at high velocity:
// Configure soft limits in motor rotationsconfig.SoftwareLimitSwitch.ForwardSoftLimitEnable = true;config.SoftwareLimitSwitch.ForwardSoftLimitThreshold = 35.0; // rotations
config.SoftwareLimitSwitch.ReverseSoftLimitEnable = true;config.SoftwareLimitSwitch.ReverseSoftLimitThreshold = 0.5; // rotationsSoftware limits are only as reliable as your zero reference. If the motor powers on in an un-zeroed state without an absolute encoder (CANcoder), soft limits will activate at the wrong physical locations.
Safety Watchdogs
Section titled “Safety Watchdogs”WPILib commands automatically time out if a motor safety object is starved of updates:
- Set default commands to stop motors or hold position.
- Never write
while(true)loops inside commandexecute()methods. - Always use
.withTimeout(Seconds.of(2.0))on mechanism movement commands in autonomous routines.
Verified Sources & Standards
- CTRE Phoenix 6 Current Limits Specificationv6.docs.ctr-electronics.comHardware Vendor
- REVLib Smart Current Limitsdocs.revrobotics.comHardware Vendor
- WPILib Watchdog Timersdocs.wpilib.orgWPILib Standard