Note, I made these to work with Jonas Khulings excellent X ends, standard mendel X-ends have a hole right where the micro switch button goes, which means that it will probably not work. They should work with any X-end design that has a flat surface on the bottom between the Z leadscrew and the smooth rod.
Also note, that this design assumes that your Z screws have at least 28mm of extra space at the bottom. If you have more, you can change the lift height in the scad file to get a slightly smoother lift.
I use two of these, one on each Z screw, but you can use one if you just want to get a better Z endstop. For each-Z lift you'll need:
o One submicroswitch, (I measured mine at 12.82x6.5x4.7mm, see picture)
o 2 or 3 M2x20 screws
o 2 or 3 M2 nuts
o 4 or 6 M2 washers
o 2 M8 nuts (one can be from your existing X-ends)
Pretty much any microswitch small enough to fit between the Z screw and Z smooth rods will work, but smaller is better. If your switches are a different size, you'll need to download the scad file, modify it and export your own stl file. Oh, and if you micro switch comes with a lever, just take it off, as it will mostly be in the way and reduce accuracy.
First wire up your switches. Remember that the button will be pressed during normal operation. My board is configured for NC (normally closed) and so I hooked it up like this:
board -- sw1pin2 sw1pin1 -- sw2pin1 sw2pin2 -- board
This means the circuit is closed when the Z carriage rests on the Z lifts.
Check that your Z-lifts fit well:
- Make sure the switches fit snugly
- Make sure that the prongs touch the smooth rod, but doesn't grip it too firmly (file them down if they do)
- Make sure the top is smooth
Now insert the relays into the Z lifts and put the screws in. Use washers on each side to protect the plastic. The third screw is meant to be used with the bushing to hold the smooth rod in. This is optional and I am in fact not using it on my printer.
To mount the lifts, lift up your X carriage (and put something there to hold it up) then turn the nuts on the screws down to about 20mm from the bottom. Put the Z-lift, over the nut with the prongs around the smooth rod and push it up as far as it will go. Then put another nut at the bottom of the Z screw. Push the lift down and make sure that the top nut is close to the top, but is NOT sticking out. Repeat for the other side, then adjust your Z screws so that the X carriage is level.
Now go into your slicer configuration, and set up your "Start G-Code" to something like this:
G28 X0 Y0 ; home X and Y axis
G90 ; Use absolute coordinates
G21 ; Use mm
M109 ; Wait for extruder to heat up
G1 X10 Y10 F1000 ; make sure we are over the glass
G28 Z0 ; home Z axis
G1 Z0.9 F100 ; Move up a bit
G1 X20 Y20 F1000 ; Move to clean glass
G1 Z0.9 F100 ; Move Z axis up a little
G92 Z0 ; Set Z=0 at current location
G1 F1000 ; Set default speed
The idea here is to wait until the extruder heats up, then home it somewhere on the print surface (dump area will not work) and then move it back up a little bit and zero the Z axis there. My bed has a little flex in in, which means that I need to move the extruder up 0.9mm after homing. Change the two occurrences of 0.9 above to suit your printer.
(See, I lied a little, you still need to adjust your Z endstops, but you do it in software, not with a screw.)
This setup should also work to detect how level the bed is, but I still need to work on implementing the software for that.
Be sure to clean the spot where leveling happens between prints. Also, don't level in the middle of the bed as you won't know which of the two switches will trigger.