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

    Automatic Bed Leveling with Conditional Gcode Iterations

    Scheduled Pinned Locked Moved
    Gcode meta commands
    5
    79
    6.4k
    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.
    • mwolterundefined
      mwolter @fcwilt
      last edited by

      @fcwilt
      It’s just a different way of doing it and like I mentioned, this way I can be sure it’s raised 20mm from its current position. The G30 command actually sets Z to about 3m. So G1 Z20 will only raise Z by 17mm.

      fcwiltundefined 1 Reply Last reply Reply Quote 0
      • Kolbiundefined
        Kolbi @Phaedrux
        last edited by

        @Phaedrux said in Automatic Bed Leveling with Conditional Gcode Iterations:

        Now you're cooking with gas!

        Definitely cooking with gas now!

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

          @mwolter said in Automatic Bed Leveling with Conditional Gcode Iterations:
          The G30 command actually sets Z to about 3m. So G1 Z20 will only raise Z by 17mm.

          I think you will find that a G91 G1 Z20 will raise Z by 20 unless it doesn't have that much room left on the axis.

          If a G30 sets Z to 3 then a G91 G1 Z20 will take Z to 23.

          At least that is my experience.

          Good luck.

          Frederick

          Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

          mwolterundefined Phaedruxundefined 2 Replies Last reply Reply Quote 1
          • mwolterundefined
            mwolter @fcwilt
            last edited by

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • Phaedruxundefined
              Phaedrux Moderator @fcwilt
              last edited by

              @fcwilt said in Automatic Bed Leveling with Conditional Gcode Iterations:

              I think you will find that a G91 G1 Z20 will raise Z by 20 unless it doesn't have that much room left of the axis.

              Correct. G90 moves to an absolute point, G91 is relative to the current position.

              https://duet3d.dozuki.com/Wiki/Gcode#Section_G90_Set_to_Absolute_Positioning

              Z-Bot CoreXY Build | Thingiverse Profile

              mwolterundefined 1 Reply Last reply Reply Quote 1
              • mwolterundefined
                mwolter @Phaedrux
                last edited by

                @Phaedrux If the command G90 G1 Z20 is used in one line, does G91 have to be used to return to absolute mode?

                Phaedruxundefined A Former User? fcwiltundefined 3 Replies Last reply Reply Quote 1
                • Phaedruxundefined
                  Phaedrux Moderator @mwolter
                  last edited by

                  @mwolter That's a good question, and I'm not sure off the top of my head. Would have to test to see if it sticks in that format or not.

                  Z-Bot CoreXY Build | Thingiverse Profile

                  1 Reply Last reply Reply Quote 0
                  • Kolbiundefined
                    Kolbi
                    last edited by

                    Another thing I noticed is repeatability with PindaV2 probe is not as consistent as BLTouchV3.1... So being that I use a bondtech bmg mosquito, I've made this modified version to scrap the Pinda and welcome the BLTouch. Will get it sorted on the printer and test it fully this weekend.
                    BMGm-BLTouch.JPG BMGm-BLTouch-Actual.jpg

                    mwolterundefined 1 Reply Last reply Reply Quote 0
                    • mwolterundefined
                      mwolter @Kolbi
                      last edited by

                      @Kolbi looks good! Is that SLS or MJF printed?

                      Kolbiundefined 1 Reply Last reply Reply Quote 0
                      • Kolbiundefined
                        Kolbi @mwolter
                        last edited by Kolbi

                        @mwolter It was done on an HP Multijet Fusion (MJF), using Nylon PA12.

                        1 Reply Last reply Reply Quote 0
                        • A Former User?
                          A Former User @mwolter
                          last edited by

                          @mwolter said in Automatic Bed Leveling with Conditional Gcode Iterations:

                          If the command G90 G1 Z20 is used in one line, does G91 have to be used to return to absolute mode?

                          yes, g-code knows nothing about white space or line breaks

                          (optionally you can use push and pop, M120, M121)

                          Kolbiundefined 1 Reply Last reply Reply Quote 1
                          • fcwiltundefined
                            fcwilt @mwolter
                            last edited by

                            @mwolter said in Automatic Bed Leveling with Conditional Gcode Iterations:

                            @Phaedrux If the command G90 G1 Z20 is used in one line, does G91 have to be used to return to absolute mode?

                            G90 is absolute, G91 is relative.

                            Frederick

                            Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                            mwolterundefined 1 Reply Last reply Reply Quote 0
                            • mwolterundefined
                              mwolter @fcwilt
                              last edited by

                              @fcwilt
                              That’s why I used that command. Pulled that command from another macro and couldn’t remember why it was created. It’s used to move some amount from the current position without needing to bounce back and forth from absolute to relative and back to absolute positioning.

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

                                @mwolter said in Automatic Bed Leveling with Conditional Gcode Iterations:

                                @fcwilt
                                That’s why I used that command. Pulled that command from another macro and couldn’t remember why it was created. It’s used to move some amount from the current position without needing to bounce back and forth from absolute to relative and back to absolute positioning.

                                But there is no reason not to make use of the two positioning modes, there is no downside to using them.

                                There is nothing to be gained by emulating relative mode using the object model as you are doing.

                                Frederick

                                Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                                1 Reply Last reply Reply Quote 0
                                • Kolbiundefined
                                  Kolbi @A Former User
                                  last edited by

                                  @bearer said in Automatic Bed Leveling with Conditional Gcode Iterations:

                                  optionally you can use push and pop, M120, M121

                                  @bearer I read the gcode manual but these two functions still made little sense to me - best I can derive is a save state / restore state? Could you expand a little on these and give me some use examples?

                                  Many thanks,
                                  Kolbi

                                  A Former User? 1 Reply Last reply Reply Quote 0
                                  • A Former User?
                                    A Former User @Kolbi
                                    last edited by

                                    @Kolbi does https://forum.duet3d.com/topic/17854/retrieve-the-position-of-an-axis/5?_=1596130135808 help?

                                    Kolbiundefined 1 Reply Last reply Reply Quote 0
                                    • Kolbiundefined
                                      Kolbi @A Former User
                                      last edited by

                                      @bearer Maybe because I just woke or hadn't gone on my run yet - but it is not completely crystal clear to me. Given the example below:

                                      M120              ;push 
                                      G91               ; relative positioning
                                      G0Z30             ; move Z 30mm
                                      M121              ;pop
                                      

                                      I gather that 'M120; push' saves the current kinematic control state, then the user issues G91 & G0Z30 to relatively move the Z axis, and then returns to the previous control state by issuing an M121 - meaning that no M90 command was needed as M121 sorted that out?

                                      A Former User? 1 Reply Last reply Reply Quote 0
                                      • A Former User?
                                        A Former User @Kolbi
                                        last edited by

                                        @Kolbi said in Automatic Bed Leveling with Conditional Gcode Iterations:

                                        meaning that no M90 command was needed as M121 sorted that out?

                                        yes - but more importantly if you for reasons unknown already were in relative mode you would not return to absolute in error.

                                        Kolbiundefined 1 Reply Last reply Reply Quote 1
                                        • Kolbiundefined
                                          Kolbi
                                          last edited by

                                          @bearer Ah ok - thanks! Besides rel/nonrel state changes - what would be an additional use case?

                                          A Former User? 1 Reply Last reply Reply Quote 0
                                          • A Former User?
                                            A Former User @Kolbi
                                            last edited by

                                            @Kolbi ref M120 docs; i only used for absolute/relative and feedrate

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