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

    Level bed only once

    Scheduled Pinned Locked Moved
    General Discussion
    6
    10
    502
    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.
    • CVMichaelundefined
      CVMichael
      last edited by

      Right now in my startup gcode in the slicer, I am calling "M98 Pbed.g", but if I print small parts, and many times without restarting the printer; the subsequent levelling is unnecessary, and takes a long time.

      This is the gcode in bed.g

      M561                ; clear any bed transform
      M98 Pdeployprobe.g  ; deploy mechanical Z probe
      
      G30 P0 X0   Y20   Z-99999 ; probe near a leadscrew
      G30 P1 X400 Y20   Z-99999 ; probe near a leadscrew
      G30 P2 X0   Y380  Z-99999 ; probe near a leadscrew
      G30 P3 X400 Y380  Z-99999 S4 ; probe near a leadscrew and calibrate 4 motors
      
      M98 Pretractprobe.g ; retract mechanical Z probe
      
      M98 Phomez.g
      
      M561                ; clear any bed transform
      M98 Pdeployprobe.g  ; deploy mechanical Z probe
      G29                 ; probe the bed and enable compensation
      M98 Pretractprobe.g ; retract mechanical Z probe
      

      Is there a way to tell it: if this is already done, don't do it again ?

      1 Reply Last reply Reply Quote 0
      • oliofundefined
        oliof
        last edited by

        Conditional gcode in rrf can do this.

        <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

        1 Reply Last reply Reply Quote 0
        • CVMichaelundefined
          CVMichael
          last edited by

          Thanks for your reply!

          But what is rrf ?

          1 Reply Last reply Reply Quote 0
          • Danalundefined
            Danal
            last edited by Danal

            rrf = RepRap Firmware, which is what runs on the Duet.

            rrf2 = the mainstream release, V2, until a couple of months ago, when:

            rrf3 = newer release, V3, that just came out of beta. RRF3 is the one with conditional gcode.

            Delta / Kossel printer fanatic

            1 Reply Last reply Reply Quote 0
            • CVMichaelundefined
              CVMichael
              last edited by

              Took me a while to find this:
              https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands

              1 Reply Last reply Reply Quote 0
              • chas2706undefined
                chas2706
                last edited by

                @CVMichael

                You could do this:

                I put the bed levelling code in a macro called LevelLeadscrews and placed it in the /sys folder then added this at the bottom of my config.g:

                M98 P"LevelLeadscrews.g"

                The bed levelling will auto start when printer is first switched on but will not be performed again until the next switch on.

                Phaedruxundefined 1 Reply Last reply Reply Quote 0
                • dc42undefined
                  dc42 administrators
                  last edited by dc42

                  In RRF 3.01RC1 I think the following in the start.g file should work:

                  if move.compensation.deviation == 0  ; if bed probing hasn't been done yet
                    G32   ; run bed.g
                    if move.compensation.deviation > 0.2  ; if bed probing indicates the bed is far from level
                      abort "Too much bed compensation needed"
                  

                  You may need to adjust the 0.2 value depending on how flat your bed and gantry are.

                  BTW your bed.g file could be improved:

                  • Don't use M98 commands to deploy/retract the Z probe. For most types of Z probe, deployment and retraction are not needed. For BLTouch it is automatic. For other types of probe that need to be deployed, use M401 before the group of G30 commands and M402 after; and you do not need any deploy/retract commands around G29 because it is automatic.

                  Duet WiFi hardware designer and firmware engineer
                  Please do not ask me for Duet support via PM or email, use the forum
                  http://www.escher3d.com, https://miscsolutions.wordpress.com

                  1 Reply Last reply Reply Quote 0
                  • Phaedruxundefined
                    Phaedrux Moderator @chas2706
                    last edited by

                    @chas2706 putting movement gcodes into config is a bit risky. What happens if the power goes out and comes back on? Do you really want the printer to start moving and homing and probing with something still on the bed?

                    Z-Bot CoreXY Build | Thingiverse Profile

                    1 Reply Last reply Reply Quote 0
                    • chas2706undefined
                      chas2706
                      last edited by

                      @Phaedrux

                      I understand that but I forgot to mention that a message auto appears using M291 S3 asking for confirmation rather than auto levelling so you have the chice to either go ahead or cancel.

                      1 Reply Last reply Reply Quote 0
                      • chas2706undefined
                        chas2706
                        last edited by

                        This is the content of LevelLeadscrews.g:

                        M291 P"Leadscrew levelling will be performed, Ok or Cancel?" R"Bed Levelling" S3 ; User must click OK or cancel.
                        G32 ; Home all axis then do true bed levelling (Leadscrew Levelling Check)

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