Macros. Ideas, suggestions, tips and tricks



  • Just thought I'd start a thread where we could share thoughts and ideas for useful macro files. Maybe people could share their pause, resume, sleep, stop, tfree, tpost or any other user defined macros along with a bit of information such as printer type and what benefit or advantages the macro gives them. Sorry I've nothing to start the ball rolling with - I guess I'm looking for ideas and tips myself.



  • I've only added one to reset the heaters when they fault. It has M562 P0 and M562 P1. Since I've added it, it's been used once, so far.



  • That's a good idea. Much easier to press a button labelled "Reset Heaters" than to try and remember the right M code.



  • Hi,
    I trying to setup a macro to check/level my bed with 3 points with a paper.
    I try this macro below, but the printer did't stop/pause after going to the first point (neither the other…) :

    M98 P/sys/homeall.g

    G1 X90 Y180 Z5
    M226
    M117 Place paper under the nozzle

    G1 Z0
    M226
    M117 Go to next point

    G1 Z5
    G1 X0 Y10
    M226
    M117 Place paper under the nozzle

    G1 Z0
    M226
    M117 Go to next point

    G1 Z5
    G1 X170 Y10
    M226
    M117 Place paper under the nozzle

    G1 Z0
    M226
    M117 Last check on middle

    G1 Z5
    G1 X85 Y100
    M226
    M117 Place paper under the nozzle

    G1 Z0
    M117 finish by homing

    G1 Z5

    G28

    I hope there is a Gcode asking for a validation on the paneldue, maybe a box ? or have i to use a mechanical endstop to report the validation for the next action ?

    Thanks !


  • administrators

    There isn't a gcode in RRF to wait for user action, but it sounds like a good idea to me. Is there an existing gcode that fits the bill? If not, should it be a new gcode, or just an option on M117?



  • An option to M117 should work perfectly in case it show the message in the front layer (in macro layout)of the paneldue and not in the console layout/tab.
    It could be really cool to implant this, it's open some user sequence in macro possibility.

    Thanks !



  • Wouldn't using M577 and a switch on one of the E endstops work?

    http://reprap.org/wiki/G-code#M577:_Wait_until_endstop_is_triggered



  • I didn't try but it should work. This switch or button can also have a pause function like PRZ did.
    But it will be nice to have a virtual button and associated text on screen, it's more ergonomic ! (and less wire ! )



  • A quick hack I use in both my slicer epilogue and in a macro file:

    M140 S-273
    M109 S150
    M104 S-273
    M81

    This shuts off the heated bed, waits for the hot end to cool down to 150 C, then shuts off the 12V power (including, in particular, the hot end fan).

    My prints also start with:

    G1 X60 Y70 Z15 F6000
    G1 X70 Y70 Z5
    G1 X65 Y90 Z5
    G1 X65 Y70 Z5
    G1 X60 Y90 Z5
    G1 X60 Y70 Z5
    G1 X60 Y70 Z15
    G1 X0 Y0 Z50

    This makes the nozzle scrub itself on the toothbrush ziptied to the frame of my Mini Kossel. A toothbrush is definitely not ideal; now that I have a hardened nozzle I should probably switch to a wire brush or something.



  • I'm using a bedcheck.g file containing

    [[language]]
    ;bed level check
    
    G30 P0 X-100 Y-60 Z-99999		; X tower
    G30 P1 X100 Y-60 Z-99999		; Y tower
    G30 P2 X0 Y100 Z-99999	S-1		; Z tower
    
    G1 X0 Y0 Z100 F10000
    
    

    Which I run using M98 Pbedcheck.g after G32 it probes the tower bases as that where my bed supports are.



  • I've added couple of new ones. Since PLA and PETG run at different temps, the z probe offset is slightly different between them.

    For example the PETG Offset has:
    G31 P500 X0 Y12 Z1.6 ; increase Z to get closer to bed

    The PLA Offset macro has a different Z.



  • @dc42:

    There isn't a gcode in RRF to wait for user action, but it sounds like a good idea to me. Is there an existing gcode that fits the bill? If not, should it be a new gcode, or just an option on M117?

    Is this implemented yet? I really could use this right now for a bed leveling macro… I would like to move the head around to 4 points and wait for user input at each point.


  • administrators

    It's not implemented yet. Perhaps it should be M226 with a parameter that means "don't run pause.g or resume.g"?



  • @dc42:

    It's not implemented yet. Perhaps it should be M226 with a parameter that means "don't run pause.g or resume.g"?

    That sounds like it would work perfectly….. right now I have 4 different macros for each point.... trying to make this simple for my kids. A single macro that pauses at each point where they can adjust the leveling screw then hit confirm on the paneldue would be perfect.


Locked
 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.