Monday, 4 April 2011

Auto z-probe

A niggling problem I have with Hydraraptor is that the z-axis calibration varies with the weather and how much it is used. This is because the frame is made from wood, which absorbs atmospheric moisture and expands. When the machine is running constantly the heat from the bed dries it out and it plateaus at a low z-value. If I don't use it for a while the z-axis gets higher by as much as 0.5mm in wet weather and the first few builds need large adjustments. When printing raft-less the initial layer height needs to be accurate to about 0.05mm for 0.3mm layers.

When it was configured as a milling machine I made a tool height sensor to solve the problem. It doesn't work for FFF though because the nozzle usually has hot plastic dribbling from it and it also wastes some of the build area.

To solve the problem I designed a z-probe that hangs below the nozzle at the start of the build but then retracts itself after the measurement. It consists of a weighted metal rod that slides through a couple of plastic guides. It has a plastic flange on the top that depresses the plunger of a light action micro switch. In measurement mode the rod protrudes about 10mm below the nozzle. When the measurement is completed the axis descends to place the nozzle close to the bed. The rod lifts until the attractive force of two Neodymium magnets causes it to be pulled about 5mm above the nozzle and held there until the start of the next build.

Here it is installed on the axis.

I used a Meccano worm gear as an improvised weight to ensure the micro switch is activated, much cheaper options exist! The actual weight is surprisingly not very critical. It must be enough to activate the switch reliably but not too heavy for the magnets to lift.

The operating procedure is as follows: The machine warms up the bed and the extruder and waits for a couple of minutes for the nylon pillars that support the bed to expand fully. It then extrudes a length of filament with the z-axis at the top and gives an audio prompt on my computer. I grab the filament and snap it off and then lower the z-probe, which closes the switch and instructs the machine to start.

The axis descends rapidly to place the rod 1mm above the centre of the bed. It then descends in 0.1mm steps until the switch opens. Then it ascends in 0.01mm steps until the switch closes again and that gives the Z calibration point, which is a known distance (about 10mm) above the bed. The nozzle then descends to 1mm above the bed to retract the probe before it moves to the start point.

Here is a video of the sequence.

It could also lower the probe automatically simply by having a bracket near the top of the z-axis to catch the flange as the axis rises past it. The reason I don't do that at the moment is because I use the act of manually lowering the probe as a cue to the machine that I have removed the start extrusion.

The design is on Thingiverse.


  1. Clever, I like that, low tech, reliable and it works.

  2. Yes if you can call Neodymium low tech. A lower tech way of providing mechanical hysteresis would be a pivoted weight that passes a tipping point.

  3. A very neat solution to the problem. Is your ambient temprature constant wondering how the Z axis metal work expansion might affect tolerance.

    I like to see Neodymium used to solve problems.
    Reminds me of the old Neon Novilties articles in Pratical Wireless.

    How many years have Weller been using magnets. I can't remember not having a TCP bit started work in 1971.

  4. Yes ideally it would be mounted on the z-axis closer to where the extruder is to be less affected by the aluminium expansion. I am hoping that will be small though as it runs at a fairly constant temperature.

  5. Good idea! only how are you keeping the friction between the pin and the mounting small enough? Just by the weight? And how do you know at what distance from the platform the switch does change state? Or is that a kind of experimental determined threshold?

  6. The holes in the guides are well clear of the rod apart from a small section at the end which is reamed to fit. That keeps the friction small. The rod alone is just about heavy enough to close the switch, it is very light action. The weight mitigates any friction effects.

    The offset is determined as follows: The machine was calibrated by other means to give good prints. I then added the probe and found out what z-value it triggered at. That gave me the offset from the nozzle and from then on I add the difference between the measured value and that initial reading.

  7. You could electronically drop the probe by winding some magnet wire around one of the NdFeB magnets and then running a current through it to cancel out the field thus dropping the probe. As a first test, just use a bench supply or a pot to raise the current slowly until the probe drops. Then setup a channel on your controller to apply that current when you want the probe to come out. NdFeB magnets can take being brought down to zero flux without damage or demagnetization if they're not too hot (>200C or so).

  8. What about using a servo to auomatically get it down?
    I've seen some z-probes for the ToM that do this.

  9. Yes a servo or a solenoid could be used to automatically deploy it, but if you have spare travel in your z-axis, a bracket positioned to push it down as the z-axis rises to the top is much cheaper and simpler.

  10. fantastic idea, i'm thinking of using force sensing resistor attached to the print bed in-order to acheve the same thing... can you see any problems with this idea?... or any ways to improve it?... btw i'm not going to use the extruder to press it, will probs attach something to the extruder so that no drops of plasic will drop on the FSR

  11. If you attach something to the extruder to press the FSR then doesn't that need to be retracted out of the way when printing?

    Will the heat from the bed affect the FSR?

  12. Hi nophead
    do you have links to the CAD or stl files?

  13. The last line of the post is a link to Thingiverse.

  14. Hi nophead,
    I've printed out your design. got the micro switch. but now i need to understand how to connect it to the machine. please advise where the wires go. and is there code to add. i couldn't find these instructions.
    I'm really looking forward to getting this bad boy in action!!!

  15. I use my own hardware, firmware and software. I don't think anybody has added this to any of the reprap firmwares or hosts yet, AFAIK.

    You would need to connect to a spare input on your controller with a pullup resistor. Some electronics have max limit inputs as well as min. Perhaps you could use Z max, but you would need to modify the firmware.

    A quick hack would be to wire it in place of your normal limit switch and then connect that to the normally open pins. When the probe was retracted your normal limit switch would work and stop the nozzle hitting the bed. When deployed you could home to it. I think you could then send some G code to offset the Z axis by the distance from the probe to the nozzle.

    I don't know if you will be able to auto retract it because most firmwares don't allow you to step past the limit switch. You could manually retract it though.

    Sorry I can't be more help, but I have no experience with any of the Reprap hardware or software.

  16. thanks,
    Im running a makerbot TOM.
    im a bit of an beginner with electronics & programming, but will give it my best shot. have you experience with the TOM? any suggestions with the TOM?
    what about using the z endstop but in reverse? i.e the height of the bed could be worked out from this z probe instead, maybe by changing the code of the "new" z calibration in skienforge one could use the Z-probe to get a more accurate height. possibly modifing it furture to work as an auto bed leveler. any ideas or comments?

  17. No I don't have any experience of TOM, but I vaguely remember somebody adding a retractable probe to a Makerbot and putting it on Thingiverse. They used a servo to retract the probe but you might be able to reuse some of their method.

  18. thanks nophead, when i finish this project I will update here, how i accomplished it, or a link to go to. I really like how you developed this to act as a auto bed "leveling" device, and hope to have the same functionallity on my printer soon.

  19. Good luck with that.

    My understanding is that Makerbot interpret the gcode in Replicatorg and send binary to the firmware like I do. In which case you should be able to do the vector maths in replicatorg.

  20. I am trying to figure out which micro-switch to buy; in your photos I can read that you are using a Cherry E21 series switch. Are you using the one which triggers at 15 grams operating force?

    I am trying to find a similar switch as I can't seem to find a store who has the same series. But most shops advertise 0.25N to 0.5N as the lowest, which is roughly 25 to 50 grams (unless I'm mistaken). Do you know how heavy your Meccano weight is?

    1. I made another one with a 25g weight and a SAIA G3M1T1PUL 15g switch from RS