forked from Klipper3d/klipper
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
230 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,189 @@ | ||
# [filament_motion_sensor extruder_sensor] | ||
# extruder: extruder | ||
# detection_length: 10.5 | ||
# event_delay: 60.0 | ||
# switch_pin: filament_control_1 | ||
# pause_on_runout: False | ||
# runout_gcode: | ||
# {% if printer.virtual_sdcard.is_active %} | ||
# {action_respond_warning('411: The filament has run out or there is a problem with its supply at the Extruder 1.')} | ||
# # PAUSE TURN_OFF_EXTRUDERS=0 E=0 | ||
# {% else %} | ||
# FILAMENT_ERROR EXTRUDER=extruder | ||
# {% endif %} | ||
[filament_motion_sensor extruder_sensor] | ||
extruder: extruder | ||
detection_length: 10.5 | ||
event_delay: 15.0 | ||
switch_pin: e_filament_sensor_pin | ||
pause_on_runout: False | ||
runout_gcode: | ||
{% if printer.virtual_sdcard.is_active %} | ||
M117 trigered_filament_sensor0 | ||
{action_respond_warning('411: The filament has run out or there is a problem with its supply at the Extruder0.')} | ||
;RECOVER_EXTRUSION SENSOR='extruder_sensor' | ||
{% else %} | ||
FILAMENT_ERROR EXTRUDER=extruder | ||
{% endif %} | ||
|
||
# [gcode_macro FILAMENT_ERROR] | ||
# gcode: | ||
# {% if params.EXTRUDER == 'extruder' %} | ||
# {action_raise_error('401: Filament error on Extruder0')} | ||
# {% else %} | ||
# {action_raise_error('402: Filament error on Extruder1')} | ||
# {% endif %} | ||
[gcode_macro FILAMENT_ERROR] | ||
gcode: | ||
{% if params.EXTRUDER == 'extruder' %} | ||
{action_raise_error('401: Filament error on Extruder0')} | ||
{% else %} | ||
{action_raise_error('402: Filament error on Extruder1')} | ||
{% endif %} | ||
|
||
[gcode_macro SET_FILAMENT_SENSOR] | ||
rename_existing: SET_FILAMENT_SENSOR_OLD | ||
gcode: | ||
SET_FILAMENT_SENSOR_OLD SENSOR={params.SENSOR} ENABLE={params.ENABLE} | ||
SAVE_VARIABLE VARIABLE={params.SENSOR} VALUE={params.ENABLE} | ||
|
||
#[gcode_macro RECOVER_EXTRUSION] | ||
#variable_enable_offset: 1 | ||
#variable_enable_prime: 1 | ||
#variable_enable_second_extruder: 0 | ||
#variable_count_trigered_sensor: 0 | ||
#gcode: | ||
# {% set sensor = params.SENSOR %} | ||
# {% if params.RESET %} | ||
# RECOVER_EXTRUSION_BY_OFFSET RESET=1 | ||
# RECOVER_EXTRUSION_BY_PRIME SENSOR={sensor} RESET=1 | ||
# {% if printer["gcode_macro RECOVER_EXTRUSION"].enable_second_extruder %} | ||
# RECOVER_EXTRUSION_BY_SECOND_EXTRUDER RESET=1 | ||
# {% endif %} | ||
# SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION VARIABLE=enable_offset VALUE=1 | ||
# SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION VARIABLE=enable_prime VALUE=1 | ||
# SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION VARIABLE=enable_second_extruder VALUE=0 | ||
# SET_PRINT_STATS_INFO COUNT_TRIGERED_SENSOR={printer["gcode_macro RECOVER_EXTRUSION"].count_trigered_sensor} | ||
# SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION VARIABLE=count_trigered_sensor VALUE=0 | ||
# {% else %} | ||
# SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION VARIABLE=count_trigered_sensor VALUE={printer["gcode_macro RECOVER_EXTRUSION"].count_trigered_sensor + 1} | ||
# {% if printer.print_stats.info.current_layer == 0 and printer["gcode_macro RECOVER_EXTRUSION"].enable_offset and printer["gcode_macro RECOVER_EXTRUSION_BY_OFFSET"].checks_made < printer["gcode_macro RECOVER_EXTRUSION_BY_OFFSET"].check_count %} | ||
# {action_respond_warning('412: Recover extrusion by offset %s' % printer["gcode_macro RECOVER_EXTRUSION_BY_OFFSET"].checks_made)} | ||
# RECOVER_EXTRUSION_BY_OFFSET SENSOR={sensor} | ||
# {% else %} | ||
# {% if printer["gcode_macro RECOVER_EXTRUSION"].enable_offset %} | ||
# RECOVER_EXTRUSION_BY_OFFSET RESET=1 | ||
# SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION VARIABLE=enable_offset VALUE=0 | ||
# {% endif %} | ||
# {% if not printer.pause_resume.is_paused %} | ||
# PAUSE TURN_OFF_EXTRUDERS=0 E=0 | ||
# {% endif %} | ||
# {% if printer["gcode_macro RECOVER_EXTRUSION"].enable_prime and (printer["gcode_macro RECOVER_EXTRUSION_BY_PRIME"].checks_made < printer["gcode_macro RECOVER_EXTRUSION_BY_PRIME"].check_count or printer["gcode_macro RECOVER_EXTRUSION_BY_PRIME"].use_cooldown) %} | ||
# RECOVER_EXTRUSION_BY_PRIME SENSOR={sensor} | ||
# {% else %} | ||
# {% if printer["gcode_macro RECOVER_EXTRUSION"].enable_prime %} | ||
# RECOVER_EXTRUSION_BY_PRIME SENSOR={sensor} RESET=1 | ||
# SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION VARIABLE=enable_prime VALUE=0 | ||
# {% endif %} | ||
# {% if printer["gcode_macro RECOVER_EXTRUSION"].enable_second_extruder and sensor == 'extruder_sensor' and printer["filament_motion_sensor extruder1_sensor"] and not printer["gcode_macro RECOVER_EXTRUSION_BY_SECOND_EXTRUDER"].enabled %} | ||
# RECOVER_EXTRUSION_BY_SECOND_EXTRUDER | ||
# {% else %} | ||
# {% if printer["gcode_macro RECOVER_EXTRUSION"].enable_second_extruder and sensor == 'extruder_sensor' %} | ||
# {action_respond_warning('413: Switch to second extruder and resume printing.')} | ||
# RECOVER_EXTRUSION_BY_SECOND_EXTRUDER RESET=1 | ||
# SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION VARIABLE=enable_second_extruder VALUE=0 | ||
# {% endif %} | ||
# #Set timeout and wait for user | ||
# {action_respond_warning('414: All attempt to extrude failed.')} | ||
# M117 all_attempt_extrude_failed | ||
# UPDATE_DELAYED_GCODE ID=TURN_OFF_EXTRUDERS_DELAYED DURATION=300 | ||
# SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION VARIABLE=enable_offset VALUE=1 | ||
# SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION VARIABLE=enable_prime VALUE=1 | ||
# SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION VARIABLE=enable_second_extruder VALUE=0 | ||
# {% endif %} | ||
# {% endif %} | ||
# {% endif %} | ||
# {% endif %} | ||
# | ||
#[delayed_gcode RECOVER_EXTRUSION_DELAY] | ||
#gcode: | ||
# RECOVER_EXTRUSION SENSOR='extruder_sensor' | ||
# | ||
#[gcode_macro RECOVER_EXTRUSION_BY_OFFSET] | ||
#variable_check_count: 3 | ||
#variable_checks_made: 0 | ||
#variable_check_value: 0.1 | ||
#gcode: | ||
# {% set sensor = params.SENSOR %} | ||
# {% if params.RESET %} | ||
# {% set reset_value = printer["gcode_macro RECOVER_EXTRUSION_BY_OFFSET"].check_value * printer["gcode_macro RECOVER_EXTRUSION_BY_OFFSET"].checks_made %} | ||
# SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION_BY_OFFSET VARIABLE=checks_made VALUE=0 | ||
# {% if printer.gcode_move.current_wcs == 0 %} | ||
# SET_GCODE_OFFSET Z_ADJUST=-{reset_value} MOVE=1 | ||
# {% else %} | ||
# G10 L2 P0 R1 Z-{reset_value} | ||
# {% endif %} | ||
# {% else %} | ||
# M117 recover_extrusion_by_offset_attempt_{printer["gcode_macro RECOVER_EXTRUSION_BY_OFFSET"].checks_made + 1} | ||
# {% if printer.gcode_move.current_wcs == 0 %} | ||
# SET_GCODE_OFFSET Z_ADJUST={printer["gcode_macro RECOVER_EXTRUSION_BY_OFFSET"].check_value} MOVE=1 | ||
# {% else %} | ||
# G10 L2 P0 R1 Z{printer["gcode_macro RECOVER_EXTRUSION_BY_OFFSET"].check_value} | ||
# {% endif %} | ||
# SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION_BY_OFFSET VARIABLE=checks_made VALUE={printer["gcode_macro RECOVER_EXTRUSION_BY_OFFSET"].checks_made + 1} | ||
# UPDATE_STATE_FILAMENT_RUNOUT_POSITION SENSOR={sensor} | ||
# {% endif %} | ||
# | ||
#[gcode_macro RECOVER_EXTRUSION_BY_PRIME] | ||
#variable_check_count: 3 | ||
#variable_checks_made: 0 | ||
#variable_use_cooldown: 1 | ||
#gcode: | ||
# {% set sensor = params.SENSOR %} | ||
# {% set extruder = 'extruder' if sensor == 'extruder_sensor' else 'extruder1' %} | ||
# {% if params.RESET %} | ||
# SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION_BY_PRIME VARIABLE=checks_made VALUE=0 | ||
# SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION_BY_PRIME VARIABLE=use_cooldown VALUE=1 | ||
# {% else %} | ||
# {% if printer["gcode_macro RECOVER_EXTRUSION_BY_PRIME"].use_cooldown and printer["gcode_macro RECOVER_EXTRUSION_BY_PRIME"].checks_made >= printer["gcode_macro RECOVER_EXTRUSION_BY_PRIME"].check_count %} | ||
# {% set extruder_temp = printer["gcode_macro PAUSE"].extruder_temp if extruder == 'extruder' else printer["gcode_macro PAUSE"].extruder1_temp %} | ||
# {action_respond_warning('415: Recover extrusion after cooling and heating.')} | ||
# M106 S255 | ||
# M109 S50 | ||
# M107 | ||
# M109 S{extruder_temp} | ||
# M400 | ||
# G4 P3000 | ||
# LOAD_MATERIAL | ||
# LOAD_MATERIAL | ||
# M400 | ||
# G4 P3000 | ||
# SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION_BY_PRIME VARIABLE=use_cooldown VALUE=0 | ||
# CHECK_FILAMENT_MOTION_SENSOR SENSOR={sensor} | ||
# {% else %} | ||
# {action_respond_warning('416: Recover extrusion do extrude attempt %s' % printer["gcode_macro RECOVER_EXTRUSION_BY_PRIME"].checks_made)} | ||
# M117 try_do_extrude_{printer["gcode_macro RECOVER_EXTRUSION_BY_PRIME"].checks_made + 1} | ||
# M400 | ||
# G4 P3000 | ||
# LOAD_MATERIAL | ||
# LOAD_MATERIAL | ||
# M400 | ||
# G4 P3000 | ||
# SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION_BY_PRIME VARIABLE=checks_made VALUE={printer["gcode_macro RECOVER_EXTRUSION_BY_PRIME"].checks_made + 1} | ||
# CHECK_FILAMENT_MOTION_SENSOR SENSOR={sensor} | ||
# {% endif %} | ||
# {% endif %} | ||
# | ||
#[gcode_macro CHECK_FILAMENT_MOTION_SENSOR] | ||
#gcode: | ||
# {% set sensor = params.SENSOR %} | ||
# {% set filament_detected = printer['filament_motion_sensor ' ~ sensor].filament_detected %} | ||
# {% if filament_detected %} | ||
# {action_respond_warning('417: Extruding attempt completed successfully, resuming printing.')} | ||
# M117 resume_after_trigered_sensor | ||
# RESUME | ||
# {% else %} | ||
# UPDATE_DELAYED_GCODE ID=RECOVER_EXTRUSION_DELAY DURATION=1 | ||
# {% endif %} | ||
# | ||
#[gcode_macro RECOVER_EXTRUSION_BY_SECOND_EXTRUDER] | ||
#variable_enabled: 0 | ||
#gcode: | ||
# {% if params.RESET and printer["gcode_macro RECOVER_EXTRUSION_BY_SECOND_EXTRUDER"].enabled %} | ||
# SET_GCODE_OFFSET X_ADJUST=25.0 MOVE=1 | ||
# ENABLE_CONSTRAIN ENABLE=0 | ||
# SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=current_extruder VALUE=0 | ||
# SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=extruder1_temp VALUE=0 | ||
# SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=extruder_temp VALUE={printer["gcode_macro PAUSE"].extruder_temp} | ||
# SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION_BY_SECOND_EXTRUDER VARIABLE=enabled VALUE=0 | ||
# {% else %} | ||
# M117 resume_print_another_extruder | ||
# SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION_BY_SECOND_EXTRUDER VARIABLE=enabled VALUE=1 | ||
# SET_GCODE_OFFSET X_ADJUST=-25.0 MOVE=1 | ||
# ENABLE_CONSTRAIN ENABLE=1 | ||
# SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=current_extruder VALUE=1 | ||
# SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=extruder1_temp VALUE={printer["gcode_macro PAUSE"].extruder_temp} | ||
# SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=extruder_temp VALUE=0 | ||
# RESUME | ||
# {% endif %} | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
# [filament_motion_sensor extruder1_sensor] | ||
# extruder: extruder1 | ||
# detection_length: 10.5 | ||
# event_delay: 60.0 | ||
# switch_pin: filament_control_2 | ||
# pause_on_runout: False | ||
# runout_gcode: | ||
# {% if printer.virtual_sdcard.is_active %} | ||
# {action_respond_warning('411: The filament has run out or there is a problem with its supply at the Extruder 2.')} | ||
# # PAUSE TURN_OFF_EXTRUDERS=0 E=0 | ||
# {% else %} | ||
# FILAMENT_ERROR EXTRUDER=extruder1 | ||
# {% endif %} | ||
[filament_motion_sensor extruder1_sensor] | ||
extruder: extruder1 | ||
detection_length: 10.5 | ||
event_delay: 15.0 | ||
switch_pin: e1_filament_sensor_pin | ||
pause_on_runout: False | ||
runout_gcode: | ||
{% if printer.virtual_sdcard.is_active %} | ||
M117 trigered_filament_sensor1 | ||
{action_respond_warning('411: The filament has run out or there is a problem with its supply at the Extruder2.')} | ||
;RECOVER_EXTRUSION SENSOR='extruder1_sensor' | ||
{% else %} | ||
FILAMENT_ERROR EXTRUDER=extruder1 | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters