Under-bed piezo force sensing

  • In another thread:


    Two points:

    1. Force sensors in the bed supports can suffer from the trigger height varying slightly with position. Typically they are more sensitive when you probe close to one of the sensors.

    2. If you are going to change your nozzle length by a large amount on a delta printer without resetting the homed height parameter in the M665 command, you had better specify a large dive height in the M558 command.

    I wanted to give this it's own thread because I think it is a complex topic and the experience of others would be appreciated. I know there is another lengthy thread about piezo sensing, but it is focused on mounting the piezo sensor the nozzle. Mounting the sensors under the bed presents some unique issues, such as:

    1. Three (or perhaps 4 if you are using a Cartesian) sensors that have to, in the end, be treated as one by the board.
    2. Reduced sensitivity at any one sensor because the load is being distributed among multiple support posts.
    3. There is the potential benefit of integrating the signal, with the appropriate logic, from multiple sensors for better discrimination, but that's "wishlist".

    I've been testing some cheap 20mm piezo elements, and what I'm finding is that:

    1. It takes a pretty good tap to create much voltage. I think the safe assumption, at least for these piezo elements, is that you need to be able to reliably detect a signal of 0.1 - 0.4 volts at the low end. The high end might go up to 5V+, but in that case you probably really rammed the nozzle into the bed.
    2. Other threads talk about need to bend the piezo elements for force to register. I find that straight down compressive force works just as well, if not better.
    3. The piezo elements don't have much noise. For example, if you shake them around, you might get hundredths of a volt out of them. It takes an intentional tap in the right direction to exceed 0.1V. Given this, I don't think discrimination of signal vs noise should be a problem, but I have no practical experience yet.
    4. They are easy to break. I would suggest straight compressive forces rather than bending because if you bend them too much, you'll ruin them (with an audible crack).

    My plan is to place a piezo unit directly under each bed support. Given that the piezo elements do not actually support the bed (the frame does, and the piezos are just slipped in between, like a washer), and that I have springs attached to the bed, I am not sure how much force is going to turn into signal. I don't think this would be an issue if I had the ability to due rudimentary logic on the signal (e.g., running the signal through something like an attiny or adafruit board, as suggested by dc42) given that I don't expect much noise, but right now I don't have that capability, so I'm hoping that it will "just work" when 3 piezo elements are connected in parallel to a fairly simply circuit that turns the voltages into a binary signal for the Duet.

    Has anyone implemented this exact configuration, or have thoughts on why it should be done differently?

  • Hi James,

    I have a very-much unsupported, totally off the top of my head and rather dodgy idea that might get you in a position to be able to make a proof of concept with off the shelf parts.

    Essentially you need a high gain (~30-50 ?), low noise amplifier with overvoltage protection - What comes to mind is a thermocouple amplifier.

    Take for example the AD8495:

    The datasheet shows that this will work at 3.3V, has an analogue output (Which I'd expect to be nearly digital with piezo elements due to the gain) and will be happy with a 25V input signal.

    If you connect your piezo elements in series across the input of the amplifier, you may get a digital signal representing the tiniest of forces. I think that an extreme gain like this should help improve the repeatability across different locations on the bed, as long as it isn't too high of course.

    Needless to say, this is not a supported use of a thermocouple amplifier and will probably make some (most) electronics engineers cry. It may also simply not work as I envisage in my head.

    PS: Thermocouple amplifiers are not a cheap solution, I only recommend them as a possible way of using off the shelf parts for your proof of concept. Also the gain is not adjustable, but Ebay failed me in a search for off-the-shelf adjustable amplifier modules with suitable specs.

    Edit: Just noticed there's another piezo thread with a better supported electronics solution: https://www.duet3d.com/forum/thread.php?pid=7345#p7345

  • The mechanical engineer in me is just trying to fathom how this would work in practice. I'm unclear as to how the Piezo elements would be mounted. You say that they would not be supporting the bed yet the would need to be coupled to the bed in some way. Any chance of a sketch or something?

  • Forget the above. Just been looking at this http://forums.reprap.org/read.php?1,635075. Might be worth a read James if you haven't already.

  • I meant not fully supporting the bed, of course they have to somewhat support the bed to be coupled to force changes. The piezos are too small to be the only thing that supports the bed, so I was planning to sandwich them between some thin silicone sheet (1mm), both for protection and insulation, with the 20mm aluminum frame under, and a custom printed bracket (which is larger and screws into the frame on either side of the piezo) that holds the bed screws and springs over.

    In this set up, the piezo would have some (maybe a lot, depending on how tight the screws are and how compressive the silicone is) pre-load on them. I'm guessing more than optimal, but I think this would allow at least some decent portion of the force to be transmitted through the piezo. If the silicone ends up being too cushioning (I'm assuming not at only 1mm thick), I could use a thin piece of plastic as insulation, which might help give a sharper signal.

    A photo of the bracket is below. The two holes on the side are for M3 screws to affix it to the frame. The center hole holds the screws that support the bed (with springs on them). The small channel at the bottom center is to allow for the piezo wires and solder blobs. The piezo will go under this, either directly or with a sheet of silicone in between. SInce the frame is metal, I have to put something insulating under the piezo, so there will be a silicone or plastic sheet there.

  • Is it possible to add piezo "speaker" that emits high frequency sound (over 20 KHz) to effector or bed and the same piezo "microphone" that receives this sound on other end?

  • Someone did something like this. They created a system that detected the nozzle touching the bed by how it changes the transmitted or resonant frequencies, by injecting white noise with something (I don't think it was a piezo) and then they had piezo sensors attached to the frame. They did Fourier analysis to the waveforms using a DSP chip to detect touch vs non-touch positions.

    They said it was "simple" because there are libraries available to do the waveform analysis, but I think their definition of simple and mine are a bit different. Still, very cool, just more involved than I want to try to tackle right now.

  • Maybe it's possible to detect high frequency digital (0\1) signal of predefined fequency without using such complex things as resonant frequencies, DSPs and other?

    In this case it will be slightly simpler task - all that you need is just one "speaker" piezo on effector side and one "microphone" piezo on bed side. No need to use force then touching bed by nozzle to generate high quality signal. Also signal modulation will provide better selectivity of touching/contact.

    UPD: maybe it's possible to update firmware to produce just few impulses for "speaker" between each motor step then nozzle going to bed in bed probing function? In this case it's possible to "listen" for received data between steps.

  • Hi guys, I'm the piezo hot end guy. I based my ideas on this work http://forums.reprap.org/read.php?1,635075,page=1 by Leadinglights and Moriquendi. They document an under bed piezo system with some 6-9months of testing behind it. The issue they had was a little with heat, and the response of the piezo element changing with temperature, and a small amount of tilting the bed on contact causing one piezo to cancel another out (one being bent upwards and one downwards). This is why I decided to move the piezo to above the hotend where it is cool, and where only one piezo is required. All the benefits of nozzle based probing with none of the drawbacks of other systems.

    When it comes to z-probes no perfect one has yet been made, but I am willing to bet that right now the closest thing is the piezo hot end (and I'm not trying to sell them). The IR sensor is very accurate and on cartesian/corexy machines where effector-tilt is not a factor its very suitable, if you're happy that you can't always probe all of the bed as it's offset. However the search continues, I am keen to see what you can come up with.

    As for sound my microdelta has a Deltaprintr Mini Hotend on it with a very noisy 25mm fan which spins fast. To manually calibrate it I bring the nozzle down till it touches the bed where the sound distinctly changes, perhaps a mic of some sort could pick this up. A piezo attached to the bed however would overheat, this is the problem with underbed piezo's or FSR's they don't tolerate 110 deg C, so you have to come up with either a simple (not very firm bed) mount or an elaborate mount for them.

  • Thanks for the input. I plan to have air circulation under the bed, so even with a bed heater, I'm assuming (perhaps incorrectly) that the temperature will not get anywhere near 100C.

    With respect to the piezos offsetting each other, can't a diode or something very simple deal with this? In other words, assume we are only interested in positive voltages and filter negative ones (or vice versa).

  • Well Moriquendi's latest piezo signal conditioning board has inputs for 3 piezo's so I presume it handles this. He's sending me one but I cannot see any reason to put 3 under my bed, when the one in the hot end does the job better than any other sensor I;ve used so far. I will have a play with it, I was thinking about using two sensors to have a degree of fail safe in the event of a wire break. PM him on reprap if you want one, they're going fast this seems to be gaining some traction.

    The two technologies which might be even more promising are accelerometers, to detect contact and what ultimaker seem to be using on the UM3 a capactive-type sensor under the sprung glass bed detects the nozzle pressing onto the glass.

  • administrators

    Regarding accelerometers it's worth reading Michael Hackney's experience with accelerometers here:


  • Yeah I've read that thread they do seem to conclude that currently its difficult to make it reliable. I'd say the opposite were true with the piezo hotend sensor, that seems to be very reliable.

    In other exciting news (https://www.duet3d.com/forum/thread.php?id=940) it sounds small at first but this will save hundreds if not thousands of hours of printing time, in avoiding first layer problems. I'm nicknaming it auto first layer calibration as this is what it basically amounts to.

  • The point made by James in the first posting on this thread is not quite true for piezo disks - although perhaps I spread this about a bit with an early posting on the RepRap forum http://forums.reprap.org/read.php?1,635075,635164#msg-635164 which is a load of doggy-doo.

    There is very little variability at different positions on the bed as long as the piezos are fairly closely matched - within batches of no-name piezos there has been less than 3% variability of output or of capacitance. The reason that this is true is that the charge generated on each disk is fairly proportional to applied force. Simply paralleling three discs will give the correct output even if one of them gets a negative output - think of a three legged table with the legs bolted to the floor, the sum the compressive forces on the three legs equals the weight put on the table even if you sit on an unsupported corner causing the opposite leg to be under tension


  • If I can stick my oar in here and give a stir.

    I've been using piezo sensors underneath the bed of my enclosed kossel mini for months now and I've never had a problem, I can probe hot (bed at 100c) or cold without any issues


  • There is now a wiki page addressing the underbed piezo sensors at http://reprap.org/wiki/Underbed_Piezo-electric_sensors


  • I found the reference for the person who used a DSP chip with FFT to sense bed contact:


  • In theory this should work well. How it copes with softer surfaces such as painter's tape or PEI I am not sure, but hard surfaces like glass, aluminium, printbite etc… should work.

  • Note that the author of the above-mentioned article (http://hackaday.com/2016/07/18/sonic-3d-printer-auto-bed-leveling-makes-swoosh/) opines that:

    We’re beginning to see a new generation of 3D printer controllers that feature a more powerful 32 bit MCU, ideally we want one that supports DSP instructions. Given the availability of cheap STM Nucleo boards with powerful, DSP-enabled ARM Cortex-M4 MCUs, my bet is that insanely powerful 3D printer controller electronics, capable of tricks like this one, are bound to happen rather soon.

    Do you think this is accurate, or perhaps is the Duet processor potentially already capable of this?

    I know that dc42 has suggested that such calculations be carried out on a separate chip to separate the Duet firmware from "aftermarket" functions like this, so I know that right now using a separate chip is the way to do it. I'm mainly curious as to whether such functions might become a standard part of the firmware in the future.

  • @DjDemonD – I would bet that there are substantial changes to the waveform even for softer surfaces, but they might be different changes than a harder surface. It would be interesting to see how generalizable the technique is. Maybe it's easy to program it for "if the waveform changes substantially in any way, activate the endstop", or maybe you have to have a better idea of what the changes look like and so you could do some machine (or human) learning on multiple surfaces, different types of bed suspension, different hot ends, different placement of the white noise generator, etc.

  • I can't imagine the processing required to do any type of z probing is taxing the duet controller if it can generate step pulses at 350Khz. Whether you want to integrate this type of thing is another issue. If you fit an accelerometer it processes it doesn't require the controller to process its raw data that's happening on board, its outputting the results.

Log in to reply