From 0d9a09a138fd473124b700ada6d9f0f46756db1d Mon Sep 17 00:00:00 2001 From: Pascal Pieper Date: Sat, 15 Jan 2022 22:49:00 +0100 Subject: [PATCH] [Doc] Include safety output pin Signed-off-by: Pascal Pieper --- config/sample-pwm-tool.cfg | 13 ++++++++++--- docs/Using_PWM_Tools.md | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/config/sample-pwm-tool.cfg b/config/sample-pwm-tool.cfg index 38d640de5491..f0990993e3c0 100644 --- a/config/sample-pwm-tool.cfg +++ b/config/sample-pwm-tool.cfg @@ -3,7 +3,7 @@ # See docs/Using_PWM_Tools.md for a more detailed description. [output_pin TOOL] -pin: !ar9 # use your fan's pin number +pin: !PIN # use your fan's pin number pwm: True #hardware_pwm: True # Using hardware PWM is optional. @@ -27,19 +27,26 @@ high_throughput: True # needs to be in default speed (off), or else the MCU will # do a safety-shutdown. +[output_pin TOOL_ENABLE] +pin: !OTHER_PIN +shutdown_value: 0 + [gcode_macro M3] gcode: + SET_PIN PIN=TOOL_ENABLE VALUE=1 {% set S = params.S|default(0.0)|float %} SET_PIN PIN=TOOL VALUE={S / 255.0} [gcode_macro M4] gcode: + SET_PIN PIN=TOOL_ENABLE VALUE=1 {% set S = params.S|default(0.0)|float %} SET_PIN PIN=TOOL VALUE={S / 255.0} [gcode_macro M5] gcode: SET_PIN PIN=TOOL VALUE=0 + SET_PIN PIN=TOOL_ENABLE VALUE=0 # Optional: LCD Menu Control @@ -47,13 +54,13 @@ gcode: [menu __main __control __toolonoff] type: input enable: {'output_pin TOOL' in printer} -name: Fan: {'ON ' if menu.input else 'OFF'} +name: Tool: {'ON ' if menu.input else 'OFF'} input: {printer['output_pin TOOL'].value} input_min: 0 input_max: 1 input_step: 1 gcode: - M3 S{255 if menu.input else 0} + SET_PIN PIN=TOOL_ENABLE VALUE={1 if menu.input else 0} [menu __main __control __toolspeed] type: input diff --git a/docs/Using_PWM_Tools.md b/docs/Using_PWM_Tools.md index 79a62a290e9f..03fba05990b1 100644 --- a/docs/Using_PWM_Tools.md +++ b/docs/Using_PWM_Tools.md @@ -23,6 +23,8 @@ laser-goggles of the right wavelength if the laser is powered; and to disconnect the laser when it is not needed. Also, you should consider using a safety timeout, so that when your host dies unexpectedly, the tool will stop. +An additional safety layer would be powering your tool through the hotend-heater pin. +In the configuration, the additional `[output_pin]` would be activated by `M3/M4` and disabled by `M5`. For an example configuration, see [config/sample-pwm-tool.cfg](/config/sample-pwm-tool.cfg).