Sunday, March 8, 2020

A New Z Axis Optical Endstop Design for UMMD

The Old Z Axis Endstop


I'm kind of old-school in my printer designs. I like things to be as close mechanically perfect as I can figure out how to make them, instead of putting sensors everywhere and hoping the controller's firmware can compensate for poor materials or construction.  If you've followed any of my blog posts on UMMD you'll know I prefer to use a flat print bed, accurately trammed instead of putting a bed sensor on the extruder carriage.  I also prefer to use endstop switches in all axes.


When I built UMMD one of the things I put some extra effort into was a finely adjustable Z=0 endstop.  I used a lever and cam to effectively reduce the adjusting screw movement to approximately 100 um per rev of the screw. It has worked well and reliably for a few years but during recent work on the machine I noticed some things I didn't like, leading me to redesign the whole thing.





The main problem is that the switch is mounted solidly on the frame of the printer and the adjuster/lever/cam are mounted solidly on the moving part of the Z axis.  Over the last few years as I've swapped out hot-ends and extruders, changed a few things in the Z axis, and rezeroed the bed a number of times, the adjuster has crashed into the switch a few times.  The result is that the switch has put some dents in the cam so adjustment isn't as smooth and reliable as it was when the whole thing was new.



This is the lever/cam assembly that used to bump the microswitch.  It has become a problem to set the Z=0 position because the dents in the cam no longer trigger the switch the way the smooth surface used to.


I could print a new lever and cam but that wouldn't prevent the problem from happening again, and making it out of metal seems like a lot of trouble.  The way the switch is mounted is a big part of the problem.  It should not be set in opposition to the motion of the Z axis.  After changing to optical endstops in the X and Y axes, I decided to do the same in Z with the intention of mounting the endstop so that if the bed moves up beyond the endstop it won't damage anything.


I could just mount the switch on a spring that would allow it to move a bit if the cam bangs into it too hard, but there are other considerations as well. The original lever and cam design worked pretty well, but it wasn't really linear so I could never be sure of the exact amount of movement I was getting when I turned the adjuster screw.  I wanted to get 100 um per rev of the adjuster screw so that I could accurately move the bed in small amounts like 20-50 um.  I decided to look for an alternative and discovered something called a "differential screw".



How It Works


There are different ways to implement a differential screw.  The one I chose has two different thread pitches along its length.  One end of the screw turns in a fixed nut, the other is in a sliding nut.  If you turn the screw clockwise, it moves into/through the fixed nut and into/through the sliding nut.  The net movement of the sliding nut is the difference between the two pitches.  The sliding nut movement is in the direction of the screw movement if the larger pitch screw is the one threaded through the fixed nut.


This video illustrates the concept:




A more compact approach is to have a screw inside a threaded tube that has one pitch on the inside and a different pitch on the outside.  Like this:





If you have deep pockets you can buy off-the-shelf differential screws from specialty mechanical parts companies. Beware the ~$20 "differential screw micrometers" being sold on ebay.  They appear to be simple 0.5 mm pitch screws with a nice knob.  I don't have the deep pockets for a real differential screw, and since I wanted 0.1 mm per turn of the screw, I looked for standard screws that had 0.1 mm difference in their pitches.  A look at a metric thread pitch table reveals multiple possibilities.

Size - Nominal Diameter
(mm)
Pitch1)
(mm)
Clearance Drill
(mm)
Tap Drill
(mm)
Tensile Stress Area
(mm)
M 1.60.351.81.25
M 20.402.41.60
M 2.50.452.902.00
M 30.503.402.50
M 3.50.603.902.90
M 40.704.503.308.78
M 50.805.504.2014.2
M 61.006.605.0020.1
M 81.259.006.8036.6
M 101.5012.008.5058.0
M 121.7514.0010.2084.3
M 142.0016.0012.00
M 162.0018.0014.00157
M 202.5022.0017.50245
M 222.5025.0019.50
M 243.0027.0021.00353
M 273.0030.0024.00
M 303.5033.0026.50561
M 364.0040.0032.00817
M 424.5046.0037.501120
M 485.0053.0043.001470
M 565.5062.0050.502030
M 646.0070.0058.002680
M 686.0074.0062.00


1) For metric threads pitch is the distance between threads.

There are multiple pairs of screws that could be used to get 100 um per turn sensitivity (M3/M3.5, M3.5/M4, M4/M5), and even some that could give 50 um per turn (M1.6/M2, M2/M2.5, M2.5/M3), but those screw sizes are relatively uncommon, especially in the long lengths (70 mm or so for my application) needed.


I selected the M5/M4 combo.  Every turn of the M5 screw moves the screw forward 0.8 mm and moves the sliding M4 nut back 0.7 mm leaving a net forward motion of 0.1 mm at the sliding nut.  If I use the sliding nut to activate my endstop switch, I'll have a very finely adjustable endstop, and unlike my previous lever/cam arrangement, every turn of the screw should give exactly 100 um with accuracy limited by the screw thread quality.  This technique can be used to bump a mechanical switch or to trigger an opto interruptor.


One problem with this arrangement is limited range of motion at the output.  If I turn the M5 screw 10 times, the screw will move 8 mm.  The sliding nut will move 1 mm in the same direction as the screw.  So if I want 10mm adjustable output range, the 5mm screw would have to be at least 80mm long and the 4mm screw at least 70mm long. Not even UMMD has room for a 150mm long Z=0 screw.  Nope, I won't be adjusting the screw over a 10 mm range.


UMMD's opto endstop mounts on the Z axis vertical T-slot frame so the endstop can easily be repositioned within the adjustment range of the differential screw, so I settled on a reasonable differential screw adjustment range of 2 mm.  The 5mm screw has to move 16mm and the 4mm screw 14mm.  That means the exposed thread length of the screw has to be 30 mm plus the thicknesses of the fixed nut, the thumbwheel, the sliding nut and the mount.



Making a Differential Screw


I tried printing a jig to hold two screws, one M5 and one M4 butted end to end, with a spherical space inside the jig at the joint.  I screwed one screw into the jig, then inserted a drop of epoxy, then screwed in the other screw until it stopped against the first screw.  After the epoxy set, I cut off the jig.  The force required to cut off the jig resulted in breaking the epoxy joint between the screws.  Hmmm.

Someone at the makerspace suggested that I could drill holes in the ends of the screws and use a pin to hold them together, but I couldn't figure out a good way to accurately drill a ~1 mm hole in the axial center of a screw.


Another suggestion was to make a coupling nut that was threaded for M5 on one side and M4 on the other and then just screw it together with locktite or epoxy to ensure it can't easily come apart.  This is probably the easiest way to go, but adds the length of the coupling nut to the screw.


Finally, someone else at the makerspace suggested that I drill and tap a block of metal, then split it with a saw and use it as a clamp to hold the screws for welding.


In the end, I mounted a 50mm long M5 screw in a collet on a lathe and turned the end 20 mm down to 4 mm diameter, then threaded it with an M4 die.  It was actually pretty quick and easy, mostly because I had help from an expert lathe operator at the makerspace.


Turning the M5 screw on the lathe.  M5x0.8mm threads have a minor diameter that is about 4 mm, so essentially, all you have to do is turn it down until the threads disappear.  I made four or five passes making very shallow cuts so that the cutter wouldn't deflect the screw too much as it was cutting it.  After the screw was turned down to about 4 mm diameter, I rotated the cutter and beveled the end of the screw.


Once the M5 threads were removed and the end of the screw was beveled, I used a die to manually cut the M4x0.7 mm threads into the end of the screw.  The end of the tailstock on the lathe (not visible in the picture) was used to ensure that the die was started square to the screw.
Testing the M4 threads after cutting them.  Yup, it works!
The almost finished differential screw.  I still have to grind flats on the head so I can turn the screw with a printed thumbwheel.


The Rest of the Parts


Once I had the screw, the rest was easy.  I designed and printed a thumbwheel with 10 evenly spaced bumps to make it easy to set the position - just turn the screw by 1 bump for every 10 um of movement.


The base of the part (the red block under the bracket in the image below) is the fixed nut that the M5 screw threads into.  I used a block of PTFE, 5mm thick, because it works well for that type of operation in the kinematic mount for the bed.  I drilled an undersized hole and let the M5 screw roll its threads in the plastic.  It is gripped firmly but still easily adjustable.



CAD rendering of the differential screw and opto endstop mounted on t-slot.

The flag is a printed part (blue) with a hole to fit an M4 nut.  I found a spring in my junk box that pushes the flag up against the nut and minimizes backlash. The flag spring and screw fit into a printed square tube (yellow) that prevents the flag and nut from rotating as the adjuster screw is turned.  When the adjuster is turned 20 times, the screw moves 16 mm and the flag moves 2 mm in the same direction as the screw.


You can't tell from the picture, above, but if the opto endstop should fail and the bed keeps moving up, the square tube tube will have room to pass by the opto interruptor, so nothing will get damaged.  The bearing blocks on the Z axis will eventually hit the physical stops.

The Fusion360 CAD file is here.

Here are the pieces of the new Z=0 adjuster.  The PTFE fixed nut (white) mounts on the belt clamp bracket as does the square tube (blue).  The differential screw goes through the fixed nut and the bracket.  The spring goes inside the square tube to keep the flag and M4 nut pushed against the screw threads.




The opto endstop is screwed to a printed bracket that is held on the printer's Z axis vertical frame with a bolt and t-nut.



Assembly


This is what it looks like when it's assembled.


And this is what it looks like when it is installed.


Other Uses for Differential Screws


People make focus-stacking rigs for macro photography using linear guides and stepper motors to move the camera or object being photographed in small steps as they capture a series of images that are later processed using stacking software to greatly increase the depth of focus in the final image. The typical way to do it relies on the relatively inaccurate microstepping to reposition the camera or object 10-50 um between images.  It would be pretty easy to couple a differential screw to a sliding carriage.  With a differential screw made using M5x0.8 mm and M4x0.7 mm threads, a full turn of the motor (200 steps, typically) will move the camera or object 100 um, so each full step of the motor will move the camera or object 0.5 um.  That means you can use the relatively accurate full steps of the motor for fine positioning instead of relying on "iffy" microstepping.

If you wanted to make a laser engraver to make very small markings, or even a 3D printer to make very small parts, differential screws could be used to position the laser/extruder.

How about a motor driven microscope stage?

UPDATE  3/30/20


I have run some tests on the precision of the opto endstop and tested the differential screw adjuster.  New post here.


4 comments:

  1. This is wonderful!

    The lathe would also have been the way to accurately center-drill for 1mm pins to connect two screws, but that would only have aligned the two screws, not held them together. Your eventual solution looks much better to me!

    If anyone wants to do this but needs more total travel, start with M5 threaded rod instead of a screw, and use two locknuts at the M5 end to hold the knob. (They make low-profile M5 locknuts that would be convenient here.) You'll want to use a live center and/or follower if you have substantially more stick-out, or you can do it in stages, with the threaded rod inside the lathe spindle, and just do a few centimeters at a time.

    "Low Profile Nylon Lock Nut" is the search term for the nuts I found; be aware that they are commonly available in both RH and LH thread due to using them to attach potentially counter-rotating propellers in RC aviation.

    ReplyDelete
    Replies
    1. In my case the screw proved long enough, but for something like a focus stacking rig, simply coupling two threaded rods together, say M6 and M5, using a modified coupling nut, would allow much longer travel. I'd drill out one half of an M5 coupling nut then thread it with an M6x1.0 tap. M6 and M5 screws plus a 200 step per rev motor would give 1 um per step.

      Delete
  2. Hi Mark
    Retired electronics engineer here in Canada trapped in the house due to virus situation around us... Can't express how happy I am I came across your blog - it's jammed to the ceiling with fantastic reading and concepts to learn. I'm currently building a "bed flinger" as you refer to them as my first printer, but it won't be my last. The valuable knowledge you are sharing on here is simply fantastic. I'll be busy for days trying to absorb it all. Thanks very much for your efforts to document everything you are doing !

    ReplyDelete
    Replies
    1. Wow! Thanks! I'm glad you're finding some useful information here.

      Delete

Leave comments or a questions here and I'll try to post a response as soon as I can.