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

    3.3RC2 - NaN while probing bed for manual levelling

    Scheduled Pinned Locked Moved
    Beta Firmware
    5
    10
    425
    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.
    • jay_s_ukundefined
      jay_s_uk
      last edited by jay_s_uk

      This came about whilst helping a user with writing a macro for manually levelling their bed. I'm reporting this against 3.3RC2 but I think it affects most previous versions.

      Back story. A user has prusa printer which has been converted to RRF. The prusa printers have a bed which is secured by 9 screws and fixed supports. This user has converted his bed to mounted on adjustable supports.

      We were creating a macro to be used to probe the locations and suggest how much to adjust the screws by.
      a0e27abd-dd6a-448d-8332-ee487a83623e-image.png

      • box 1 represents a normally mounted bed. the red dots would be the screw locations in M671 and also probe the same locations (or as close as possible to). This is the type of probing I carry out to manually adjust my bed. My typical macro looks like this
      M671 x15:250:15:250 y25:25:260:260 P0.5                             ; The location of the four bed securing screws
      
      ; M558 P0												; Uncomment this if you don't have a Z Probe
      
      G28 Z                                                               ; Home Z
      
      G30 P0 X15 Y25 Z-99999 ; probe near an adjusting screw              ; Front left screw
      G30 P1 X240 Y25 Z-99999 ; probe near an adjusting screw             ; Front right screw
      G30 P2 X15 Y255 Z-99999 ; probe near an adjusting screw             ; Rear left screw
      G30 P3 X240 Y255 Z-99999 S4 ; probe near an adjusting screw         ; Rear right screw
      
      G28 Z       
      
      • Box 2 represents a prusa mounted bed. This doesn't work as M671 only supports 8 locations. Maybe allowing 9 adjustment points could be a future enhancement?

      • Fortunately, the guy I was helping with the bed has a fixed support in the middle so really only has 8 locations. Box 3 represents those 8 locations. Again, all 8 would go in M671 and all 8 would be probed (as RRF doesn't let you define 8 points but only probe 4). That probing fails with NaN. More specifically, this was the output.

      M98 P"0:/macros/test levelling"
      Error: Calibration failed, computed corrections: nan nan nan nan nan nan nan nan
      
      • We then created a probing routine as shown in Box 4. Again, the red dots were used for M671 locations and probe locations. That also got a NaN as shown in the output below.
      M98 P"0:/macros/test levelling"
      Error: Calibration failed, computed corrections: nan nan nan nan
      

      Is there any improvement that can be done to this? The ideal would be for Box 3 to be supported but if not, the probing routine for the prusa bed could be split into 2 probing routines consisting of Box 1 and then Box 4.

      Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

      o_lampeundefined OwenDundefined dc42undefined 3 Replies Last reply Reply Quote 0
      • o_lampeundefined
        o_lampe @jay_s_uk
        last edited by

        @jay_s_uk
        Just a hint: you can prevent the slightly irritating " {1}" lines in the code boxes, by defining the code sections as 'perl' language
        Like :
        ´´´perl

        1 Reply Last reply Reply Quote 0
        • OwenDundefined
          OwenD @jay_s_uk
          last edited by

          @jay_s_uk
          I believe you should have an S parameter on the last probe to tell it how many points were used
          see wiki

          jay_s_ukundefined 1 Reply Last reply Reply Quote 0
          • jay_s_ukundefined
            jay_s_uk @OwenD
            last edited by

            @owend there is one
            G30 P3 X240 Y255 Z-99999 S4 ; probe near an adjusting screw ; Rear right screw

            Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

            OwenDundefined 1 Reply Last reply Reply Quote 0
            • dc42undefined
              dc42 administrators @jay_s_uk
              last edited by

              @jay_s_uk I'm sorry, the leadscrew levelling system only supports levelling with 2, 3 or 4 support points. I will change M671 to enforce this limit. It is the actual number of Z motors that can be up to 8 in some builds.

              I suggest you start by loosening all the screws except the corner ones, and level those 4. Then generate a height map and adjust the remaining screws to get it as flat as possible.

              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

              gloomyandyundefined 1 Reply Last reply Reply Quote 0
              • gloomyandyundefined
                gloomyandy @dc42
                last edited by gloomyandy

                @dc42 Even with only four support points (see example 4) it still generates a set of NaNs (the d2 part of the computation ends up as zero). Is there some sort of assumption about the position of the supports?

                dc42undefined 1 Reply Last reply Reply Quote 0
                • OwenDundefined
                  OwenD @jay_s_uk
                  last edited by

                  @jay_s_uk said in 3.3RC2 - NaN while probing bed for manual levelling:

                  @owend there is one
                  G30 P3 X240 Y255 Z-99999 S4 ; probe near an adjusting screw ; Rear right screw

                  Jeebas I'm getting more blind every day.
                  Time to stop posting from my phone. 🔍 🤓

                  1 Reply Last reply Reply Quote 1
                  • dc42undefined
                    dc42 administrators @gloomyandy
                    last edited by

                    @gloomyandy said in 3.3RC2 - NaN while probing bed for manual levelling:

                    @dc42 Even with only four support points (see example 4) it still generates a set of NaNs (the d2 part of the computation ends up as zero). Is there some sort of assumption about the position of the supports?

                    Only that no three of them are collinear, which also applies to the probe point coordinates. What M671 coordinates and probe point coordinates generate nans?

                    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

                    jay_s_ukundefined 1 Reply Last reply Reply Quote 0
                    • jay_s_ukundefined
                      jay_s_uk @dc42
                      last edited by

                      @dc42 This code results in a NaN

                      M671 x111:0:222:111 y0:88:88:176 P0.5                             ; The location of the four bed securing screws
                      
                      ; M558 P0                                                ; Uncomment this if you don't have a Z Probe
                      
                      G28 Z                                                               ; Home Z
                      
                      G30 P0 X111 Y10 Z-99999 ; probe near an adjusting screw             ; Front right screw
                      G30 P1 X10 Y88 Z-99999 ; probe near an adjusting screw         ; Rear right screw
                      G30 P2 X212 Y88 Z-99999 ;
                      G30 P3 X111 Y176 Z-99999 S4 ;
                      
                      G28 Z                                                               ; Home Z
                      

                      Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

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

                        @jay_s_uk I can see why that won't work. The firmware models the bed as a plate that can have an XY twist. With four mounting points positioned at the centres of the edges, three of them would define the bed plane and adjustment of the fourth one would bend the bed instead of twisting it. So the matrix used in the calculation is singular.

                        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
                        • First post
                          Last post
                        Unless otherwise noted, all forum content is licensed under CC-BY-SA