Nesting commands in Macros



  • Hello everyone,

    I'm trying to set up a semi-automatic probe offset Macro for my self built CoreXY printer.

    Essentially, the process is to home, send a G30 command to probe the bed. After that I zero the height with G92 Z0 and send M208 S1 Z-100 so I can use the jog controls to go below 0.

    I then use a piece of paper to find the correct nozzle height and then I put that Z height (changing its sign from - to +) in the G31 command in the config.

    However, I do not know how I can automate this.

    1st Macro will look like this:

    "
    G28 X
    G28 Y
    G1 X110 Y110 F6000
    G30
    G92 Z0
    M208 S1 Z-100
    "
    I would then to the paper thing and I want another Macro to read the Z height value and save it in the config. Is there any way I can do this?

    Macro 2:
    "
    G31 Z"M114 Z"
    M500
    "

    Regards,
    Adrian


  • administrators

    I think this may work:

    • position the nozzle a few mm above the bed,
    • send M558 P0 to select manual probing mode
    • send G30
    • raise the nozzle a few mm
    • use M558 to select the Z probe
    • send G31 S-2
    • send M500 P31 to write config-override.g including the G31 parameters


  • Thanks for the reply!

    I don't quite understand what G31 S-2 does. Looking at the wiki the S parameter is for temperature calibration?

    I'm going to try it out anyway and see the results.

    Regards,
    Adrian


Log in to reply