strayr / strayr-k-macros

useful macros to extend the functionality of klipper
GNU General Public License v3.0
147 stars 9 forks source link

Macro start_print reorder extruder pre-temp #1

Closed stephbellemare closed 1 year ago

stephbellemare commented 2 years ago

Hello, i,ve re-ordered the pre-heating commands for the hotend, considering if you had pre-heated to unload / load filament, your macro would have to wait for the extruder to cool down, and then re-start heating back up. this is the way i've done it

[gcode_macro START_PRINT] variable_version: 0.1 description: Does everythin to go from a cold printer to a successful print except a purge line. gcode: {% set svv = printer.save_variables.variables %} {% set BED_TEMP = params.BED_TEMP|default(svv.setup_default_bed_temp)|float %} {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(svv.setup_default_nozzle_temp)|float %}

{% if svv.setup_version|float < version|float %}
    { action_raise_error("Setup data is older than macro version
    You should check the values in INIT_SETUP and run it to update
    ")}
{% endif %}
{% if svv.setup_use_bed_offset == 1  %}
    BED_DETAILS # tell us about the bed
{else}

{% endif %}

G92 E0 ; reset extruder
G90 ; absolute
M82 ; extruder absolute
G92 E0 ; reset extruder

M107 S0; turn off fan
M117 Heating Bed to {BED_TEMP}
UPDATE_DELAYED_GCODE ID=clear_display DURATION=10
M140 S{BED_TEMP} ; start heating
M104 S{svv.setup_idle_temp} ; set extruder warmup temp
SETUP_BED TOL_CORNERS=0.2 TOL_GANTRY=0.02
M190 S{BED_TEMP} ; wait for bed temp
#PARK
#M109 S{svv.setup_idle_temp}
M117 Preheat Extruder
UPDATE_DELAYED_GCODE ID=clear_display DURATION=10
#SETUP_BED TOL_CORNERS=0.2 TOL_GANTRY=0.02
LOAD_MESH_TEMP BED_TEMP={BED_TEMP}
M104 S{EXTRUDER_TEMP}
#PARK
#Set our baseline offset for nozzle height, this is based PROBE_CALIBRATE result
SET_GCODE_OFFSET Z={svv.setup_nozzle_offset} ;+ve is UP
#And apply changes for a different bed
{% if svv.setup_use_bed_offset == 1  %}
    SET_GCODE_OFFSET Z_ADJUST={svv.bed_offset}
{% endif %}
M117 Heating Extruder to {EXTRUDER_TEMP}
UPDATE_DELAYED_GCODE ID=clear_display DURATION=10
M109 S{EXTRUDER_TEMP} ; wait for extruder temp
M117 Starting Print
UPDATE_DELAYED_GCODE ID=clear_display DURATION=10
_SOUND_YES
G28 #Try homing at end to fix gcode
strayr commented 2 years ago

I agree there is a problem there, but I'm using the extruder heating (or cooling) to idle temp as a "wait a bit and let the bed settle at print temperature" as if I don't the bed can still be settling and creeping when I start the mesh.

On Sat, 12 Mar 2022, 16:08 stephbellemare, @.***> wrote:

Hello, i,ve re-ordered the pre-heating commands for the hotend, considering if you had pre-heated to unload / load filament, your macro would have to wait for the extruder to cool down, and then re-start heating back up. this is the way i've done it

[gcode_macro START_PRINT] variable_version: 0.1 description: Does everythin to go from a cold printer to a successful print except a purge line. gcode: {% set svv = printer.save_variables.variables %} {% set BED_TEMP = params.BED_TEMP|default(svv.setup_default_bed_temp)|float %} {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(svv.setup_default_nozzle_temp)|float %}

{% if svv.setup_version|float < version|float %} { action_raise_error("Setup data is older than macro version You should check the values in INIT_SETUP and run it to update ")} {% endif %} {% if svv.setup_use_bed_offset == 1 %} BED_DETAILS # tell us about the bed {else}

{% endif %}

G92 E0 ; reset extruder G90 ; absolute M82 ; extruder absolute G92 E0 ; reset extruder

M107 S0; turn off fan M117 Heating Bed to {BED_TEMP} UPDATE_DELAYED_GCODE ID=clear_display DURATION=10 M140 S{BED_TEMP} ; start heating M104 S{svv.setup_idle_temp} ; set extruder warmup temp SETUP_BED TOL_CORNERS=0.2 TOL_GANTRY=0.02 M190 S{BED_TEMP} ; wait for bed temp

PARK

M109 S{svv.setup_idle_temp}

M117 Preheat Extruder UPDATE_DELAYED_GCODE ID=clear_display DURATION=10

SETUP_BED TOL_CORNERS=0.2 TOL_GANTRY=0.02

LOAD_MESH_TEMP BED_TEMP={BED_TEMP} M104 S{EXTRUDER_TEMP}

PARK

Set our baseline offset for nozzle height, this is based PROBE_CALIBRATE result

SET_GCODE_OFFSET Z={svv.setup_nozzle_offset} ;+ve is UP

And apply changes for a different bed

{% if svv.setup_use_bed_offset == 1 %} SET_GCODE_OFFSET Z_ADJUST={svv.bed_offset} {% endif %} M117 Heating Extruder to {EXTRUDER_TEMP} UPDATE_DELAYED_GCODE ID=clear_display DURATION=10 M109 S{EXTRUDER_TEMP} ; wait for extruder temp M117 Starting Print UPDATE_DELAYED_GCODE ID=clear_display DURATION=10 _SOUND_YES G28 #Try homing at end to fix gcode

— Reply to this email directly, view it on GitHub https://github.com/strayr/strayr-k-macros/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKIYU2EJSYXQE5G25OJ7YITU7S6PXANCNFSM5QSB7CIA . You are receiving this because you are subscribed to this thread.Message ID: @.***>