Arduino – (Macro Slide for Focus Stacking)

Have questions about the equipment used for macro- or micro- photography? Post those questions in this forum.

Moderators: rjlittlefield, ChrisR, Chris S., Pau

Craig Gerard
Posts: 2877
Joined: Sat May 01, 2010 1:51 am
Location: Australia

Arduino – (Macro Slide for Focus Stacking)

Post by Craig Gerard »

Arduino – (Macro Slide for Focus Stacking)

I was recently sent some information from one of our more quiet readers who is hoping to cultivate some discussion in relation to the project (links below) and "these outcomes".

I'm also interested in such an adaptation, but intend to use a Newport translation stage....the Manfrotto 454 scares me (I once owned one and we didn't get along :twisted: )

Here are some links that will hopefully launch a discussion. All comments and suggestions welcome.

http://tester.id.au/?p=339
Now to the Arduino control, this time I decided to use a Freetronics “eleven” board, the Freetronics LCD & Keypad shield and the Adafruit Motor/Stepper/Servo Shield.
Freetronics “eleven” board
http://www.freetronics.com/products/eleven

Freetronics LCD & Keypad Shield
http://www.freetronics.com/products/lcd-keypad-shield

Adafruit Motor/Stepper/Servo Shield
http://www.adafruit.com/products/81

This is the complete circuit board that Steve is using http://cdn.shopify.com/s/files/1/0045/8 ... v1_0_b.pdf


Craig
To use a classic quote from 'Antz' - "I almost know exactly what I'm doing!"

elf
Posts: 1416
Joined: Sun Nov 18, 2007 12:10 pm

Post by elf »

The Atmega 328 microcontroller used in the smaller Arduinos is pretty limited for in/out pins. I'd recommend using one of the newer Arduino Mega 2560 Clones. My setup is based on Arduino Duemilanove and I'm (slowly) working on it's replacement so I can control more axes.

Programming the Arduino is pretty easy to do if you have any programming experience and the support community is large and generous.

lee100
Posts: 3
Joined: Sat Aug 27, 2011 8:10 am

Post by lee100 »

elf wrote:The Atmega 328 microcontroller used in the smaller Arduinos is pretty limited for in/out pins. I'd recommend using one of the newer Arduino Mega 2560 Clones. My setup is based on Arduino Duemilanove and I'm (slowly) working on it's replacement so I can control more axes.

Programming the Arduino is pretty easy to do if you have any programming experience and the support community is large and generous.
actually you can (sort of) expand the number of pins by using shift registers. such as this one http://www.sparkfun.com/products/733 basically you use one pin to on your arduino to control several pins on the shift register chip, thus effectively expand the number of pins you have at your disposal

Blcak
Posts: 34
Joined: Wed May 09, 2012 6:19 am
Location: Switzerland (originally)

Post by Blcak »

lee100 wrote:actually you can (sort of) expand the number of pins by using shift registers. such as this one http://www.sparkfun.com/products/733 basically you use one pin to on your arduino to control several pins on the shift register chip, thus effectively expand the number of pins you have at your disposal
The larger ATMegas aren't much more expensive, really. What is it, two bucks more for the 64 EA type? Sure, you'd need either a PCB or an adapter to through hole for these, but you can get the latter from China for a couple of bucks, too. Throw in an ISP (myAVR for example), get an oscillator on the bord for more precision, some passives, a KIS-3R33S step-down module from eBay (google these, they're great!), and you're truly free in your developing needs.

abpho
Posts: 1524
Joined: Wed Aug 17, 2011 7:11 pm
Location: Earth

Post by abpho »

Very interesting. Seeing this has got me thinking that I should build something like this. Maybe not as fancy given my current skill set. But I am in the market of something that can reliably give me 0.001mm increments. Not sure if moving the focusing rail on a Canon FD bellows will yield that sort of resolution.

elf
Posts: 1416
Joined: Sun Nov 18, 2007 12:10 pm

Post by elf »

abpho wrote:Very interesting. Seeing this has got me thinking that I should build something like this. Maybe not as fancy given my current skill set. But I am in the market of something that can reliably give me 0.001mm increments. Not sure if moving the focusing rail on a Canon FD bellows will yield that sort of resolution.
The Arduino (or any other micro processor) can easily give you the 1 micron increments, what's hard to do is get a focusing rail that can slide with little or no stiction (also called stick/slip). You also need to put a number on what you mean by 'reliably'. It is usually called tolerance and you could say, I need 1 micron movements +-.25 microns.

If the Canon bellows has nylon slides, you can replace them with TPFE (Teflon impregnated) slids and also lap the mating sufaces until everything slides smoothly. You can buy diamond polishing compound down to 200,000 grit, so it's really just a matter of how much effort you want to put into it.

If you add a linear encoder and gear the stepper (or servo) down to where it needs to move 2 or 3 full steps per micron, you should be able to accurately move in 1 micron steps.

abpho
Posts: 1524
Joined: Wed Aug 17, 2011 7:11 pm
Location: Earth

Post by abpho »

Wow. I wonder if buying the stackshot is a better solution. Especially since I know very little about this stuff. Honestly, I was just going to slap a stepper motor onto the focusing rail and see what happens. But spending a few dollars here and there soon ads up and next thing you know I spent enough to pay for that stackshot. :D

I'll see what I can first steal without getting caught.

:D

elf
Posts: 1416
Joined: Sun Nov 18, 2007 12:10 pm

Post by elf »

An Arduino, a stepper motor, and a stepper driver board are relatively inexpensive compared to a Stackshot, which itself is relatively inexpensive compared other micron or sub-micron solutions. Building your own automated system can give you a lot more flexible solution. For example, I have 300mm travel for the bellows draw and I'm thinking about making one with 1meter travel for some longer focal length lens.

Insect-O-Saurus
Posts: 37
Joined: Fri May 27, 2011 10:51 pm

Post by Insect-O-Saurus »

I've had a go and building one of these things as cheaply as I could - basically the Arduino was the bit that cost the money, everything else was either adapted (rails from old CD drive) or I just did it myself.

A video of the system can be seen in action here...

focus stack space junk

elf
Posts: 1416
Joined: Sun Nov 18, 2007 12:10 pm

Post by elf »

Can you add a few images of the stage? It would be interesting to see how all of the pieces fit together.

Insect-O-Saurus
Posts: 37
Joined: Fri May 27, 2011 10:51 pm

Post by Insect-O-Saurus »

A few images of the setup I'm currently using for capturing studio stacks. The software is currently under development...

overview, the two USB cables (one from camera and other from Arduino) can be seen at the bottom of the shot. Note that it's the subject that's being stepped and not the camera.
Image

Arduino wiring
Image

Stepper motor driver
Image

Stepper motor
Image

Image preview and stacking software
Image

Direct image capture from camera to PC
Image

Hope that's all of some interest

Iain

Rylee Isitt
Posts: 476
Joined: Fri Apr 13, 2012 3:54 pm
Location: Canada
Contact:

Post by Rylee Isitt »

I have a similar setup. Arduino works well. Even some of the smallest, least capable Arduino units would work well with shift registers. I use the UNO, but I'm pretty sure the Arduino Mini would work just fine too.

I drive the stepper using a Dual H-bridge chip and use a pair of reed relays and DIP switches to deal with the camera shutter release.

A big factor to pay attention to is the stepper motor's torque. In my current setup, my stepper does not have enough torque to move the BHMJ fine focus knob unless I remove the tension washer from inside the knob.

If you use more powerful steppers, you will start experiencing heat. The motor itself can get quite hot, and so can the controller chip. Both may need heat sinks. But with low power steppers, that is not a huge concern.

arby
Posts: 34
Joined: Wed Oct 05, 2011 7:45 am

Post by arby »

Iain

What's the 'wee bit of software' referred to in the video, did you write that in Visual Basic? if so how do you talk to the Arduino with it?

I was trying to do my Arduino version with switches and the LCD that came with the development kit. 40 years have passed since I last did any programming (and it was Z80 assembler on a Nascom back then) I'm finding it not so easy now as it used to be.

Bob
Insect-O-Saurus wrote:
A video of the system can be seen in action here...

focus stack space junk

elf
Posts: 1416
Joined: Sun Nov 18, 2007 12:10 pm

Post by elf »

Deleted... :)

Any programming language that can read and write to a serial port will work fine. I used C# for the app that runs on the computer and downloads settings and commands to the Arduino.

Insect-O-Saurus
Posts: 37
Joined: Fri May 27, 2011 10:51 pm

Post by Insect-O-Saurus »

arby wrote:
What's the 'wee bit of software' referred to in the video, did you write that in Visual Basic? if so how do you talk to the Arduino with it?
I actually used c# but as elf says, any language able to read/write to a serial port will do the trick.

I simply send a character to the serial port which runs a block of code on the Arduino

So in c# on the PC it's something like

SerialPort serialPort1 = new SerialPort();
serialPort1.BaudRate = 9600;
serialPort1.Open();
serialPort1.Write("1");

and on the Arduino it's

if (Serial.available())
{
int c = Serial.read();
if (c=='0')
{
while (stepPos > -690)
{
stepPos--;
myStepper.step(-1);
}
}
else if (c=='1')
{
while (stepPos < 0)
{
stepPos++;
myStepper.step(1);
}
}
.... and so on

Can't guarantee it's the 'proper' way to do it, but it works for me

Iain

Post Reply Previous topicNext topic