Z Probe with Piezo element errors

Hi there. I have been having trouble getting Repetier FW to play nicely with my precisionpiezo board, but I can't get it to trigger/untrigger properly. The board is tuned in that it detects taps but not so much as to induce false positives. I have made posts on the RepRap Forum piezo thread to no avail, which I render below. https://reprap.org/forum/read.php?1,767998,850895#msg-850895

I have a 27mm piezo sensor on a Rostock Max, but I can't seem to get it interfaced with my RAMBo and Repetier Firmware properly.
I've reflashed the firmware many times, each time changing a setting. I have tested an entire matrix of probe/endstop settings.

I'm certain it is wired correctly from Piezo20 to RAMBo, as I color coded the connectors, and I verified the piezo is in the proper polarity (no trigger on pressure release)


In Repetier Firmware I've tested all combinations of true/false for Z_PROBE_ON_HIGH, ENDSTOP_PULLUP_Z_MIN, and inverted Z Min logic. No matter what it either gives me Z probe triggered before probing, or the Z probe didn't untrigger on repetitive probe; only in two instances of the second situation did the carriage actually do a probe plunge and not raise instantly.
The only thing I kept constant was that Z probe pin is the Z Min pin, and ENDSTOP_Z_MIN = true. I realize that the Piezo20 works by pulling SIG low, thus requiring pullup, but I wanted to test it anyways.
Result denotes a scenario: 1 is triggered before probe starts error. 2 is probe didn't untrigger on probe. The letter in that column denotes the physical movement made after G30 P0 was sent. P is where the effector actually descended and touched an object, whereas i occurs in a configuration that caused instant raising of the probe.

ENDSTOP_Z_MIN_INVERTING
Z_PROBE_ON_HIGH
ENDSTOP_Z_MIN_PULLUP

M119 TRIGGERED (BLUE)

ZMIN/PROBE

RESULT

M119 UNTRIGGERED RED

ZMIN/PROBE

X
X
Y
L/L
1i
L/H
Y
Y
Y
L/H
2i
L/L
Y
X
Y
L/H
2p
L/L
X
Y
Y
L/L
1i
L/H
X
X
X
L/L
1i
L/H
Y
X
X
L/H
2i
L/L
X
Y
X
L/L
1i
L/H
Y
Y
X
L/H
2p
L/L

Comments

  • As far as I know is the piezo effect quite short when compression occurs. So the important question is how long does the signal last? It must last at least 2-3 steps or it might be missed. Or does the electronic hold signal until it uncompresses? If electronics create signal a pullup is normally not required.
  • edited April 2019
    The Piezo20 works by pulling SIG down to 0V once it detects a voltage spike from the piezo element compression. The piezo element, once compressed, does not produce continuous voltage. it's only a pulse. Also, the Piezo20 board doesn't provide its own voltage source, so they say it needs the pullup resistor and 3-5v from the mainboard.

    I think the SIG pulldown must last longer than 3 steps because the blue LED which is tied to the signal stays lit long enough for a human eye to see. It's also slow enough to reset that Moriquendi (board designer) suggested a slow multimeter should be able to measure it to some degree.
  • Ok, so lets assume it stays long enough to be detected during motion. Testing with M119 will most likely not work as it takes time to hit enter and then the flash of led is over I think. So what you measure is off state signals which must be low. With pullup state is 5V so inverting signal should be the right setting.

    Since M119 is not a solution for testing try enabling debug endstops if you are using recent version (not sure when I added this).
    M111 S71
    should enable it and report every end stop change detected. Be aware that this can crash firmware if you have many changes in a row. But at least you know that it gets detected.
  • I am using Repetier 1.0.2 which does have endstop debugging mode.
    I changed the firmware to enable pullup, Z probe on high, and Z min inverting.
    It reported during G30 P0 that when I tapped, Z probe was H. It then gave me "untriggered" error; after that message it reported Z probe went L.

    Does Z probe on high actually do what I think it does? (makes Z probe logic see 5V as inactive and 0V as active.)
  • Z probe on high means 5V is triggering.

    But I think I see what goes wrong. Switching to high is working from your message. Now firmware expects that when you move back the signal is off. But your sensor does not go off directly - it has a fixed time of high signal and when the test is done it is still high causing the error. So you need to wait a bit before retrying next measurement.
    #define Z_PROBE_DELAY delayInMc
    must be > 0 in your case. How big is what you need to test. That is quite new, so search in your sources if it is already there in 1.0.2. With the right delay the untriggered message should disappear.
  • At one point I had the delay up to 1000. This merely delayed the beginning of the probe cycle. I currently have it at 500, but it appears to not effect the second probe timing.

    I am aware you added this setting purely for the purposes of piezoelectric sensor users, and this is the behavior that seems to be intended:
    https://github.com/repetier/Repetier-Firmware/issues/686
    The feature requested by DjDemonD (of precisionpiezo) was a delay BEFORE probing, although he does not use Repetier himself.

    Anyways, Moriquendi has said that the output pulse of this board is around 200 milliseconds. During the triggered state, Piezo20 PCB pulls SIG to 0V for 200ms, then returns to untriggered at higher voltage.

    Ideas? It appears I need negative logic, so Z_PROBE_ON_HIGH is incorrect despite its seeming to work since you said it makes the firmware see high voltage as triggered.
  • I have rechecked Printer::runZProbe and saw 3 places where a delay might be needed for safe signals. Will update the dev version later today along with an other addition I'm testing.
  • Great. I'll be watching the commits and will test the dev branch as soon as I see your changes.
  • The new changes are good. Thank you. The piezo probe is working as expected.
Sign In or Register to comment.