Two Stepper Questions Related to Speed & Distance

Greetings All ...

I have two Arduino programming questions related to controlling a stepper motor's speed and distance.

First, what is the slowest a stepper motor can go, and how to I get there? I understand this relates to the delay command. But I also understand that microstepping involves sending power to both coils. I want to do time lapse photographer on a camera slider. And I'd like to be able to tell the Arduino to move the stepper motor a distance of six feet over a period of several hours.

Next, how can I "teach" the stepper motor to recognize the distance from beginning to end on my slider track? Is this a matter of running the stepper from beginning to end and counting the number of steps it took to get there?

Please advise, and thanks in advance for the sage advice.

Sincerely ...

Stephen McDowell

First, what is the slowest a stepper motor can go, and how to I get there?

The slowest speed is stopped. To get there, stop sending step pulses. The speed is controlled by the time between steps. That can be delay() but that is the absolute worst way to control a stepper.

Your system has a mechanical connection between the object to be moved (camera) and the stepper. A belt or lead screw. That means that there is a precise distance that the camera will move for each step of the motor. So the number of steps is the distance to move divided by the distance per step. And the time between steps is the total time to move the distance divided by the steps to move.

Stepper basics.
Simple stepper code.

What stepper do you have? What stepper driver? Is the drive a belt or lead screw or ... ?

There is no limit to the length of time between steps - you could do one step per month if you wanted to.

Microstepping makes for smoother motion and, of course, if you choose x4 microstepping the interval between steps would need to be 25% of the interval for full steps if you want the same speed.

It would be a good idea to ensure that the stepper is stationary when the camera shutter is triggered.

...R

Greetings, groundFungus ...

Technically speaking, stopped really isn't a speed. It is, in fact, the complete absence of speed.

But I appreciate Smart Aleck just as much as the next amateur.

The gadgetry I'm goofing with at the moment comes from Amazon, and is described as follows:

"TB6600 4A 9-42V Stepper Motor Driver CNC Controller with Stepper Motor Nema 17 Bipolar 1.7A 40N.cm Holding Torque and Motor Mounting Bracket for 3D Printer Hobby CNC Router XYZ by Beauty Star."

The camera rig is belt driven. The belt connects to the front and rear of a gantry plate that's been cobbled together with RigWheels equipment. The max distance is roughly six feet.

Ideally, I'd have a series of sketches available that would drive the gantry plate from beginning to end and then stop. The different sketches would determine direction and speed.

Thanks for the response.

Sincerely ...

Stephen McDowell

Hello Robin2 ...

Thanks for the response.

I have considered programming the stepper to coincide with shutter activity. But this would be increasingly difficult in situations where the available light changes gradually, as in sunrises and sunsets. I can do things like bulb ramping, but that's not a precise process. And most of the time lapse work I've seen that was created on a slider was done in continuous motion mode. And if a single shot in low-light situations takes, say, 45 seconds to complete, the distance the slider will travel in those 45 seconds would be minimal, if it takes the camera two hours to traverse six feet.

There would indeed be motion blur. But the persistence of vision and all the cognitive, visual processes that come into play when stringing images together might ... cancel that out.

This being my pioneering slider-based time lapse endeavor, I can't say for sure.

But I'm eager to try.

Sincerely ...

Stephen McDowell

zzsgm202:
There would indeed be motion blur. But the persistence of vision and all the cognitive, visual processes that come into play when stringing images together might ... cancel that out.

Sorry. I got my wires twisted - I was thinking of still photography.

...R

Hi Robin ...

We are indeed talking about still photography. The slider would be used to create a video sequence consisting of a series of still photographs shot over a period of time - two hours, for example.

So, 60 seconds of video at 24 frames per second would be 1,440 images.

For a sunset, most of those images are going to be shot with daylight present. So exposure times are going to start out at around 1/100th of a second and gradually diminish to somewhere around 1/60th of a second or so while the sun sinks below the horizon. After the sun sets, exposure times increase. Most of the time lapse work I've done was shot in a downtown area. Electric light and such gives you some luminance. But you're still looking at and exposure time of around 30 seconds or so. It's difficult to gauge.

You can, as I mentioned, do something called Bulb Ramping (or Bramping, as it's also known) to adjust factors like f-stop and ISO to keep the exposure time consistent.

But I'm curious as to whether a very small stepper motor step executed during a 30 second shot will be detectable when that shot is mixed in with a series of shots where the motor didn't move. The reason motion pictures work is due to a visual retention phenomenon called the Persistence of Vision. Images are retained on the retina. The standard cinematic frame rate of 24 frames per second ensures that the sequence of images isn't perceived as a stroboscopic flicker.

Pardon me if you already knew all that.

But I digress:

As I said, my goal is to create a series of sketches that will move the gantry plate that the camera is attached to from one end of a six-foot rig to the other. When it gets to the other side, it stops just before it reaches the end of the rig. That way I can set it up, turn it on, leave it alone for a couple of hours, and come back with the entire process having executed without the stepper motor pulling the gantry plate and camera off the rig.

Thanks again.

Sincerely ...

Stephen

It is usual practice to have at least one limit switch for "homing" the motor. Once you home the motor all you need do is count steps to know the precise position of the camera. A sketch that just sends a pules evey time period and counts the steps till a certain number is a pretty simple sketch.

Use millis() to do the timing. These Non-blocking timing tutorials:
Several things at a time.
Beginner's guide to millis().
Blink without delay().
and the non blocking example in Robin2's stepper code tutorial show how.
Do not use delay.

zzsgm202:
But I'm curious as to whether a very small stepper motor step executed during a 30 second shot will be detectable when that shot is mixed in with a series of shots where the motor didn't move. The reason motion pictures work is due to a visual retention phenomenon called the Persistence of Vision. Images are retained on the retina. The standard cinematic frame rate of 24 frames per second ensures that the sequence of images isn't perceived as a stroboscopic flicker.

My original comment in Reply #2 had incorrectly assumed that you were taking photos to be viewed as still images.

I'm aware that movie frames can include a lot of blur that is not perceived by the audience.

I suspect the answer to your question can only be found by experiment. There could be two types of camera movement - linear movement due to the stepper motor and bounce if the camera mounting has any play in it. The bounce might be more noticeable.

On the other hand maybe your camera has image stabilisation.

...R

Why do you need a series of sketches?

Hello Wildbill ...

One sketch for left to right. Another for right to left.

Multiple sketches for various traverse times - 6' in one hour, two hours, three hours, etc.

It's likely I'll end up tweaking a single sketch prior to each shoot. But I'm just trying to plan ahead.

If I'm overlooking something grievously simple here, do tell.

Note - I've been in IT for 25 years. The farthest I've ever progressed in the Wonderful World of Programming is:

Hello World

Sincerely ...

Stephen

I would expect ( as mentioned above) to have a micro switch triggered when the gantry is at one end of the rail so the system can get itself into a start position.

Then you could have a pot to select a duration and a switch to kick it off. That way, there's only one sketch.

I agree with wildbill, a bit of time coding and a bit of hardware could make you a versatile system that could be programmed on the spot for whatever profile is required. Camera sliders are a popular subject on the forum. A search will find how others have done it.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.