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

    Correct Configuration for Z Min Stop and Z Probe

    Scheduled Pinned Locked Moved Solved
    Using Duet Controllers
    2
    12
    725
    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.
    • JRCLundefined
      JRCL
      last edited by JRCL

      Thanks to those who have been providing me all the support.

      Decided to go with a Z min end stop and Z probe (per @fcwilt). However, I'm struggling to correctly configure the two together with Mesh Compensation. My Z keeps ending up higher than anticipated when the print starts despite what seems like a correct homing and mesh probing, I think I'm overwriting some values possbily.

      I took a step away from the firmware to implement some new hardware and I lost my rhythm 😬 .

      -I dont have a sys/mesh.g as of now but think maybe I need to ? but not sure what should go in there and what stays in bed.g and homeall.g

      -I define my mesh bed probe in config.

      ;homeall.g 
      
      M98 P"homev.g"				;home v
      M98 P"homey.g" 				; lifts the nozzle 10mm and homes Y
      G1 H1 X-320 F10000     ; move quickly to X axis endstop and stop there (first pass)
      G1 H2 X5 F12000          ; go back a few mm
      G1 H1 X-320 F7000       ; move slowly to X axis endstop once more (second pass)
      M98 P"homez.g"		;home the z axis which also should align lock mechanism and Y End
      M98 "homeu.g"		;home U
      G1 H2 Z15			; raise Z to give probe space
      G29 S0                            ; probe bed
      
      ;bed.g
      
      G28 ; home
      M401 ; deploy Z probe
      G30 P0 X60 Y35 Z-99999 ; probe corner one
      G30 P1 X200 Y35 Z-99999 ; probe corner 2
      G30 P2 X200 Y200 Z-999999	; probe corner 3
      G30 P3 X60 Y200 Z-99999 S4 ; probe corner 4 
      M402 ; retract probe
      
      fcwiltundefined 1 Reply Last reply Reply Quote 0
      • JRCLundefined JRCL marked this topic as a question
      • fcwiltundefined
        fcwilt @JRCL
        last edited by

        @jrcl

        I don't understand your homeall.g file.

        • You call macros to home V, Y, Z, U but you code the homing of X.
        • You have G29 S0 - why is that there?
        • What are axis V and U used for?

        I call macros in my homeall.g file - in fact I have nothing but macro calls so I don't duplicate any code that is already in homex.g, homey.g, homez.g, etc.

        If you have a Z min endstop the simplest approach is to home Z first. Then you don't have to have the various G1 H2 Z# commands to raise/lower Z when homing X, Y, etc.

        I don't understand your bed.g file.

        • Are you trying to do Manual or Automatic Bed Leveling (auto requires multiple Z steppers)?
        • What type of Z probe are you using?

        Once we have those answers we can move forward.

        Frederick

        Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

        JRCLundefined 1 Reply Last reply Reply Quote 1
        • JRCLundefined
          JRCL @fcwilt
          last edited by

          @fcwilt Yes I have some additional functions the machine performs that aren't exactly cartesian based after the machine finishes printing. V axis is far away from the "printer assembly" portion of the machine so I would say ignore that and U actually controls the angle of Y-axis relative to X in the XY plane. Between these things, the movements in my homeall file are indeed odd but other than probing and my Z, everything is doing what I want it to be doing in homeall.g

          I used to call all macros in my home but now I have to do these odd movements. Z has to home twice for again, what would be difficult reasons to explain in a post.

          I'm trying to do ABL but with a BL Touch. Z min is just a microswitch.

          fcwiltundefined JRCLundefined 2 Replies Last reply Reply Quote 0
          • fcwiltundefined
            fcwilt @JRCL
            last edited by fcwilt

            @jrcl

            Anytime you create or load a height map you need to first set the Z=0 Datum which is easily done by moving the Z probe to the center of the bed and then doing a G30.

            If the Z probe settings in G31 are correct then the Z=0 position of the printer will be correctly set.

            Then you can create or load a height map and all should be fine.

            When do you execute the G32 needed to run the bed.g file?

            Since you are using a BLTouch you do not need the M401/M402 commands in the bed.g file as the firmware handles that automatically.

            Since you are doing Automatic Bed Leveling you need to be sure the Z=0 Datum is set, at some point, after the leveling is complete. To keep things simple I do it at the end of the bed.g just to be sure it is done.

            Also your bed.g file is only doing one pass at leveling the bed. This may not be enough.

            Here is how I do it which will run up to 5 leveling passes - which have always been enough for my printer - usually one or two do the job. Of course, the G30 commands need to use values suitable for your printer.

            This is from my bed.g file:

            while true
              ; run leveling pass
            
              ; --- probe near bed corners ---
            
              G30 P0 X-140 Y-90 Z-99999    ; LF
              G30 P1 X-140 Y90  Z-99999    ; LR
              G30 P2 X140  Y90  Z-99999    ; RR
              G30 P2 X140  Y-90 Z-99999 S4 ; RF 
            
              ; check results - exit loop if results are good
            
              if move.calibration.initial.deviation < 0.02
                break
            
              ; check pass limit - abort if pass limit reached
            
              if iterations = 5
                M291 P"Bed Leveling Aborted" R"Pass Limit Reached"
                abort "Bed Leveling Aborted - Pass Limit Reached"
            
            ; --- finish up ---
            
            ; --- set Z=0 datum which can be affected by leveling ---
            
            M98 P"center_probe.g"           ; position for probing
            
            G30                             ; do single probe which sets Z to trigger height of Z probe
            

            Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

            JRCLundefined 1 Reply Last reply Reply Quote 2
            • JRCLundefined
              JRCL @JRCL
              last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • JRCLundefined
                JRCL @fcwilt
                last edited by JRCL

                @fcwilt Oh I thought Z=0 datum was done before ABL so that it knows how high off to come to probe in the first place. I think thats part of my problem too then. I'll make sure to remove the M401/M402 command as well.

                G31 commands are correct and Z height for it was determined using the "Checking the Trigger Height" Section

                So you don't use mesh.g at all either? Either way that is a helpful outline. So in your case is the only time the Z-Min end-stop used is in homing z?

                fcwiltundefined 1 Reply Last reply Reply Quote 0
                • fcwiltundefined
                  fcwilt @JRCL
                  last edited by

                  @jrcl said in Correct Configuration for Z Min Stop and Z Probe:

                  @fcwilt Oh I thought Z=0 datum was done before ABL so that it knows how high off to come to probe in the first place. I think thats part of my problem too then. I'll make sure to remove the M401/M402 command as well.

                  G31 commands are correct and Z height for it was determined using the "Checking the Trigger Height" Section

                  So you don't use mesh.g at all either? Either way that is a helpful outline. So in your case is the only time the Z-Min end-stop used is in homing z?

                  I do use mesh.g. One thing I do that is different is to keep like things together. So in my mesh.g file I have all the commands that are needed to create a height map, including commands like the M557 that are commonly put in config.g

                  I use a Z min endstop for Z homing on all my printers. It allows homing of Z first and getting it clear of the bed so you can home X and Y without the G1 H2 moves typically used to lift/drop Z for clearance when homing X and Y.

                  Frederick

                  Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                  JRCLundefined 2 Replies Last reply Reply Quote 1
                  • JRCLundefined
                    JRCL @fcwilt
                    last edited by

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • JRCLundefined
                      JRCL @fcwilt
                      last edited by JRCL

                      @fcwilt I'm so stupid. I constantly call Mesh Compensation, ABL in my head, and I did it again on here, arg! I am manually leveling with Z min and then just using BL Touch to probe.

                      My bed.g now looks like this, I moved M557 here so I wouldn't have to reset my board when I'm playing around with those values. I'm still running high when the print starts. I just run homeall.g then bed.g to start my actual print gcode file. However I'm still running high, maybe I need to run through the MBLA again? or redo checking my trigger height.

                      ;bed.g
                      G1 X135 Y118 Z12				; position in center of bead for probing
                      G30                             ; do single probe which sets Z to trigger height of Z probe
                      M557 X5:150 Y10:150 P3							; define probing grid
                      G29 S0							; enable mesh compensation 
                      
                      fcwiltundefined 1 Reply Last reply Reply Quote 0
                      • fcwiltundefined
                        fcwilt @JRCL
                        last edited by

                        @jrcl said in Correct Configuration for Z Min Stop and Z Probe:

                        @fcwilt I'm so stupid. I constantly call Mesh Compensation, ABL in my head, and I did it again on here, arg! I am manually leveling with Z min and then just using BL Touch to probe.

                        My bed.g now looks like this, I moved M557 here so I wouldn't have to reset my board when I'm playing around with those values. I'm still running high when the print starts. I just run homeall.g then bed.g to start my actual print gcode file. However I'm still running high, maybe I need to run through the MBLA again? or redo checking my trigger height.

                        ;bed.g
                        G1 X135 Y118 Z12				; position in center of bead for probing
                        G30                             ; do single probe which sets Z to trigger height of Z probe
                        M557 X5:150 Y10:150 P3							; define probing grid
                        G29 S0							; enable mesh compensation 
                        

                        Let's see if we can clear things up.

                        Mesh Bed Compensation is the feature that uses a height map to adjust the Z position during printing to try and compensate for bed irregularities.

                        The suggested place to create the needed height map is in mesh.g.

                        The code above from bed.g should work fine but let's move it into mesh.g which is the best place for it.

                        You have a G32 somewhere which is invoking bed.g - just change that to G29 and it will invoke mesh.g - and everything will be in sync.

                        You have specified in the M557 a 3 x 3 grid which is only 9 points. Now if your bed is nice and regular that may work fine. I have beds which are rather "bumpy" and need grids of 200 to 400 points.

                        If you want to find out how "bumpy" your bed is just create a height map with 400 points and look at in the DWC height map viewer. It will take sometime to create a 400 point height map so be patient. After viewing the height map you can decided just how many points you need for good results and use appropriate values in your mesh.g file.

                        Since I need a large number of points I create my height map using a macro I invoke manually from the DWC. I then use this height map for all subsequent printings. From time to time I create the height map again just to be safe.

                        Frederick

                        Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                        JRCLundefined 1 Reply Last reply Reply Quote 2
                        • JRCLundefined
                          JRCL @fcwilt
                          last edited by JRCL

                          @fcwilt Swapped that all to mesh.g and called G29 instead. Redid, MBLA, Z Trigger height, and ran a 100 point to start. Definitely yield improved results and is functioning correctly. Just some fine-tuning and I think I will eventually implement something like a 400-point height map once more things on the machine are finalized. Thanks for the help as always! Your explanations are always a nice balance of basic enough to fully understand but not patronizingly so 🙂

                          fcwiltundefined 1 Reply Last reply Reply Quote 3
                          • JRCLundefined JRCL has marked this topic as solved
                          • fcwiltundefined
                            fcwilt @JRCL
                            last edited by

                            @jrcl

                            Always glad to be of help when I can. I remember starting out with my first 3D printer and having to climb the learning curve. Pretty soon it will all be second nature to you.

                            Frederick

                            Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

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