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

Reverse math for 3-point auto leveling?

Scheduled Pinned Locked Moved Solved
Tuning and tweaking
2
17
2.4k
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.
  • undefined
    Martin1454
    last edited by Martin1454 24 Nov 2018, 11:54

    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)

    1 Reply Last reply Reply Quote 0
    • undefined
      dc42 administrators
      last edited by dc42 24 Nov 2018, 12:23

      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.

      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

      undefined 1 Reply Last reply 24 Nov 2018, 14:14 Reply Quote 0
      • undefined
        Martin1454 @dc42
        last edited by Martin1454 24 Nov 2018, 14:14

        @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
        
        1 Reply Last reply Reply Quote 0
        • undefined
          Martin1454
          last edited by 26 Nov 2018, 15:44

          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

          1 Reply Last reply Reply Quote 0
          • undefined
            dc42 administrators
            last edited by 26 Nov 2018, 18:21

            You need to have home Z before you run G32. The simplest way is to do a G30 probe at bed centre.

            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

            undefined 1 Reply Last reply 26 Nov 2018, 18:34 Reply Quote 0
            • undefined
              Martin1454 @dc42
              last edited by Martin1454 26 Nov 2018, 18:34

              @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
              
              1 Reply Last reply Reply Quote 0
              • undefined
                dc42 administrators
                last edited by dc42 26 Nov 2018, 18:38

                Instead of that G30 command you added, use:

                G1 X160 Y130 F6000
                G30

                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

                undefined 1 Reply Last reply 26 Nov 2018, 18:51 Reply Quote 0
                • undefined
                  Martin1454 @dc42
                  last edited by 26 Nov 2018, 18:51

                  @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
                  
                  undefined 1 Reply Last reply 26 Nov 2018, 18:53 Reply Quote 0
                  • undefined
                    Martin1454 @Martin1454
                    last edited by Martin1454 26 Nov 2018, 18:53

                    @martin1454
                    Found it - it was the G28 in my bed.g file
                    EDIT:
                    way better probeing
                    0_1543258863643_Udklip.PNG

                    1 Reply Last reply Reply Quote 0
                    • undefined
                      Martin1454
                      last edited by 16 Dec 2018, 16:23

                      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?

                      1 Reply Last reply Reply Quote 0
                      • undefined
                        dc42 administrators
                        last edited by 17 Dec 2018, 15:37

                        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.

                        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

                        undefined 1 Reply Last reply 18 Dec 2018, 07:00 Reply Quote 0
                        • undefined
                          Martin1454 @dc42
                          last edited by 18 Dec 2018, 07:00

                          @dc42 Aha, I will try that! - newer though about changing the pitch

                          1 Reply Last reply Reply Quote 0
                          • undefined
                            Martin1454
                            last edited by 18 Dec 2018, 17:13

                            @dc42
                            So I made a few changes - I edited the positions a bit in M671, and changed the "fudge factor" to 1.25

                            It have become a bit better, but still not working optimal:
                            0_1545153178231_height.png
                            0_1545153187547_new.PNG

                            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.

                            1 Reply Last reply Reply Quote 0
                            • undefined
                              dc42 administrators
                              last edited by 19 Dec 2018, 14:30

                              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.

                              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

                              undefined 1 Reply Last reply 19 Dec 2018, 17:56 Reply Quote 0
                              • undefined
                                Martin1454 @dc42
                                last edited by 19 Dec 2018, 17:56

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

                                1 Reply Last reply Reply Quote 0
                                • undefined
                                  Martin1454
                                  last edited by Martin1454 14 Jan 2019, 19:06

                                  after adding 5 point leveling instead of 3, it works quiet bit better0_1547492547383_Unavngivet.png

                                  But Im thinking about chainging it from 3 independent motors to 4

                                  1 Reply Last reply Reply Quote 0
                                  • undefined
                                    Martin1454
                                    last edited by Martin1454 18 Jan 2019, 18:30

                                    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

                                    0_1547836211655_49342220_10217893577268121_4807436385667514368_o.jpg

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