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.
    • Martin1454undefined
      Martin1454 @dc42
      last edited by Martin1454

      @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
      • Martin1454undefined
        Martin1454
        last edited by

        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
        • dc42undefined
          dc42 administrators
          last edited by

          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

          Martin1454undefined 1 Reply Last reply Reply Quote 0
          • Martin1454undefined
            Martin1454 @dc42
            last edited by Martin1454

            @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
            • dc42undefined
              dc42 administrators
              last edited by dc42

              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

              Martin1454undefined 1 Reply Last reply Reply Quote 0
              • Martin1454undefined
                Martin1454 @dc42
                last edited by

                @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
                
                Martin1454undefined 1 Reply Last reply Reply Quote 0
                • Martin1454undefined
                  Martin1454 @Martin1454
                  last edited by Martin1454

                  @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
                  • Martin1454undefined
                    Martin1454
                    last edited by

                    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
                    • dc42undefined
                      dc42 administrators
                      last edited by

                      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

                      Martin1454undefined 1 Reply Last reply Reply Quote 0
                      • Martin1454undefined
                        Martin1454 @dc42
                        last edited by

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

                        1 Reply Last reply Reply Quote 0
                        • Martin1454undefined
                          Martin1454
                          last edited by

                          @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
                          • dc42undefined
                            dc42 administrators
                            last edited by

                            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

                            Martin1454undefined 1 Reply Last reply Reply Quote 0
                            • Martin1454undefined
                              Martin1454 @dc42
                              last edited by

                              @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
                              • Martin1454undefined
                                Martin1454
                                last edited by Martin1454

                                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
                                • Martin1454undefined
                                  Martin1454
                                  last edited by Martin1454

                                  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