Inexpensive Piezoelectric Elements for Nozzle Contact Detection and Build Platform Leveling in FFF 3 D Printers

Inexpensive piezoelectric diaphragms can be used as sensors to facilitate both nozzle height setting and build platform leveling in Fused Filament Fabrication (FFF) 3D printers. Tests simulating nozzle contact are conducted to establish the available output and an output of greater than 8 Volts found at 20 ◦C, a value which is readily detectable by simple electronic circuits. Tests are also conducted at a temperature of 80 ◦C and, despite a reduction of greater than 80% in output voltage, this is still detectable. The reliability of piezoelectric diaphragms is investigated by mechanically stressing samples over 100,000 cycles at both 20 and 80 ◦C, and little loss of output over the test duration is found. The development of a nozzle contact sensor using a single piezoelectric diaphragm is described.


Introduction
RepRap printers are low cost 3D printers which can reproduce a substantial portion of the components that were used in its own construction.The RepRap project started at the University of Bath as an initiative to develop a low-cost 3D printer and now has many hundreds of collaborators.The stated goal of the RepRap project is To produce a pure self-replicating device not for its own sake, but rather to put in the hands of individuals anywhere on the planet, for a minimal outlay of capital, a desktop manufacturing system that would enable the individual to manufacture many of the artifacts used in everyday life [1].In order to meet the requirement for a minimum outlay of capital, a core objective of the RepRap project is that RepRap printers should be able to print many of the parts that are used in their own construction.Those parts of a RepRap printer that cannot be printed should be both readily available and inexpensive [2].Although designed as sounders, piezoelectric discs will also function as sensors they are useful components for making RepRap printers: This paper addresses the suitability of piezoelectric diaphragms as sensors for build platform leveling in FFF printers.
Piezoelectric diaphragms are readily available as they are used as in many manufactured goods and are also inexpensive: Prices for small quantities in December 2017 for branded diaphragms was £0.84 [3] while unbranded ones about £0.34 [4].Piezoelectric discs may also be salvaged from many sources such as greetings cards and toys as well as electronic equipment such as phones.
A feature of piezoelectric discs which makes them suitable for use in RepRap printers, and possibly in similar applications, is that they are quite robust.With moderate care it is possible to drill holes through the ceramic and the diaphragm with only minor degradation of performance.Piezoelectric discs have also had the ceramic part segmented with the modified assembly used to provide mechanical scanning for a Maker built scanning tunnelling microscope [5].
Taken together, the low cost and ready availability of piezoelectric discs along with their robustness make them an excellent component for use in RepRap printers and indeed in other equipment for the Maker communities, in resource constrained locations and even for the quick construction of prototypes and proof of concept models in well funded organizations.A selection of piezoelectric discs are shown in Figure 1 including two salvaged components and one with a drilled hole.FFF 3D printers, also known as FDM printers [6] produce a solid object by printing layers of material one upon another on to a flat build platform.The adhesion of the first layer to the build platform depends on several factors, the thickness of the first layer being a very important one [7] as thick or thin areas can result in a print detaching from the build platform [8].The nozzle height above the build platform determines the first layer thickness and can be influenced by many things such as: The build platform itself may be less flat than is needed for a good print; initial adjustment may have been effected by thermal expansion of parts of the printer while routine changes of parts such as the printer nozzle or build platform are likely to change the nozzle height and the first layer thickness.Measuring the nozzle height at a number of positions over the area of the build platform before the first layer is printed can allow manual correction or automatic optimization of the first layer or layers.
The early RepRap printers leveled the build platform manually by adjusting three or four sprung adjusting screws [9].As manual adjustment was laborious and may be required frequently, methods were sought to automatically check the height of the printer nozzle without resorting to tools such as feeler gauges.Once the earliest automatic methods of measuring the relative distance from the nozzle to the build platform it became possible to use software to compensate for distortion of the build platform and ultimately to compensate for geometric errors in the printer itself.
The first methods used on RepRap, DIY and Maker built 3D printers for automatic build platform leveling measured the distance between the print nozzle and the build platform using a switch which could be manually, mechanically or electrically deployed.Proximity sensors have also been used including inductive, capacitative, ultrasonic and optical sensors, both industrial and purpose built.Proximity sensors are difficult to place close to the nozzle and will not measure the proximity of a point directly under the nozzle.Other sensors detect the nozzle contact coming into contact with the build platform so measuring the nozzle height as well as its horizontal position.The majority of the available information of the various sensors used for build platform leveling in RepRap printers can be found on the RepRap Wiki where a range of sensor types are described [10].
Nozzle contact sensors include electrical contact types which rely on a clean conductive nozzle contacting a clean conductive build platform; FSR (force sensitive resistor) sensors [12] which detect the pressure of the nozzle on the build platform beneath which several FSRs are mounted; Accelerometers which detect the deceleration of the print head when the nozzle contacts the build platform; Strain Gauge sensors using foil strain gauges, elements etched directly into the PCB or load sensor elements; microphonic sensors which detect the vibration caused by nozzle contact and piezoelectric sensors.The piezoelectric sensors described in this paper are nozzle contact sensors.
Although there had previously been discussion in public forums of the possible use of piezoelectric diaphragms as sensors in RepRap printers, the first reported use of them was by Njål Brekke [13].
The piezoelectric diaphragms described in this paper are typified by the Murata 7BB series [14] and any functionally similar replacements from unidentified manufacturers.These diaphragms are used in musical novelties, as the voice in toys, to produce the warning sound in alarms, to replace the mechanical click sound in tactile keyboards and in a great many other ways.
Conversion of electrical energy to mechanical energy in piezoelectric diaphragms is by what is correctly termed the "Inverse Piezoelectric Effect".However piezoelectric materials also exhibit the "Direct Piezoelectric Effect" where mechanical energy is converted to electrical energy: It is this effect which is used by the sensors described in this paper.The diaphragm consists of a piezo-active ceramic disc bonded to a metal disk and a conductive layer on the opposite surface which form the electrical connections.
The design intent of these piezoelectric diaphragms is the conversion of electrical energy to mechanical movement when an electrical potential applied to the piezo-active ceramic causes the centre of the diaphragm to bow relative to the periphery.The ceramic used will also operate in the reverse sense, a pressure that causes the diaphragm to bow or to bend will generate an electrical charge between the electrodes.In addition, a pressure applied directly between the face and the substrate without causing it to bend will also generate an electrical charge.
In order to assess the usefulness of inexpensive piezoelectric diaphragms as sensors in FFF printers an experiment has been designed and equipment constructed to simulate nozzle contact events in FFF 3D printers.Various pressures are applied directly to a piezoelectric diaphragm and the voltage generated are recorded.
It is known from earlier tests [15] that the response of piezoelectric diaphragms can be considerably reduced.It must be noted these were only records of a single pressure release event and would not be indicative of long term performance, although it was noted that some makes of piezoelectric diaphragms performed much better.
The limitation of use at higher temperatures is investigated in this article as well as the effect of large numbers of simulated nozzle contact events at room temperature and at temperatures near the limit of sensitivity.Data is compared for diaphragms before and after thermal cycling to assess the ageing of the diaphragms in service.
The development of a Z probe integrated into the printer hotend is described by Simon Khoury in the discussions section of this article.

Materials and Methods
The experiments conducted were intended only to determine if piezoelectric discs could be used reliably as a method of detecting a contact between the printer nozzle and the printer build platform with an acceptable degree of accuracy.It was a further aim to determine if the reliability or accuracy would be adversely affected by long term use or if higher temperatures would cause a loss of reliability.
The upper and lower limits of thickness of all parts of the initial layer of plastic which would be fully adhered to the build platform would change with many factors: The thickness of the first layer, the nozzle diameter, the plastic material, linear speed of deposition, width of plastic laid down etc.For typical RepRap FFF printers with a nozzle size between 0.25mm and 0.5mm and a first layer thickness of 0.25mm to 0.3mm a commonly accepted variation from the desired thickness of ±50µm is regarded as being acceptable.
An Electrical Response jig to simulate nozzle contacts was constructed and mounted in a Proxxon MF70 light milling machine [16] modified for CNC control which was controlled through Mach3 software [17] to provide the required mechanical action.The jig is depicted in Figure 2 and has a small table mounted on an actuator rod which is connected to a 3D printed parallel mechanism, the parallel mechanism transferring pressure to the piezoelectric diaphragm through a 3D printed pressure pad.
A load spring maintains an upward pressure on the actuator rod and on the diaphragm through the parallel mechanism.A preload adjuster centres the pressure pad at its resting position and provides a small force on the piezoelectric disc after the spring load has been removed.The CNC machine is programmed to start a probe moving towards the actuator from 1mm above it and to continue for 0.5mm after striking the actuator.This was done to eliminate the effects of the acceleration and deceleration times which are a feature of CNC programs.In order to check for loss of sensitivity in use including that at higher temperatures, a test rig was fabricated to stress piezoelectric discs by alternately applying a pressure to the disc and relaxing that pressure over a large number of cycles and over a range of temperatures.The rig consists of an aluminium block having a flat surface on which the piezoelectric disc is mounted and a pressure pad having a flat surface of the same diameter as the upper electrical contact of the disc.A force generated by a spring is applied by way of an actuator rod and a parallel mechanism to the pressure pad; an electrical solenoid acts to relax the major part of the pressure on the piezoelectric disc at regular intervals.
Provision is made to adjust the pressure on the pad due to the spring, the pressure due to the elasticity of the joints of the parallel mechanism and the mechanical travel of the armature and actuator rod.The rig, shown in Figure 3, is mounted on a stand which also carries a dial indicator for checking the travel of the actuator rod and the pressure pad adjusting screw during adjustment.An upward force is applied through the return spring adjusting eye with a spring dynamometer to set the spring pressure.Adjusting the preload applied by the parallel mechanism is done by lifting the free end of the parallel mechanism with a spring dynamometer with the solenoid operated.During commissioning of the rig the following were found to be usable values: Force applied by the parallel mechanism alone to the piezoelectric disc 0.5N; force applied through the actuating rod 4.5N when lifted 0.25mm from its resting position; Armature to Solenoid clearance in the non-operated state 0.8mm; overtravel of the actuator rod from the point that pressure is relaxed to full travel of the solenoid 0.3mm.The dial indicator is removed during cycling tests.
The temperature of the piezoelectric disc is maintained by a resistance heater in the heater block and a thermocouple temperature controller [19].The voltage generated by the piezoelectric disc was recorded by a digital storage oscilloscope [20] and a X10 probe.

Electrical Response of Piezoelectric Diaphragms.
A first batch of 10 piezoelectric diaphragms were obtained on eBay, the manufacturer of these is unknown but they were similar in size and appearance to Murata 7BB-27-4LO.The traces below were all from one of these diaphragms fitted in the Electrical Response Jig shown in Figure 2.  The probe strikes the actuator and over-travels by 20µm each cycle from 20 to 220µm.The voltage response is shown in Figure 5.The increase in peak voltage is again approximately linear.However the travel at greater than 120µm is 33% more than the 90µm implied by the first test.It is speculated that this is due to the deceleration phase from the CNC software although an exact value for this is not known.
To obtain data on the force response the solid probe was replaced with a light spring and travel was set so that with each cycle the force applied by the spring was increased by 20 grams force to a maximum of 100 grams force.To obtain the required spring rate an Entex stock no.3352 spring was shortened to give a rate of 125 grams per mm.The resulting voltage is shown in Figure 6, the available voltage being significantly reduced by resistive leakage through the oscilloscope probe.The remaining nine piezoelectric diaphragms were all checked for basic voltage output and did not differ visually from the first one shown in Figure 4.

Cycling tests to determine service life.
Using the test equipment shown in Figure 3, a Murata 7BB-27-4LO piezoelectric diaphragm was mounted and subjected to 100,000 cycles of pressure at 5N relaxed every 5.4 seconds to 0.5N for 2 seconds.After an initial hour to allow the equipment to settle the output was monitored and recorded every 25,000 cycles.The temperature was checked when each reading was taken and remained within  To investigate any change that may occur at higher temperatures the piezoelectric diaphragm was replaced with a new Murata unit and the temperature of the heater block raised to 50 o C. The peak amplitude was initially 12.0V but increased to 13.5V after 50,000 cycles.As this increase had been unexpected, a further new Murata piezoelectric diaphragm was fitted and the temperature increased to 80 o C. At this higher temperature the peak amplitude increased from 3.8V to 6.0V over the duration of the 100,000 pressure cycles, this change being plotted in the red line in To determine if the increase was an effect of the temperature alone a further test was devised.Using a new piezoelectric diaphragm the rig temperature was rapidly bought up to 80 o C while the diaphragm was maintained at a pressure of 5N without pressure cycling.At several points the solenoid was operated for long enough for three pressure cycles to be applied and the resulting voltage to be recorded, about 15 seconds.The resulting peak amplitudes, recorded over 175 hours and plotted in the lower (green) trace in Figure 8, indicate that the higher temperature is the principle cause of the rise in output.In previous tests [15] a relatively rapid decline in sensitivity of piezoelectric diaphragms with increasing temperature was found.A new test was conducted in order to better categorize this in combination with the observed increase in high temperature sensitivity over time.A new piezoelectric diaphragm was fitted to the temperature response rig

Piezoelectric sensors in RepRap printers
Since the introduction of this method of detecting nozzle contact, members of the RepRap community have used a wide range of ways of applying piezoelectric diaphragms, not only for this purpose; but also to replace limit switches used for detecting the homing position for delta printers as well as Cartesian printers.A nozzle contact technique which has been successfully applied is to use a single diaphragm in a fitting which holds the hot-end of the printer -an example of this is described below and kits are available from [21].Piezoelectric diaphragms may be fitted to detect upward contact pressure at the nozzle end, or they may be used to sense the downward pressure on the build platform by using a number of diaphragms -typically three -mounted between the platform and its mountings.
The RepRap forum has been instrumental in the development of this technology with active threads following the development of the idea [22], support of both the open source, and purchased kits of piezoelectric Z probes as well as the development of conditioning circuitry [23], [24].
The conditioning circuitry typically consists of a resistance/diode protection circuit followed by a high impedance low gain ( unity to 5) amplifier and a comparator.There may be low pass filtering of the input signal to remove mechanical and electrical noise and high pass filtering to remove the effect of temperature drift on the piezoelectric diaphragm.The most commonly used conditioning circuitry is that designed by Idris Nowell (Moriquendi) and is available through Precision Piezo [21] There is some evidence that the use of piezoelectric diaphragms in Maker and DIY printers has spread beyond the immediate RepRap community with kits being sold in South America [25] and pirated copies being available from a Chinese source.[26]

Piezo Electric Nozzle Contact Sensing by use of drilled piezo ceramic discs
A further development in the use of piezo electric sensing systems, as discussed here, was made by Simon Khoury.At the time (Jan 2017) the use of piezo electric sensing of nozzle contact by placement of piezoelectric discs either beneath a 3D printer's build platform, or somewhere upon its print head assembly, was already known.However, the system of placing the discs below the build platform, required at least three piezo discs, sometimes four, so was considered more complex than necessary.
The build platform assembly is frequently mounted on a moving axis, the Y-axis in some cases (I3-type printers and their derivatives) or the Z-axis (for example corexy style printers) which results in two potential issues: Firstly, if the axis in which the piezo electric diaphragms moves, and such movement is required to bring the build platform and nozzle into contact this can, depending on the design and the quality of linear motion components, create mechanical noise which reduces the sensitivity of the apparatus.As such, the scheme of placing the sensors under the build platform is especially suitable on a delta printer, where the bed is fixed in place, but less satisfactory on other designs with moving build platforms especially in the z-axis direction; secondly the stability of the build platform resting on mounts containing piezoelectric diaphragms, can be affected in this scheme, resulting in a mobile build platform, which inevitably causes reduction in print quality.Mounts are either more stable though more complex and expensive to build, or less stable but often cheaper and easier to construct.It is required that as much of a 3D printer be as rigid as possible in use including the build platform and its substructure, primarily to ensure the accuracy of the printed objects, and secondarily to enable accurate probing to take place.Additionally since 3D printers enhance the adhesion of the deposited polymer to the build platform by the use of heat, usually in the range of 55 o C to 115 o C, the possibility that the piezoelectric discs would heat up in use existed, which would cause undesirable changes in performance (reduced sensitivity or erratic triggering.)This lead to the realisation that a simpler method of using piezoelectric discs as sensors for nozzle contact was possible.
The key innovation, was to drill a hole through the centre of the piezoelectric disc, in such a way that it would still function adequately afterwards.Indeed, the cutting by either spur point drill bit, utilizing moderate force and low rpm, or the use of lathe to cut the hole in the disc resulted in a hole through the upper conductor, ceramic and lower brass body of the disc of good quality.A hole of between 4.5mm and 5mm was chosen to minimize the amount of ceramic material removed, which generates the voltage during deformation, and to allow the 3D printing polymer (filament) to pass through the disc.In the case of the more common 1.75mm diameter filament type, a PTFE guide tube (2mm ID 4mm OD) was used to surround it, which prevents undesirable flexing of the filament as it is driven into the melting chamber above the printers nozzle (hotend).In the case of a 3mm filament no guide tube was used (as this filament is stiffer due to its larger diameter).It is noteworthy that while piezo-ring devices already exist with holes centrally located, the cost of these devices is higher than for piezoelectric discs described here and they are available only from specialist suppliers.
Having determined by test probing, and testing of various drilled piezo electric discs on an oscilloscope, that the disc still functioned as it did when un-drilled, albeit with a reduction in voltage generated equal to the proportion of ceramic material removed, but well within the range at which detection with high sensitivity is possible, the next step was to mount the disc above the extruded polymer heater assembly.
An extruded polymer heating assembly -referred to generally as a hotend -typically consists of a metal block with an electrical heating element placed into it, a nozzle threaded into the metal block through which the polymer is extruded, and a thermistor or PT100 sensor to provide closed loop control by PID of the temperature.This is attached to an externally threaded metal tube (ceramic/polymer in some types) which is threaded into the metal block (hotend) at one end, butted tightly against the mating surface of the nozzle, and at the other end into a (typically) aluminium heat-sink (correctly known as a coldend), the purpose of which is to prevent the heat in the hotend, (often between 180 o C and 270 o C) from rising by conduction to the print-head which can often be made of printable polymers, such as ABS, to enable parts to be printed by the machine itself.These polymers would soften at around 130 o C, and deform without the heatsink, and typically a fan with duct to pass air through it.
Construction of the sensor units shown in Figure 10 consisted initially of two 3D printed polymer (ABS) components and a piezoelectric disc (Murata 7BB 27mm).The lower part incorporated a clamp that held the heat-sink mentioned above with its hotend attached, and which incorporated a surface on its upper aspect which contacted the piezoelectric disc.The upper part on its lower aspect incorporated a surface for contacting the piezo electric disc, fixing holes for attachment to the lower part and some method of attachment to the print-head.As such the design, in its most basic form, is a piezo electric disc (with the hole drilled) sandwiched between two 3D printed polymer parts -one attached to the printhead and the other to the hotend/coldend assembly.The filament can pass through the sensor assembly and piezoelectric disc due to its centrally drilled hole, and into the heat-sink, hotend and reach, ultimately, the nozzle.When the nozzle and build platform are brought together so that contact occurs, a force is generated which is transmitted directly upwards through the assembly.The force required to register contact is only in the order of 10-15g depending on the hardness of the printing surface on the build platform, of which many types are in common use.This force can be modified by changing the speed at which the nozzle and build platform are brought together during probing.When this occurs a voltage is generated by the piezoelectric diaphragm which can be detected an amplifier circuit.
One of the key requirements of a sensor within a mounting system for the hotend/coldend assembly is for the hotend/coldend assembly mounted using it, to be as rigid as possible.Having lateral movement of the nozzle greater than 20-30µm during printing is highly undesirable, and would result in low accuracy printing, especially during the deposition of external perimeters.As each layer of material is deposited its upper surface is rarely uniform enough for the nozzle not to occasionally contact it when it passes over during printing of the next layer.Vertical movement of the nozzle is also undesirable but so long as it is less then 100µm, its effect on the accuracy of the print is acceptable.The sensor unit's design therefore is a compromise between having high sensitivity for nozzle contact which would be achieved by having a relatively loose assembly which allows for greater compression/flex in the piezoelectric disc, yet an unstable nozzle, and having an extremely tight assembly which would have much less sensitivity due to pre-loading of the piezoelectric disc, but exhibit greater nozzle stability.
Another aspect considered was that in the first prototype shown here, which used a 27mm piezoelectric disc, the mechanism by which force was imparted to the piezoelectric disc was by uniform compression.Whilst this achieves reasonable sensitivity, greater sensitivity can be achieved by flexing the disc.In this version four screws were used to hold the assembly together.This allowed a reasonably firm assembly to be constructed.Another version with three screws holding the assembly together was deemed to be too flexible and polymer pins were introduced alongside the screws, the idea being that the lower part could slide on the pins, the pins acting to limit lateral movement in the assembly and attached hotend/nozzle.This was later designed-out as the unit became smaller and this lateral movement was reduced.
Later versions shown here used a flange on the uppermost aspect of the lower part which engaged the piezoelectric diaphragm just lateral to the hole drilled into it and was 8mm internal diameter and 10mm external diameter.The upper part of the assembly incorporated a recess, with a lip into which the piezoelectric diaphragm sits.As such when these two components are attached to one another the diaphragm is bent centrally against its upper support and placed in light pre-load.This enhances sensitivity whilst achieving much less movement laterally at the nozzle.Another change was to make the unit smaller, in order to do the size of piezoelectric disc reduced from 27mm to 20mm.

Conclusions
The results of the equipment tests have been limited to determining if the output was sufficient even without conditioning circuitry to be reliably detected with either an analog or digital input of an controller, typically an Arduino, such as is often used with RepRap printers.The tests did demonstrate that a useful level of reliability, sensitivity and repeatability of piezoelectric diaphragms can be expected and the cyclic tests have indicated that a long service life should also be expected.
The tests conducted at 80 o C, both with pressure cycling and statically, do not extend to a long term but the relatively small change in output over the short term gives no reason to expect unreliability.
Piezoelectric diaphragms have other useful characteristics such as robustness, high availability and low cost.Some weaknesses such as the variability of response, temperature drift and polarization are known and are largely due to the uses described here relying on parameters not specified for manufacturing.Despite the foregoing, the output from these components is so large that even a poor quality piezoelectric diaphragm is able to give an output much greater than is needed for accurate detection of the 3D printer build surface.
In order to promote the widespread adoption of this technology and method of probing the build platform of a 3D printer, the company Precision Piezo [21] has been formed which has, during its first 6 months of operation sold some 125 units.These have been performing extremely well and the variety of 3D printers on which they are used increases daily.The technology which is discussed here is open source in nature and rooted in the RepRap community where ideas such as this continue to be discussed, developed and shared for the good of all.

Figure 1 .
Figure 1.A selection of piezoelectric diaphragms, from left to right -35mm diameter, 27mm with drilled hole, 20mm diameter salvaged unit from greeting card on top, Murata unit below, 12mm salvaged unit on right.

Figure 2 .
Figure 2. Test equipment for obtaining response data.

PreprintsFigure 3 .
Figure 3. Test equipment for obtaining temperature response and ageing data.

Figure 4 .
Figure 4. 1mm per second with pre-travel and after-travel.Vertical 2V per cm, Horizontal 50ms per cm

Figure 5 .
Figure 5. Cycling 1mm per second with increasing travel.Vertical 5V per cm, Horizontal 1 second per cm

Figure 6 .
Figure 6.Cycling 2mm per second with increasing force.Vertical 1V per cm, Horizontal 1 second per cm 20 o C±2 o C at each reading.The first and final oscilloscope records are shown in Figure 7 and the peak value graphed and shown in the top (blue) trace in Figure 8.During this test the peak voltage fell from 25V to 23.2V

Figure 8 .Figure 8 .
Figure 8. Change of peak amplitude with temperature and number of pressure cycles

Figure 9 .
Figure 9.Effect of temperature on peak response before and after 50,000 pressure cycles at 80 o C

Figure 2
and the pressure cycled as in earlier tests.The temperature was bought up rapidly in 10 o C steps to 80 o C and the peak amplitude Preprints (www.preprints.org)| NOT PEER-REVIEWED | Posted: 21 December 2017 doi:10.20944/preprints201711.0181.v2at each interval was recorded.The test was continued for 50,000 cycles with the temperature held at 80 o C after which the heater was turned off and peak amplitude recorded every 10 o C down to 30 o C. The results of this test are plotted in Figure 9, the lower (blue) line showing the peak values before the heat soak and the upper (red) line showing the peak values after the soak.