A heavy Duty macro rail

oracacle

Senior Member
As some of may have noticed i have been fetling away on a project that not much has been said about, well not that I am getting to the point were i will be needing a little more help in chosing some of the final components i thought some of you may like to take a look at were i have gotten to so far.

First off a little machanical design.


proto 6 - 1 by f2268d215cc925918731918f4efa0289, on Flickr

I have made use of a ball screw and thread to remove any chance of back lash. however the drawback is that it is easy to rotate the thread by push on the nut... this was easily resolved before i even notice the issue within the electronics for the bipolar stpper motor.

however before the foner detials of the lead screw were finalised i had decided to use a bipolar stepper motor, to move up to 4.5kg of mass. After a little reasearch i found that stepper motors come in various chassis sizes callend NEMA, nema 17 seemed about correct (same size as cognisys use). I found one on a well known auction site that was rated for 4.4kg/cm (0.431492n/m) holding torque. then came the challange of driving such a motor.

I went hunting for a way to drive it, the obvious route being through a pair of h bridges, but finding something suitable with a current rating of 1.68amp was proving dificult and expensive. after a little more reading one stepper world i thought using a mocro step controller may prove more apprpiate to what I amtrying to do. At first i tryed to design a micro step controller using a picaxe to generate the correct sine wave patterns, this proved difficult along with the normal expense of the H-brides and the picaxe. I ended up find several micro step controllers, in particular the THB6064AH, it was able to achieve very high presicion in regard to the number of micro steps per step, as many as 64 (64micro steps * 200 steps pre rotation = 12800 step total). The IC also has various duty cycles available too.

after sourcing the lead screw, motor and driver some basic maths insued, the pitch of the screw is 4mm - 4 / number of micro steps = distance traveled be each micro step

4 / 12800 = 0.0003125mm per micro step

it turns out i am going to be well beyound the normal mathmatical capabilities of the PICAXE, but then so would the calculations for the Depth of Feild. so the next step was learning how to use the micromega FPU
 

geoff07

Senior Member
I don't know what it does, but it looks impressive. But I would try very hard indeed to use Picaxe calcs before turning to the FPU. Think about pre-calculated lookups.
 

oracacle

Senior Member
After a little more research I found that macro photography makes use of a special Depth of Feild (or DoF) calculations that take basic information and turn it into usable data.

found here: http://www.tirpor.com/macro/macro_DOF.htm (and various others)
the calculation needed information that i did not have, but maybe able to to get with a little looking around some places of the internet.

Image depth was the biggest issue, this is the distance from the forward lense element to the seneros or film. The camera does not report with information like it does for lense focal length and f-stop. As camera have a lense mounting flange i thought there muct be information on the distance from flange to sensor, and the then this finger can be added to a emasurement made from the flange to the sensor plane -wikipedia came to the rescue witha list of the flange to sensor distances for most mounting system

http://en.wikipedia.org/wiki/Flange_focal_distance

in my case i am using nikon f-mount, so a value of 46.5mm was obtained.

now even though i had all of the information i needed for the mathmatical calcultions doing them to any degree of accuracy was the next challenge.

I turned to the micor mega v3.1 fpu - which to be frank, to start with was a bigger headache than i had anticpated - still through thing up that i still dont understand but hope to soon.
I took 2 weeks to get to a point were i was getting consistant results for basic mathmatics.

after settiing in program a start flange to lense of 50mm and an fstop of 5.6 and focal length of 60 (CoC was set to the standard 0.019948) this was the firs answer it gave me

FPU in place
uM-FPU V3.1.2
Image Distance
96.5
Magnification
0.60833334
Effective Aperture
9.0066661
Symmetrical DoF
0.97097988
the program then incremented the flagne to lens by 1 one and re-ran the maths

Image Distance
97.5
Magnification
0.625
Effective Aperture
9.0999994
Symmetrical DoF
0.92941732
it haad shown it able to do the maths to high degree of acuracy, repeatedly and consitantly.

the next step was to get started on the components - which as why i started this thread in the forst place
 

oracacle

Senior Member
I don't know what it does, but it looks impressive. But I would try very hard indeed to use Picaxe calcs before turning to the FPU. Think about pre-calculated lookups.
you beat me to my next post, trying to pre-claculate every variable will be next to imposible, witht huge variaty of lense, close up filters, extension tubes, depth of objects - there will be pre-claculated lookups for thing like shutter times.
 

oracacle

Senior Member
now to the part that I need some help, far most things are pretty standard. however the power circuit is the one i stuck with. I still need to finalise the main power source, it will either be 6 or 12v (unless i find something lice in the middle), some more experimanting need to be done a 6 volts for the motor - 5 volts is too low and the motor easily misses steps. idealy i need at least 2x the motor rating, the motor is rated for 2.78v


Circuit 1 v5.1 by f2268d215cc925918731918f4efa0289, on Flickr

some fairly low cost idea for a regulator - swithing would be ideal in case of 12v main supply. also ideas for the FETs (think i drew the circuit with 2N7000 connected around the wrong way with source to ground)

details about the motor driver found here
http://www.piclist.com/techref/io/stepper/THB6064/index.htm
 

oracacle

Senior Member
I have ordered some 2N7000 and FQP27P06 (instead of IRFR9020) mosfets. i will bread board the circuit before I build anything.

however i am still uncertian about the regulator, trying to keep waste to a minimum i was thinking of a switching regulator, I can get some LM2575 which seem to be able to do the job, should be able to deal with anything from the smallest voltage i will need for the motor up to 40v - are there any other suggestion, within about a fiver before a go for this option?
 

oracacle

Senior Member
Think I have the power circuit finalised, still note sure what size battery to use, but will need to be at least 7v if I have read the data sheet for the LM2575 correctly.

the MOSFETs will be operated by the PICAXE thought a 1K resistor, although most examples i have found seem to omit these resistors - any thought on best practive for this type of circuit would be appreciated
 

Attachments

oracacle

Senior Member
Well i have been running some tests on the code i have to date, there appears to be an issue when using the serout at around the same time as the puslout

this code gives 0.2mm under travel over the distance of 3mm (aprox 640 missed micro steps)

Code:
do
		inc w20
		pulsout clk, 1   					'send clock cycle to motor controller
		hi2cout 0, (selecta, compare, fadd, sdist)	'add distance travelled by one micro step
		hi2cout 0, (selecta, depth, Fcmp, compare)	'compare previous distance
		hi2cout 0, (READSTATUS) 				'prepare to read comparison
		hi2cin 0, (tempbyte)    				'read status to temp byte
		if tempbyte >= 129 then exit  			'check if current postition is less then required depth
		serout screen,n2400, (254,212,#w20) 'for testing
		loop
this code give <0.01mm variation on 6mm travel

Code:
do
		pulsout clk, 1   					'send clock cycle to motor controller
		hi2cout 0, (selecta, compare, fadd, sdist)	'add distance travelled by one micro step
		hi2cout 0, (selecta, depth, Fcmp, compare)	'compare previous distance
		hi2cout 0, (READSTATUS) 				'prepare to read comparison
		hi2cin 0, (tempbyte)    				'read status to temp byte
		if tempbyte >= 129 then exit  			'check if current postition is less then required depth
		loop
i found this while looking for the reason why the motor wasnt turning during the fine tuning part of the set sequence, don't know if any one else has had this issue.

power i currently being provided by the 5v and 12v rails of an old PC PSU as i dont have all the parts for the power circuit as of yet. The picaxe doesnt seem to be reseting as it will update the display but not pulsout - PCB scope came in quite handy for fault finding this little porblem
 

oracacle

Senior Member
Its been awhile since i have managed to get around to doing anything for the Rail, did a little testing and found that having 2 switched circuits (one for logic and one for controller) was casing issues, this may have been down to the design of the bought in controller board - but speaking of which i managed to reverse it motor power voltage cooking a lovely THB6064.

I also purchased a cheap "rip off" wired controller for my camera with the intention of reverse engineering the thing. it took very little work. i quick look inside shown 3 metal spring strip, one common, one for focus and one for shutter. a quick cut to the cable and spliced in stereo jacks an i was able to interface with a picaxe with little issue, a quick test set up:

Code:
[color=Green]#rem   ------
b.7--->|1  6|
     --|2  5|<----Focus
     | |3  4|--
     | ------ |
     |        |
     | ------ |
b.6--->|1  6| |
     +-|2  5|<----Shutter
     | |3  4|-+---Common
     | ------
     |
  Ground

using 2 4N25 opto isolators. Common refers to the commen connection to both focus and shutter circuits.

I beleive that comman would be the ground side of the camera but a prefrnce to not interfering with camera
votlage and circuits would be prudent due to the cost of repairing or replacing such equipemtn

The wired shutter release has been modified and fitting with 3.5mm stereo plug interface to allow easy connection
to other home made device

Sleeve  |Ring |Tip
-------- ---\ /--\
       | |  | |--|
-------- ---/ \--/

sleeve - Camera comon
Ring   - Shutter
Tip    - Focus
#endrem[/color]
[color=Blue]symbol focus      [/color][color=DarkCyan]= [/color][color=Blue]b.7       [/color][color=Green]'tip, red on test lead[/color]
[color=Blue]symbol shutter    [/color][color=DarkCyan]= [/color][color=Blue]b.6       [/color][color=Green]'ring, white on test lead[/color]
[color=Black]main:
      [/color][color=Blue]high focus              [/color][color=Green]'enable focus circuit
      [/color][color=Blue]pause [/color][color=Navy]1000              [/color][color=Green]'allow time for camera to focus - focus must be engaged before shutter will release, even in manual focus mode
      [/color][color=Blue]pulsout shutter[/color][color=Black], [/color][color=Navy]250    [/color][color=Green]'take shot - 250 seems to be about as short as it will got still more testing required
      [/color][color=Blue]inc [/color][color=Purple]b0                  [/color][color=Green]'for debuging
      [/color][color=Blue]pause [/color][color=Navy]1000              [/color][color=Green]'wait for some time
      [/color][color=Blue]low focus               [/color][color=Green]'reset focus
      [/color][color=Blue]debug
      goto [/color][color=Black]main[/color]
 

oracacle

Senior Member
Well after a little under 4 months of waiting for the aluminium parts to arrive I have started getting things moving - quite literally. after some issue with a the puslout comand, which will now be replaced with a high followed by low comands i have made some progreesss on enitial calibration and parking of the carriage.

The positioning of the carriage after depth setting now works as it should, and has been tweaked to give a 0.5mm movement instead of a single step (which is 0.0003125mm)

I have attatched an updated circuit diagram which more closely resembles what i have, the differences are in the fact that the power circuit is on a seperate board and the connector are different. there is 1 10 way ribbon for the LCD, button, LED and peizo. And there is a 20 way ribbon that split into 2 10s, one carries logic power, ground and signal to the motor driver, the other 10 way pulls logic power from the power board, on/off signal and then continues onto a 8 way d-sub for the end stop switches and camera connector.

I still dont have a need for the RAM yet so it has not been installed.

I will get some photos uploaded next week when the rail has been fully assembled.

I have also found that the motor is over kill, it will lift rather more than the the four and half kilograms originally sepcified, i will try and put a number on it at some point but cant promise anything

I have also attatched a .txt of the initalise program that sits in slot 0, it still needs some work to resolve issue is the 2 motor cable are plugged in back to front - this causes the motor to trun in the opposite direction
 

Attachments

Last edited:

oracacle

Senior Member
I have been tweaking the program

Functionaloty has increased, the rail now has the ability to use mirror up if required with variable settle time (between 0-9 seconds), it can split stacks so that muitlple sub stack can be made from 1 to 2000 shots per sub stack. It can now also run continuous from the front of the rail, moving the the overalp distance calculated from the DoF.

I still need to invest in a good macro lense and a new sturdier tri-pod but the extension tubes will do for the time being
heres an image created from every third shot from a 102 shot stack


2014-04-14_00-17-50 M=C R=1 S=4 by f2268d215cc925918731918f4efa0289, on Flickr
 
Top