Welcome! Log In Create A New Profile


Piezoelectric disks for Z contact detect and bed levelling

Posted by leadinglights 
Re: Piezoelectric disks for Z contact detect and bed levelling
April 18, 2019 02:57AM
Hi frankvdh,

I may yet take you up on your offer of help but at this moment I am pursuing a different goal. The aim is not to extract a good contact from a bad background but to show up when a bad background has made the integrity of a signal unreliable. The method I use on both the slope and the baseline is to do a version of a running average (Savitsky Golay) which does provide filtering but I then use MAD (Mean Absolute Deviation) to pick up that those two parts were close to straight lines. If the signal does not pass a few sequential tests then it needs to be repeated.

The example that a friend used to describe it is that LIGO uses sophisticated filtering methods extract a signal from two colliding black holes as it is hard to get the black holes to do it again. With a 3d printer we can clean the nozzle before re-probing or try again without a small child banging the table the printer is one etc..


Edited 1 time(s). Last edit at 04/18/2019 03:50AM by leadinglights.
Re: Piezoelectric disks for Z contact detect and bed levelling
May 14, 2019 05:00AM
I have been working on a modification of a piezoelectric bed leveling sensor and conditioner which is able to distinguish between a good nozzle contact and one made unreliable by virtue of plastic between the nozzle and the bed, dirt under the nozzle, external vibration and even loose glass plate on the print bed.It does this by distinguishing the signature of a good nozzle contact from a bad one: A good contact is shown by having a sharp onset followed by a very linear rise in output at a predictable rate.

Other useful features are that the contact speed can be less than 2mm per second and contact will be detected within less than 20µm. A secondary contact output shows that contact has occurred but may be unreliable - this contact being within 100µm. The secondary contact is to prevent bed damage in the result of a good contact not being received.

Although this will meet my own needs, it has become obvious that developing this to meet the needs of others will need a considerable investment in both time and money and this means that I will not be able to make it an open source project.

My question is, will there be sufficient interest to make the further development worth my while? Although I can't at the moment price the whole thing, I think that a target of "competitive" is very achievable - assuming that anything that sells in reasonable quantity such as BL Touch is the competition.

A bit of info on [reprap.org] and [reprap.org]

Re: Piezoelectric disks for Z contact detect and bed levelling
May 14, 2019 12:21PM
You have some kind of 350Hz'ish pick up on your ADC values leadinglights (going by your graph) which you for sure has noticed. Wonder what that is ?

If your piezo sensor leads aren't a twisted pair, then maybe try twisting them (or use screened lead), that super-imposed HF should then go away I'd have thought.

Anyway, good work, thank you for sharing !

Am just working out what the best way is to build in a piezo disc (I bought five 26mm (I think) disc's off ebay) into the hotend/extruder assy I'm currently doing. I'll be doing the same with a little CPU once I have it sorted out.

Edited 1 time(s). Last edit at 05/14/2019 12:22PM by Pippy.
Re: Piezoelectric disks for Z contact detect and bed levelling
May 15, 2019 12:04PM
@Pippy A somewhat similar noise is visible on the scope here [reprap.org] In the case of that trace it was the mechanical noise from the Z stepper motor. I assumend that this was the case with the 350Hz noise but it doesn't tie up with the stepper frequency. I can't investigate at the moment as I have dismantled the rig to use it for milling my new heated build stage but it is on my "wierd things to be checked" list.

For the circuit I have switched to a PIC16F1703 which has two useful Op-amps built in and enough mojo to do some fairly complex data processing. For piezo discs Murata are best but most of the Chinese ones are perfectly good although you should be aware that sometimes the polarity varies even within a batch

Re: Piezoelectric disks for Z contact detect and bed levelling
May 15, 2019 01:21PM
Have you considered something like a bandpass filter? A smallish circuit to attenuate unwanted frequencies to single out the desired frequencies so that you get fewer false positives? This is how glass break sensors for alarm systems work, a mic (Oh look, a piezo one!) is filtered to attenuate sounds outside of the frequency that glass breaking makes, so that it can very sensitively report when the window is broken.

You get a distincitve "sound" from nozzle contact with something solid, so you just need to pick up on those frequencies.

A bandpass filter can be done for a single channel with 24dB/octave with a single quad op-amp and supporting resistors and capacitors. This should get you a fairly narrow range of frequency to listen for, and ought to allow you to make the thing much more sensitive, without triggering false alarms, or at least let you know if you're getting good contact.

MBot3D Printer
MakerBot clone Kit from Amazon
Added heated bed.

Leadscrew self-built printer (in progress)
Duet Wifi, Precision Piezo parts
Re: Piezoelectric disks for Z contact detect and bed levelling
May 15, 2019 02:37PM
A lot of work was done by many people on sensing the vibration from the contact but much of it was based on false assumptions. The piezo in almost all of the sucessful Z probes does not sense a vibration but a pressure change. the fact that the initial contact signal decays away through leakage in the element and amplifier is irrelevant as it has done its job by then. Similarly, trying to "tune" the circuit based on frequency is going to be so printer/hotend/bed specific that it will become unreliable if there is a change; for example, temperature causing a frequency drift.

My very early circuits even dispensed with a potentiometer to adjust for the trigger point but were dependant on the hardware of the sensor going from full pressure to no pressure within a short distance - see the firs post in this thread. My present circuit/software is sufficently immune to unwanted stimulus that it can even ignore one "British Standard Child Banging on Printer Table" of unwantedness.

Re: Piezoelectric disks for Z contact detect and bed levelling
May 16, 2019 06:19AM
Looking forward to seeing your final gubbings leadinglights !
Re: Piezoelectric disks for Z contact detect and bed levelling
June 11, 2019 04:00PM
Just reporting that I have been running some early tests in a "semi-real-world" situation that shows repeatability of well better than 0.5 gram at 2 grams of nozzle contact pressure.

10 microns of movement of the nozzle gives 0.60 Newtons ( say 62 grams or 2¼ ounce) of force in the middle of the bed.so 2 grams should equate to 0.067 micron. As my Z axis is 1mm/rev and ¼ step on a 1.8° stepper there is sledome even one step difference in trigger points.

Re: Piezoelectric disks for Z contact detect and bed levelling
June 12, 2019 05:12AM
... are you interested in even finer resolutions and/or "non-contact" force measuring?

Developed some sensing methodes in my "active" time, when working in the micro/nanotech industry cool smiley

Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Piezoelectric disks for Z contact detect and bed levelling
June 12, 2019 07:38AM
Hi Viktor,

I am very interested in any possible technology for sensing in 3D printers. Finer resolutions are nice, but only insofar as a finer ultimate resolution will point to a likely better reliability.

At the moment I am convinced that piezo sensing is the best available technology but even it is imperfect as it doesn't lead itself to a sensor which can be strapped to any printer - as can the BLTouch or various non-contact sensors.
The most interesting of the non-contact types is using the nozzle as a capacitative probe: The non-linear relationship between distance and capacitance can be used to indicate an approach in the 10 microns region - the shape of the approach curve can likely even predict things like clean nozzle, hard plastic on the nozzle or soft plastic on the nozzle.

I look forward to hearing of other potential sensing technologies from you.

Re: Piezoelectric disks for Z contact detect and bed levelling
June 12, 2019 09:07AM
Hi Mike,

a pretty simple non-contact sensing can be achieved by a fine nozzle, blowing air, and measuring the pressure change inside the nozzle when moving toward a surface -- the pressure change rises nearly exponentially shortly before contact.

Another non-contact sensor can be done by focussing a beam of white(!) light with a lens with "high chromatic error" and a colour sensor nearby - with the colour aberation the spot area will be "more blue" in the top and "more red" in the bottom. This is used with the "Chrocodile"-Sensor

A simple but pretty precise and reliable "contact" sensing can be done by fixing a piezo buzzer to the nozzle and a microphone to the bed (or the other way around).

Made some others too with different methodes, but cold be too complex for common use ...

*** EDIT ***
- for the "Chrocodile"-sensor - this is best done with a fiber bundle, where the "feedback sensor"-fiber is in the middle and the light-emitting fibers arranged concentrically around - have some "image-feeding" fiber-bundles with 3000 or 10000 parallel fibers with bundle diameter of up to 1mm, where a 0.2mm fiber can be placed in the middle of the light entry end, so it will receive the reflection from the sensor-end ... and around the 0.2mm fiber there is enough place/volume to feed the white light through.

This could be used even without a chroma sensor - fix a short FL lens to the sensor end and measure the reflected brightness - when the focus is exactly on the surface, the reflection is stronger ... above or below it will weaken ...

Edited 2 time(s). Last edit at 06/12/2019 09:20AM by VDX.

Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Piezoelectric disks for Z contact detect and bed levelling
June 12, 2019 10:42AM
I have actually tried the pressure drop method when deployable microswitches were the only common hight sensors used on RepRaps. I used a small nozzle of 2mm diameter feeding cooling air into a larger tubewith a 10mm diameter opening at the build stage end - when the area of the gap was less than the 2mm nozzle the pressure rose rapidly. The outer tube was lowered and the pressure for the sensing nozzle were both taken from the "near field cooling" air from an aquarium pump.

The Chrocodile sensor is very intriguing. I have come across confocal distance sensing before but with two different color light sources - deliberately using chromatic aberation is genius.

My trials with a piezo buzzer were not succesful as I was not able to make it insensitive to noise pickup. Although I never tried a fixed frequency and narrow band filter I abbandoned this as I thought it likely that getting a good noise immunity would probably mean that getting a confirmed signal would take several milliseconds and give a poor sensitivity.

On my trials of the new piezo sensor I have found that the difference between a nozzle contact on the aluminium of the bed and a bed with 130 micron thick overhead projector transparancy film is clearly picked up. This bodes well for the detection of dirty nozzles.

Re: Piezoelectric disks for Z contact detect and bed levelling
June 12, 2019 11:25AM
... for the sonic contact measuring you should optimize it to solely "structure-borne sound" (? - in German "Körperschall") - so the sound transmitted trough air is negligible, but instantly sensed with contact ...

Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Piezoelectric disks for Z contact detect and bed levelling
October 03, 2019 06:45AM
I thought that I would just update you on the progress of my new piezoelectric controller. The controller is one that gives two signals to the controlling device (Arduino, Duet etc..) One signal is to show that a nozzle contact has been seen while the other signal shows that the signal is good - not noise or contamination on the nozzle.
The latest software and hardware working, although showing that more work is needed. The circuit and program are very sensitive to a good bed contact, responding in 4ms and about 15µm of travel after the nozzle first touches the bed. It also detects plastic on the nozzle which I simulated with a 0.25mm rubber gasket. Although it rejects some mechanical noise, such as most finger taps on the bed or dropping 8mm balls on the bed, it can be fooled with careful finger taps. Worse though is that detects noise through the workbench and frame. This was most unexpected as it 100% immune to rattling from the end of an X or Y movement or the beginning of the Z probe down move.

I am presently rewriting the software to modify the windows that a contact event must be within to improve this. Hopefully, I can beat the noise through the workbench problem as I can see what it is doing. It may be more difficult to beat the calibrated finger tap though.

I have put the hardware on [circuitmaker.com] but because circuitmaker is less common than say Eagle, I have the circuit diagram below. I will put Gerber and NC files on the same site once the latest changes have been done (improved EMC and test points)

Software is on [github.com]

Beware though, the software is written in Microchip assembler both for speed and because I prefer it to high-level languages. I am given to understand that assembly language causes terror in the unwary and may cause brain rot.

I will not be pursuing this beyond the point where it works to my satisfaction so anybody who wants to copy is most welcome. MIT license applies so even commercial as long as attribution is given.

Re: Piezoelectric disks for Z contact detect and bed levelling
October 12, 2019 03:12PM
After a lot of testing, I have found that this conditioner works acceptably well for my printer. Having said that, it does seem that the recognition of the nice linear ramp will not give a universal conditioner that needs no adjustment. The signal to show that a contact event is or is not good will have to have some provision for adjustment. The things that have made ramp recognition less reliable than hoped for include a bounce in the signal [reprap.org] and greater than expected compliance at the corners of the build stage and variability between piezos.

Originally I had designed in some communication (I2C) between the conditioner and the controller (RAMPS/Arduino etc..) to effect adjustments but my excitement about how well a nozzle contact ramp is recognized led me to hope that no adjustment would be needed.

Present plans are to ignore the printer controller altogether for adjustments, doing them instead with a PC or laptop by way of the original I2C pins and a USB to I2C module such as this [www.robot-electronics.co.uk]


Edited 1 time(s). Last edit at 10/12/2019 03:14PM by leadinglights.
Re: Piezoelectric disks for Z contact detect and bed levelling
November 16, 2019 12:37PM
I received a flurry of PMs and emails a few days ago asking what progress there had been on the new piezo conditioner circuit so this is a report on the present status. There is some good news and some not so good news first.
The reliability and sensitivity remain good and new techniques have been introduced that help to reduce false "good nozzle contact" signals. Other good news is that it is looking more possible to discriminate particular reasons for reporting a bad contact event, in particular, the signal from a dirty nozzle should be detectable.
Principal bad news is that the goal of not needing to be tuned seems to be becoming more remote. A Delta printer with 3 underbed sensors mounted to a solid platform can likely be tuned by nothing more than selecting the Z probe speed. Mounting geometries for square beds on cartesian printers, particularly those with 3 point mounting are less tunable. 4 point mounting is ugly and prone to maladjustment, but may also not need tuning.
The problem here comes in two parts, The movement of the bed under the force of the nozzle is more than expected on the corner and, even at speeds as low as 2mm/sec, the plate bounces back giving rise to a hump in the contact response. The effect is shown in the attached diagram although this is not in the corner (even more messy) but about 2/3 of the way to the corner.

The upshot of all of this is that since the hump is dependent on the mass and the elasticity of the bed and other mechanical parts, controllers based on this will need tuning. If the bed is predictable then it should need no tuning and is almost a replacement for a microswitch - albeit with additional dirty nozzle detection.

Re: Piezoelectric disks for Z contact detect and bed levelling
January 17, 2020 10:58AM
Hi Mike!
Shall I tune asm code or at least some defines for the piezo sensor type ? or do you have some kind of calibration proc ?
Re: Piezoelectric disks for Z contact detect and bed levelling
January 17, 2020 02:43PM
Hi b0ba,
This project is going quite badly at the moment: I must have been psychic with the earlier comment about the bed being predictable - one of my printers is showing that this may be is a problem. There is a bit of a write-up in [reprap.org] In short, it is possible to get the sort of accuracy and predictability that would allow very accurate sensing directly over the sensors as long as they are a matched set. away from the sensors and with miss-matched piezos it becomes a bit messy and a drop-in "microswitch replacement" is unlikely.

I have not given up completely though and will be converting my Delta printer to use the MCU conditioner hopefully in the near future. A good feature that has not gone away is that it is very good at detecting plastic on the nozzle - even the difference between contact with the metal of the bed and with a Kapton layer is easy to spot.

So as far as the software goes, it is a bit out of date and I will need to do some serious updating. Watch this space but don't expect anything for a couple of weeks as I am trying to get some of the other parts of my new printer working.

Re: Piezoelectric disks for Z contact detect and bed levelling
January 17, 2020 03:33PM
Thanks Mike for the fast and advanced answer. I am looking right now z-probe solution for my Delta robot and found your idea very innovative. Typical solution has different kind of analog comparators with piezo sensor. Do you have under the bed sensors or solution like this [www.thingiverse.com] ?
Anyway, I would like to order PCBs in China and try. I am not sure only how is sensitive your source code for mechanical part of solution. Asm for this kind of controllers is not my key skill.
Looking forward for your progress.
EDIT: understand, you have under bed sensors. May be your solution will work better for the extruder mounted sensor.

Edited 1 time(s). Last edit at 01/19/2020 06:52AM by b0ba.
Re: Piezoelectric disks for Z contact detect and bed levelling
April 07, 2020 12:30AM
Mike, I know you have been busy with other projects but I'm curious if you have done any more on the piezo.controller. I'm at frustration city with my orion e3dv6 on a cartesian. I'm not ready to quit on it but I see where others have gone down a very deep rabbit hole with their piezo's with some having success and others giving up in frustration. Having tried the things that others have tried such as jens53 in the big piezo thread with no real success I feel that to get good repeatable results with a hotend based piezo probe requires more signal conditioning options and possibly an improved piezo mount. This is an opinion only since I'm not an expert. I have been playing around with these piezo sensors for about a year now and have had some success with under bed sensing but I would like a reliable hot end piezo . I love the piezo concept but hope and wish for a solution that is closer to plug and play, but that may not be possible.
Re: Piezoelectric disks for Z contact detect and bed levelling
April 20, 2020 05:10AM
Hi luckyflyer,
I am sorry that I have taken so long to respond but things have been difficult lately.
I have not made much progress with the controller as I have not found any way to reliably get around the dynamic behaviour of under-bed sensors I do not think they are a good solution for DIY. I did some experiments on my Delta printer where I moved one of the 3 sensors only 30mm from its original position and found that the trip force increased from about 10 grams to nearly 50 grams - and this varied with nozzle (Z) speed.

I have done some initial investigation with a view to making a very small piezo sensor which would be part of the printer hot-end. This would be based on a purpose-made piezo and would completely replace the hot-end mount - instead of being an intermediate adaptor. The design would not be easily made by DIYers and makers but the intention was to have them made in quantity (in China) and built into hot-ends by the hot-end manufacturer. This would make it principally a commercial item although likely could be fitted by competent makers. Unfortunately, the turmoil that the world is in means that communications and supply chains have been a bit fractured and I don't know if and when I will look at this again.

Re: Piezoelectric disks for Z contact detect and bed levelling
February 11, 2021 06:25AM
Short version for those for whom “Too long: did not read” is a mantra:
I am looking for suggestions for how to get software changes and any other comments or thoughts on my two-headed printer bed leveling method. Video at [www.youtube.com] and pictures below

Some years ago I became convinced that undebed piezoelectric sensors were the best technology for bed leveling in an FFF printer. In particular, the underbed piezos in my Delta printer were, and remain, completely reliable. Two other printers, both loosely based on the early Prusa Mendel design, had underbed piezos of the same design which were mostly reliable, though not bulletproof: I thought that the occasional less than sparkling result was down to the lack of rigidity of the unbraced sides of the design.

With my newest printer, I placed three underbed sensors well inboard from the edges. This was because the design of the bed gave only limited space for the placement of the sensors. It was only when I fully characterized the behavior of the sensors across the whole of the bed that I realized that there was a dynamic problem that gave rise to areas of insensitivity and that these areas were pretty much unpredictable – they also ended any hopes of getting the very accurate bed leveling that had been almost within my grasp. The effect was much like I imagine an early test pilot felt when he discovered that if he increased the angle of attack beyond a certain point that the aircraft would stall and he would plunge to his death.

In the intervening year, progress has been somewhat spasmodic until recently when I have started to get some very good results. The present approach is that there is only one underbed sensor plus one contact sensor mounted near the nozzles. The first nozzle is brought directly above the underbed sensor and a G30 probing operation called. The printing heads are then swapped and the G30 probing operation repeated and the Z distances for each is stored. Then both heads are withdrawn to a halfway position and the bed moved so that the contact sensor is directly above the same point that had just been checked with the nozzles. A third G30 operation is performed to obtain the offset at that point, followed by a G32, also using the contact sensor to obtain a leveling plane.

There is an added complexity in that the underbed sensor and the contact sensor have different outputs, presently wired to a RAMPS board with the underbed sensor being connected to the Z-Min limit switch pin and the contact sensor being connected to the X-Max pin.

Along with the added complexity though, there are some added benefits. The underbed sensor is able to determine if the nozzle has any plastic on the tip which would render a probing operation unreliable. Both of the probes can check that the baseline immediately before the probing operation is flat, not drifting with temperature changes, and is also free of mechanical or electrical noise. This last item can replace the normal necessity of having a delay immediately before the probing operation to allow the XY movement artifacts to die away. The outputs will require additional inputs to the host computer.

Where to next on this project depends on if I can get some features incorporated into one or more of the various firmwares that run on Arduino/RAMPS combinations. The main one is that two distinctly separate inputs to the host are needed for the probing with the nozzles and with the touch sensor. Also nice would be two more inputs, one to suppress probing until after the XY shaking has died away, ane one for the detection of plastic on the nozzle.

Sorry, only registered users may post in this forum.

Click here to login