From: David Woodhouse Date: Tue, 11 Feb 2025 23:01:06 +0000 (+0000) Subject: Reinstate Home command, adjust speed and stallguard thresholds X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=efe10649d25b1d671da60118dd978b46336aa2f2;p=users%2Fdwmw2%2Fesp32-pool.git Reinstate Home command, adjust speed and stallguard thresholds This will be better once the reed switches are wired up, but it works for now. --- diff --git a/blind.yaml b/blind.yaml index ec1010a..5a1de7e 100644 --- a/blind.yaml +++ b/blind.yaml @@ -18,13 +18,13 @@ esphome: 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 @@ -195,6 +195,14 @@ button: - 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: @@ -232,8 +240,20 @@ binary_sensor: 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 diff --git a/landing-blind-3.yaml b/landing-blind-3.yaml index 69c69df..ce7ebfc 100644 --- a/landing-blind-3.yaml +++ b/landing-blind-3.yaml @@ -1,7 +1,7 @@ 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