forked from zellneralex/klipper_config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
power.cfg
90 lines (83 loc) · 3.08 KB
/
power.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#####################################################################
# Idle Timeout
#####################################################################
[idle_timeout]
gcode:
{% if printer.webhooks.state|lower == 'ready' %}
{% if printer.pause_resume.is_paused|lower == 'false' %}
{action_respond_info("POWER: Execute Idle Timeout")}
TURN_OFF_HEATERS
{% if printer['gcode_macro _USER_VARIABLE'].hw.relay.ena %}
UPDATE_DELAYED_GCODE ID=_DELAY_HEATER_OFF DURATION=10
{% endif %}
UPDATE_DELAYED_GCODE ID=_DELAY_PSU_OFF DURATION=20
{% endif %}
{% endif %}
# 2h timeout
timeout: 7200
#####################################################################
# Safety Relay extruder
#####################################################################
## Use a pin to switch on a relay for the Extruder heater if klipper is active
## XYE board, UPWR_DET_PIN Connector
[output_pin extruder_relay]
## negativ logic
pin: !P1.0
pwm: false
shutdown_value: 0
value: 1
#####################################################################
# Safety Relay heater_bed
#####################################################################
## Use a pin to switch on a relay for the heater_bed if klipper is active
## Z board, UPWR_DET_PIN Connector
[output_pin heater_bed_relay]
## negativ logic
pin: !z:P1.0
pwm: false
shutdown_value: 0
value: 1
#####################################################################
# Macro
#####################################################################
[delayed_gcode _DELAY_PSU_OFF]
gcode:
{action_respond_info("POWER: 24V PS power off")}
{action_call_remote_method("set_device_power", device="psu", state="off")}
[gcode_macro _HEATER_ON]
description: Helper: Power on BED and Extruder power
gcode:
{%if printer['output_pin heater_bed_relay'].value == 0 %}
{action_respond_info("POWER: heater_bed power on")}
SET_PIN PIN=heater_bed_relay VALUE=1
{% endif %}
{action_call_remote_method("set_device_power", device="bed", state="on")}
{%if printer['output_pin extruder_relay'].value == 0 %}
{action_respond_info("POWER: extruder power on")}
SET_PIN PIN=extruder_relay VALUE=1
{% endif %}
[delayed_gcode _DELAY_HEATER_OFF]
gcode:
{%if printer['output_pin heater_bed_relay'].value == 1 %}
{action_respond_info("POWER: heater_bed power off")}
SET_PIN PIN=heater_bed_relay VALUE=0
{% endif %}
{action_call_remote_method("set_device_power", device="bed", state="off")}
{%if printer['output_pin extruder_relay'].value == 1 %}
{action_respond_info("POWER: extruder power off")}
SET_PIN PIN=extruder_relay VALUE=0
{% endif %}
[gcode_macro _SHUTDOWN_PI]
description: Helper: Power down the rPi
gcode: {action_call_remote_method("shutdown_machine")}
[gcode_macro PRINTER_OFF]
description: Park head and Power down the rPi
gcode:
{% set user = printer['gcode_macro _USER_VARIABLE'] %}
_CG28 ; home if not already homed
G90 ; absolute positioning
G0 X{user.park.bed.x} Y{user.park.bed.y} Z{user.park.bed.z} F{user.speed.travel}
M117 PI Off in 5 sec
G4 P5000
M400
_SHUTDOWN_PI