analog probe triggered on falling edge? how?
-
I need to configure analog probe to trigger on falling edge.
Reading documentation P1 is "rising edge", si triggers when you get over the treshold and P3 is "same only falling edge" but I'm failing to make it work.
M558 P1 C"zprobe.in" R0 H5 F3000 T3000 A3 S0.03 K0 I1 G31 P{sensors.probes[0].value[0] - 50} G31 M119 > Z probe 0: current reading 0, threshold -50, trigger height 0.700, offsets X0.0 Y0.0 > Endstops - X: not stopped, Y: not stopped, Z: no endstop, Z probe: at min stop M558 P3 C"zprobe.in" R0 H5 F3000 T3000 A3 S0.03 K0 I1 G31 P{sensors.probes[0].value[0] - 50} G31 M119 > Z probe 0: current reading 0, threshold -50, trigger height 0.700, offsets X0.0 Y0.0 > Endstops - X: not stopped, Y: not stopped, Z: no endstop, Z probe: at min stop M558 P1 C"zprobe.in" R0 H5 F3000 T3000 A3 S0.03 K0 I1 G31 P{sensors.probes[0].value[0] + 50} G31 M119 > Z probe 0: current reading 0, threshold 50, trigger height 0.700, offsets X0.0 Y0.0 > Endstops - X: not stopped, Y: not stopped, Z: no endstop, Z probe: not stopped M558 P3 C"zprobe.in" R0 H5 F3000 T3000 A3 S0.03 K0 I1 G31 P{sensors.probes[0].value[0] + 50} G31 M119 > Z probe 0: current reading 0, threshold 50, trigger height 0.700, offsets X0.0 Y0.0 > Endstops - X: not stopped, Y: not stopped, Z: no endstop, Z probe: not stopped
both P1 and P3 behave identical, triggers when current > treshold
-
@arhi said in analog probe triggered on falling edge? how?:
I need to configure analog probe to trigger on falling edge.
Reading documentation P1 is "rising edge", si triggers when you get over the treshold and P3 is "same only falling edge" but I'm failing to make it work.
Which RRF and board?
Where'd you read "rising edge" and "falling edge"?
I only see that P3 inverts the control signal and I'm not even sure if its supported anymore. The WHATS_NEW pages are a little ambiguous. You could try inverting the pin but I don't remember if that works in analog mode.
https://duet3d.dozuki.com/Wiki/Gcode#Section_M558_Set_Z_probe_type
- P1 specifies an unmodulated or smart IR probe, or any other probe type that emulates one (probe output is an analog signal that rises with decreasing nozzle height above the bed). If there is a control signal to the probe, it is driven high when the probe type is P1.
- P3 is similar to P1 but drives the control signal to the probe low. This may be used to switch between different Z probes.
-
@gtj0 said in analog probe triggered on falling edge? how?:
Which RRF and board?
RC12 and 2eth
Where'd you read "rising edge" and "falling edge"?
Well P1 def trigger on rising edge as it triggers when read > th
P3 is kinda unclear but if it inverts the output then again output = !(read>th) so falling edge (the == point is irrelevant really)
I only see that P3 inverts the control signal and I'm not even sure if its supported anymore.
Whatever the "control signal" is.
I assume it is the "output of the comparison of read vs threshold" that controls further behavior of the firmware and not some servo/modulator signal but it's probbly just that.
The WHATS_NEW pages are a little ambiguous. You could try inverting the pin but I don't remember if that works in analog mode.
does not, tried
I solved the problem by physically inverting the signal before it reaches the duet but I wasted 2 hours before I figured out signal is going down and not up (nothing to do with duet, just the probe), finally I hooked up a scope and everything was clear inside few seconds, could not get duet to trigger on falling so inverted the signal, this is mostly postmortem checking if there maybe actually is a way to trigger on falling edge
-
@arhi said in analog probe triggered on falling edge? how?:
M558 P1 C"zprobe.in"
M558 P1 C"!zprobe.in" should have done what you wanted.
-
@dc42 said in analog probe triggered on falling edge? how?:
M558 P1 C"!zprobe.in" should have done what you wanted.
I tried that
and it did not, but I'll try it again as last time I tried something at 3am and didn't work worked during normal hours so problem was, as usual, between keyboard and chair. So lemme try again.
-
so originally defined without !
triggered when current > trasholddefined with !
same thing current > trasholdNow, since I did have some sleep, I do see that it was reading 775 and now 247 so I suspect it always trigger when current > trashold but if I define with !analogpin the "current" is actually "1024 - current_if_no_invert" ? Am I right?
-
@arhi I've just been testing this...
Inverting the pin changes the calculation of the value but it doesn't change the consideration of whether it's "triggered" or not. It's always triggered when the value is above the threshold. The
I
parameter does nothing it appears.One thing I noticed in my testing is that issuing
M558
always resets the threshold to 500 so aG31
command should always come afterM558
. It's in the docs for M558 but I forgot it. -
@gtj0 yes, that's what I suspected it always trigger when read > th but calculate read as 1024-read in case of ! in the analog pin name. I did not do nothing for me too, confusing but..
yes, G31 always after
-
@arhi said in analog probe triggered on falling edge? how?:
@gtj0 yes, that's what I suspected it always trigger when read > th but calculate read as 1024-read in case of ! in the analog pin name. I did not do nothing for me too, confusing but..
Yes in RRF 3.01 using ! in front of the pin name will change the reading to 1000 minus the original reading. So if you also change the threshold to 1000 minus the original threshold, it should do what you want.
-
@dc42 yup it works great, just as you explained. I originally expected the readings to remain the same but > < to be switched but this also makes sense.