Skip to main content

CTRE Basics (Phoenix 6)

Minimum bring‑up steps we follow for every TalonFX:

1) Construct on the right CAN ID (and CAN bus name if using more than rio) 2) Apply configs (PID Slot0, output limits, neutral mode) via getConfigurator().apply(...) 3) Zero/seed position if needed 4) Log faults and important telemetry on startup 5) Set a safe default command that won’t drive hardware unexpectedly

TalonFX fx = new TalonFX(10, "rio");
var cfg = new TalonFXConfiguration();

// Slot0 PID & FF
cfg.Slot0.kP = 0.2;
cfg.Slot0.kI = 0.0;
cfg.Slot0.kD = 0.0;
cfg.Slot0.kS = 0.1;
cfg.Slot0.kV = 0.0;
cfg.Slot0.kG = 0.0;

// Outputs
cfg.MotorOutput.withNeutralMode(NeutralModeValue.Brake)
.withPeakForwardDutyCycle(1.0)
.withPeakReverseDutyCycle(-1.0);

fx.getConfigurator().apply(cfg);
fx.set(0.0);

Ironclad Standard: Configs are idempotent and applied every boot.