Pages: [1]   Go Down
Author Topic: running a bipolar stepper on macro rail  (Read 2492 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi i'm looking at buying the uno board and other bits to move a linear rail for micro photography up to 20x magnification , i have the motor but wonder if anyone has done the same or similar and could share the programing, the motor should give me a 0.001mm minimum step but on top of that i want to trigger the shutter on my camera, I have had a long look over the programs at Arduino and can't find anything suitable at this moment in time, any help would be welcomed.

thanks
Parts list:

uno board
SN754410ne H-Bridge
5v bipolar stepper motor
breadboard
« Last Edit: June 10, 2012, 04:37:53 pm by geetee50 » Logged

Carlisle PA USA
Offline Offline
Newbie
*
Karma: 0
Posts: 23
I'm so old I'm getting paid for it!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

geetee50 ...

What are the drive specs on your motor?  Does each winding run on 5 volts with a current drain of less than about 40 milliamps?  If "yes", you can (WITH PROPER OVERVOLTAGE CLAMPING DUE TO INDUCTIVE SPIKES!) drive it directly from the Arduino.  If "no", you will need a "shield" (= interface board) to connect to the Arduino to provide the proper drive voltages/currents for the motor.  I think there are several stepper motor shields available.  Go through the same analysis for the shutter driver.  Google for "Arduino shields".  (An example: http://www.robotshop.com/ca/adafruit-motor-shield-kit-arduino-8.html) From there, you can start to get a better idea of the hardware complexity you are facing. 

Blessings in abundance, all the best, & ENJOY!
Art in Carlisle, PA USA
Logged

Blessings in abundance, all the best, & ENJOY!
Art in Carlisle, PA USA

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 618
Posts: 33945
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I have had a long look over the programs at Arduino and can't find anything suitable at this moment in time,
The trick is to write your own programs.

This is like saying I have looked all over the supermarket and I can't find an apple, plum and gooseberry pie, you won't, so bake your own.
Logged

Boston Suburbs
Offline Offline
God Member
*****
Karma: 16
Posts: 955
I am above your silly so-called "Laws", Mister Ohm.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'll make a couple of assumptions.. one is that you have a rail, that it can be driven by the motor physically (geared to it, screw drive, what have you, as long as rotation of the motor causes the camera to travel), that kind of thing.  

Since it seems like you are just getting started, I'd skip soldering boards, and like these guys are suggesting, get a stepper controller "shield".  There are a number of them, I'm a fan of Adafruit and Rugged Circuits, but they are typically fairly similar.. They are just a series of digital switches which can handle the actual load of a motor, which an Arduino can't directly.  Happily, these are not all that particular about voltage or current requirements of most small to midsized steppers, within reason.. they can usually handle most DC steppers other than heavy CNC stuff.  Your stepper motor will list it's requirements in terms of voltage and current, you are just going to get a controller board capable of that or greater.  As for the arduino, any of them is fine for the project, so I'd just get an Uno to keep it all simple as possible.

You are also going to want an optocoupler, I use 4n25 and pc817, but basically any NPN optocoupler will do, and a resistor for it, 1k ohm or so.  This acts as a way to electrically protect the camera while allowing the arduino to operate the shutter via a cable release port (2.5mm on most SLR's).



From there, it's a matter of working out how the bits go together, and taking a whack at working out how to do it in code.  Rest assured, you are not facing a huge coding effort... but I'll suggest that you take some time, and learn a bit about the whole thing.  Arduino is a heck of a powerful tool for photography.

I'm currently building a 10K lumen LED photo special effects flash with Arduino control at it's core.  

Read, do some browsing, particularly around the "Playground" areas, and search the forums for some similar stuff.  It's here to be found.  If you do actually get stuck-- the folks here are more than happy to help.. the general requirement is one of "Sure we'll help, but you need to try it yourself first." - but in a good way.

« Last Edit: June 10, 2012, 01:31:29 am by focalist » Logged

When the testing is complete there will be... cake.

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 610
Posts: 49027
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I can't find an apple, plum and gooseberry pie
Damned good thing. smiley
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Almost helpful guys

I was asking if anyone had made a program for the uses I stated, I’ve done the homework for parts and just wanted a simple programme to step the motor and trigger the camera, dead simple really and happy to write it if nothing comes up on here. Grumpy_Mike  Really why do you bother to be honest I doubt I would get that much satisfaction from writing a program that moves a motor then waits 3seconds then triggers the camera waits 1 second and repeats same 200 times, if its already written I’ll have it thanks.

Webtest: thanks I was looking at adding a shield

Focalist: thank you interesting post, if you know of a post with similar issue please post back

Paul S:  Good effort!
« Last Edit: June 10, 2012, 04:09:14 pm by geetee50 » Logged

Boston Suburbs
Offline Offline
God Member
*****
Karma: 16
Posts: 955
I am above your silly so-called "Laws", Mister Ohm.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

heheh, you basically just wrote your program.

Your pseudocode is fine, just a matter of translation to C/Arduino.

Your main loop consists of:

Code:
void loop()
{
for(int i=1; i<201; i++) {
Stepper.step(steps);
delay(3000);
digitalWrite(shutterpin, HIGH);
delay(100);
digitalWrite(shutterpin, LOW);
delay(1000);
};
}

You'll then be just looking at what pin is connected to what.  The variable names above ought to be fairly descriptive.  I am assuming it's a pretty typical response SLR above, and gives 100msec duration of "holding down the shutter".  That's usually plenty.

You are going to also need some type of limit sensing.. the program will also need to be able to return the carriage to the home position, unless you are just going to do all that manually.  If this is a one off, it may be easiest just to do that.  You know the length of travel and the home position, to position sensing itself isn't actually required.  KISS (Keep It Simple, Stupid) principle of prototyping...
« Last Edit: June 11, 2012, 11:36:02 am by focalist » Logged

When the testing is complete there will be... cake.

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry for late reply thank you very much.
Logged

Pages: [1]   Go Up
Jump to: