Jump to content

macro help please !

Recommended Posts

I wish I had a better understanding of macros but they are still mainly ancient Sioux to me.

I hope someone can help me. I just want the bed of my Trident to move down a bit further after the print finishes. It must be fairly simple to change something in my PRINT_END macro :


[gcode_macro PRINT_END]
#   Use PRINT_END for the slicer ending script - please customise for your slicer of choice
    # safe anti-stringing move coords
    {% set th = printer.toolhead %}
    {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %}
    {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %}
    {% set z_safe = [th.position.z + 20, th.axis_maximum.z]|min %}
    M400                           ; wait for buffer to clear
    G92 E0                         ; zero the extruder
    G1 E-2.0 F3600                 ; retract filament
    G90                       ; absolute positioning
    G0 X{x_safe} Y{y_safe} Z{z_safe} F20000  ; move nozzle to remove stringing
    G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} #Z50 F3600  ; park nozzle at rear
    M107                                     ; turn off fan


Link to comment
Share on other sites

This is what I have for my end macro. It will just drop the bed 10mm, which is the G1 Z10 F3000 command.


[gcode_macro PRINT_END]
#   Use PRINT_END for the slicer ending script - please customise for your slicer of choice
   G91 ; Incremental Positioning
   # Retract a bit
   G1 E-2 F2700
   G1 E-2 Z0.2 F2400
   G1 X5 Y5 F3000
   G1 E-5 F2000
   # Turn off bed, extruder, and fan
   M140 S0 ; bed temp
   M104 S0 ; extruder temp
   M106 S0 ; fan speed
   # Raise nozzle by 10mm
   G1 Z10 F3000
   G90 ; Absolute Positioning
   G1 X250 Y255 F3000 ; Move head out of the way.
    status_off #LED OFF

  • Like 1
Link to comment
Share on other sites

Here is what you are doing now:


    {% set z_safe = [th.position.z + 20, th.axis_maximum.z]|min %}

This is the current position + 20 or the maximum Z for your printer, whichever is smaller.  So where it goes depends on the height of the object you object printed.   So let's say you pprinter has a 300mm tall build volume and you just printed a 299mm tall object.   It will only move to 300.    It move as much as 20mm, no more.    Change the number from 20 to something else if you like but you can expect the printer to move only as far as it can and no more even if you change 20 to 50.


  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...