[tmc2209] Add TMC2209 stepper driver (#20437)

Co-authored-by: J. Nick Koston <nick@home-assistant.io>
This commit is contained in:
Remco van Essen
2026-10-12 13:13:11 -10:00
committed by GitHub
co-authored by J. Nick Koston
parent 0c43d689d7
commit 132e9dac8b
12 changed files with 888 additions and 0 deletions
+57
View File
@@ -0,0 +1,57 @@
stepper:
- platform: tmc2209
id: tmc2209_step_dir
uart_id: uart_bus
address: 0
step_pin: ${step_pin}
dir_pin: ${dir_pin}
enn_pin: ${enn_pin}
rsense: 110 mOhm
vsense: false
ottrim: 1
run_current: 800mA
hold_current: 400mA
microsteps: 16
max_speed: 2000 steps/s
acceleration: 1000 steps/s^2
deceleration: 1000 steps/s^2
- platform: tmc2209
id: tmc2209_serial
uart_id: uart_bus
address: 1
index_pin: ${index_pin}
clock_frequency: 12MHz
analog_current_scale: true
max_speed: 1000 steps/s
esphome:
on_boot:
then:
- tmc2209.configure:
id: tmc2209_step_dir
inverse_direction: true
microsteps: 8
interpolation: true
enable_spreadcycle: false
tpwm_threshold: 0
- tmc2209.configure:
id: tmc2209_serial
microsteps: !lambda "return 32;"
- tmc2209.currents:
id: tmc2209_step_dir
run_current: 1A
hold_current: 0.5A
iholddelay: 4
tpowerdown: 20
standstill_mode: freewheeling
- tmc2209.currents:
id: tmc2209_serial
irun: 20
ihold: !lambda "return 5;"
- tmc2209.enable: tmc2209_serial
- stepper.set_target:
id: tmc2209_serial
target: 1000
- tmc2209.disable:
id: tmc2209_step_dir
@@ -0,0 +1,9 @@
substitutions:
step_pin: GPIO12
dir_pin: GPIO13
enn_pin: GPIO14
index_pin: GPIO15
packages:
uart_115200: !include ../../test_build_components/common/uart_115200/esp32-idf.yaml
tmc2209: !include common.yaml
@@ -0,0 +1,9 @@
substitutions:
step_pin: GPIO12
dir_pin: GPIO13
enn_pin: GPIO14
index_pin: GPIO15
packages:
uart_115200: !include ../../test_build_components/common/uart_115200/esp8266-ard.yaml
tmc2209: !include common.yaml
@@ -0,0 +1,9 @@
substitutions:
step_pin: GPIO2
dir_pin: GPIO3
enn_pin: GPIO6
index_pin: GPIO7
packages:
uart_115200: !include ../../test_build_components/common/uart_115200/rp2040-ard.yaml
tmc2209: !include common.yaml