Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Desactivate M120 on nested macro call

    Scheduled Pinned Locked Moved
    Tuning and tweaking
    2
    5
    526
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JuLundefined
      JuL
      last edited by

      Is there a way to desactivate a M120 command when call a macro?
      I use a macro wich call themself each time I need it(for manually levelling my bed with help of my capacitive probe). The problem is, if I agree to do it more then 5 or 6 time, I've got a "push stack overflow" wich I assume is usefull but not in my case. Here attached my macro "Bed Level"

      G0 Z10
      ; Point1 front left
      G0 X-26 Y10 F10000
      G30 S-1
      M114
      G0 Z10
      ; Point 2 front right
      G0 X182 Y10 F10000
      G30 S-1
      M114
      G0 Z10
      ; Point 3 rear right
      G0 X182 Y217 F10000
      G30 S-1
      M114
      G0 Z10
      ; Point 4 rear left
      G0 X-26 Y217 F10000
      G30 S-1
      M114
      G0 Z10
      ; Do it again?
      M291 P"Recommencer?" S3
      M98 P0:/macros/Levelling/Bed Level

      Is there also possibility to stock the M114 result into variable wich I could display with a M117? (not really important as I could see it in gcodeconsole)

      1 Reply Last reply Reply Quote 0
      • fcwiltundefined
        fcwilt
        last edited by

        Hi,

        Did you try adding a M121 before you call it again?

        How many times do find you are repeating this?

        On my machines I find that after third time there is little improvement.

        Frederick

        Printers: A FT-5 with the 713 upgrade bits, a custom MarkForged style, a small Utilmaker style, a small CoreXY from kit and a E3D MS/TC setup. Various hotends. Using Duets (2 and 3) running 3.4.6

        1 Reply Last reply Reply Quote 0
        • JuLundefined
          JuL
          last edited by

          @fcwilt said in Desactivate M120 on nested macro call:

          Did you try adding a M121 before you call it again?

          I didn't. Does it reset the stack?

          @fcwilt said in Desactivate M120 on nested macro call:

          How many times do find you are repeating this?

          3 times start to be correct, but within 5 or 6 times, I manage to be as 0.01 deviation

          1 Reply Last reply Reply Quote 0
          • fcwiltundefined
            fcwilt
            last edited by

            Well the M120 stores the state of the machine on the stack.

            The M121 is the opposite, if you will, and restores the state of the machine and frees up the stack memory that the M120 used.

            However I just tried it and it doesn't work. No error message but the macro is not called again.

            How about putting multiple M291/M98 pairs in one macro and calling another.

            That works and while it is not as elegant it solves the push/pop problem.

            Frederick

            Printers: A FT-5 with the 713 upgrade bits, a custom MarkForged style, a small Utilmaker style, a small CoreXY from kit and a E3D MS/TC setup. Various hotends. Using Duets (2 and 3) running 3.4.6

            1 Reply Last reply Reply Quote 0
            • JuLundefined
              JuL
              last edited by

              I tried too. M121 just blocks the macro wherever it is.

              @fcwilt said in Desactivate M120 on nested macro call:

              How about putting multiple M291/M98 pairs in one macro and calling another.

              I'll maybe do that (or one big with multiple cycle and M291) or if there is a GOTO like gcode but I don't think so.

              Thx

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Unless otherwise noted, all forum content is licensed under CC-BY-SA