Originally shared by Sebastian Szafran I was playing with different values of pull-up resistors

Originally shared by Sebastian Szafran

I was playing with different values of pull-up resistors and removed 10k resistor from the RC filter, but still I get false probes reported randomly. I can say it goes a little better, as I was able to catch first 50+ probe points with no problem, but then the problem came again.

I measured the voltage between the probing tool (v-bit connected to GND) and the PCB (connected to Due probe pin D18) during the process. It is 3.3V (HIGH) when probing begins and gets low (so we have ACTIVE_LOW trigger) every time the tool is touching a PCB = it ‘grounds’ the PROBE pin down to 0V. When the tool goes up again moving to the next probe point the PROBE pin immediately goes back to 3.3V.
The faulty probes are starting (and disappearing) unexpectedly, while probe pin remains on VCC (3.3V) and not touching GND in any way at that time.

Does the INPUT_INACTIVE in the code below correspond to D18 PROBE pin at 3.3V (this is when NO switch is opened in my circuit) or 0V? And how is all that related to HIGH or LOW logic state of a PIN vs. ACTIVE_LOW or ACTIVE_HIGH transition?

static stat_t _probing_start()
{
// initial probe state, don’t probe if we’re already contacted!
int8_t probe = gpio_read_input(pb.probe_input);

// INPUT_INACTIVE means switch is OPEN
if ( probe == INPUT_INACTIVE ) {
	cm_straight_feed(pb.target, pb.flags);
    return (_set_pb_func(_probing_backoff));

} else {
    cm.probe_state = PROBE_SUCCEEDED;
    return (_set_pb_func(_probing_finish));
}

}

and here

static stat_t _probing_backoff()
{
// Test if we’ve contacted
int8_t probe = gpio_read_input(pb.probe_input);

// INPUT_INACTIVE means switch is OPEN (at least for now)
if ( probe == INPUT_INACTIVE ) {
    cm.probe_state = PROBE_FAILED;

} else {
    cm.probe_state = PROBE_SUCCEEDED;

    // capture contact position in step space and convert from steps to mm.
    // snapshot was taken by switch interrupt at the time of closure
    float contact_position[AXES];
    kn_forward_kinematics(en_get_encoder_snapshot_vector(), contact_position);

    cm_queue_flush();                               // flush queue & end feedhold
    cm_straight_feed(contact_position, pb.flags);   // NB: feed rate is the same as the probe move
}
return (_set_pb_func(_probing_finish));

}

@Alden_Hart @Riley_Porter_ril3y Do you have any idea(s) what next to check in order to solve this problem?

Has Synthetos gotten back with you at all on whether it could be a bug? The fact that your pull up resistors hehlped actually points to it being your hardware. Have you tried using optocouplers to then drive your probe port with clean 3.3v on one side and then something like 12v on the other?

Try to cut power from the spindle, see if that helps.
I usually get similar errors but less frequent than yours when I leave spindle power supply on while probing.