Pages: [1]   Go Down
Author Topic: Seeking Custom Program For Dual Stepper Control  (Read 1353 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 52
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I'm currently planning a project to build a 2 axis timelapse head. And I'm looking to power 2 steppers using an arduino uno and a motor shield:

http://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino/using-stepper-motors

I will be using 2 of these motors:

 http://www.mitsumi.co.jp/latest/Catalog/pdf/motor_m42sp_6nk_e.pdf

the head would turn around 360 degrees and would be able to move up and down at 180 degrees

The problem I have is that there is no program out there that will achieve what I want to do so i'd like to see if there is anyone out there that would be willing to try and code one.

What I am trying to control is the number of steps that the motor does over a period of time..

e.g if one step = 0.5 degree

and I wanted to go +180 degrees over a 3 hour period that would be 360 steps over 180 minutes.. so 2 steps per minute or 1 step over 30 seconds

if that makes sense...

here is my original post in project guidance for more info:
http://forum.arduino.cc/index.php?topic=177345.0

Logged

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

Quote
The problem I have is that there is no program out there that will achieve what I want to do so i'd like to see if there is anyone out there that would be willing to try and code one.
There is no SINGLE piece of code.

There are plenty of examples for controlling two stepper motors. There are plenty of examples of using millis() to determine if it is time to do something (like step one of the motors).

How will this program know how many steps for each motor? How will it know over what interval? How will it know when to start running the program with known data? Is it supposed to activate the camera, too? Or just manipulate the platform the camera is on?

If the number of steps in each direction is known, and the overall time to perform that number of steps, it is trivial to determine the interval between steps. It is equally trivial to determine when the time between steps has elapsed, and to then step each motor.

If the motors needed to step often, then there could come a point where the time required to step a motor exceeds the interval between steps, but that hardly seems a concern here.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 52
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset



How will this program know how many steps for each motor?

Is that really necessary due to the fact that the motors will never spin 360 degrees in one time-lapse.

How will it know over what interval?

Could rpm be brought into this? I really have no idea.



How will it know when to start running the program with known data?

?


 Is it supposed to activate the camera, too? Or just manipulate the platform the camera is on?

Just manipulate the platform I have a seperate controller for the camera

If the number of steps in each direction is known, and the overall time to perform that number of steps, it is trivial to determine the interval between steps. It is equally trivial to determine when the time between steps has elapsed, and to then step each motor.

Could I specify the interval in between steps, then I wouldn't have to sepecify a total time for the shoot?

If the motors needed to step often, then there could come a point where the time required to step a motor exceeds the interval between steps, but that hardly seems a concern here.
Logged

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

Quote
Is that really necessary due to the fact that the motors will never spin 360 degrees in one time-lapse.
Yes, it is necessary to know how many steps you want to take, somehow. That can be total number of steps or an angle and you calculate the total number of steps knowing how many steps equals 360 degrees.

Quote
Could rpm be brought into this? I really have no idea.
Yes, but speed is not a stepper motor's strong suit. Repeatability and accuracy of step size are.

Quote
?
You've go to say "go" somehow...

Quote
Could I specify the interval in between steps, then I wouldn't have to sepecify a total time for the shoot?
I'm leery of customers asking if they can specify the requirements in some particular way. It sounds like they really don't know what they want. If there is an equation in the form A = B + C, and you know two values (A and B, A and C, or B and C) you can calculate the other one. You have an equation involving number of steps, interval between steps, and total time. Specify any two, and the program can compute the other one. An overly-constrained situation arises when you want to specify all three, and the third value doesn't fit the equation.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 52
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Is that really necessary due to the fact that the motors will never spin 360 degrees in one time-lapse.
Yes, it is necessary to know how many steps you want to take, somehow. That can be total number of steps or an angle and you calculate the total number of steps knowing how many steps equals 360 degrees.

What makes it slightly more complex is bringing the gear ratio's into it.. of which I have not settled on. Thinking about it, the motor would actually spin multiple times before the output gear would've turned once..

-if I had a gear on my motor of 17 teeth and a 61 tooth gear meshed so a 17:61 ratio

-each step on the output gear is .5 of a degree

-360/.5=720 <-- number of steps

-720/48=15 so 15 turns of the step per 1 turn of the output gear if I were to use these ratios



Quote
You've go to say "go" somehow...
Any example of how tis done conventionally ..? As you may be able to tell I'm a little bit new to arduino and electronics at this level I really hadn't fathomed that this project would take quite so much thought ...

Quote
I'm leery of customers asking if they can specify the requirements in some particular way. It sounds like they really don't know what they want. If there is an equation in the form A = B + C, and you know two values (A and B, A and C, or B and C) you can calculate the other one. You have an equation involving number of steps, interval between steps, and total time. Specify any two, and the program can compute the other one. An overly-constrained situation arises when you want to specify all three, and the third value doesn't fit the equation.

I get that..

If we determined that the motor does 15 spins per 1 turn of the output gear then it would be 7.5 turn

if we could do:

360 (no. of steps in 180 degrees at 0.5 per step)/ total time of the shoot (mins) = interval (mins)

Just an idea, you've got me thinking

Logged

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

Quote
Any example of how tis done conventionally ..? As you may be able to tell I'm a little bit new to arduino and electronics at this level I really hadn't fathomed that this project would take quite so much thought ...
There needs to be something that starts the motors turning and the camera snapping pictures, doesn't there? I'm not sure how much thought needs to go into setting the whole process in motion. I'd have a switch, with a big green cap (and one with a big red cap, for STOP!), that started the whole process.

But, thinking is good, even if you need to do more than you thought.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 52
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Timing is not imperative when you first start the time-lapse.

The camera shutter will be remotely controlled separate to anything else so we don't need to worry about that! the shutter would be released once between every 2-10secs

The tripod control could just be run when I upload the program to the Arduino?
Logged

Pages: [1]   Go Up
Jump to: