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

Detecting Z-Probe Pickup on move command

Scheduled Pinned Locked Moved
Gcode meta commands
5
57
2.5k
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
    sinned6915 @fcwilt
    last edited by sinned6915 2 Oct 2021, 18:21 10 Feb 2021, 18:21

    @fcwilt EXACTLY!
    probe not attached P=1000
    probe attached, P=0

    undefined 1 Reply Last reply 10 Feb 2021, 18:22 Reply Quote 0
    • undefined
      fcwilt @sinned6915
      last edited by 10 Feb 2021, 18:22

      @sinned6915 said in Detecting Z-Probe Pickup on move command:

      @fcwilt EXACTLY!
      probe not attached P=1000
      probe attached, P=0

      So this switch is currently configured as a Z probe?

      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

      undefined 1 Reply Last reply 10 Feb 2021, 18:24 Reply Quote 0
      • undefined
        sinned6915 @fcwilt
        last edited by sinned6915 2 Oct 2021, 18:25 10 Feb 2021, 18:24

        @fcwilt yes, that is what i attempted with my M558 command. syntax and comments below

        M558 K0 P5 C"^zprobe.in" H8 R0.5 F200 T9000 A1 S0.03
        ; K0 for probe 0, P5 for NC switch, C for input pin,
        ; ^ for enabling the native pullup resistor on Duet2 hardware running RRF3
        ; H dive height of 8mm, F300 probing speed 6mm/sec, T9000 travel speed 150mm/sec,
        ; A3 number of probes 1, S0.01 max tolerance of 0.01
        undefined 1 Reply Last reply 10 Feb 2021, 18:35 Reply Quote 0
        • undefined
          fcwilt @sinned6915
          last edited by 10 Feb 2021, 18:35

          @sinned6915 said in Detecting Z-Probe Pickup on move command:

          @fcwilt yes, that is what i attempted with my M558 command=

          Just for your information you should be able swap the values returned by the probe, open versus closed, by adding a ! character to the beginning of the pin name.


          Some folks home Z using Z endstop switches (I'm one of them). Some home Z using a Z probe.

          When homing with endstop switches you use a G1 H1 command.

          When homing with a Z probe you use a G30 command.

          The important thing to note is that in both cases movements stops when the endstop switch or the Z probe is activated.

          When homing using a G1 H1 command you have control over the direction of the move. So you can move toward an endstop switch at Z min or one at Z max.

          When homing with a G30 command I think the direction is always going to be toward Z min.


          So have you considered configuring this switch NOT as a Z probe but as a Z endstop switch and trying to use a G1 H1 command?

          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

          undefined 1 Reply Last reply 10 Feb 2021, 18:49 Reply Quote 0
          • undefined
            T3P3Tony administrators
            last edited by T3P3Tony 2 Oct 2021, 18:48 10 Feb 2021, 18:48

            while sensors.probes[0].value[0]=1000

            so i have tested the logic using this macro:

            while sensors.probes[0].value[0]=1000
            G91
            G1 Z0.01
            G90
            echo iterations
            if iterations=10
            break

            With the following result when I go slightly past the Z trigger point (which i need to do to get this transition

            M98 P"0:/macros/00_test"
            0
            1
            2
            3
            4
            5
            6
            ok

            So i would test your while loop. You can make a that just does

            echo sensors.probes[0].value[0]
            

            and the manually move the z probe into a triggered/not triggered status to confirm it all works as you expect it.

            www.duet3d.com

            undefined 1 Reply Last reply 10 Feb 2021, 18:58 Reply Quote 0
            • undefined
              sinned6915 @fcwilt
              last edited by 10 Feb 2021, 18:49

              @T3P3Tony here is a video of trying to execute the loop meta command.
              https://photos.app.goo.gl/DYYfcTEyFbJhUGGw5

              when i first tryed to run it, it complained that G0/G1 axis not sufficiently homed so I overrode it with M564 S0 H0.
              then the bed moved and stopped. at that point the system appeared to be un-responsive. when I hit the STOP button PanelDue, I got a couple of error messages.

              probe type- this is one thing that confused me.
              https://duet3d.dozuki.com/Wiki/Connecting_a_Z_probe#Section_Mode_Num_5

              but there was something that I thought I read that was RRF3 specific that said it was not case and I had to use Mode 4 instead if I wanted NO and it had to be on E0 endstop circuit. I can not find it now, but I am trying to remember if it was RRF3 or Duet3 specific.

              @fcwilt I think you might be right abtou G1 vs. G30 . I think that to meake it work though, I need to redefine the probe to be active LOW so that it beleives its 'triggered' when the circuit comepletes.

              undefined 1 Reply Last reply 10 Feb 2021, 19:51 Reply Quote 0
              • undefined
                T3P3Tony administrators
                last edited by 10 Feb 2021, 18:53

                try a loop with just an echo of the switch state and see if it reports the state change as you expect when you manually trigger it

                www.duet3d.com

                1 Reply Last reply Reply Quote 0
                • undefined
                  sinned6915 @T3P3Tony
                  last edited by 10 Feb 2021, 18:58

                  @T3P3Tony said in Detecting Z-Probe Pickup on move command:

                  so i have tested the logic using this macro:

                  are you running that macro from the console on DWC or via terminal and USB cable?

                  is RRF reporting back the iteration values line by line as it runs?

                  I am trying to understand the differnce between the echo statement you posted and what I was using previously -

                  M409 K"sensors.probes[0].value"

                  undefined 1 Reply Last reply 10 Feb 2021, 19:02 Reply Quote 0
                  • undefined
                    T3P3Tony administrators @sinned6915
                    last edited by T3P3Tony 2 Oct 2021, 19:38 10 Feb 2021, 19:02

                    @sinned6915 I am running it as a macro from within DWC (i.e. it is saved in a macro file not entered into the console line by line)

                    There is a limitation on how DWC report macro outputs when using DSF on SBC so the output of the macro is not reported until it completes, but you can see the Z axis raising by 0.01 each time it loops

                    www.duet3d.com

                    undefined 1 Reply Last reply 10 Feb 2021, 19:04 Reply Quote 0
                    • undefined
                      sinned6915 @T3P3Tony
                      last edited by 10 Feb 2021, 19:04

                      @T3P3Tony should it matter that I am on Duet2 Ethernet?

                      1 Reply Last reply Reply Quote 0
                      • undefined
                        sinned6915
                        last edited by sinned6915 2 Oct 2021, 19:23 10 Feb 2021, 19:21

                        @T3P3Tony I had to increase the iterations to be able to catch it. i did not think to chage the feedrate, only the iterations.

                        I had to issue a M564 command to overide movement before home, it gave me an error message otherwise.

                        while sensors.probes[0].value[0]=1000
                        G91
                        G1 Z0.01
                        G90
                        echo sensors.probes[0].value[0]
                        echo iterations
                        if iterations=100
                        break

                        i manually deployed the probe. once the probe snapped into place, the bed stopped moving.
                        The console showed 41 iterations the system reported a probe value of 500, where before it was consistently 1000.

                        now i am trying to reconcile how this might be different than the original -

                        while sensors.probes[0].value[0]=1000
                        G1 Z-0.5 F360

                        is it the break command at the end? I read the break to apply to the if iterations statement.

                        EDIT: I am wondering if changing to probe type 8 might be better being unfiltered.

                        undefined 1 Reply Last reply 10 Feb 2021, 19:39 Reply Quote 0
                        • undefined
                          T3P3Tony administrators @sinned6915
                          last edited by 10 Feb 2021, 19:39

                          @sinned6915 the break is only called if the if statement evaluates to true. If you only got to 41 iterations 41 then the while loop evaluated to false and ended before the if statement evaluated to true.

                          Using M564 makes sense if you have your bed unable to move below 0.

                          The 500 report for value, if only for a brief moment could just be the probe moving between the two levels.

                          Either probe type 5 or 8 should work in this case. 5 might be slightly slower to respond but i don't think that is the root cause of the issue. Also no it does not matter that you are on Duet 2.

                          Try much smaller movements. Don't forget that the move you send will complete, maybe 0.5mm is too much.

                          www.duet3d.com

                          1 Reply Last reply Reply Quote 0
                          • undefined
                            fcwilt @sinned6915
                            last edited by 10 Feb 2021, 19:51

                            @sinned6915 said in Detecting Z-Probe Pickup on move command:

                            @fcwilt I think you might be right abtou G1 vs. G30 . I think that to meake it work though, I need to redefine the probe to be active LOW so that it beleives its 'triggered' when the circuit comepletes.

                            So you are determined to make it work using the switch as a probe and doing a while loop?

                            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 0
                            • undefined
                              dc42 administrators
                              last edited by 10 Feb 2021, 22:22

                              @sinned6915, if you want to use a G1 command in a while loop with a test to stop movement, you will need to use M400 after the G1 command. Otherwise the G1 commands will be put in the move queue and will not happen instantly. That is why movement continues after the switch is triggered.

                              Alternatives are to configure the switch as an endstop switch and then use a G1 H1 move; or configure the switch as a Z probe and use a G30 move.

                              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 10 Feb 2021, 22:43 Reply Quote 1
                              • undefined
                                fcwilt @dc42
                                last edited by 10 Feb 2021, 22:43

                                @dc42 said in Detecting Z-Probe Pickup on move command:

                                Alternatives are to configure the switch as an endstop switch and then use a G1 H1 move; or configure the switch as a Z probe and use a G30 move.

                                Bless you, good sir. Bless 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

                                undefined 1 Reply Last reply 10 Feb 2021, 23:56 Reply Quote 0
                                • undefined
                                  sinned6915 @fcwilt
                                  last edited by sinned6915 2 Nov 2021, 00:04 10 Feb 2021, 23:56

                                  @dc42- the many movements filling the que and then clearing it out makes sense.

                                  i think i discovered that by accident earlier too. with really small small steps, like Z=-0.01 it will move and 'softly' pickup the probe and stop.
                                  when I change to a valuue of Z-0.1 i would still overrun it. Then i threw in an M400 and the behavior really changed.

                                  @fcwilt I have been struggling the z-endstop logic all afternoon. as i have tried to show you, I already HAVE the switch set as both endstop and as probe, and I tried using the G1 and G31 commands before I got to this point. I have not doubted you, I just have not ben able to make it work. don't take it peronsally.

                                  M574 Z1 S2 ; configure Z-probe endstop for low end on Z
                                  and
                                  M558 K0 P5 C"^zprobe.in" H8 R0.5 F200 T9000 A1 S0.03

                                  it seems that to make it work, I HAVE to change the probe logic, and that is where I am getting tripped up. it also has to get changed back to probe the bed.

                                  https://duet3d.dozuki.com/Wiki/Gcode#Section_M558_in_RepRapFirmware_Num_3

                                  is where the RRF3 specific stuff was hidden at.

                                  neither method is foolproof. as an engineer my brain is thinking not 'if this bad thing happens' but more 'WHEN this bad thing happens', which will cause the least amount of carnage.

                                  undefined 2 Replies Last reply 11 Feb 2021, 00:04 Reply Quote 0
                                  • undefined
                                    fcwilt @sinned6915
                                    last edited by 11 Feb 2021, 00:04

                                    @sinned6915 said in Detecting Z-Probe Pickup on move command:

                                    @fcwilt I have been struggling the z-endstop logic all afternoon. as i have tried to show you, I alrady HAVE the switch set as both endstop and as probe, and I tried using the G1 and G31 commands before I got to this point. I am have not doubted you, I just have not ben able to make it work. don't take it peronsally.

                                    I cannot find the configuration commands that set the switch to be an Z endstop.

                                    Can you guide me to them?

                                    Thanks.

                                    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

                                    undefined 1 Reply Last reply 11 Feb 2021, 00:28 Reply Quote 0
                                    • undefined
                                      fcwilt @sinned6915
                                      last edited by 11 Feb 2021, 00:07

                                      @sinned6915 said in Detecting Z-Probe Pickup on move command:

                                      it seems that to make it work, I HAVE to change the probe logic, and that is where I am getting tripped up. it also has to get changed back to probe the bed.

                                      You should not have to do that.

                                      Once the probe displays 1000 in the DWC when it is activated and 0 when it is not you have the correct settings for all uses as a probe.

                                      Unless you have two probes - then you can configure each one separately to obtain the correct values.

                                      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 0
                                      • undefined
                                        sinned6915 @fcwilt
                                        last edited by sinned6915 2 Nov 2021, 01:15 11 Feb 2021, 00:28

                                        @fcwilt said in Detecting Z-Probe Pickup on move command:

                                        I cannot find the configuration commands that set the switch to be an Z endstop.

                                        I am reading the command reference for M574. There is a difference in the application in RRF2 an 3.

                                        https://duet3d.dozuki.com/Wiki/Gcode#Section_M574_RepRapFirmware_Num_3

                                        and the Snnn options -

                                        1 = switch-type (eg microswitch) endstop input,
                                        2 = Z probe (when used to home an axis other than Z),
                                        3 = single motor load detection,
                                        4 = multiple motor load detection (see Notes).

                                        M574 says if you use the swtich as active low, invert it by prefixing the pin name with !.
                                        eg: P"!xstop"

                                        RRF3 introduced the C parameter to define the input pin, and the M558 notes for RRF3 says to invert the input, prefix the C with !.
                                        eg: !C

                                        EDIT: The other issue is that the logic and threshold numbers change. Changing the probe type inverts the probe value. I was under the impression that 1000 was high and 0 was low, but it seems to be more realted to the state of the probe.

                                        alt text

                                        alt text

                                        1 Reply Last reply Reply Quote 0
                                        • undefined
                                          fcwilt
                                          last edited by 11 Feb 2021, 01:43

                                          @sinned6915 said in Detecting Z-Probe Pickup on move command:

                                          M574 Z1 S2 ; configure Z-probe endstop for low end on Z

                                          You posted this earlier on...

                                          M574 Z1 S2 ; configure Z-probe endstop for low end on Z

                                          From the documentation you pasted...

                                          2 = Z probe (when used to home an axis other than Z),

                                          Notice the other than Z

                                          Again from the documentation you pasted...

                                          1 = switch-type (eg microswitch) endstop input,

                                          To use that switch as an Z endstop you need an M574 like this.

                                          M574 Z1 S1 C"name_of_pin_switch_is_connected_to"

                                          You also may need the ^ and/or ! character to get the endstop state to match the switch state.

                                          Is this switch used for some other purpose - you mention probing the bed? I was thinking this switch was mounted to the frame but it seems it may be mounted to the gantry?

                                          I don't think the same input can be an endstop input and a z probe input at the same time. But I need to verify that. In any case re-configuring it depending on what you need to do that that moment is perfectly fine and not uncommon.

                                          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

                                          undefined 2 Replies Last reply 11 Feb 2021, 02:20 Reply Quote 0
                                          28 out of 57
                                          • First post
                                            28/57
                                            Last post
                                          Unless otherwise noted, all forum content is licensed under CC-BY-SA