Stepper motor set speed

This is more of a theoretical question.
Let's say i have a stepper motor, the usual, like nema 17.
And i command it to move at a constant speed, not acceleration, very simple.
So, let assume i use a driver with 16 microsteps and some 16t gt2 pulley and i want to move at 40mm/sec.
SO, i calculate pulse rate for microsteps.
3200 usteps per rev, 32mm per rev, so, 100 usteps per 1 mm.
So i need to pulse 40100 / 1 second = 4000 pulses/second to get 40 mm/sec
And i just start banging 4000 p/s to the STEP pin of the driver.
Now the question: when the motor will actually acheive the speed of 40mm/sec
Let even assume there is no big load, just belt on a pulley.
The speed is set by the period between pulses (or pulse rate), so, if it start from 0 to 40mm/sec in just one step then the time is very short 0,00025 and the acceleration is unrealistic.
X=X0+V0
t+ (a*t^2)/2
X0=0
V0=0
t=0,00025 s
x= one ustep distance = 0.00001 m

a=(2x)/t^2=0.00002 m/ 0,0000000625 ss= 320m/s*s !!!

That's over 32g :slight_smile: For a load of 100g it will result in a force of 32N
That additional 32N for the belt.

But i highly doubt that a stepper can really provide such acceleration.
So, how can i estimate on what ustep it will actually acheive the set speed of 40mm/sec?

I know that toque of usteps is less than full steps. I calculate incremental torque for 1 ustep and it is still enough to pull pretty big load. So it is not the limiting factor.

Maybe i should consider rotor inertia? Back EMF is still small at such speed, or maybe not if i make a first jerk, maybe it spikes. I am lost here.

ArtemKuchin:
So, how can i estimate on what ustep it will actually acheive the set speed of 40mm/sec?

It’s a bit more complex than that. Stepper motors are very different from DC motors.

If you ask it to start at a step rate that it is not capable of it probably won’t move at all. If the situation is marginal, and it just misses a few steps before getting up to speed then I suspect you could never rely on a specific number of steps being needed because the process will have a large random element.

The correct thing to do is to program it to accelerate to the speed you want and that way there is never a missed step and at all times you know exactly what speed it is doing.

…R
Stepper Motor Basics
Simple Stepper Code

simple acceleration code

I know that it is complex and i know that acceleration is a way to go, but in some case there is a need to momentary speed change and that will create some acceleration which can badly influence the mechanical parts. What i need is just first order worst case estimation for the described case.

Just use AccelStepper and let it do the speed ramping for you.

Unless a stepper is tiny (like autofocus steppers), it is physically incapable of jumping to fast step
rates from stationary without ramping and will simply stall, jitter or even go backwards.

ArtemKuchin:
But i highly doubt that a stepper can really provide such acceleration.
So, how can i estimate on what ustep it will actually acheive the set speed of 40mm/sec?

You are thinking inverted - the step rate is the thing, acceleration is the rate of change of the step rate,
often measured in steps/sec/sec

I know that toque of usteps is less than full steps.

Wrong, its the same for all modern stepper drivers in which full steps are just a special case
of microstepping. Usually the severe vibration and resonance of full steps means they have much
less usable torque than microsteps.

I calculate incremental torque for 1 ustep and it is still enough to pull pretty big load. So it is not the limiting factor.

Dynamic torque in a stepper motor is a complex function of driver supply voltage, rotation speed and resonance/vibration. You have in practice to measure it. And in practice you have to tune the acceleration
rate too, since it depends on various factors (not the least of which is mechanical damping provided by
the mechanical load).

Maybe i should consider rotor inertia? Back EMF is still small at such speed, or maybe not if i make a first jerk, maybe it spikes. I am lost here.

The way to setup a stepper and driver for maximum performance is this:

Connect all the mechanical load.

Set acceleration to a low value

Trying higher and higher speeds until the motor stalls/miss-steps. Back off 25% and call this the maximum
usable speed.

Now up the acceleration higher and higher until the motor stalls/miss-steps. Back off 25% and use this
as the acceleration rate thereafter.

If you can't get the performance you need this way you may need higher supply voltage or a bigger motor,
or mechanical damping. Leadscrew systems are much more likely to have bad resonances that belt
systems, note.

[/quote]

MarkT:
The way to setup a stepper and driver for maximum performance is this:

Connect all the mechanical load.

Set acceleration to a low value

Trying higher and higher speeds until the motor stalls/miss-steps. Back off 25% and call this the maximum
usable speed.

Now up the acceleration higher and higher until the motor stalls/miss-steps. Back off 25% and use this
as the acceleration rate thereafter.

Simple and practical

...R

Another thing worth noting is that an unloaded stepper is pretty resonant, but at a much higher frequency
that when loaded, so testing without the load might completely fail to trigger a resonance that happens
with the full inertia of the load connected to the motor. That can spoil your day!

One of the reasons to always use near maximum acceleration settings is to cross any resonant speeds
as fast as possible. You may find certain speeds are problematic and avoid them (by trial and error).

In a CNC application you have to get the system to work at all speeds, so mechanical damping of
resonance can really help save the day.

Some advance stepper drivers use electronic damping of the drive signal (this is complex stuff),
by estimating/modelling the rotor motion from the current waveform and adapting to cancel it.

Adding mechanical viscous couplings is another possibility

Maybe i got it wrong, but microstepping solve resonance problem almost completelly, doesn't it?