Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Expected input to z_probe_in and getting status?

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    3
    7
    1.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Jamesundefined
      James
      last edited by

      I have a circuit hooked up to z_probe_in which is supplying short (~10ms) bursts of 2.7-2.8 volts when a piezo detects movement. So far, just by hitting the bed and sending M119 (attempting to be simultaneous), I haven't been able to prove this is working (meaning, z probe always reports "not stopped"). A piezo can't make a continuous signal like holding a normal endstop switch closed, so testing is proving frustrating.

      Is this voltage adequate, is there a minimum time for a signal to be considered "on," and is there a better way I can test this (e.g., is there some command that will allow z probe status to be pushed to the console automatically when it changes)?

      1 Reply Last reply Reply Quote 0
      • Jamesundefined
        James
        last edited by

        Making these changes to config.g helps – I can now get it to sometimes show the endstop is hit:

        M558 P5 X0 Y0 Z0 ; Z probe is an IR probe and is not used for homing any axes
        G31 X0 Y0 Z0 P50 ; Set the zprobe height and threshold (P500 was default)

        What does P50 in the second line actually mean? Is that milliseconds, some relative value from 0 to 254, or what?

        1 Reply Last reply Reply Quote 0
        • DjDemonDundefined
          DjDemonD
          last edited by

          My understanding when used with digital probe mode it's a debounce, that is a mechanism to smooth out a switch which might make several connects and disconnects when pressed, to give a nice sharp digital change in state. So it's the debounce time in milliseconds.

          I'm using it with Piezo hotend probe to reduce false triggers. I've got mine set to 1ms.

          Simon. Precision Piezo Z-Probe Technology
          www.precisionpiezo.co.uk
          PT1000 cartridge sensors NOW IN, just attach to your Duet board directly!

          1 Reply Last reply Reply Quote 0
          • Jamesundefined
            James
            last edited by

            Doesn't setting it to 1ms effectively remove the debounce function? The signals I am seeing from the piezos have a period of about 10ms.

            1 Reply Last reply Reply Quote 0
            • dc42undefined
              dc42 administrators
              last edited by

              It's not debounce time in ms but it does define the debounce time, with lower values triggering faster. From memory, I think a value of 100 or lower should give zero debounce.

              Duet WiFi hardware designer and firmware engineer
              Please do not ask me for Duet support via PM or email, use the forum
              http://www.escher3d.com, https://miscsolutions.wordpress.com

              1 Reply Last reply Reply Quote 0
              • Jamesundefined
                James
                last edited by

                Thanks dc42. Is it possible to provide a formula or table that translates the setting to a ms delay?

                Given the length of the signals I see coming from the piezos (~10ms signal, gap, and then sometimes another 10ms bounce – so the whole process is generally over in less than 50ms), and the fact that I would say it's impossible for the bed leveling procedure to hit the bed, raise, move, and hit the bed in another spot, in less than a few hundred milliseconds, setting the G31 P value to something that means, say 100ms, would seem to be a safe, effective, choice.

                1 Reply Last reply Reply Quote 0
                • dc42undefined
                  dc42 administrators
                  last edited by

                  The G31 P value is intended to set the threshold for analog sensors. The fact that it can be used to debounce noisy digital Z probe inputs is a by-product of the filtering that is applied. A Z probe reading is taken every 2ms and that is passed into an averaging filter. The filer takes the average of the last 8 readings. For an analog Z probe, the reading is whatever the probe returns. For a digital Z probe, it is 1000 when the probe output is active and 0 when it isn't.

                  The upshot of this is:

                  • Events shorter than 2ms in duration may not be seen
                  • If you use a digital sensor and you set the G31 P parameter to 125 or less, then a single active reading from the probe is sufficient to cause a trigger
                  • If you set the threshold between 126 and 250 then you need two readings out of the last 8 to be active to cause a trigger

                  The 2ms interval between readings is a hangover from the old code that used the Arduino core, and I'll probably change it to 1ms before the 1.18 release.

                  HTH David

                  Duet WiFi hardware designer and firmware engineer
                  Please do not ask me for Duet support via PM or email, use the forum
                  http://www.escher3d.com, https://miscsolutions.wordpress.com

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Unless otherwise noted, all forum content is licensed under CC-BY-SA