Logic Check - Probe on Trigger vs "Un"Trigger?

So I thought I’d get everyone’s take on this…

First some background:
This is based on my Voron 2.4 350mm with a Voron Tap sensor.

For those that don’t know, The Voron Tap works by using an optical interrupter to trigger as a probe. When the nozzle touches the bed, the hotend actually moves UP on a very small linear rail and a small piece of plastic/metal interrupts the optical beam. Otherwise gravity holds the hot end setup in place with strong magnets.

I know from experience that there is some hysteresis in the triggering of the Tap.

In other words, the position the Tap triggers at and “un” triggers at isn’t the same. Once it triggers there is a certain amount of movement needed to make it “un” trigger.

With that in mind, I added some code to the probing section of the homing.py file.

   def probing_move(self, mcu_probe, pos, speed):
       gcode = self.printer.lookup_object('gcode')
       endstops = [(mcu_probe, "probe")]
       hmove = HomingMove(self.printer, endstops)
       try:
           epos = hmove.homing_move(pos, speed, probe_pos=True)
           next_probe_move = epos[:]
           next_probe_move[2] += 5
           new_epos = hmove.homing_move(next_probe_move, 1, probe_pos=True,triggered=False)
           results = f"Probe triggered at: {epos[2]:.6f} \n"
           results += f"Probe un-triggered at: {new_epos[2]:.6f} \n"
           results += f"Difference: {new_epos[2] - epos[2]:.6f} \n"
           gcode.respond_info(results)

Basically

  • Move down at the probing speed until the Tap triggers
  • Move back up slowly until it untriggers
  • Report both the trigger and untrigger points and the difference
  • Return the untrigger point as the “probe” point

Some results:

Probe triggered at: -0.677000
Probe un-triggered at: -0.627000
Difference: 0.050000

Probe triggered at: -0.674500
Probe un-triggered at: -0.627000
Difference: 0.047500

Probe triggered at: -0.674500
Probe un-triggered at: -0.624500
Difference: 0.050000

Probe triggered at: -0.672000
Probe un-triggered at: -0.624500
Difference: 0.047500

Probe triggered at: -0.677000
Probe un-triggered at: -0.627000
Difference: 0.050000

Pretty consistent .05 deviation from trigger to untriggered.

Now for the logic check…

  • Which one should be the basis for the probe position?
    and
  • Does it matter?

I’m thinking it will all depend on my setting of the Z_Offset, which in the case of my probe is literally the distance travelled until triggering or if I want to set it as such, when its untriggered after triggering.

But I haven’t thought through it for other probe types and what that would mean/would change.

If anyone is interested in trying my code I can upload it to github with a small install/uninstall script.

Any input/thoughts on one vs the other and why would be great.

Edit: Forgot to add, I understand optical interrupters have hysteresis built in to prevent rapid toggling around the trigger point. I was just interested in how repeatable it was and it’s very repeatable.

I’m more curious about other probe types and if there is any inherent benefit to the probe point being on the trigger or the “un” trigger. My gut feeling is it’s the same either way, depending on how you want to set your Z offset.

With the exception of BL Touch (and its clones), I think every other Z axis sensor solution is going to have some kind of hysteresis between triggered and “untriggered”. Otherwise, there will be closed/open oscillations at the trip point that will require the sensor to move beyond the trip point to ensure a clean object sense.

Before I go on a tear about optical interrupters being used as end switches, I think it might be a worthy experiment to see if there is any advantage to looking at the difference between triggered and “untriggered”. I’m not sure how precise devices are designed for moving away from the triggered position and I don’t know what the repeatability is across individual units.

I use Super Pindas and a Triangle Lab inductive sensor and they do give triggering specifications (2mm +/-15% for the Super Pinda and 2mm +/-10% for the Triangle Lab) but nothing for “untriggering”.

Personally, I’m not a big fan of using optical interrupters for any kind of precision position triggering - they’re not designed for it and the response will be dependent on the amount of light passing from the LED to the phototransistor they are the only sensors in which the slower you go, the worse the accuracy of the probing will be.

The phototransistor is an analog device; when a little bit of light falls on it, you’ll be in the linear region (more light, more current can flow through it) which means that the voltage at the phototransistor’s collector and the pull up resistor will be some value between zero and Vdd (lowering as more light falls on the phototransistor). Unfortunately, for an application like this, you want the sensor to go from off (no current flow and the collector voltage at Vdd) to the saturation region (full on and collector voltage at zero volts). So, unless the aperture can change from fully opaque to fully transparent instantly, you’re going to get something different from the clean transition that you expect.

Doing a bit of research, I did find useful information in the first optical interrupter datasheet that I found here:

The analog operation of the device is shown in this graph:

The more current passing through the LED in the optical interrupter (called “Forward Current”), the more current that can be passed by the phototransistor. The graph appears to show the phototransistor in the linear region with the Forward Current being 0 to 20mA - this is analogous to the barrier between the LED and the phototransistor being partially open.

Looking at the operating conditions for the optical interrupter, 50mA is the maximum Forward Current which leads me to believe that the phototransistor will be in the saturation region at this point when there is nothing between the LED and the phototransistor.

When looking at the on/off characteristic, I found this graph and representative circuit/waveform:

So, going by this, your “ON TIME” will be something like td + tr/2 and “OFF TIME” will be something like ts + tf/2. I’m dividing “tr” and “td” by two assuming that you have a CMOS input which will trigger at 1/2 Vdd. It looks like “ON TIME” will be shorter than “OFF TIME”, which gives you what you’re calling “hysteresis”.

I don’t know who set up the optical interrupter but I suggest that you take a look at the driving voltage and current limiting/pull up resistors used. If you’re not driving the maximum forward current for the device, you may not be getting as crisp a response as is possible. Similarly, a fairly low resistance pull up will give you better responses for your tf and tr timing.

1 Like

I say “Opto Interruptor” as a general thing, It’s actually technically a “Photomicrosensor” in mine. Same “principle” slightly different setup.

As in, it has it’s own internal system with a Schmitt trigger logic gate setup/amplification etc.

Here’s the exact datasheet for the one in my Tap

Response time low to high is 8uS, High to low is 20uS.
I looked to see if I could find any better than that recently and there are some but they’re way too big to fit into a hot end setup.

Mine is driven at it’s maximum forward current of 25mA so max response.

I think every probe has it’s pros and cons honestly, there is always going to be variance due to some factor or another.

I can regularly achieve .001mm accuracy repeatably. But that’s based on a few factors that are probably unique to me (or my printer type) that I’ve worked around.

Namely:

Belt tension on CoreXY “Flying Gantry” printers is a huge deal especially with a large one like mine (350mm).

The back of the gantry sags when the power is off and if I’m not careful the belt can sag slightly below the pully. So when I turn the printer back on if I don’t fully move the z axis up and down a ways (depending on how far it was from the bed when I turned it off), the belt might have tension on one side of the pully but be slack on the other cause the “tension point” is the center of the pully.

(Anyone that thinks I’m full of it, try it yourself. It doesn’t happen every time but press your finger against the belt on both sides of the drive pully after you turn your printer back on and move a bit (5 - 10 mm))

Similarly, Quad gantry leveling affects the probing because if the probe is skewed at an angle cause the gantry is skewed it’ll trigger at a different travel distance. It’s small, but still… We’re talking .2mm layer heights or less we’re trying to hit sometimes, so every bit helps.

Bed temps also cause the thermal expansion but that’s every printer.


Back to the original question though.

I’m not sure how precise devices are designed for moving away from the triggered position and I don’t know what the repeatability is across individual units.

I guess that’s the crux of the question. Is one more repeatable than another? My results above show mine is very repeatable at .05mm untrigger distance pretty consistently. I guess I’d need to design a test setup to see if it’s TRIGGERing at the same point (and not just trust Klipper).

I’m also trying to think through any assumptions I, or others, may be making about probing in an abstract sense.

There is no real “right answer”, I thought I’d just bring up the discussion if anyone wanted to chime in with their own experience. It might lead to something fruitful.

Honestly, I would not care.
Accuracy (is my measurement really the “true” value) often does not play that big role. E.g. for homing you fine tune it anyway with the z-offset or babystepping etc.

Precision (are repeated measurements) the same is essential, since all accuracy will take you nowhere without precision.
One could even state that precision is the natural upper limit of the achievable accuracy.

1 Like

I generally agree, however, I threw together a quick new command in Klipper and had it probe and collect the trigger and untrigger positions in various spots across my bed and dump it to a csv file.

My untriggered position is quite a bit more repeatable than my trigger position.

Things that make you say “Hmm…”

But it’s also slower to probe that way. So there is definitely a tradeoff.
Plus, slow short stepper motor movements are kind of noisy.

I’ll poke around with it a bit. I just thought it was kind of interesting.