A Scanning Z Probe for RepRapFirmware and Duet
Recently we saw the announcement of the Beacon scanning Z probe. Unlike traditional Z probes, it doesn’t have to be lowered at each probe point in order to measure the deviation from Z=0 at each probed point; instead the bed is scanned and the deviation is measured at a (potentially large) number of points. Does this offer significant advantages over traditional Z probes, such as BLTouch and (for delta printers) the Duet3D Smart Effector? The Beacon has a USB interface and is designed for use exclusively with Klipper firmware. Can we use the same technology with other firmwares – in particular RepRapFirmware – and at the same time reduce the cost?
The Beacon probe has been analysed in this Twitter thread. Basically, it uses a LDC1612 inductive sensor ship, coupled with a small microcontroller (likely a SAMD21) to process the output of the LDC1612 and provide a USB interface. The LDC1612 is nothing new. You can buy a breakout board from Seeed either directly or from distributors, such as RS Components in the UK. The associated Github Repository was created in June 2018. However, what the creators of the Beacon have done is to recognise the potential of the LDC1612 chip to measure deviation from an ideal height, rather than to use it as a traditional inductive Z probe with a triggered/not-triggered output.
The Beacon is priced at $79.99 which is more than some 3D printer control boards. I guess that Beacon3D is attempting to recoup their development costs before their product gets widely cloned.
Inductive Z probes are far from ideal for 3D printers. Before you buy one, consider the following:
It’s clear that a scanning inductive Z probe offers potentially significant time savings compared to a traditional inductive Z probe. So, if you’ve decided that an inductive Z probe is right for your machine, is there a way to use the Beacon with Duet and RepRapFirmware, or to construct an alternative with similar functionality and (preferably) at lower cost? The manufacturers of the Beacon have stated that it is for use with Klipper firmware only, so we can’t expect any help from them.
Perhaps the biggest obstacle to using it with Duet is that the interface to it is via USB only. This presents two problems:
Prototyping this was not difficult. The Seeed LDC1612 evaluation board is priced at $16.40 plus carriage. It’s also available in the UK from RS components, at £15.30 including VAT. If you are into making your own PCB then you can purchase a bare LDC1612 chip from Digikey for just $3.75 plus carriage. The Seeed module includes a 40MHz oscillator, so if you use the bare chip then you will need to either use the oscillator built-into the chip, or provide a 40MHz oscillator, or generate a suitable clock for the SAMC21 on the tool board (my sample tool board firmware generates a 32MHz clock on the PA23 test pad).
Version 1.1 and later of the Duet 3 Tool Board uses a I2C bus with 3.3V signals levels to connect the LID3DH accelerometer. The Seeed module or a bare LDC1612 chip can be connected to the same bus. I picked up +3.3V and GND for it from the IO1 connector, tapped into the SDA signal on resistor R54, and the SCL signal on R53. These resistors are 0402 size so I used a fine-tipped soldering iron. Here is an image showing the location of the two resistors on the version 1.2 tool board, close to opposite corners of the accelerometer chip. I have circled the two pads that the wires connect to.
Here is a photo showing the wires connected to those points. I found wire wrapping wire suitable for this because it is thin but solid core.
Here’s how I connected the Seeed LDC1612 board to the tool board for the purposes of testing.
I chose to install the scanning sensor on my E3D Tool Changer, which I had previously modified to use a Duet 3D 6HC main board and tool boards for two Hemera tools. Rather than mount the sensor on one of the tools, I chose to mount it on the tool pickup head. I printed a part to replace the original printed cover of the tool pickup head. The tool board is wider than the front of the pickup head, so to keep it clear of the sides of the machine when the pickup head is at the extremes of the X axis, I extended the cover upwards to hold the tool board clear of the machine frame. I also extended the bottom of the cover to mount the sense coil about 3mm higher than the Z probe microswitch on the pickup head. Here are some more photographs.
The microswitch on the tool pickup head is a stable and accurate Z probe, whereas inductive Z probes are known to be sensitive to temperature. Therefore I chose to use the inductive sensor as a secondary Z probe. This also allowed me to compare height maps produced by the scanning probe with height maps produced by the microswitch. Here’s an extract from my config.g file:
; Microswitch Z probe
M558 K0 P8 C"io3.in" H3 F1000:600 I0 T30000
M558 K0 P8 C"io3.in" H3 F1000:600 I0 T30000
G31 P200 X0 Y0 Z0
;M557 X-140:140 Y-80:80 S40 ; temporarily disable original mesh grid
; Scanning inductive Z probe
M558 K1 P11 C"24.i2c.ldc1612" F25000 T30000
G31 K1 Z3 Y-17M557 X-140:140 Y-90:80 S12 ; define mesh grid for probe 1
The next step was to modify the mesh.g file to handle the K parameter, so that I could use G29 K0 to use the original microswitch probe, or G29 K1 to use the scanning probe:
; mesh.g file, handles G29 commands with no S parameter
; mesh.g file, handles G29 commands with no S parameter
T-1
M208 S0 Y100
if exists(param.K) & param.K=1
G1 X0 Y0 F30000 ; move to bed centre
G30 K0 ; re-establish Z=0
M558.1 K1 S2 ; calibrate the scanning probe
G1 Z7 ; approach from above in case of backlash
G29 S0 K{exists(param.K) ? param.K : 0}
G1 X0 Y0 F24000
M208 S0 Y49
G1 Y-150
I chose to calibrate the scanning probe immediately before scanning the height map. It’s probably not necessary, but it takes only a few seconds and makes the process less sensitive to temperature. The whole calibration and scanning process takes around 20 seconds..
Here’s an example of the height map produced by the scanning probe.
For comparison, here’s the height map produced by the microswitch probe:It is evident that the height maps have similar shape but there is a small Z offset between them.
The scanning probe using LDC1612 and the 20mm search coil on the Seeed breakout board appears to work well, at least when used in combination with a regular Z probe to establish an accurate Z=0 datum.
Further work remains, in particular:
Although I prototyped this using a Duet 3 tool board, for those not wishing to make hardware modifications it would be possible to use a SAMMYC21 board instead. I have added LDC1612 support to the standard SAMMYC21 firmware configuration.
Here is a short video showing the prototype in action: