Re: Kulago/Mauch DRO ISA quadrature feedback kit



> From: Doug Fortune <pentam-at-home.com>
> Ok, I know there is a limit to how fast you can step a stepper (in rpm).

It's more a problem of the granularity of the frequency control during
accel/decel. The way the real time system works is that there's an 8254
counter/timer chip inside every PC that can (is) programmed to generate an
interrupt every so often. It's fed by a nearly 1.2MHz clock, and you can set
it to interrupt the CPU at any multiple of those clock pulses by programming
a register in the 8254 that counts down to 0, generates an interrupt, and
then self reloads your value into the countdown register again. The value we
program into that register we call PERIOD and the lower it is, the more
frequent the interrupts. The maximum speed that the PC can process the
interrupts (before another one occurs) is determined by:

1. How fast the computer is.
2. How much the computer has to do for each interrupt.

In our case we have to calculate whether it's time to toggle the step signal
(among other things). Let's say you're running along with a stepper pulse
stream that looks like this:

111111111100000000001111111111000000000011111111110000000000
i.e. the step signal is high for 10 PERIODS (1), and low for 10 PERIODS (0).

If you want to speed up a little, your next step would be this:

111111111100000000011111111110000000001111111111000000000
i.e. the step signal is high for 10 PERIODS (1), and low for 9 PERIODS (0).

A little faster still? OK:

111111111000000000111111111000000000111111111000000000
i.e. the step signal is high for 9 PERIODS (1), and low for 9 PERIODS (0).

The first step was from a frequency of 20 PERIODs to 19 PERIODs which is
about a 5.3% increase. The next step from 19 to 18 results in a 5.6%
increase, not bad eh? How about this one:

1110011100111001110011100
i.e. high 3, low 2

to

11001100110011001100
i.e. high 2, low 2

This is an increase in frequency of _25%_! Remember, there are _NO
INTERMEDIATE FREQUENCIES_ that you can achieve! Why does this matter? Because
as RPMs rise in a stepper motor, available torque falls. At a speed of 5
PERIODs there might not be enough torque to make the 25% leap to 4 PERIODs
and the motor will stall. The same motor/driver combination may be capable of
much higher speeds, but you don't have sufficiently close grained control of
the step frequency to accelerate the motor to it's maximum RPM.

I used that spreadsheet and plugged in a PERIOD of 10, and out came the
following frequencies (in Hz):

Delay	Step Freq	
0	119,319	
1	59,660	
2	39,774	
3	29,831	
4	23,865	
5	19,887	
6	17,046	
7	14,916	
8	13,259	
9	11,933	
10	10,848	

To relate this to a real world example, the last stepper machine I built was
unable the transition reliably from 3617 Hz to 3741 Hz even though I know
that the motors and drives should have worked fine up to around 10000 Hz.

The only ways I know of to get around this problem (other than using servos!)
are:

1. Forget the interrupt idea and use a software timing loop. Much better
control of the step frequency is possible if moves are mostly planned out in
advance and a short loop (maybe written in assembly) simply clocks out the
pulses. The major problem is that while a move is happening, nothing else
(like the user interface) can be serviced. You might lengthen your software
loop slightly to check for keypresses that signal "abort move, return to user
control", but not much else. This (I believe) is the Indexer LPT method.

2. Use special hardware to either increase the granularity of interrupt
scheduling (this may be the Ahha method, I haven't reverse engineered their
stuff), or to implement a programmable frequency generator controlled by the
PC (the Flashcut method). The only drawbacks to these methods are (at the
present time), cost and having to live with proprietary systems. Of these two
methods, I like the programmable frequency generator best.

May the torque be with you,

Matt




Date Index | Thread Index | Back to archive index | Back to Mailing List Page

Problems or questions? Contact