G29/mesh.g in 3.2beta2 usage?



  • In my project, I have to park first my Tool before a G29 can be executed.

    If a soloution availible to send a pre or post code for a specific G-Command

    e.g.

    macro-g29.g
    T-0 ; park tool
    do somthing else
    G29 ; execute the real G29 command
    do somthing else


  • Moderator

    You could use bed.g macro, which is called by G32. Then inside bed.g you can do whatever commands you want, including G29.

    I think in fw 3.2 there will also be a macro called mesh.g which would be called by G29 if present, providing analogous functionality to G32/bed.g



  • @Phaedrux said in pre or post code for G-Code:

    bed.g macro

    Thank's Phaedrux - but this don't help. I use this macro already, that's fine - but if someone else call a g29 (eg. a start script from a slicer, or duet's WEB-Interface or...) then - crash..... if a tool is grabbed at this time.

    G32 s not a problem - because i can park my tool first in bed.g....

    I have to make sure, that NEVER a tool is loaded when a G29 command is executed. Otherwise my system has a mechanical crash...



  • @Phaedrux said in pre or post code for G-Code:

    mesh.g

    Thank's - I found this

    In RepRapFirmware 3.2 and later, mesh.g is run in response to a G29 command with no parameters. If file mesh.g is not found then it behaves like G29 S0 instead.

    I have to update first ..

    I'll try it out and give feedback... !


  • Moderator

    As part of the mesh.g you could have a conditional statement saying if a tool is loaded, undock it then run g29.



  • i agree with you... but this dont work.

    my system upgrade to 3.2-beta2 is done.

    without a mesh.g file everything is like it was before.

    with a new mesh.g file (only one line in it with "g29") i get the error

    G29 Error: Push(): stack overflow

    maybe a Stack overflow occurs when iu run a recursive macro ?



  • I think calling of mesh.g is broken in beta 2 with an SBC attached if thats what you have.



  • @jay_s_uk said in pre or post code for G-Code:

    I think calling of mesh.g is broken in beta 2 with an SBC attached if thats what you have.

    I don't necessarily think so ...

    In mesh.g I should probably use "G29 S0" (this works).

    But if someone calls "G29 S0" directly, mesh.g is not executed ... and the problem is there again.


  • Moderator

    Moved to the beta firmware forum and updated the title for @chrishamm to see


Log in to reply