




[filament_switch_sensor fila]
pause_on_runout: True
runout_gcode:
PAUSE
SET_FILAMENT_SENSOR SENSOR=fila ENABLE=1
event_delay: 3.0
pause_delay: 0.5
switch_pin: !PC1
заменяем их на
[filament_switch_sensor fila]
switch_pin: ^PC3
pause_on_runout: False
event_delay: 3.0
pause_delay: 0.5
runout_gcode:
PAUSE
M117 Filament switch runout
insert_gcode:
M117 Filament switch inserted
[filament_motion_sensor btt_encoder_sensor]
switch_pin: ^PC1
detection_length: 6
extruder: extruder
pause_on_runout: False
runout_gcode:
PAUSE
M117 Filament encoder runout
insert_gcode:
M117 Filament encoder inserted
[delayed_gcode DISABLEFILAMENTSENSOR]
initial_duration: 1
gcode:
SET_FILAMENT_SENSOR SENSOR=btt_encoder_sensor ENABLE=0
SET_FILAMENT_SENSOR SENSOR=fila ENABLE=0
[gcode_macro SFS_on] #Add "SFS_on" to PRINT_START and RESUME macros
gcode:
M117 ENABLING the Smart Filament Sensor
G92 E0
SET_FILAMENT_SENSOR SENSOR=btt_encoder_sensor ENABLE=1
SET_FILAMENT_SENSOR SENSOR=fila ENABLE=1
[gcode_macro SFS_off] #Add "SFS_off" to PRINT_END, PAUSE and CANCEL_PRINT macros
gcode:
M117 DISABLING the Smart Filament Sensor
G92 E0
SET_FILAMENT_SENSOR SENSOR=btt_encoder_sensor ENABLE=0
SET_FILAMENT_SENSOR SENSOR=fila ENABLE=0
Ищем их в printer.cfg
[gcode_macro PRINT_START]
gcode:
#HOT_CALIBRATE_START
SFS_on
[gcode_macro RESUME]
rename_existing: BASE_RESUME
variable_zhop: 0
variable_etemp: 0
gcode:
# Parameters
{% set e = params.E|default(2.5)|int %} ; hotend prime amount (in mm)
{% if printer['pause_resume'].is_paused|int == 1 %}
SFS_on
# SET_FILAMENT_SENSOR SENSOR=fila ENABLE=1 ; enable filament sensor
#INITIAL_RGB ; reset LCD color
SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value
{% if etemp > 0 %}
M109 S{etemp|int} ; wait for hotend to heat back up
{% endif %}
RESTORE_GCODE_STATE NAME=PAUSEPARK MOVE=1 MOVE_SPEED=150 ; go back to parked position in case toolhead was moved during pause (otherwise the return zhop can error)
G91 ; relative positioning
M83 ; relative extruder positioning
{% if printer[printer.toolhead.extruder].temperature >= printer.configfile.settings.extruder.min_extrude_temp %}
G1 E{e} F900 ; prime nozzle by E, lower Z back down
# {% else %}
# G1 Z{zhop * -1} F900 ; lower Z back down without priming (just in case we are testing the macro with cold hotend)
{% endif %}
RESTORE_GCODE_STATE NAME=PAUSEPARK2 MOVE=1 MOVE_SPEED=150
RESTORE_GCODE_STATE NAME=PAUSE MOVE=1 MOVE_SPEED=10 ; restore position
BASE_RESUME ; resume print
{% endif %}
Ищем их в printer.cfg
[gcode_macro PRINT_END]
gcode:
M106 P2 S0
M106 P0 S0
M106 P3 S0 #关闭活性炭风扇
M104 S0
M140 S0
M141 S0
M220 S100
M221 S100
SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value
CLEAR_PAUSE
SET_FILAMENT_SENSOR SENSOR=fila ENABLE=0
M84
# SET_STEPPER_ENABLE STEPPER=stepper_x enable=0
# SET_STEPPER_ENABLE STEPPER=stepper_y enable=0
# SET_STEPPER_ENABLE STEPPER=stepper_z enable=1
# SET_STEPPER_ENABLE STEPPER=extruder enable=0
BED_MESH_CLEAR #恢复调平数据
BED_MESH_PROFILE LOAD=default
G31
BEEP I=2 DUR=500
SFS_off
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
gcode:
# Parameters
{% set z = params.Z|default(50)|int %} ; z hop amount
{% if printer['pause_resume'].is_paused|int == 0 %}
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE={z} ; set z hop variable for reference in resume macro
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=etemp VALUE={printer['extruder'].target} ; set hotend temp variable for reference in resume macro
SFS_off
# SET_FILAMENT_SENSOR SENSOR=fila ENABLE=0 ; disable filament sensor
SAVE_GCODE_STATE NAME=PAUSE ; save current print position for resume
BASE_PAUSE ; pause print
{% if (printer.gcode_move.position.z + z) < printer.toolhead.axis_maximum.z %} ; check that zhop doesn't exceed z max
G91 ; relative positioning
G1 Z{z} F600 ; raise Z up by z hop amount
{% else %}
# { action_respond_info("Pause zhop exceeds maximum Z height.") } ; if z max is exceeded, show message and set zhop value for resume to 0
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE=0
{% endif %}
SAVE_GCODE_STATE NAME=PAUSEPARK2
G90 ; absolute positioning
G1 X{printer.toolhead.axis_maximum.x/2} Y{printer.toolhead.axis_maximum.y} F6000 ; park toolhead at front center
SAVE_GCODE_STATE NAME=PAUSEPARK ; save parked position in case toolhead is moved during the pause (otherwise the return zhop can error)
M104 S0 ; turn off hotend
SET_IDLE_TIMEOUT TIMEOUT=86400 ; set timeout to 12 hours
SET_STEPPER_ENABLE STEPPER=extruder enable=0
{% endif %}
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
{% if (printer.gcode_move.position.z) < 200 %} ; check that zhop doesn't exceed z max
G1 Z200 F600
{% endif %}
G1 X0 Y0 F12000
SDCARD_RESET_FILE
PRINT_END
BASE_CANCEL_PRINT
SFS_off
Без филамента: filament_detected: False
С филаментом: filament_detected: True
Чтобы проверить энкодер пропишите QUERY_FILAMENT_SENSOR SENSOR=btt_encoder_sensor
Автор: @paradoxicaliness