¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Stepper motor drive PULSE? #MISC #STEP


 

¿ªÔÆÌåÓý

Hi Ralph,

Throw out the concept that stepping pulses are PWM.? They aren't.

?

Now look at the driver you are interfacing to and read the specifications.? There are several.

1.????? Minimum step pulse width.? Usually no less than 1 or 2 Microseconds.

2.????? Direction change setup time.? This one is important.? If you change the direction pin it must remain at that new level for a number of Microseconds before you issue a step pulse.

3.????? Some stepper drivers will also state minimum step pulse low time but generally not and the minimum time is usually the same time as the step pulse.

?

Think of it this way.? If you have full stepping or 200 steps per rev it's likely you still won't run the stepper motor faster than about 700 RPM before the torque falls off so badly that it has no power. ??If it can even get there through the resonant point.? That's where micro-stepping comes in.? It helps to prevent resonance where the torque falls off very steeply. You see fancy things done with GECKO drivers.? They shift the phase slightly during the resonant points and switch over to full step above that (from 10 micro steps/step) to increase the torque at higher speeds.

?

Anyway, at 720 RPM you are turning 12 revolutions per second.? At 200 steps per rev that's 2400 Hz or about 417uS period.? The step pulse only needs to be high for about 2 uS of that.

?

Now change to 10 micro-steps/step and you have 24,000 Hz and a 41.7 uS period.? Still only need 2 uSec. Step pulse.?

?

It's easy enough to get a hardware counter module to create 24kHz.? But implementing an acceleration curve is more difficult.? And a stepper motor will lock up with a full speed step rate.? By the same token you can't just remove the step rate.? So your stepper code has to do two things.

?

1.????? Accelerate up to speed while maintaining a smooth acceleration

2.????? Maintain speed with even step pulses

3.????? Decelerate to zero arriving at the stopped point with exactly the correct number of steps so the distance travelled is correct.

?

The small systems that track a spindle work differently.? They look at the spindle encoder frequency, perhaps multiplying and dividing by a scale factor and that's the step rate.? They then scale that number to create an acceleration up to the scaled spindle speeds and then switch off the acceleration and just use the spindle pulses to create step pulses.? Again, only about 2uS.

?

Often they will run a separate speed check loop to detect that the spindle is slowing down faster than expected because the motor has been switched off.? They then switch back into a deceleration loop and bring the motor back down to 0 without locking up.? Distance isn't important because the half nut is still used to engage the carriage.? Or with a VFD make sure the spindle can't accelerate faster than the stepper motor and then just directly couple the spindle encoder pulses to the stepper pulse input.

?

These systems work well as long as the speed of the spindle encoder pulses remains low enough so that the processor can keep up.? A Sherline or a mill turning 6000 RPM is out of the question if the encoder is more than 200 PPR.? I believe the parallel port LinuxCNC implementation suffers from this restriction.?? OTOH, with a MESA card the FPGA hardware uses quadrature encoder counters to track spindle speed with encoder line counts of 2500 or 10,000 PPR at 10,000 RPM.? That's 100MHz.

?

John

?

?

?

?

?

From: [email protected] [mailto:[email protected]] On Behalf Of Ralph Hulslander
Sent: July-11-20 11:21 AM
To: [email protected]
Subject: [digitalhobbyist] Stepper motor drive PULSE? #MISC #STEP

?

What does a Stepper Motor drive pulse look like?

This is very basic, starting from scratch.

I am writing (attempting to write)? PWM code to drive a stepper motor.
What should the pulse look like?
How long?
How much delay between pulses? Is the delay the same as Duty cycle?

Yes I have managed to get myself thoroughly confused.

I have seen someone using a 20ms pulse with a 50ms delay for UGS settings.

What is the practical range?
Do you vary the pulse length or the OFF time?

Ralph

Ralph

--
Clausing 8520, Craftsman 12x36 Lathe, 4x12 mini lathe, 14" Delta drill press, 40 watt laser, Consew brushless DC motors and a non working 3D printer

Join [email protected] to automatically receive all group messages.