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

    Z configuration for sensors

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    6
    34
    1.3k
    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.
    • fcwiltundefined
      fcwilt @Timothee Leblond
      last edited by

      @Timothee-Leblond

      For the sake of simplicity and not duplicating code this is how I code homeALL.g.

      M98 P"homeZ.g"
      M98 P"homeY.g"
      M98 P"homeX.g"
      

      You can change the order as best for your printer.

      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

      Timothee Leblondundefined 1 Reply Last reply Reply Quote 0
      • Timothee Leblondundefined
        Timothee Leblond @fcwilt
        last edited by

        @fcwilt
        Thanks for the tip, I'll do that in the future.

        But I'm not sure it will solve my problem right?

        fcwiltundefined dc42undefined 2 Replies Last reply Reply Quote 0
        • fcwiltundefined
          fcwilt @Timothee Leblond
          last edited by

          @Timothee-Leblond said in Z configuration for sensors:

          @fcwilt
          Thanks for the tip, I'll do that in the future.

          But I'm not sure it will solve my problem right?

          No, nothing to do with your problem - it just makes things a bit simpler in that if you make a change to homing code for one axis (X Y or Z) you don't need to make the same change to homeALL.g

          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

          Timothee Leblondundefined 1 Reply Last reply Reply Quote 0
          • Timothee Leblondundefined
            Timothee Leblond @fcwilt
            last edited by

            @fcwilt

            This is smart, thank you though!

            1 Reply Last reply Reply Quote 0
            • Phaedruxundefined
              Phaedrux Moderator
              last edited by

              I'm kind of at a loss for your probe issue. It's confusing why M401 would work to deploy the pin manually but not during the homing move.

              Have you tried manually positioning he probe at the center of the bed and then sending M401 and G30 to deploy and start probing?

              Z-Bot CoreXY Build | Thingiverse Profile

              1 Reply Last reply Reply Quote 0
              • dc42undefined
                dc42 administrators @Timothee Leblond
                last edited by dc42

                @Timothee-Leblond what happens if you do the following:

                1. Position the probe a long way above the bed.
                2. Either home X and Y, or send e.g. G92 X0 Y0 to make RRF consider that X and Y have been homed.
                3. Send M401 and check that the probe deploys.
                4. Send G30. Before the probe pin touches the bed, manually push it up to trigger the probe.
                5. If the probing move doesn't stop, turn the printer off to prevent the probe crashing into the bed.

                If at step 4 RRF reports that the probe is already triggered at the start of the probing move, that means you need to use C"io6.in" instead of C"!io6.in" . Either way, don't include the ^ character because that will reduce the noise margin.

                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

                Timothee Leblondundefined 1 Reply Last reply Reply Quote 0
                • Timothee Leblondundefined
                  Timothee Leblond @dc42
                  last edited by Timothee Leblond

                  @dc42

                  I've been following your steps:

                  1. manually placed the probe at the center
                  2. Used G92 X0 Y0 as Z homing does not work after I individually homed XY.
                    If I try homing Z without G92, it says: "Error: G30: Insufficient axes homed for bed probing."
                  3. Using M401 works well deploying the probe
                  4. Manually pushing the probe after G30 works well.

                  However here are my problems now:
                  -Z homing doesn't not work alone as It always sends the error mentioned.
                  -Sending move commands to Z always gives the same error.
                  -When homed, sending move commands to Y does not work well (bumping against wall with positive integers, and only accepts -10 maximum with negative ones.
                  -After homing all, sending move commands to Z works but stops after a bit making a noise
                  -Homing all works but makes a lot more noise than homing X and Y individually.
                  -When homing all axes, the extruder is NOT going to the center of the bed before probing...

                  jay_s_ukundefined 1 Reply Last reply Reply Quote 0
                  • jay_s_ukundefined
                    jay_s_uk @Timothee Leblond
                    last edited by

                    @Timothee-Leblond you have a G1 Z move in your homing file. you can't move an axis if you haven't homed it

                    Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

                    Timothee Leblondundefined 1 Reply Last reply Reply Quote 0
                    • Timothee Leblondundefined
                      Timothee Leblond @jay_s_uk
                      last edited by

                      @jay_s_uk

                      Indeed, but I cannot home Z. I always have the Error: Insufficient axes homed for bed probing.

                      jay_s_ukundefined 1 Reply Last reply Reply Quote 0
                      • jay_s_ukundefined
                        jay_s_uk @Timothee Leblond
                        last edited by

                        @Timothee-Leblond exactly. You're trying to move an unhomed axis using a move that requires a homed axis before you have homed it. I'm not surprised it's failing.

                        You need to go through your home z file and understand what each line is doing

                        Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

                        Timothee Leblondundefined 1 Reply Last reply Reply Quote 0
                        • Timothee Leblondundefined
                          Timothee Leblond @jay_s_uk
                          last edited by

                          @jay_s_uk

                          Okay, now I get it.

                          Now it's moving but I cannot figure out why it's not moving to the center.
                          Even replacing the following variables by simple G1 X150 Y150 do not work:

                          var xCenter = move.compensation.probeGrid.mins[0] + (move.compensation.probeGrid.maxs[0] - move.compensation.probeGrid.mins[0]) / 2 - sensors.probes[0].offsets[0]
                          ;var yCenter = move.compensation.probeGrid.mins[1] + (move.compensation.probeGrid.maxs[1] - move.compensation.probeGrid.mins[1]) / 2 - sensors.probes[0].offsets[1]
                          

                          I mean, it randomly works, sometimes yes, sometimes not...

                          gloomyandyundefined 1 Reply Last reply Reply Quote 0
                          • gloomyandyundefined
                            gloomyandy @Timothee Leblond
                            last edited by

                            @Timothee-Leblond Make sure you are in absolute mode when executing the move to the centre of the bed. In your homeall.g you posted above you have:

                            var xCenter = move.compensation.probeGrid.mins[0] + (move.compensation.probeGrid.maxs[0] - move.compensation.probeGrid.mins[0]) / 2 - sensors.probes[0].offsets[0]
                            var yCenter = move.compensation.probeGrid.mins[1] + (move.compensation.probeGrid.maxs[1] - move.compensation.probeGrid.mins[1]) / 2 - sensors.probes[0].offsets[1]
                            G91 ; relative positioning
                            G1 X{var.xCenter} Y{var.yCenter} F1000 ; go to bed centre
                            G90 ; absolute positioning
                            M401
                            G30 ; probe the bed
                            M402
                            

                            So the move in that case will be using relative coordinates.

                            As was mentioned above it is much easier to just call your homex, homey homez macros from homeall it keeps things simple.

                            Timothee Leblondundefined 1 Reply Last reply Reply Quote 0
                            • Timothee Leblondundefined
                              Timothee Leblond @gloomyandy
                              last edited by

                              @gloomyandy

                              Thanks for your help!
                              Following your advice, I'm now calling my home macros in my homeall.g.
                              However, after changing homez according to your suggestion, I still have problems. In the following file, the printer is sending the bed on the low end (towards me) although is should go in the high end. Then, it is probing without moving to the center (X not moving). What is weird is that home XY both work as expected.

                              ; homez.g
                              ; increase Z
                              
                              G91                                    ; relative positioning
                              G1 H2 Z5                               ; move Z relative to current position to avoid dragging nozzle over the bed
                              G90                                    ; absolute positioning
                              
                              ; home Z
                              ; NOTE: The following XY position is determined from the probe grid defined in the next section
                              var xCenter = move.compensation.probeGrid.mins[0] + (move.compensation.probeGrid.maxs[0] - move.compensation.probeGrid.mins[0]) / 2 - sensors.probes[0].offsets[0]
                              var yCenter = move.compensation.probeGrid.mins[1] + (move.compensation.probeGrid.maxs[1] - move.compensation.probeGrid.mins[1]) / 2 - sensors.probes[0].offsets[1]
                              G1 X{var.xCenter} Y{var.yCenter} F6000 ; go to bed centre
                              M401
                              G30                                    ; probe the bed
                              M402 ; retract probe
                              

                              In my config.g, I have the following. M574 Y2 S3 should indicate to home in the high end.

                              ; Endstops
                              M574 X1 S3                            ; configure X axis endstop
                              M574 Y2 S3                            ; configure Y axis endstop
                              M574 Z1 S2                            ; configure Z axis endstop
                              M915 X Y R0 F0
                              

                              Home X and home Z work now:

                              ; homex.g
                              ; called to home the X axis
                              ;
                              ; generated by RepRapFirmware Configuration Tool v3.5.8 on Tue Dec 10 2024 15:03:23 GMT-0500 (Eastern Standard Time)
                              
                              ; increase Z
                              G91 ; relative positioning
                              G1 H2 Z5 ; move Z relative to current position to avoid dragging nozzle over the bed
                              G90 ; absolute positioning
                              M400
                              M913 X70 Y70 ; drop motor current to 40% -> for sensorless homing
                              M400
                              
                              ; home X
                              G91 ; relative positioning
                              var maxTravel = move.axes[0].max - move.axes[0].min + 5 ; calculate how far X can travel plus 5mm
                              G1 H1 X{-var.maxTravel} F3000                            ; coarse home in the -X direction
                              G1 X5 F3000                                             ; move back 5mm
                              G1 H1 X{-var.maxTravel} F1000                            ; fine home in the -X direction
                              G90 ; absolute positioning
                              
                              ; decrease Z again
                              G91 ; relative positioning
                              G1 H2 Z-5 F6000 ; move Z relative to current position
                              G90 ; absolute positioning
                              
                              M400 ; Wait for current moves to finish
                              M913 X100 Y100 ; return current to 100% -> for sensorless homing
                              M400 ; Wait for current moves to finish
                              
                              ; homey.g
                              ; called to home the Y axis
                              ;
                              ; generated by RepRapFirmware Configuration Tool v3.5.8 on Tue Dec 10 2024 15:03:23 GMT-0500 (Eastern Standard Time)
                              
                              ; increase Z
                              G91 ; relative positioning
                              G1 H2 Z5 ; move Z relative to current position to avoid dragging nozzle over the bed
                              G90 ; absolute positioning
                              
                              M400 ; Wait for current moves to finish
                              M913 X70 Y70 ; drop motor current to 70% -> for sensorless homing
                              M400
                              
                              ; home Y
                              G91                                                     ; relative positioning
                              var maxTravel = move.axes[1].max - move.axes[1].min + 5 ; calculate how far Y can travel plus 5mm
                              G1 H1 Y{var.maxTravel} F3000                             ; coarse home in the +Y direction
                              G1 Y-5 F3000                                            ; move back 5mm
                              G1 H1 Y{var.maxTravel} F2000                             ; fine home in the +Y direction
                              G90                                                     ; absolute positioning
                              
                              ; decrease Z again
                              G91 ; relative positioning
                              G1 H2 Z-5 F6000 ; move Z relative to current position
                              G90 ; absolute positioning
                              
                              M400 ; Wait for current moves to finish
                              M913 X100 Y100 ; return current to 100% -> for sensorless homing
                              M400 ; Wait for current moves to finish
                              

                              Would you have an idea?

                              gloomyandyundefined 1 Reply Last reply Reply Quote 0
                              • gloomyandyundefined
                                gloomyandy @Timothee Leblond
                                last edited by

                                @Timothee-Leblond Sorry it is not very clear to me what is happening. Perhaps you could make a short video of what you are seeing. I suggest that you home x then home y then home z and video all three homing operations. That will hopefully make it easier to work out what is going on. Oh and you might also want to add something like:

                                echo "X center", var.xCenter, "y center", var.yCenter
                                

                                This should display the values in your DWC console when you run homez.g, Just to check to make sure that the x, y values are being calculated correctly.

                                Timothee Leblondundefined 2 Replies Last reply Reply Quote 0
                                • Timothee Leblondundefined
                                  Timothee Leblond @gloomyandy
                                  last edited by Timothee Leblond

                                  @gloomyandy

                                  Here is the answer from echo: X center -0.5 y center -0.5
                                  I forgot to mention that my homez had been done through the RRF config tool.

                                  And here is the video:
                                  IMG_5972.mp4

                                  What you see in the video:
                                  -Homing X and Y work
                                  -Homing Z is sending the bed in the wrong direction and probing is not at bed center.

                                  I also have another problem that is not visible on the video. I can't raise the Z axis more than 10 cm above the bed. The motors jam and make a lot of noise.

                                  Hopefully you'll see what I mean. Let me know if you need further details.

                                  1 Reply Last reply Reply Quote 0
                                  • Timothee Leblondundefined
                                    Timothee Leblond @gloomyandy
                                    last edited by Timothee Leblond

                                    @gloomyandy

                                    UPDATE:

                                    I tried tweaking the var commands it seems that the following are much better:

                                    var xCenter = (move.axes[0].min + move.axes[0].max) / 2 - sensors.probes[0].offsets[0]
                                    var yCenter = (move.axes[1].min + move.axes[1].max) / 2 - sensors.probes[0].offsets[1]
                                    

                                    At least, X and Y are now moving to a point on the bed. It is not the center but maybe it comes from the offset settings.. Do you know how to deal with this? Would you also have an idea why I cannot raise Z much?

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

                                      @Timothee-Leblond said in Z configuration for sensors:

                                      UPDATE:

                                      I tried tweaking the var commands it seems that the following are much better:

                                      var xCenter = (move.axes[0].min + move.axes[0].max) / 2 - sensors.probes[0].offsets[0]
                                      var yCenter = (move.axes[1].min + move.axes[1].max) / 2 - sensors.probes[0].offsets[1]
                                      

                                      At least, X and Y are now moving to a point on the bed. It is not the center but maybe it comes from the offset settings.. Do you know how to deal with this? Would you also have an idea why I cannot raise Z much?

                                      The current endstop configuration behavior is that when endstop is triggered during a G1 H1 move the current axis position is set to axis min or axis max, depending on where the endstop is located.

                                      The problem for me has always been is that the endstops are never located so that they trigger exactly at axis min or axis max.

                                      So for an X axis with min of -100 and max of 100 the G1 H1 position may end up being X=100 when the endstop actually triggered at X=90.

                                      I end up have to adjust things in my homing files by doing a G91 G1 move that results in the axis being at the center of the bed and then doing a G92 X0 or G92 Y0 so that the logical position matches the physical position.

                                      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

                                      Timothee Leblondundefined 1 Reply Last reply Reply Quote 0
                                      • Timothee Leblondundefined
                                        Timothee Leblond @fcwilt
                                        last edited by

                                        @fcwilt

                                        Hi Frederick,

                                        I like your approach. Could you please show a test file?

                                        Thank you,

                                        TIM

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

                                          @Timothee-Leblond said in Z configuration for sensors:

                                          @fcwilt

                                          Hi Frederick,

                                          I like your approach. Could you please show a test file?

                                          Thank you,

                                          TIM

                                          Assume the X endstop is at max end and triggers exactly at X=90 and the axis range is -100 to 100.

                                          G91              ; relative moves
                                          G1 H1 X210 F6000 ; fast move to endstop
                                          G1 X-20          ; backoff a bit            
                                          G1 H1 X25 F300   ; slow move to endstop
                                          ; now at this point the logical position is X=100 even though the physical position is X=90
                                          G1 X-90          ; move to physical X=0
                                          G92 X0           ; sync logical and physical positions
                                          

                                          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 0
                                          • First post
                                            Last post
                                          Unless otherwise noted, all forum content is licensed under CC-BY-SA