www.photomacrography.net :: View topic - FocusStepper: Focus Stacking Automation
www.photomacrography.net Forum Index
An online community dedicated to the practices of photomacrography, close-up and macro photography, and photomicrography.
Photomacrography Front Page Amateurmicrography Front Page
Old Forums/Galleries
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
FocusStepper: Focus Stacking Automation

 
Post new topic   Reply to topic    www.photomacrography.net Forum Index -> Equipment Discussions
View previous topic :: View next topic  
Author Message
TheLostVertex



Joined: 22 Sep 2011
Posts: 292
Location: Florida

PostPosted: Thu Aug 13, 2015 12:41 pm    Post subject: FocusStepper: Focus Stacking Automation Reply with quote

Driving The Wooden Monster, is FocusStepper. A Java application and Arduino build which communicate with eachother to drive the stepper motor.

In coming up with the UI, I was heavily inspired by Rik's thread on DoF calculation. His thread had been a great help to me in the past, as well as the spreadsheet he made. But I didn't want to be swinging back and forth between a spread sheet to do calculations.

Hopefully the UI makes a little bit of sense to people. I am by no means a UI designer.



The application operates like this:
1. The left column selects the size of each focus step. Three options are given for ways to choose. Automatic calculation, move a set distance, or move a set number of motor-steps
2. The middle column selects what the depth of the stack will be. Three options are here as well. Start/End points to select where you want the stack to begin and end, a user specified distance to stack, or a number of focus-steps to perform.
3. In order to focus for setting the start and end point, the arrow buttons in the top middle column will move the rail. Single arrows will move the rail by whatever the CURRENTLY selected focus-step size is. Double arrows will move the rail by the currently selected focus-step size times the multiplier in the settings window (default 2). For example, if the focus-step size is 200 motor-step, the [>] will move it toward the subject 200 motor-steps and [>>] will move it toward the subject 400 motor-steps.
4. The right column displays info about the current focus-step size, stack, a time estimate and other details.

A peak at the settings window shows some options and settings available. Also you can see I tucked away some calculation parameters that aren't likely to be changed much for calculating focus-step size here.



I won't go over the settings here, but everything should have tool tips, and I also have a page explaining things in more detail, linked below.

I would like to note though that I discover that in order to trigger the camera in live view, the time the shutter had to be depressed is quite long. The measurements Rik made for his 500d correspond directly to the amount of time the shutter must be depressed to get consistent accusation. A value of 100ms for "Shutter Actuation Time" in example, leads to the shutter firing only about 60% of the time in live view. A value of 600ms fires 100% of the time.



In the main UI you can see a button called "F Win". Since the UI is some what large, and I am likely to be using a live view display on my computer, F Win creates a always-on-top focus window that takes up little room. This lets me have some screen real-estate back when setting star/end points and things like that. Closing the Focus Window brings back the main UI.


The software can run in some what limited capacity without being connected. It can run a "fake" stack, and you can see the output in the console.

For the hardware, there is a schematic and some notes in a pdf on the downloads page linked below. My set up pictured is connected via bluetooth, and runs quick well in OS X. On Windows, I have not had much success getting bluetooth to function. So for windows it is best to omit the bluetooth serial connection and use a USB cable, or maybe try a different bluetooth serial module (I can not offer much help here though).

I have more information about the software here:
http://www.thelostvertex.com/focus-stepper/

And the software, Arduino schematics and parts, and Arduino firmware has all be release for free here:
http://www.thelostvertex.com/focus-stepper-downloads/

Please let me know if I missed anything or it you have any questions Smile

BTW Chris S., I added a go to middle command Wink

EDIT: I forgot to mention the software and arduino communicate bidirectionally. This is to prevent any sort of hardware mishaps. It also means that if you cancel the stack at any time, or cancel the motor movement while focusing, it will update the motor's position correctly.
_________________
-Steven
Flickr Macro Rig Control Software
Back to top
View user's profile Send private message
mawyatt



Joined: 22 Aug 2013
Posts: 980

PostPosted: Thu Aug 13, 2015 1:06 pm    Post subject: Reply with quote

Steven,

Your "Wooden Monster" is a work of art sir!! You and your brother are true craftsmen!!

Just a note on the schematic for the stepper motor driver. It shows a 1uF decoupling capacitor on the power input. I believe the polarity is inverted.


This certainly looks like a fun project and thanks for all the work building the "Monster" and writing the code!!


BTW I live in Clearwater and it's raining now, we have had enough already!! Can we send some to Ca, they really need it!!

Best,

Mike
Back to top
View user's profile Send private message
AdmiralBumbleBee



Joined: 06 Jul 2015
Posts: 3

PostPosted: Thu Aug 13, 2015 1:39 pm    Post subject: Reply with quote

mawyatt wrote:

BTW I live in Clearwater and it's raining now, we have had enough already!! Can we send some to Ca, they really need it!!

Best,

Mike


That rain put us back weeks. Sad

I'm still waiting to finish a new sub-base for the rig (with some nice toned shellac), but I can't get out and spray because of the constant rain!

Thanks for pointing out the decoupling cap error. It was also listed at the wrong value. Fritzing can be a real pain sometimes. An old revision had it correct, but it somehow became flipped when I was moving some components around.

-Robert (the brother) Twisted Evil
Back to top
View user's profile Send private message
TheLostVertex



Joined: 22 Sep 2011
Posts: 292
Location: Florida

PostPosted: Thu Aug 13, 2015 3:23 pm    Post subject: Reply with quote

Thanks mawyatt. I have updated the pdf and my flickr with the right polarity and values. Good catch.
_________________
-Steven
Flickr Macro Rig Control Software
Back to top
View user's profile Send private message
elf



Joined: 18 Nov 2007
Posts: 1319

PostPosted: Thu Aug 13, 2015 6:02 pm    Post subject: Reply with quote

One of the things on my setup that I found most useful was a Pause/Restart button. Occasionally my flash will misfire, usually from a low battery, so it's nice to be able to pause the stack to fix the issue.

A log file can be useful as well.

Can this app handle changing the focus step size per frame when using bellows draw to stack?
Back to top
View user's profile Send private message
lothman



Joined: 14 Feb 2009
Posts: 286
Location: Stuttgart/Germany

PostPosted: Fri Aug 14, 2015 2:08 am    Post subject: Re: FocusStepper: Focus Stacking Automation Reply with quote

TheLostVertex wrote:

Please let me know if I missed anything or it you have any questions Smile


Thanks a lot for sharing all your experience and knowledge. Perhaps one little thing what could be changed.
Instead of "Distance per motor step" you could add the date of the components: pitch of the spindle, transmission ratio, steps per revolution (motor data). But on the other hand that could be calculated by hand.
Back to top
View user's profile Send private message
AdmiralBumbleBee



Joined: 06 Jul 2015
Posts: 3

PostPosted: Fri Aug 14, 2015 9:57 am    Post subject: Reply with quote

elf wrote:
One of the things on my setup that I found most useful was a Pause/Restart button. Occasionally my flash will misfire, usually from a low battery, so it's nice to be able to pause the stack to fix the issue.

A log file can be useful as well.

Can this app handle changing the focus step size per frame when using bellows draw to stack?


Pause/restart and resume are possible to be implemented. The design of the software is such that implementing this are fairly simple, but they weren't totally necessary for the first release. I actually have code in there commented out that allows for pause/resume Cool

It does produce a very detailed log.

It does not currently allow focus step size per frame, but that is fairly easily implemented. I'm not sure how the UI would present this feature to the user, though I'd imagine TheLostVertex has a better clue.
Back to top
View user's profile Send private message
TheLostVertex



Joined: 22 Sep 2011
Posts: 292
Location: Florida

PostPosted: Fri Aug 14, 2015 12:04 pm    Post subject: Re: FocusStepper: Focus Stacking Automation Reply with quote

lothman wrote:
Instead of "Distance per motor step" you could add the date of the components: pitch of the spindle, transmission ratio, steps per revolution (motor data). But on the other hand that could be calculated by hand.


I spent some time thinking about that when I was designing it. Initially I was going to do it like you suggest, but then I thought there are so many different ways one might build something, and they may not be using components that they know all the specs for. So instead I decided distances per full step allows you to physically measure what the movement is. Either though measuring with Zerene, or measuring with dial indicator or calipers and then dividing by the number of steps. And as you said, you can always calculate it by hand if you know (which is what I did for my set up).

Hopefully my reasoning makes a little bit of sense Smile

elf wrote:
One of the things on my setup that I found most useful was a Pause/Restart button. Occasionally my flash will misfire, usually from a low battery, so it's nice to be able to pause the stack to fix the issue.

A log file can be useful as well.

Can this app handle changing the focus step size per frame when using bellows draw to stack?


Resume functionality is somewhere on the todo list. For now, if you are using the start/end point mode for distance and you stop the stack, it keeps track of the current motor position. You could just set the start point to where you stopped the stack, and hit start again and it will start from that point. A bit of a hack, but its something I can use until better functionality is implemented.

I was working on logging stuff to file during the 'monsoon' here, but I was not very happy with it so I reverted. Right now the logging that there is there outputs to the console window. Honestly is a little bit schizophrenic in its formatting, but it is there. Better logging/logging to file is also some where on the todo list.

It does not. I never thought about driving a bellows like that while doing this. I also am not sure how I would accommodate setting that up in the UI.
_________________
-Steven
Flickr Macro Rig Control Software
Back to top
View user's profile Send private message
elf



Joined: 18 Nov 2007
Posts: 1319

PostPosted: Fri Aug 14, 2015 10:51 pm    Post subject: Reply with quote

The UI can be pretty simple for bellows draw. I have a settings tab where the focal length, fStop, mm to Exit pupil (used to calculate the bellows draw), step size (used when doing fixed sized steps), and maximum end point ( I move each lens so the entrance pupil is aligned with the panorama rotation points). The rotation points are treated as 0 for calculating bellows draw.

On the main page I can select between moving the stage, moving the camera and lens as a unit, or just moving the camera with the lens in a fixed position.

I also have a button to just trip the shutter. It's useful for checking exposure, etc.

I hard coded the stepper info, but it wouldn't be hard to expose it on another tab. I prefer working in millimeters instead of steps. This allows you to add a scale to the stage for a visual reference.

Here's a thread on my setup.
Back to top
View user's profile Send private message
BugEZ



Joined: 26 Mar 2011
Posts: 642
Location: Loves Park Illinois

PostPosted: Sat Aug 15, 2015 10:13 am    Post subject: Reply with quote

A very impressive interface and nicely done!

When I built my electronics to drive my stepper rig 6 years ago I stayed away from a computer based interface because it did not occur to me that it would be easier. I did not discover the Arduino equipment family till I had ordered discrete components. My controller uses analog knobs to set the stepsize. It is described here in this old post.

http://www.photomacrography.net/forum/viewtopic.php?t=12851

Were I starting from scratch I think I would probably go with a computer based interface. Yours is very nicely done.

I only use a few different lens arrangements in my stacking.

10X 0.3 NA Oly, on my 200mm tube lens
20X JML objective on my 200mm tube lens,
29mm f3 UKA lens on extension tubes.

I have learned what step size settings (knob positions) work best for these lenses so I don't have to work through step size. However, I do often wish for more flexibility for setting the start and stop setpoints. Your digital interface handles this nicely. My analog knob interface causes me to do a lot of "adjust and check" when setting those starts and stops. A bit pesky at times!

Your interface is very clear and understandable. Very nicely done indeed!

Keith
Back to top
View user's profile Send private message
TheLostVertex



Joined: 22 Sep 2011
Posts: 292
Location: Florida

PostPosted: Wed Aug 19, 2015 9:19 am    Post subject: Reply with quote

Thanks for the additional info Elf. Soon as I clicked the link I remembered your rig Smile

Thanks for the compliments Keith. I had thought about doing a more portable interface, but decided that I would always be around a computer anyways. So computer control it was. I the future I might try and build a more portable tripod mounted device too. Some time further down the road. For now I need to finish up my current rig.
_________________
-Steven
Flickr Macro Rig Control Software
Back to top
View user's profile Send private message
Ludvig Friberg



Joined: 04 Jul 2011
Posts: 20

PostPosted: Wed May 10, 2017 7:29 am    Post subject: Reply with quote

Is anyone here running this? I tried to get it to work but I cant get the serial communication working, I flashed the Arduino(duemilanove) with the hex file from http://www.thelostvertex.com/focus-stepper-downloads/

When trying to connect I can see that the arduino RX led is flashing but no connection. Console gives :

On tty I get:
/dev/tty.usbserial-A9007KAH
Adding Listener!
In PingTask: Connected == false
In PingTask: Connected == false
In PingTask: Connected == false
In PingTask: Connected == false
In PingTask: Connected == false
Removing Listener!

I tried both OSX and different flavours of Windows.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    www.photomacrography.net Forum Index -> Equipment Discussions All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group