• 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 @OwenD
    last edited by sinned6915 2 Oct 2021, 17:05 10 Feb 2021, 06:51

    @OwenD thank you for your help. I see where I made the indentation mistakes. I apprciate you cleaning up my code and reposting it. I'm REALLY close now, I think a couple of tweakes will do it.

    1. I rewired the steppers so that all the Z motors are on the Duet board. I enede up putting X & Y on the Duex board. It gets a little fussy becasue reading the RRF FW limitations, the extruder, associated heater and thermistor that go together also have to be on the SAME board.

    I will put config.g snips at the end in case someone else needs to see what I did.

    1. I did confirm that the probe value is 1000 when the switch is not connected; 0 when connected; and 1000 when the NC is broken.

    3 . Here is a video of the probe deploy, bed leveling and probe retract. The dock is just 2-sided taped to the glass bed for now.

    EDIT: https://youtu.be/bkqzr3B-ufs

    alt text

    If you watch the probe pickup, the green LED lights up when the pairs of magnets between the carraige and probe make contact. The LED goes off when the NC goes to open. (The magnets mechanically and electrically couple the switch to the circuit).

    What I do not like is that the bed continues to move well after probe is picked up and even after the switch is triggered. I tried to slow down the feedrate on the probe pickup. I did not try reducing the step.

    It quite literally crashes the prbe into the bed and the bed lifts off the pivots. If the bed was fixed, I think it would be damaged.

    Any thoughts on how to stop the bed quicker?

    You can see the LED reflection blink when the switch is triggered.

    Here is the deployprobe.g -

    if sensors.probes[0].value[0]!=1000 ; if sensor is value other than 1000 do this
    abort "deployprobe: Probe already picked up. Manually return probe to the dock"
    ; if we're here we know it's 1000 which I assume is because you have an NC switch as a probe.
    G91
    M564 S0 H0 ; allow movement outside of print area and while not homed
    G1 Z10 F6000 ; move Z for clearance
    G90 ; absolute positioning
    G1 X0 Y15 F6000 ; move to side of probe dock location
    M400 ; wait for moves to finish
    G1 X0 Y0 ; move exactly above probe for pickup
    M400 ; wait for moves to finish
    while sensors.probes[0].value[0]=1000 ; loop to check when probe value changes from 1000 to 0
    G1 Z-0.5 F200 ; move bed with probe dock up 0.5mm at a time until the switch activate.
    ; This will get ugly if the switch fails as you have limits off!
    G1 Z1 F360 ; move bed to clear probe from dock
    M400
    G1 X100 F6000 ; move right so probe moves out of the dock
    M400
    G1 Z5 F360 ; move bed to clear probe from glass build surface
    M400 ; wait for moves to finish
    M564 S1 ; limit axis to print area
    G90
    if sensors.probes[0].value[0]!= 0
    abort "deployprobe: Probe not picked up! Print cancelled."

    here is the retractprobe.g file -

    ; *******************************************************
    ; retractprobe.g
    ; ********************************************************
    M400
    if sensors.probes[0].value[0] != 0
    abort "retractprobe: Probe not currently picked up!"
    M564 S0 ; allow movement outside of print area
    G90 ; absolute positioning
    G1 X100 Y0 Z5 F12000 ; move to the starting point
    G1 X60 Y0 F12000 ; move to the entry position for the dock
    G1 X0 Y0 F600 ; move to the dock position
    G1 X0 Y20 F12000 ; move to the side adjacent to the dock
    M400
    G1 X100 Y20 F12000 ; move to the right to clear dock
    G1 X145 Y0 Z10 F6000 ; move to start point at middle front
    M400
    M564 S1 ; limit axis to print area
    if sensors.probes[0].value[0] != 1000
    abort "retractprobe: Probe not correctly dropped off in dock!"

    Here are the tweaks to my config.g file: I had to put all the Z motors on the Duet board.

    ; Probe Definiotns
    ; set Z probe type to switch and the dive height + speeds. Probe A times
    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
    ; ****
    ; Drives
    ; in order from left to right on the board
    ; 4 - 3 - 0 - 1 - 2
    ; X - E0 - Z2 - Z1 - Z0
    ;
    M569 P4 S1 ; physical drive 4 goes forwards 0
    M569 P3 S1 ; physical drive 3 goes forwards E0
    M569 P0 S1 ; physical drive 0 goes forwards Z2
    M569 P1 S1 ; physical drive 1 goes forwards Z1
    M569 P2 S1 ; physical drive 2 goes forwards Z0
    ; Duex Drive Assignements
    ; in order from left to right on the board
    ; 6 - 5
    ; X - Y
    M569 P5 S1 ; physical drive 5 goes forwards Y
    M569 P6 S1 ; physical drive 6 goes forwards X
    ; X Y Z0:Z1:Z2 E
    M584 X6 Y5 Z2:1:0 E3 ; set drive mapping
    M671 X0:290:290 Y163.5:307.5:17.5 S15 ; Z0 left screw at -88,110 pivot point 0,163.5
    ; Z1 back right at 340,302 pivot point 290,307.5
    ; Z2 front right at 340,-2 pivot point 290,17.5
    ; max correction S is 15mm
    undefined 1 Reply Last reply 10 Feb 2021, 07:12 Reply Quote 0
    • undefined
      fcwilt @sinned6915
      last edited by 10 Feb 2021, 07:12

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

      1. I rewired the steppers so that all the Z motors are on the Duet board. I enede up putting X & Y on the Duex board. It gets a little fussy becasue reading the RRF FW limitations, the extruder, associated heater and thermistor that go together also have to be on the SAME board.

      That didn't hurt be it wasn't necessary, at least with firmware 3.1.1 and Duet 2/Duex 5 combo.


      As to stopping bed movement - did you consider trying to arrange some sort of sensor that could function as a Z end stop sensor just for purposes of picking up the probe?

      With G1 H1 commands movement stops when the associated end stop sensor is triggered.

      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, 07:47 Reply Quote 0
      • undefined
        sinned6915 @fcwilt
        last edited by 10 Feb 2021, 07:47

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

        With G1 H1 commands movement stops when the associated end stop sensor is triggered.

        I did try that at one point. iirc, the carriage jumped to the position defined in the homez.g file.

        What mystifies me right now is that I believe that the probe value has to go from 1000 to 0 since the circuit goes from open to closed as evidenced by the LED illuminating.

        I will try G1 H1 again. Perhaps I need to try G1 H1 with a Z grater than 0 - like this?

        G1 H1 Z2.0

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

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

          I did try that at one point. iirc, the carriage jumped to the position defined in the homez.g file.

          I don't know what you mean by that.

          When the end stop is triggered during a G1 H1 move the firmware sets the current position for the axis in question to the min/max of that axis as defined in the M208 for that axis. It uses min or max depending on the configuration of the end stop as being at the low end (uses min) or high end (uses max).

          After the G1 H1 finishes you will need to reset the Z position, using G92 Znnn, to the correct position.

          If the end stop is at known Z position that would be simple but I don't fully understand how this probe change feature is implemented.

          I will try G1 H1 again. Perhaps I need to try G1 H1 with a Z grater than 0 - like this?

          G1 H1 Z2.0

          Since G1 H1 moves are usually done in relative mode, set using a G91 command, a G1 H1 Z0 command would do exactly what is says - move 0 mm


          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, 17:01 Reply Quote 0
          • undefined
            sinned6915 @fcwilt
            last edited by 10 Feb 2021, 17:01

            To use the G1 H1 command, the probe has to trigger. If NC as currently set up, it has to couple the probe AND the probe has to trigger for it to work. That means that the probe value will register 1000 when the circuit is open, then 0 when the probe is picked up, then has to go to 1000 again for trigger.

            I tried temprarily changing the probe defiition to be NO instead. I was thinking that this way, the open probe would go closed as soon as the electrical continutiy was made and trigger the reading.

            Now that I have working meta command I will try to retry that in the lines above and below the proper loop statement.

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

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

              To use the G1 H1 command, the probe has to trigger. If NC as currently set up, it has to couple the probe AND the probe has to trigger for it to work. That means that the probe value will register 1000 when the circuit is open, then 0 when the probe is picked up, then has to go to 1000 again for trigger.

              I tried temprarily changing the probe defiition to be NO instead. I was thinking that this way, the open probe would go closed as soon as the electrical continutiy was made and trigger the reading.

              Now that I have working meta command I will try to retry that in the lines above and below the proper loop statement.

              Now I'm really confused.

              There was a while loop above trying to monitor the probe state while moving small amounts on the Z axis.

              Are you still trying to do this?

              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
                T3P3Tony administrators
                last edited by 10 Feb 2021, 17:25

                @sinned6915 there have been quite a bit happening on this thread. can we start from the beginning.

                With the bed probe mounted on the magnets, with the bed well out of the way, when you probe the bed does manually triggering the switch work as expected?

                If it does then for the pickup can you break it down into individual commands (sent from the console) and confirm they each work individually.

                At the core of this is this while loop:

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

                does that work when executed separately ?

                www.duet3d.com

                undefined 1 Reply Last reply 10 Feb 2021, 17:49 Reply Quote 0
                • undefined
                  sinned6915 @T3P3Tony
                  last edited by sinned6915 2 Oct 2021, 17:50 10 Feb 2021, 17:49

                  @T3P3Tony if i manally deploy the probe, everything works as expected.
                  here is old vid if it helps. https://photos.app.goo.gl/3KEhDJKUdSbfTjS2A

                  the switch is your garden variety SPDT microswitch. the NC - C are connnected to the magnets. when the halves couple, the circuit is complete to the controller.

                  i incrementally built the move commands to align the carraige over the dock. i have verified that with no probe, P=1000. When I manually couple the probes, P=0

                  the issue is the while loop.

                  the controller is not reazling the circuit is complete and the probe value goes from 1000 to 0.

                  if you watch the video from this point, you see the point where the probe is coupled- the LED lights up. then as the bed continues to move, the probe is trigered and the LED goes out as the switch is depressed.

                  https://youtu.be/bkqzr3B-ufs?t=10

                  i will make a macro of just the loop and post results in a moment

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

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

                    the issue is the while loop.

                    the controller is not reazling the circuit is complete and the probe value goes from 1000 to 0.

                    Does this switch change state at the correct location for stopping movement?

                    If so did you consider my comments about using the switch as a temporary Z endstop which would stop a G1 H1 move when the switch triggered?

                    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 10 Feb 2021, 18:19 Reply Quote 0
                    • undefined
                      sinned6915
                      last edited by 10 Feb 2021, 18:10

                      the statement by itself does does not work.
                      i made a macro to execute it -
                      alt text

                      homes X & Y axis. I even gave it an M564 S0 H0

                      I also tried to manually issue G1 Z-100 H1 but did not get anthing.

                      alt text

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

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

                        I also tried to manually issue G1 Z-100 H1 but did not get anthing.

                        A G1 H1 Znnn move will only work if that switch is configured as a Z endstop.

                        Recall that a G1 H1 stops when an endstop associated with the same axis is triggered. If not endstop is triggered it stops moving when it has moved the specified distance.

                        For example, this will move until a Z endstop is triggered or Z has moved 50mm.

                        G91
                        G1 H1 Z-50

                        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 Oct 2021, 18:21 10 Feb 2021, 18:19

                          @fcwilt paneldue doe not refresh fast enough to reflect the moment when the probe halves couple. i can not tell what the controller sees.

                          i am trusting the LED illumination as a failsafe indicator. the LED is mounted to the top half. it uses the same ground as the probe. so when the probe circuit is completed, the LED will light up.

                          when the NC is broken, the LED goes out.

                          my config lines for the probe as endstop:

                          M574 Z1 S2 ; configure Z-probe endstop for low end on Z
                          ....
                          M558 K0 P5 C"^zprobe.in" H8 R0.5 F200 T9000 A1 S0.03
                          undefined 1 Reply Last reply 10 Feb 2021, 18:21 Reply Quote 0
                          • undefined
                            fcwilt @sinned6915
                            last edited by 10 Feb 2021, 18:21

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

                            @fcwilt paneldue doe not refresh fast enough to reflect the moment when the probe halves couple. i can not tell what the controller sees.

                            i am trusting the LED illumination as a failsafe indicator. the LED is mounted to the top half. it uses the same ground as the probe. so when the probe circuit is completed, the LED will light up.

                            when the NC is broken, the LED goes out. .

                            So if movement stopped with the LED comes on it will be OK?

                            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:21 Reply Quote 0
                            • 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
                                          15 out of 57
                                          • First post
                                            15/57
                                            Last post
                                          Unless otherwise noted, all forum content is licensed under CC-BY-SA