Skip to content

Commit

Permalink
[Doc] Include safety output pin
Browse files Browse the repository at this point in the history
Signed-off-by: Pascal Pieper <[email protected]>
  • Loading branch information
Cirromulus committed Sep 10, 2022
1 parent dae56d1 commit 0d9a09a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 10 additions & 3 deletions config/sample-pwm-tool.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -27,33 +27,40 @@ 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

[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
Expand Down
2 changes: 2 additions & 0 deletions docs/Using_PWM_Tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down

0 comments on commit 0d9a09a

Please sign in to comment.