mirror of
https://github.com/bassamanator/Sovol-SV06-firmware.git
synced 2025-11-08 21:41:15 +00:00
Merging filament sensor related code.
This commit is contained in:
@@ -14,10 +14,28 @@ path: /home/pi/printer_data/gcodes
|
|||||||
[pause_resume]
|
[pause_resume]
|
||||||
[display_status]
|
[display_status]
|
||||||
|
|
||||||
|
[delayed_gcode DISABLEFILAMENTSENSOR]
|
||||||
|
initial_duration: 1
|
||||||
|
gcode:
|
||||||
|
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0
|
||||||
|
|
||||||
[gcode_macro _globals]
|
[gcode_macro _globals]
|
||||||
variable_pre_purge_prime_length: 1.4
|
variable_pre_purge_prime_length: 1.4
|
||||||
|
variable_filament_sensor_enabled: 0 # NOTE Enable(1) or disable(0) the filament sensor, if one is connected
|
||||||
gcode:
|
gcode:
|
||||||
SET_GCODE_VARIABLE MACRO=_globals VARIABLE=pre_purge_prime_length VALUE={ variable_pre_purge_prime_length }
|
SET_GCODE_VARIABLE MACRO=_globals VARIABLE=pre_purge_prime_length VALUE={ variable_pre_purge_prime_length }
|
||||||
|
SET_GCODE_VARIABLE MACRO=_globals VARIABLE=filament_sensor_enabled VALUE={ variable_filament_sensor_enabled }
|
||||||
|
|
||||||
|
[gcode_macro ADJUST_FILAMENT_SENSOR_STATUS]
|
||||||
|
gcode:
|
||||||
|
# Parameters
|
||||||
|
{% set NEWSTATUS = params.ENABLE|default(-1)|int %}
|
||||||
|
|
||||||
|
{% set FILAMENT_SENSOR_ENABLED=printer["gcode_macro _globals"].filament_sensor_enabled|default(-1)|int %}
|
||||||
|
|
||||||
|
{% if FILAMENT_SENSOR_ENABLED == 1 and NEWSTATUS != -1 %}
|
||||||
|
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=NEWSTATUS
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
[gcode_macro CHECK_PRE_PURGE_PRIME_LENGTH]
|
[gcode_macro CHECK_PRE_PURGE_PRIME_LENGTH]
|
||||||
gcode:
|
gcode:
|
||||||
@@ -72,16 +90,14 @@ gcode:
|
|||||||
BASE_CANCEL_PRINT
|
BASE_CANCEL_PRINT
|
||||||
|
|
||||||
[gcode_macro PRINT_START]
|
[gcode_macro PRINT_START]
|
||||||
# Use PRINT_START for the slicer starting script - please customize for your slicer of choice
|
|
||||||
#gcode:
|
|
||||||
# G28 ; home all axes
|
|
||||||
# G1 Z20 F3000 ; move nozzle away from bed
|
|
||||||
gcode:
|
gcode:
|
||||||
# Parameters
|
# Parameters
|
||||||
{% set bedtemp = params.BED|int %}
|
{% set bedtemp = params.BED|int %}
|
||||||
{% set hotendtemp = params.HOTEND|int %}
|
{% set hotendtemp = params.HOTEND|int %}
|
||||||
{% set chambertemp = params.CHAMBER|default(0)|int %}
|
{% set chambertemp = params.CHAMBER|default(0)|int %}
|
||||||
|
|
||||||
|
ADJUST_FILAMENT_SENSOR_STATUS ENABLE=1
|
||||||
|
|
||||||
G28 X Y
|
G28 X Y
|
||||||
# <insert your routines here>
|
# <insert your routines here>
|
||||||
M140 S{bedtemp} ; set & don't wait for bed temp
|
M140 S{bedtemp} ; set & don't wait for bed temp
|
||||||
@@ -97,8 +113,8 @@ gcode:
|
|||||||
G1 Z20 F3000 ; move nozzle away from bed
|
G1 Z20 F3000 ; move nozzle away from bed
|
||||||
|
|
||||||
[gcode_macro PRINT_END]
|
[gcode_macro PRINT_END]
|
||||||
# Use PRINT_END for the slicer ending script - please customize for your slicer of choice
|
|
||||||
gcode:
|
gcode:
|
||||||
|
ADJUST_FILAMENT_SENSOR_STATUS ENABLE=0
|
||||||
BEEP I=2 DUR=30 FREQ=8500 ; NOTE Comment out this line to stop the beeps at the end of a print
|
BEEP I=2 DUR=30 FREQ=8500 ; NOTE Comment out this line to stop the beeps at the end of a print
|
||||||
{% set PRE_PURGE_PRIME_LENGTH=printer["gcode_macro _globals"].pre_purge_prime_length|default(1.40)|float %}
|
{% set PRE_PURGE_PRIME_LENGTH=printer["gcode_macro _globals"].pre_purge_prime_length|default(1.40)|float %}
|
||||||
M400 ; wait for buffer to clear
|
M400 ; wait for buffer to clear
|
||||||
@@ -166,7 +182,7 @@ gcode:
|
|||||||
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE={z} ; set z hop variable for reference in resume macro
|
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
|
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=etemp VALUE={printer['extruder'].target} ; set hotend temp variable for reference in resume macro
|
||||||
|
|
||||||
# SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 ; disable filament sensor
|
ADJUST_FILAMENT_SENSOR_STATUS ENABLE=0
|
||||||
SAVE_GCODE_STATE NAME=PAUSE ; save current print position for resume
|
SAVE_GCODE_STATE NAME=PAUSE ; save current print position for resume
|
||||||
BASE_PAUSE ; pause print
|
BASE_PAUSE ; pause print
|
||||||
{% if (printer.gcode_move.position.z + z) < printer.toolhead.axis_maximum.z %} ; check that zhop doesn't exceed z max
|
{% if (printer.gcode_move.position.z + z) < printer.toolhead.axis_maximum.z %} ; check that zhop doesn't exceed z max
|
||||||
@@ -192,8 +208,8 @@ gcode:
|
|||||||
{% set e = params.E|default(2.5)|int %} ; hotend prime amount (in mm)
|
{% set e = params.E|default(2.5)|int %} ; hotend prime amount (in mm)
|
||||||
|
|
||||||
{% if printer['pause_resume'].is_paused|int == 1 %}
|
{% if printer['pause_resume'].is_paused|int == 1 %}
|
||||||
# SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 ; enable filament sensor
|
ADJUST_FILAMENT_SENSOR_STATUS ENABLE=1
|
||||||
#INITIAL_RGB ; reset LCD color
|
|
||||||
SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value
|
SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value
|
||||||
{% if etemp > 0 %}
|
{% if etemp > 0 %}
|
||||||
M109 S{etemp|int} ; wait for hotend to heat back up
|
M109 S{etemp|int} ; wait for hotend to heat back up
|
||||||
|
|||||||
@@ -220,6 +220,15 @@ shutdown_value: 0
|
|||||||
pwm: True
|
pwm: True
|
||||||
cycle_time: 0.0005 ; Default beeper tone in kHz. 1 / 0.0005 = 2000Hz (2kHz)
|
cycle_time: 0.0005 ; Default beeper tone in kHz. 1 / 0.0005 = 2000Hz (2kHz)
|
||||||
|
|
||||||
|
[filament_switch_sensor filament_sensor]
|
||||||
|
switch_pin: !PA4 # "Pulled-high"
|
||||||
|
pause_on_runout: True
|
||||||
|
insert_gcode:
|
||||||
|
M117 Insert Detected
|
||||||
|
runout_gcode:
|
||||||
|
M117 Runout Detected
|
||||||
|
BEEP i=3 dur=300 freq=400
|
||||||
|
|
||||||
#*# <---------------------- SAVE_CONFIG ---------------------->
|
#*# <---------------------- SAVE_CONFIG ---------------------->
|
||||||
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
|
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
|
||||||
#*#
|
#*#
|
||||||
|
|||||||
Reference in New Issue
Block a user