This will be better once the reed switches are wired up, but it works for now.
interpolation: true
tcool_threshold: 400
- tmc2209.stallguard:
- threshold: 45 #set lower if stall gaurd triggering too often
+ threshold: 70 #set lower if stall gaurd triggering too often
- tmc2209.currents:
ihold: 0
tpowerdown: 0
iholddelay: 0
# irun: 16
- run_current: 100m #Set your desired current here (800m = 800mA, 1 = 1A etc.)
+ run_current: 20m #Set your desired current here (800m = 800mA, 1 = 1A etc.)
standstill_mode: coil_short_ls
# set PD voltage # 5V 9V 12V 15V 20V
- platform: restart
name: Restart
+ - platform: template
+ name: Home
+ id: home
+ on_press:
+ - stepper.set_target:
+ id: motor
+ target: !lambda "return id(motor)->current_position - 2.5 * ${encoder_closed_pos};"
+
- platform: template
name: Stop
on_press:
inverted: true
filters:
- delayed_on: 10ms
- on_press:
- - tmc2209.disable: motor
+ on_click:
+ - max_length: 1s
+ then:
+ - stepper.stop: motor
+
+ - min_length: 2s
+ max_length: 5s
+ then:
+ - logger.log:
+ level: INFO
+ format: "Blind rehome"
+ - stepper.set_target:
+ id: motor
+ target: !lambda "return id(motor)->current_position - 2.5 * ${encoder_closed_pos};"
- platform: gpio
name: Button 3
substitutions:
name: "landing-blind-3"
encoder_closed_pos: "230000" # full blinds length (in encoder counts) !! CHANGE TO SUIT YOUR SETUP !!
- microsteps: "1"
+ microsteps: "2"
packages:
blind: !include blind.yaml