Stepper drivers

Klipper TMC5160 SPI, Sense Resistor, and TMC AutoTune

Set up TMC5160 SPI in Klipper, match the sense resistor to your driver module, check communication with DUMP_TMC, and add TMC AutoTune.

Illustrated title card for the guide: Klipper TMC5160 SPI, Sense Resistor, and TMC AutoTune

Set up [tmc5160 stepper_x] with your board’s SPI pins or bus and the installed driver module’s sense_resistor in ohms. Klipper’s TMC5160 default is 0.075, and the BIGTREETECH TMC5160T Plus calls for 0.022. After verifying communication with DUMP_TMC, add a separate [autotune_tmc stepper_x] section if you want the extension to tune that motor. Klipper configuration reference · TMC5160T Plus settings · Klipper TMC diagnostics · AutoTune configuration

TMC5160 SPI settings in Klipper

In printer.cfg, use the name of the existing stepper section after tmc5160. For [stepper_x], use [tmc5160 stepper_x]. The settings below come from the TMC5160 configuration reference and common SPI settings.

SettingWhat to enter
cs_pinThe chip-select pin for that driver position. Required.
spi_busUse spi_bus: <bus name> to select a hardware SPI bus when the MCU supports multiple buses. The default depends on the MCU.
spi_software_sclk_pin, spi_software_mosi_pin, spi_software_miso_pinSpecify all three when using software SPI. Use the pin assignments for your board.
run_currentThe driver current during movement, in amps RMS. Required. See the Klipper motor current guidance.
sense_resistorThe installed module’s motor sense resistance in ohms. Klipper’s documented default is 0.075.

The Klipper BIGTREETECH GTR configuration shows these X-axis software SPI pins in a commented example. Replace the angle-bracket placeholders with your motor current and module resistance before loading the section. Use your own board configuration to look up the pins for a different board or driver position.

[tmc5160 stepper_x]
cs_pin: PC14
spi_software_sclk_pin: PB3
spi_software_mosi_pin: PG15
spi_software_miso_pin: PB6
run_current: <amps RMS>
sense_resistor: <ohms>

Choose the sense resistor by module

Match the exact module and revision to its manufacturer documentation, then enter its resistance in ohms. Klipper configuration reference

Driver moduleEntry in [tmc5160 ...]Manufacturer reference
BIGTREETECH TMC5160 V1.0sense_resistor: 0.075TMC5160 Klipper example
BIGTREETECH TMC5160T Plussense_resistor: 0.022TMC5160T Plus Klipper settings

Verify SPI communication before adding AutoTune

Save printer.cfg, then run these commands in the Klipper console. Run DUMP_TMC once STATUS confirms the config loaded. Substitute the corresponding stepper name if you configured a different driver. Configuration checks · G-code reference

RESTART
STATUS
DUMP_TMC STEPPER=stepper_x

DUMP_TMC reports the fields Klipper configured and the fields it can read back from the driver. If Klipper reports an SPI register write error, use its SPI troubleshooting checklist.

  1. Check that motor power is on. The driver generally needs it to communicate with the MCU.
  2. Check the chip-select pin and SPI configuration against the board’s pin assignments. Turn off power before unplugging or reseating the TMC5160T Plus. BIGTREETECH installation precautions
  3. On a shared SPI bus, check the Klipper configuration for every device on the bus. The board schematic can help identify those devices and their pins.

Add TMC AutoTune

TMC AutoTune is a Klipper extension that uses the motor’s specifications and your selected tuning goal to calculate settings for most driver registers. If you use KIAUH, look for TMC AutoTune in its community extensions section. Follow the project’s installation instructions for setup over SSH.

Keep the SPI pins, sense_resistor, and run_current in [tmc5160 stepper_x]. The AutoTune project calls for interpolate: true in the driver section and recommends commenting out manual register overrides when adopting AutoTune. Klipper configuration reference · AutoTune configuration guidance

Add one [autotune_tmc ...] section per motor you want to tune. This is the project’s example for an X motor with the ldo-42sth48-2004mah ID. Use the exact ID for your motor from the motor database. AutoTune configuration

[autotune_tmc stepper_x]
motor: ldo-42sth48-2004mah

For an unlisted motor, define a [motor_constants ...] section. The motor’s datasheet usually lists the values. AutoTune custom motor instructions

AutoTune settingWhat to enter
voltageThe supply voltage powering that motor and driver. AutoTune defaults to 24 V, so enter the actual supply voltage if it differs. AutoTune parameter table
sgtFor TMC5160 sensorless homing with AutoTune, set sgt in this AutoTune section. AutoTune overrides the threshold configured in the driver section. A lower sgt makes stall detection more sensitive. AutoTune sensorless homing · AutoTune parameter table

Save the changes and repeat RESTART, STATUS, and DUMP_TMC STEPPER=stepper_x to load the configuration and inspect the driver registers. Configuration checks · G-code reference

Evidence and limits. Klipper’s live documentation and master configuration example, BIGTREETECH’s module documentation, and AutoTune’s main documentation were checked on November 26, 2026. The steps were not run on hardware.

Sources

  1. Klipper Configuration Reference
  2. Klipper BIGTREETECH GTR example configuration
  3. BIGTREETECH TMC5160 module documentation
  4. BIGTREETECH TMC5160T Plus module documentation
  5. Klipper Configuration Checks
  6. Klipper G-Codes Reference
  7. Klipper TMC Drivers Guide
  8. Klipper TMC AutoTune README
  9. Klipper TMC AutoTune Motor Database

Related