Tuesday, April 12, 2011

Auto Macro Stacker

Intro:
This project is some hardware and software which allow precise positioning of a camera for taking multiple macro shots at fixed positions such that the images can be "stacked" in software to obtain a an image which is fully in focus.

When shooting with a macro lens typically the depth of focus is very small (1-2mm), so to take an image of something you need to combine multiple pictures.

So with this project; I specifies how many shots I want to take; and how many millimeters the shots are to be and the rest is automatic.  The hardware moves the camera the right distance and controls the shutter of the camera; and repeats for all the shots.  Check out the videos at the bottom of the post.

Here is the latest video:




Mechanical - Initial Prototype
- The hardware is essentially a threaded rod with a stepper attached which allows for precise positioning of the camera.
I used mostly recycled materials for the first build:

  • Plywood ($0 scraps lying around from other projects)
  • 3/8" steel rods ($0; taken from some old printers from the trash)
  • Stepper Motor and gears($0; again taken from old printers from the trash)
  • Plastic slider; surplus UHMW (similar to delrin/acetal), bought for $4 a pound, I used about $1's worth
  • 1/2" ACME threaded rod, left over from another project; though you can use regular cheap threaded rod from the hardware store
  • Brass Bushings; not really necessary; I used a single 3/8" brass bushing cut in two ($3)


Building the linear rail:
Frame:
I sized the frame such that the stepper could sit inside, I made the length long enough to fit my left over section of threaded rod (8")

Drilling:
This is the trickiest part of the build; the holes have to be well aligned for the slide not to bind.  I did this by clamping both end pieces and the slider together and drilling the three holes at the same time.

I laid out the two parallel rods such that they were 4" apart with the threaded rod running down the middle.

Threading the rod through the slider:
To do this I filed some slots in the end of a scrap of ACME lead screw, I then heated up the screw a bit and tapped the hole.  It a few passes until it became smooth.







I turned a 1/2" from the ends of the lead screw such that they would fit in the brass bushings; this is probably overkill for this situation; since its not a CNC machine there is minimal load on the screw; I'm pretty sure it would be fine just running the threads through a larger hole in the plywood.





Results turned out ok; but it really needs brass sliders instead of just using the UHMW directly on the rail.  The UHMW plastic seemed to bind on the rail occastionally which made the motion less smooth.





I've moved on to MK-II since I scored a great little linear rail from a friend of mine; The initial prototype works its just not as cool looking :)


Mechanical MK-II:
For MK-II I machined some brackets from UHMW-PE and used a Z-axis a friend of mine provided.  He got three of the Z-axis on e-bay cheap.  The white bits are the brackets I machined on my drill press.











Electronics:
To keep it simple I decided on a simple USB interface (could easily have done a microcontroller based solution (I may do this in the future); I used the FTDI FT232R since it supports bit-banged mode; I paired this with a standard stepper driver from pololu.  I also added shutter control.

Pretty basic stuff here:
- FTDI FT232R USB interface
- Alegro A4983 stepper driver
- NPN transistor for the shutter control

Schematic is a bit of a work in progress:



I assembled it on protoboard; but I'm in the process of building some PCBs; let me know if you're interested in one once they're made; I'll have some extras.







Software:
The software is pretty straight forward; I put the source up on github:

Its currently just a command line utility; still a work in progress; but its working.

https://github.com/scottjgibson/camera-motion-controls

Stacking Software:

Check this out for a comparison of software:
http://chdk.wikia.com/wiki/Stacking_Software
I ended up using Helicon Focus


Results:

Setup:
- I'm using a standard kit Canon 18-55 mounted backwards; makes for a pretty sharp macro lens.



Here is one of the images from the first set I took; as you can see only a small area is in focus.



I did a run and stacked the 30 images together to obtain the following result; not great but I'm happy with it for a first try.



Here is are some videos of the rig in action:


The macro stacking software can generate a 3D model based on the stack of photos:

22 comments:

Unknown said...

Very cool....

I've been stuck on a iPad software project for a while now, but I've got to get my hands dirty again soon!

Xevi said...
This comment has been removed by the author.
Xevi said...

Awesome!, I am a collector of microminerals, and that I have long intended to start taking pictures in layers and use Helicon to process them, I really liked your project by minimizing contact with the camera and thus prevent vibration. Have designed and a PCB?, You know it could cost?
I feel the inconsistencies in the text, I used a translator.
regards

Anonymous said...

I want to realize this installation. Which program to use to enter the command line? Sorry for my English.

Bill said...

Did you ever get PCBs made?

Routerlogin Net said...

Very nice I really like this article
Routerlogin
Routerlogin Net

nighthawkrouterlogin said...

For Netgear Extender solution Kindly read this informative blogs. For Want to Troubleshoot Router Login Access Errors? Read This
More information is available on
WiFi Disconnecting? Fix-it!​
Is Your Router Keeps Dropping Internet?

Aeromexico Book A Flight said...

Aeromexico Book A Flight Thanks for the nice blog. It was very useful for me. I’m happy I found this blog. Thank you for sharing with us,I too always learn something new from your post.

top erection pills said...

This is a good tip particularly to those fresh to the blogosphere. Simple but very precise info… Thank you for sharing this one. A must read article!

cheap erectile dysfunction pills online said...

This is the right website for everyone who really wants to understand this topic. You realize a whole lot its almost tough to argue with you (not that I personally would want to…HaHa). You definitely put a brand new spin on a subject that's been written about for many years. Excellent stuff, just excellent!

erectile dysfunction causes said...

Hi, its fastidious article concerning media print, we all be familiar with media is a enormous source of facts.

RobinShri said...

Garmin is a program that handles the complete updating of the Mac windows. It syncs the device and links the device to your PC. Garmin.com/express will immediately refresh your PC with the new map. It even lets you know about the latest releases.

Garmin is a program that handles the complete updating of the Mac windows. It syncs the device and links the device to your PC. www.Garmin.com/express will immediately refresh your PC with the new map. It even lets you know about the latest releases.

techmanoj said...


Simply placed, via the Internet, Roku enables you to watch free and paid video content on your TV. Roku is the number 1 streaming device common in the United Kingdom and the United States.

roku.com/link

techmanoj said...


Roku activation code is a code meant to activate the software and confirm that when you are finished with the Roku activation process, you can add multiple streaming services like Netflix, HBO, NBC and many more .

Roku com link

techmanoj said...


After setting up a Roku account, you need to connect your Roku Device to a Roku account using the activation code.

roku.com/link

Productoffice said...


Garmin is a program that handles the complete updating of the Mac windows. It syncs the device and links the device to your PC. Will immediately refresh your PC with

the new map. It even lets you know about the latest releases.
www.Garmin.com/express [url=https://visitgarmin.com]Garmin.com/express[/url]

Houston Taxi said...

Webroot SecureAnywhere is the best antivirus security software for Mac and it has been gone under several tests to reclaim the position for it. Here on webrootcomsafebestbuy we have also tested the software for quite a long time and we recommend the Webroot SecureAnywhere security software for your Mac and that is a fact. Being very light without making your Device slow it can perform all the tasks at ease and the Activation followed by Installation is a very easy job to do which has already been mentioned earlier. Go through the website for Activating Webroot key code and Installing the best security software on your Mac or PC
www.webroot.com/safe

Amazon Prime said...

Garmin Express is an application designed to manage Garmin devices. It is used for app registration, software upgrades and map changes, garmin express Exercise data synchronization, and many more. Garmin Express, choose your computer’s operating system below: Windows or Mac. In order to Download and Install Garmin Express Software on your device.

Amazon Prime said...


Garmin Express is an application designed to manage Garmin devices. It is used for app registration, software upgrades and map changes, garmin express Exercise data synchronization, and many more. Garmin Express, choose your computer’s operating system below: Windows or Mac. In order to Download and Install Garmin Express Software on your device.

Unknown said...

webroot safe has a wonderful troubleshoot process through which they may resolve users issues that they face very easily. Besides this, webroot.com/safe provides the best security software that is necessary for your system life.

Unknown said...

webroot safe has a wonderful troubleshoot process through which they may resolve users issues that they face very easily. Besides this, webroot.com/safe provides the best security software that is necessary for your system life.

GEEK SQUAD WEBROOT INSTALL said...

WEBROOT GEEK SQUAD is a team of tech savvy, web-savvy, and tech-savvy people. They specialize in IT security and are available to help you with any technological problems that you may be having. The WEBROOT GEEK SQUAD has been around since the early 2000s, and they have been providing their services to many companies since then. WEBROOT GEEK SQUAD has also helped many individuals with their technological needs. They offer free consultations for any concerns that you may have about your computer or device. Geek Squad Webroot is a company that provides cybersecurity services. They offer both on-site and off-site computer repair, data recovery, and virus removal. They also provide online backup, web hosting, and domain registration. Geek Squad Webroot was founded in 1993 by Robert Stephens. He wanted to create an IT service that would be available to everyone who needed it no matter the size of their company or budget. The company was acquired by Best Buy in 2008 for $3 billion dollars. Geek Squad has more than 1,000 employees across the U.S., Canada, and Mexico with offices in every major city as well as smaller towns like Spokane, Washington; Billings, Montana; and Boise City, Idaho. Geek Squad Webroot install is a service that is offered by Geek Squad to install Webroot SecureAnywhere on your computer. This service is provided for free of cost and it can be used in the following cases: If a customer has purchased a new computer and wants to automatically install Webroot SecureAnywhere during the setup process. If a customer has purchased an antivirus or security software and wants to install Webroot SecureAnywhere alongside it. If a customer wants to reinstall their operating system on their computer, they can use this service so that they don't have to reinstall their antivirus or security software again.



WEBROOT GEEK SQUAD