Intro: Reprap Load Cell Z-Probe
I have been looking at adding Z-probing to my Prusa i3 for awhile. Having to flip down a contact Z-probe seemed unnecessarily painful and the probe, at best, would approximate the height of the nozzle tip. Force sensing resistors are another option which appear to work well, though getting the mountings exactly right can be a pain.
A load cell, as used in cooking scales, seemed to be a good idea. The load cell could become the main mounting beam between the carriage and the hot end.
There are several issues that had to be overcome in the design to make sure that
- the setup was sufficiently sensitive without false triggers – particularly from dynamic loads as the head moves around;
- various things that might cause false (or missed) triggers; and
- that the whole setup didn't drift over time.
Its operation is simple.
The HX-711 board continuously samples the weight of the extruder head (80 per second) which hangs on the end of the load cell. It transmits samples to the Arduino Nano.
The Nano raises a DigitalPin when the weight reduction from the nozzle touching the bed passes a pre-determined value.
This is picked up by the printer firmware using an unallocated digital input.
To counter drift, another digital output on the controller is used to trigger a re-zero (M42), just before a Z-probing is started.
The reference setup for this Instructable is:
- RepRap Prusa i3
- RAMPS 1.4 electronics
- Geeetech Mk8 extruder
- Heated bed with 3 point mounting
- Repetier Firmware (0.92.8) and
- Repetier Host 1.6.0
If your setup varies from this, you'll need to make adjustments!
Step 1: Get the Parts
- 1 kg (2lb) load cell (YZC-131 or similar). Size: 75-80mm x 12.7mm x 12.7mm (there are other smaller load cells that might work quite well, but don't fit my plastic parts).
- HX-711 sensor board.Arduino Nano V3.0 (5V, Atmega328) not the Arduino Pro Mini.
- A 2 x 3 female IDC cable at least 800mm long (or 2 x 3 header socket)
- Two part plastic mount for the extruder (Load_Cell_Extruder_Mounts).
The total cost of the parts is around $20 on eBay.
Step 2: Print the Plastic Parts
Print the front and back parts (files here) of the mount.
The design is for a Prusa I3 carriage and an extruder/hot end with a NEMA 17 motor.
The additional file is for a cooler duct that fits a 50 x 50 x 15 blower fan. Break off the six tags after printing - they are just to help bed adhesion.
Step 3: Connect Electronics
Don't install the header pins onto the Nano.
The Nano will be installed with the USB port at the top and to the outside.
Wire the HX-711 and Arduino Nano together. 75mm of cable should be enough.
- 5V Power: HX-711 VCC - Nano VCC [J2 Pin 4] (not VIN)
- GND: XH-711 GND - Nano GND [J1 Pin 4]
- Data: HX-711 DT - Nano D5 [J1 Pin 8]
- Clock: HX-711 SCK - Nano D6 [J1 Pin 9]
Wire the Nano to RAMPS cable. I made my cable 800mm long.
- 5V Power: Nano VCC [J2 Pin 4] (not VIN) - Cable Pin 3
- GND: Nano GND [J1 Pin 4] - Cable Pin 1
- Ztrigger: Nano D4 [J1 Pin 7] - Cable Pin 5
- Tare Pulse: Nano D3 [J1 Pin 6] - Cable Pin 6
Attach HX-711 and Nano to hot end rear mount, mount load cell onto the back mount and connect up the wires. Tuck the spare load cell wiring under the HX-711 board, with a piece of electrical tape to hold it temporarily in place.
Finally, Wire the load cell to the HX-711:
- Sense Power (Vavdd): LoadCell Red Wire - HX-711 E+
- Sense Ground: LoadCell Black Wire - HX-711 E-
- Cell -: LoadCell Green Wire - HX-711 A-
Cell +: LoadCell White/Purple Wire - HX-711 A+
Step 4: Assemble the Mount
Assemble the rest of the mount.
The order is important as many of the screws get hidden at later stages.
- Load cell to rear mount.
- Rear mount to carriage
- Front mount to Load cell
- Extruder to front mount
- Fan duct to front mount (optional)
- Cable tie all cables to both front and back mounts so that cables are securely restrained and are parallel to the load cell. Do not leave any cables out of the bundle as this will produce erratic readings as the carriage moves around!
Step 5: Firmware and Calibration
Connect the Nano to your computer via the USB and download the firmware using the Arduino IDE.
With the Nano still plugged in via the USB (and with your printer off), when the hot end is lightly pushed UP with your finger to simulate a z-probe (grams of pressure here, rather than kilograms!) the LED on the Nano should light.
If not, enable SERIAL_ON in the code and use a terminal program (e.g. Putty) to debug the readings from the load cell (see Step 7 - Debugging ).
If you're getting negative numbers with upward pressure to the hot end, either reverse the A- & A+ wires from the load cell or make the calibration_factor a negative number.
If you're not getting readings of the order of 100 – 1000 when light upward pressure is applied, adjust the calibration_factor, which should be around +500 with some (50g) pressure applied. I use a stack of three Australian 50c coins balanced on top of the outer mounting screws on the load cell to provide a ~50g weight.
If the reading is drifting (normal), just press the reset button on the Nano, which will reset the reading to zero. resetting the scale to zero (Tare) is triggered by the M42 command at the start of the Z-probe sequence.
Step 6: Speeding Up the Readings
Now comes the delicate part: changing the reading rate on the HX-711 from 10 samples per second to 80. This significantly improves the accuracy of the Z-probing.
On the cheaper boards there isn't a link that can be cut to enable this change, so the pin needs to be disconnected from GND and tied to VCC. Cut pin 15 just above the solder line, and bend it up.
Scrape a little of the protective coating off the track just above pin 16 and connect pin 15 to that track. I've used a 10k resistor, but that's not strictly necessary, a direct connection with wire is OK.
If you have bought a "red" board, then there is a link on the back. Cut it to make the rate 80 samples per second.
Step 7: Final Testing and RepRap Setup
Add a Jumper to the Power header on the RAMPS to connect the Servo header 5V pins to Arduino-supplied VCC.
Plug the header Cable into the RAMPS controller (SERVO pins).
In your Reprap firmware
- Enable Z-probing, with Digital Pin 5 as the sensing pin. No pull-up. Z-probe true when HIGH.
- I use
- 2 probe repetitions at each point
- 0.5mm probe switching distance
- 1mm/sec probing speed
The defaults for most of the other Z-Probe settings work OK
- Set up the tri-point bed leveling points. I have found that 15mm inside the three bed height adjusting screws works well.
My "auto level" script is simple and stored as a “push-button” script in my Repetier Host desktop controller. Digital Pin 4 is pulsed by the firmware (M42) to signal a re-zero at the start of each probing cycle.
M42 P4 S1 ; zero the load cell by pulsing Digital Pin 4
M42 P4 S0
G32 S0 ; bed level and store
Setup is now complete and everything should work.
Step 8: Debugging
Can't load Firmware
- Check the bottom of your Nano – if the chip is marked CH340G or similar, you need to install the correct drivers. This Instructable should help: Arduino Nano CH340.
Check the following:
- Output is increasing when pressure is applied to push up the extruder (i.e. as the extruder pushes against the bed). If the readings are decreasing, then either reverse the A+ A- wires from the load cell, or make the calibration_factor negative in the Nano firmware.
- All the stuff below.
False or inconsistent triggers
Check the following:
- Nano is not zeroing the readings before each probe sequence (M42 S1/S0 sequence) and the unloaded reading has drifted. The terminal interface (Putty) is the best way to check this behaviour. The set-up can also be zeroed by resetting the Nano (small push button).
- M42 command not supported by your firmware. Manually reset nano before probing.
- All cables from the extruder are securely cable tied at both ends of the load cell and run parallel to the load cell beam..
- Insufficient slack in filament between reel and extruder (extra pull up tension on extruder).
- Blobs of filament on the end of the nozzle.
- Calibration factor is incorrect – doesn't produce readings of around -500 (anywhere between -300 and -700 should be OK) when 50g weight is applied. Adjust calibration_factor factor in Nano firmware.