Detecting Z-Probe Pickup on move command
-
@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
-
@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
-
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.
-
@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
-
@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 ?
-
@T3P3Tony if i manally deploy the probe, everything works as expected.
here is old vid if it helps. https://photos.app.goo.gl/3KEhDJKUdSbfTjS2Athe 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
-
@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
-
the statement by itself does does not work.
i made a macro to execute it -
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.
-
@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
-
@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
-
@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
-
@fcwilt EXACTLY!
probe not attached P=1000
probe attached, P=0 -
@sinned6915 said in Detecting Z-Probe Pickup on move command:
@fcwilt EXACTLY!
probe not attached P=1000
probe attached, P=0So this switch is currently configured as a Z probe?
Frederick
-
@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
-
@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
-
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.
-
@T3P3Tony here is a video of trying to execute the loop meta command.
https://photos.app.goo.gl/DYYfcTEyFbJhUGGw5when 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_5but 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.
-
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
-
@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"
-
@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