-
Notifications
You must be signed in to change notification settings - Fork 1
/
printer_tool.cfg
63 lines (47 loc) · 1.69 KB
/
printer_tool.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#[output_pin TOOL]
#pin: !PG5 # D11=PB5, D6=PH3, D5=PE3, D4=PG5 (from closest to reset to farthest, pins are GND,5V,SIG from edge inwards)
#pwm: True
#hardware_pwm: True
#cycle_time: 0.005
#value: 0 # value to set on startup
#shutdown_value: 0 # value to set on shutdown
#maximum_mcu_duration: 5 # how long the host has to acknowledge a set_pin
#scale: 255
#[servo TOOL]
#pin: !PG5
[output_pin TOOL_POWER]
pin: PB4
[gcode_macro TOOL_ON]
description: Enables power to the tool
gcode:
SET_PIN PIN=TOOL_POWER VALUE=1
[gcode_macro TOOL_OFF]
description: Disables power to the tool
gcode:
SET_PIN PIN=TOOL_POWER VALUE=0
[gcode_macro _STARTUP_TOOL_THIS_DOES_NOT_WORK]
description: Enable power to the tool, and start the cutter at a specified RPM
gcode:
; could do something fancy like if printer['output_pin tool'].value for checking whether to
; power up and wait, or just skip to the speed set
TOOL_ON ; enable power to the tool
G4 ; wait for the ESC to boot and be ready
;SET_PIN PIN=TOOL VALUE=128 ; or whatever speed, 0-255
;SET_SERVO SERVO=TOOL ANGLE=90 ; or whatever "angle", where angles go from 0 to ... something
# M3 is "spindle speed CW" and value is 0-255
[gcode_macro M3]
description: Start the cutter (clockwise); values are in the range 0-255
gcode:
{% set S = params.S|default(0)|int %}
SET_PIN PIN=TOOL VALUE=S
# M4 is "spindle speed CCW" and value is 0-255
[gcode_macro M4]
description: Start the cutter (counter-clockwise); values are in the range 0-255gcode:
gcode:
{% set S = params.S|default(0.0)|float %}
SET_PIN PIN=TOOL VALUE=S
# M5 is "spindle stop"
[gcode_macro M5]
description: Stop the cutter
gcode:
SET_PIN PIN=TOOL VALUE=0