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

    Issue converting bed.g to use Conditional gcode

    Scheduled Pinned Locked Moved
    Beta Firmware
    8
    25
    1.3k
    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.
    • fcwiltundefined
      fcwilt @gtj0
      last edited by

      @gtj0 said in Issue converting bed.g to use Conditional gcode:

      A quick experiment revealed that if the M671 S limit is reached, no correction is done at all so it can't possibly converge by running multiple times. The only way out would be to manually move the screws until the correction would be inside the limit.

      It seems that something may have changed since I last used auto-leveling. Back then it made the max adjustment it could and multiple runs kept improving things.

      Frederick

      Printers: a E3D MS/TC setup and a RatRig Hybrid. Using Duet 3 hardware running 3.4.6

      tekkydaveundefined 1 Reply Last reply Reply Quote 0
      • gtj0undefined
        gtj0
        last edited by

        I thought it did as well which is why i tested it. I set my limit to 1mm and manually moved 1 screw so it would need at least 3mm then ran G32 S3. It probled the 3 points but returned Some computed corrections exceed configured limit of 1.00mm: -0.219 3.092 -1.290 with no movement.

        Bear in mind, I'm using RRF3 via the DSF/SBC. It may be different in standalone mode. I can check that in a bit.

        1 Reply Last reply Reply Quote 0
        • gtj0undefined
          gtj0
          last edited by

          Nope, no change in standalone mode...

          M671 X-23:238:498 Y13:485:13 S1
          ok
          G28
          ok
          G32 S3
          Error: Some computed corrections exceed configured limit of 1.00mm: 0.935 -3.386 -2.561
          G32 S3
          Error: Some computed corrections exceed configured limit of 1.00mm: 0.939 -3.385 -2.561
          
          1 Reply Last reply Reply Quote 0
          • gtj0undefined
            gtj0
            last edited by

            @dc42 : Bug?

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

              @gtj0 it can be a bug or a feature depends on how the G32 was designed by author 😄
              to me it looks like it's intentional to do not do any correction if discrepancy is larger by limit set by M671Sxxx. I'd too probbly do it exactly like that but would be cool to have a separate parameter for M671 to "do max x mm of adjustment" in order to be able to do what you want (adjust only 1mm then measure again, adjust 1mm max, measure etc etc.. ) ... but I'd keep Sxxx limit as a "hard one" as if "too badly missaligned" or "damaged probe" or "$h1t on the print bed you are probing over" trying to fix it could be damaging to the printer itself

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

                @gtj0 said in Issue converting bed.g to use Conditional gcode:

                The only way out would be to manually move the screws until the correction would be inside the limit.

                Or chose to configure a larger limit. M671 S10.

                Only you can know what limit represents "this is about to damage the printer" vs. "OK to adjust this large amount".

                Delta / Kossel printer fanatic

                1 Reply Last reply Reply Quote 0
                • tekkydaveundefined
                  tekkydave @gtj0
                  last edited by

                  @gtj0 said in Issue converting bed.g to use Conditional gcode:

                  A quick experiment revealed that if the M671 S limit is reached, no correction is done at all so it can't possibly converge by running multiple times. The only way out would be to manually move the screws until the correction would be inside the limit.

                  That's what I've found.

                  ~ tekkydave ~
                  D-Bot: 300x300mm | Duet WiFi + Duex2 | 3 independent z motors | X,Y & Z linear rails | E3D Titan Aero + V6 | Precision Piezo z-probe
                  FreeCAD, PrusaSlicer

                  1 Reply Last reply Reply Quote 0
                  • tekkydaveundefined
                    tekkydave @fcwilt
                    last edited by

                    @fcwilt said in Issue converting bed.g to use Conditional gcode:

                    @gtj0 said in Issue converting bed.g to use Conditional gcode:

                    A quick experiment revealed that if the M671 S limit is reached, no correction is done at all so it can't possibly converge by running multiple times. The only way out would be to manually move the screws until the correction would be inside the limit.

                    It seems that something may have changed since I last used auto-leveling. Back then it made the max adjustment it could and multiple runs kept improving things.

                    Frederick

                    Yes, I thought it worked that way but obviously not.

                    ~ tekkydave ~
                    D-Bot: 300x300mm | Duet WiFi + Duex2 | 3 independent z motors | X,Y & Z linear rails | E3D Titan Aero + V6 | Precision Piezo z-probe
                    FreeCAD, PrusaSlicer

                    1 Reply Last reply Reply Quote 0
                    • tekkydaveundefined
                      tekkydave
                      last edited by

                      Thanks for all the helpful comments. Just to say I have no issue with the way G30 works although the option to move by a limited amount per session would be a nice to have.
                      My issue is about the example code which seems to suggest it can iteratively home in when it can't.

                      I usually have my limit at 3mm which works fine and to be fair G30 usually achieves a deviation of 0.0 on my D-Bot first time it runs. 🙂

                      ~ tekkydave ~
                      D-Bot: 300x300mm | Duet WiFi + Duex2 | 3 independent z motors | X,Y & Z linear rails | E3D Titan Aero + V6 | Precision Piezo z-probe
                      FreeCAD, PrusaSlicer

                      1 Reply Last reply Reply Quote 0
                      • droftartsundefined
                        droftarts administrators @tekkydave
                        last edited by

                        @tekkydave said in Issue converting bed.g to use Conditional gcode:

                        My issue is about the example code which seems to suggest it can iteratively home in when it can't.

                        "if calibration yields a standard deviation that is above a limit, it repeats the calibration process"

                        From https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands#Section_Using_conditional_GCode_commands_in_bed_g_to_calibrate_a_delta_printer

                        I think you have misinterpreted what the 'limit' is; it's not the hard limit imposed by M671, it's the limit set in these lines:

                        if move.calibrationDeviation.deviation <= 0.03
                        break
                        echo "Repeating calibration because deviation is too high (" ^ move.calibrationDeviation.deviation ^ "mm)"

                        ie 0.03mm. If the calibration is more than 0.03mm out, it repeats it for up to 5 times.

                        Ian

                        Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                        tekkydaveundefined 1 Reply Last reply Reply Quote 0
                        • tekkydaveundefined
                          tekkydave @droftarts
                          last edited by

                          @droftarts said in Issue converting bed.g to use Conditional gcode:

                          @tekkydave said in Issue converting bed.g to use Conditional gcode:

                          My issue is about the example code which seems to suggest it can iteratively home in when it can't.

                          "if calibration yields a standard deviation that is above a limit, it repeats the calibration process"

                          From https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands#Section_Using_conditional_GCode_commands_in_bed_g_to_calibrate_a_delta_printer

                          I think you have misinterpreted what the 'limit' is; it's not the hard limit imposed by M671, it's the limit set in these lines:

                          if move.calibrationDeviation.deviation <= 0.03
                          break
                          echo "Repeating calibration because deviation is too high (" ^ move.calibrationDeviation.deviation ^ "mm)"

                          ie 0.03mm. If the calibration is more than 0.03mm out, it repeats it for up to 5 times.

                          Ian

                          Not what I found. G30 exits if the limit in M671 is exceeded without getting to the test.

                          ~ tekkydave ~
                          D-Bot: 300x300mm | Duet WiFi + Duex2 | 3 independent z motors | X,Y & Z linear rails | E3D Titan Aero + V6 | Precision Piezo z-probe
                          FreeCAD, PrusaSlicer

                          droftartsundefined 1 Reply Last reply Reply Quote 0
                          • droftartsundefined
                            droftarts administrators @tekkydave
                            last edited by

                            @tekkydave ANY G30 bed levelling exits if it exceeds the deviation limit set by M671, whether it's called in conditional gcode or a manual bed levelling. If you'd rather M671 issued a warning and attempted to level, rather than exiting, you'd best ask @dc42 for that functionality.

                            Ian

                            Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                            tekkydaveundefined 1 Reply Last reply Reply Quote 0
                            • tekkydaveundefined
                              tekkydave @droftarts
                              last edited by

                              @droftarts said in Issue converting bed.g to use Conditional gcode:

                              @tekkydave ANY G30 bed levelling exits if it exceeds the deviation limit set by M671, whether it's called in conditional gcode or a manual bed levelling. If you'd rather M671 issued a warning and attempted to level, rather than exiting, you'd best ask @dc42 for that functionality.

                              Ian

                              I'm ok with how G30 works and I understand what you mean about the "real" test being the 0.03. I just wanted to point out that the example needs a line explaining that it will only work within the limit you have set in your M671 command. Most users would have left this at the default of 1mm. If you have disturbed one of your leadscrews by more than 1mm you will need to manually level the bed before running the macro.

                              ~ tekkydave ~
                              D-Bot: 300x300mm | Duet WiFi + Duex2 | 3 independent z motors | X,Y & Z linear rails | E3D Titan Aero + V6 | Precision Piezo z-probe
                              FreeCAD, PrusaSlicer

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

                                Currently, if calibration fails then move.initialCalibrationDeviation and move.finalCalibrationDeviation are not changed. I'll change this in beta4 so that they are both set to the measured initial deviation. Also I'm thinking of moving them to a separate move.calibration section.

                                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 1
                                • droftartsundefined
                                  droftarts administrators @tekkydave
                                  last edited by

                                  @tekkydave I've just realised the example code is for a delta printer, which doesn't use M671 (no leadscrews) to limit correction, so hasn't been considered in the description or writing of the code. I've updated the page to reflect this.

                                  NOTE: If you use this method to iterate the levelling of a bed/gantry mounted on leadscrews (eg Cartesian, CoreXY etc), the maximum deviation corrected is still limited by the S parameter of M671 (default 1mm). If the maximum deviation exceeds this limit, the script will exit with "Error: Some computed corrections exceed configured limit of 1.00mm", as it would if G30 bed levelling was called manually.

                                  https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands?revisionid=HEAD#Section_Using_conditional_GCode_commands_in_bed_g_to_calibrate_a_delta_printer

                                  Ian

                                  Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                                  tekkydaveundefined 1 Reply Last reply Reply Quote 0
                                  • tekkydaveundefined
                                    tekkydave @droftarts
                                    last edited by

                                    @droftarts said in Issue converting bed.g to use Conditional gcode:

                                    @tekkydave I've just realised the example code is for a delta printer, which doesn't use M671 (no leadscrews) to limit correction, so hasn't been considered in the description or writing of the code. I've updated the page to reflect this.

                                    NOTE: If you use this method to iterate the levelling of a bed/gantry mounted on leadscrews (eg Cartesian, CoreXY etc), the maximum deviation corrected is still limited by the S parameter of M671 (default 1mm). If the maximum deviation exceeds this limit, the script will exit with "Error: Some computed corrections exceed configured limit of 1.00mm", as it would if G30 bed levelling was called manually.

                                    https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands?revisionid=HEAD#Section_Using_conditional_GCode_commands_in_bed_g_to_calibrate_a_delta_printer

                                    Ian

                                    Thanks 🙂 I realised the code was for a delta but adapted it to the commands I normally used in bed.g. I didn't know delta's don't use M671 so 😝 to me for using it in the wrong context. I was keen to have a play with conditional g-code.
                                    Dave

                                    ~ tekkydave ~
                                    D-Bot: 300x300mm | Duet WiFi + Duex2 | 3 independent z motors | X,Y & Z linear rails | E3D Titan Aero + V6 | Precision Piezo z-probe
                                    FreeCAD, PrusaSlicer

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