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)
    0_1543060272483_height.png
    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)


  • administrators

    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.be

    or 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?
    0_1543247060208_Udklip.PNG


  • administrators

    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
    

  • administrators

    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:
    0_1543258210130_well.PNG
    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
    0_1543258863643_Udklip.PNG



  • 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

    0_1544977257605_homing.PNG
    0_1544977276060_height.png
    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?


 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.