Reverse math for 3-point auto leveling?
-
Hi there!
I have an bit unusual problem. I have a D-bot with 3 individually controlled leadscrews, with 3 steppers on it, and are currently using the auto level feature for this, but I have one small problem - When the auto calibration routine is done, the bed is not completly leveled, but one corner is lower than the other(X0, Y0 is low, where Xmax Ymax is high)
I have 2 problems - 1 the surface is not perfect for my IR-probe - I will look into fixing that later, 2 im not sure for my coordinates for my 3 lead screws.My guess is that one of the coordinates for the leadscrew is a bit off, and therfor it compensates wrongly.
I have one screw in the middle in the left side, and 2 spaced out on the right side.
So my question is: I can see that my leadscrew is 0.25mm to low in one corner, can i reverse calculate the plan to correct the lead screw position? (or any easier solution)
-
If you run G32 several times so that it converged to zero correction required, then it should be the case that at the points you probed in bed.g, the mesh height is zero - even of you don't have the leadscrew coordinates exactly right. Is that what you find?
From your height map, my guess is that you are probing near the two front corners and the mid point of the back. You might want to try using more probe points, for example near all 4 corners.
-
@dc42 When I probe for the autoleveling, I use 3 point (one near each leadscrew)
See this video: https://www.youtube.com/watch?v=pPQ6EsfvTOI&feature=youtu.beor my code
bed.g:
M561 ; clear any bed transform G28 Z; G29 S2; Clear bed height map ; Probe the bed at 3 points G30 P0 X0 Y160 Z-9999 ; Front Right G30 P1 X320 Y47 Z-9999 ; Front Left G30 P2 X320 Y280 Z-9999 S3 ; Center Rear
and my home all:
M400; make sure everything has stopped before we make changes M574 X1 Y1 S3 ; M913 X30 Y30 ; XY motors to 30% current M915 X Y H400 S3 R0 F0 ; set X and Y to sensitivity , do nothing when stall, unfiltered ; X axis home G91 ; use relative positioning G1 Z5 F6000 S2 ; lift Z relative to current position G1 S1 X-405 F6000 ; move quickly to X axis endstop and stop there (first pass) G1 X5 F6000 ; go back a few mm G1 S1 X-405 F4000 ; move slowly to X axis endstop once more (second pass) ; Y axis home G1 S1 Y-305 F6000 ; move quickly to Y axis endstop and stop there (first pass) G1 Y5 F6000 ; go back a few mm G1 S1 Y-305 F4000 ; move slowly to Y axis endstop once more (second pass) G90 ; absolute positioning M913 X100 Y100; motor currents back to 100% ; Z-axis M561 ; Clear any bed transform G32 ; Start 3-point probe sequence - Bed.g ;M375 P"bareplate.csv" ; Load heightmap G1 Z20.0 F6000 ; Move Z to 20 G1 X5 Y5 ; Move Head to front left
-
So yesterday, I updated to the latest firmware (RC4)
Now when I home, I get an error, but not any info on why I get that error.
Anyone got an clue?
-
You need to have home Z before you run G32. The simplest way is to do a G30 probe at bed centre.
-
@dc42 said in Reverse math for 3-point auto leveling?:
You need to have home Z before you run G32. The simplest way is to do a G30 probe at bed centre.
@dc42
I added G30 to the homeall.g but still get the error:; Z-axis M561 ; Clear any bed transform G30 X160 Y130 Z-9999; G32 ; Start 3-point probe sequence - Bed.g ;M375 P"bareplate.csv" ; Load heightmap G1 Z20.0 F6000 ; Move Z to 20 G1 X5 Y5 ; Move Head to front left
-
Instead of that G30 command you added, use:
G1 X160 Y130 F6000
G30 -
@dc42
Hmm... Changed that + a bit in my bed.g script and got a new kind of error:
It is no longer red but still there.I changed my homeall to
; called to home all axes ; ; generated by RepRapFirmware Configuration Tool on Tue Jul 31 2018 15:05:50 GMT+0200 (Centraleuropæisk sommertid) M400; make sure everything has stopped before we make changes M574 X1 Y1 S3 ; M913 X30 Y30 ; XY motors to 30% current M915 X Y H400 S3 R0 F0 ; set X and Y to sensitivity , do nothing when stall, unfiltered ; X axis home G91 ; use relative positioning G1 Z5 F6000 S2 ; lift Z relative to current position G1 S1 X-405 F6000 ; move quickly to X axis endstop and stop there (first pass) G1 X5 F6000 ; go back a few mm G1 S1 X-405 F4000 ; move slowly to X axis endstop once more (second pass) ; Y axis home G1 S1 Y-305 F6000 ; move quickly to Y axis endstop and stop there (first pass) G1 Y5 F6000 ; go back a few mm G1 S1 Y-305 F4000 ; move slowly to Y axis endstop once more (second pass) G90 ; absolute positioning M913 X100 Y100; motor currents back to 100% ; Z-axis M561 ; Clear any bed transform G1 X160 Y130 F6000 G30 G32 ; Start 3-point probe sequence - Bed.g ;M375 P"bareplate.csv" ; Load heightmap ;G1 Z20.0 F6000 ; Move Z to 20 ;G1 X5 Y5 ; Move Head to front left
and removed 2 lines from bed.g
; bed.g ; called to perform automatic bed compensation via G32 ; ; generated by RepRapFirmware Configuration Tool on Tue Jul 31 2018 15:05:50 GMT+0200 (Centraleuropæisk sommertid) M561 ; clear any bed transform G28 Z; M561; Clear bed height map ; Probe the bed at 3 points G30 P0 X0 Y160 Z-9999 ; Front Right G30 P1 X320 Y47 Z-9999 ; Front Left G30 P2 X320 Y280 Z-9999 S3 ; Center Rear
-
@martin1454
Found it - it was the G28 in my bed.g file
EDIT:
way better probeing
-
So I have been playing a bit around, updated firmware and so on.
Right now my bed leveling is getting better each time I run G28 - but never perfect
I have marked out approximately the placement where it probes when probing the lead screws (the screw is ofcourse a few mm/cm outside the build plate)My sheet should be pretty straight since it is a 6mm thick cast aluminium plate (with a sheet on top) - But what doesn't make sense to me is, even after the 3 point calibration, it does not make a plan that is flat? Should the 3 points not be 0-0-0 after next G28 probing?
-
You've done 3 successive leadscrew adjustments, and on the 3rd one it still made significant corrections. This suggests that the model used by the firmware (which assumed gimballed joints) doesn't match your mechanics very well.
I think you need to run leadscrew adjustment more times, until the adjustments made are all 0.02mm or less. You may find that increasing the M671 F parameter to around 1.2 or 1.4 helps to speed up convergence.
-
@dc42 Aha, I will try that! - newer though about changing the pitch
-
@dc42
So I made a few changes - I edited the positions a bit in M671, and changed the "fudge factor" to 1.25It have become a bit better, but still not working optimal:
It is quite consisten with middle left (1) being too low, right front (2) being little too high and (3) right rear being too high.
-
Bear in mind that unless your probe is accurate and the bed and the head XY movement plane are both completely flat (which isn't the case, judging from your height map), unless your leadscrew adjustment probe points coincide with points on the mesh then you can't expect the height map to have zero error at the leadscrew probe points.
-
@dc42 said in Reverse math for 3-point auto leveling?:
Bear in mind that unless your probe is accurate and the bed and the head XY movement plane are both completely flat (which isn't the case, judging from your height map), unless your leadscrew adjustment probe points coincide with points on the mesh then you can't expect the height map to have zero error at the leadscrew probe points.
Hmm... might look into my gantry...
-
after adding 5 point leveling instead of 3, it works quiet bit better
But Im thinking about chainging it from 3 independent motors to 4
-
Finally to the point where im satisfied.
Biggeste change was changing to BL touch - After I got my hands on an thermal/IR camera, I could see that the bed was like a mirror for the camera, so that's why the IR probe didn't work good enough