Saturday, March 25, 2017

Automated Focusing of the Tamron 135 mm f/2.8 Lens


My second-iteration MyFocuser Pro control box
I thought I’d start writing up my experience building a motorized focuser for the Tamron 135 mm f/2.8 lens. After using the Tamron 135 mm f/2.8 lens a time or two, it has quickly become apparent that the various filters I’m using are not parfocal, which maybe should have been obvious given that the lens uses refractive optics and refraction is wavelength-dependent. Therefore, if I want to get good images with this lens I’m going to need to refocus at least every time I make a filter change. That would badly interfere with sleep. I recalled that Robert Brown’s do-it-yourself MyFocuser Pro project includes description of a setup for using  his Arduino Nano-controlled stepper motor focuser on a camera lens using a belt-pulley system to move the lens. After a little investigation, I decided to build a second MyFocuser Pro system to implement motorized focusing with the Tamron 135 mm f/2.8 lens. Experience with my original MyFocuser Pro has shown me I don’t use either the LCD display or the manual buttons, and a little calculation showed that with 1/32 stepping I don’t need the more expensive planetary gear stepped-down stepper motor. This meant I could build the minimal MyFocuser Pro and use it on the inexpensive NEMA 17 stepper motor and expect reasonable performance. 

I ordered the parts, waited for the slow boat across the Pacific to arrive, then assembled them. After a little Googling I realized I didn’t need to buy a special LED to run at 12 V for the “power on” indicator; rather, using two 1-kΩ resistors I already had on hand, wired in parallel, would give me the 500 Ω resistance needed to provide proper current limitation to a regular cheap LED. After initially building a board that had the transmit terminal of the Arduino shorted to +5 V (which of course could not talk to my computer), I found and cut the shorted trace, loaded the minimal MyFocuser Pro software, and got the motor moving. 
T-adapter attached to Tamron lens, with
toothpicks holding the aperture open.


I bought some toothed pulleys with a long length of toothed belt originally intended for do-it-yourself 3D printer assembly. The ends of the belt are glued together to make a loop of the proper size. I tried to get the belt length right by trial and error and found considerable tension was needed to get it to adjust the lens focus without slipping. 











Toothed belt glued to lens focusing ring.
Camera, filter wheel, lens, and focus motor assembled.


When I finally got this rig on the sky, I found the autofocusing routines in Sequence Generator Pro worked quite well with this setup. The attached images show the difference between manually focusing once then never refocusing (in the Spaghetti Nebula image) and using autofocusing every 10 subframes and on filter changes (in the Christmas Tree Cluster/Cone Nebula image). Refocusing helps a lot in my opinion. 

The setup worked pretty well on the first night out, but much more poorly on the second night. That second night I also noticed that I could see the region of stars that were in focus march across my image from bottom right to upper left as I adjusted the focus, strongly suggesting that the optical image plane and the plane of the imaging chip were not parallel. After the session ended I found that the tight belt around the lens had put a sideways force on the lens that pulled apart the glued joint holding the lens to the T-mount ring. No wonder the lens seemed misaligned with the camera; it was! 

I cleaned off all the hot glue I had used before to make the joint, and replaced it with Gorilla Glue Epoxy reinforced  with duct tape (the magical tool of all science), which I hope will hold better. Because I had a lot of toothed belt left over, I decided to try a different way of connecting the stepper motor to the lens. I hot-glued a ring of toothed belt around the focusing ring of the lens. This meshes with the toothed belt from the pulley, making a firm, non-slip connection between the motor and the focusing ring without needing a lot of tension. Initial testing suggests it moves the focus  reproducibly without a lot of backlash or hysteresis. We’ll see what really happens next time I get a chance on the sky (which may be a while, given recent weather; even with a beautifully clear day like today, the forecast says it’s going to cloud up again tonight!).
Image taken without refocusing. The blue channel is not focused as
well as the others.
Automated refocusing using Sequence Generator Pro and the MyFocuser Pro
motor assembly. Notice how much smaller the stars appear.