3.3RC2 - NaN while probing bed for manual levelling
-
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.
- 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.
-
@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 -
-
@owend there is one
G30 P3 X240 Y255 Z-99999 S4 ; probe near an adjusting screw ; Rear right screw
-
@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.
-
@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?
-
@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. -
@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?
-
@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
-
@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.