Go Down

### Topic: Again stepper problems  (Read 465 times)previous topic - next topic

#### snewpers

#15
##### Sep 20, 2018, 09:16 am
I have never worked with µsecs before!

To calculate speed I need to divide time by steps because it is the interval that specifies the speed.

In order to go from minutes to µsecs it would be minutes * 60.000.000.

So if I want the stepper to go 25.000 steps in 30 minutes it would be:

25.000 steps in (30mx60^7µs) = 1.800.000.000µs;

which would have to be divided to (time/steps):

1.800.000.000 / 25.000= 72000 µsecs interval.

So the formula would be speed = (minutes * 60^7) / steps

Is this correct? This is the exact opposite of what I calculated until now which was number of steps per second and not the interval.

Just to clarify what it is I am working on: it is a camera gantry that needs to go from A to B (lineair and rotation) when in video mode. Your code needs no modification for that other than getting the values for speed and interval in using a pot or whatever. The other mode is for a time lapse using the exact same A to B steps but in a specified time. So I need the calculated the speed over a period of time, something that is not relevant for video mode.

#### Robin2

#16
##### Sep 20, 2018, 10:26 am
This is a good example of something you could learn by doing some experiments much faster than by asking questions on the Forum.

Why not make life simple for your self

You want to do 25,000 steps in 30 minutes
That's 833.333 steps in one minute
Or 13.889 steps per second
Or 1,000,0000 / 13.889 = 720 µsecs per step

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

#### snewpers

#17
##### Sep 20, 2018, 10:51 amLast Edit: Sep 20, 2018, 10:57 am by snewpers
Your result is not correct.... 1,000,000 / 13.889 = 72000 µsecs, but the formula is fine.
(you also used a zero too much in 1,000,0000).
Not trying to be a smart ass but I couldn't get the result you posted.

I could experiment but I don't know how I could time it precisely, to be honest.

Either way, both formulas will work;

1000000 / (steps / (minutes*60)) = µsecs per step

is the same as

(minutes * 60^7) / steps = µsecs per step

Thanks!!

#### Robin2

#18
##### Sep 20, 2018, 12:05 pm
Your result is not correct.... 1,000,000 / 13.889 = 72000 µsecs, but the formula is fine.
There ... you can do it yourself.

And see how much better you are than an old duffer like me

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up