20329
« on: January 25, 2009, 07:42:06 AM »
Simpson, below is the writeup Art did, I have put the relevant paragraphs in bold but left the rest so you can see it in context.
Hood
Re: [mach1mach2cnc] Index or Timing?
Hi Guys:
Just to help clear confusion..
The INDEX input takes a one per revolution pulse. IT then calculates the speed
of the spindle from that timing,
and during a thread, calcuates if the timing from rotation to rotation slows. If
for example, the average rotation is 350us
prior to the actual motion of the thread.. ( Average time per rotation is
calculated when the spindle is on and no motion
is in effect ), and during a thread the time of one rotation is found to be
400us, this means that the last rotation took 50us
longer than the standing average ( a 14.28% slowdown) , then the axis motion is
slowed by 14.28% during the next rotation,
this repeats from rotation to rotation to end up with as near a perfect average
time of axis vs spindle rotation speed.
When using the TIMING input instead of the INDEX input, the system looks for
multiple pulses, but in particular looks
for a pulse 50% wider than the others. This 50% wider pulse is then considered
the INDEX, and the system does the
rotation speed calculation only from that pulse for the spiindle speed display.
However, the other pulses are counted, and
the total rotation time is divided by the number of pulses. SO lets say you have
4 pulses, one of which is 50% wider than the
rest. Any threading will begin on the widest pulse as the trigger, but the time
from pulse to pulse will be calculated and
compared to the total average time of rotation divided by the number of pulses.
The system will slow down axis motion to
correct for deviations between the pulses.
So more pulses will not give you a faster DRO update of rotation speed, but in
theory will correct more often for slowed
down rotations. Its been proven however, to have no advantage in the thread.
While a mathmatically theoretical advantage
exists in the multiple slot theory, any advantage gained seems to be lost in the
disadvantage of additional complexity of the
correction. There are several reasons for this internally and in the required
timing and math. My suggestion is to use INDEX
and not TIMING as a result. KISS is an important principle here IMO.
The SS is being written to use the INDEX method of timing sync at first, it
will then branch to encoder sync which is much
more exact and allows for things such as stopping a spindle and having a thread
stop and continue when the spindle is restarted.
This really required only a much higher granularity of timing than the PP
driver. TO sync to a encoder in the PP woudl require
the ability to vary the interrupt timer on granularities smaller than the
available 40us ones ( in 25Khz mode). Since the SS has
a 4MHZ maximum granularity, its much more possible to vary timing in smaller
increments thus matching exactly ( pretty much) with the varying encoder count
to count time. It is this granularity issue that guides the threading design in
current Mach3, and forces the consideration as above. By all that I mean if the
system determines a motion must slow to match a spindle, the PP driver has only
the power to create a bresenhamed output timing based on 40us granularity, the
SS could use a sub microsecond timing variation which would be invisable to the
end drivers. Any such correction can be thought of as purposely added jitter to
the output stream, Jitter slows the output stream by the required percentage but
causes a phase shift on the drivers output, so it must be kept low and the PP
driver is limited to 40us pulse to pulse variablity, usually thats much lower
than a driver can effectively see in its resultant phase shift, but in the SS
the timing jitter should be able to be much much smaller and totally invisable
to the driver which is the sought after end effect for a perfect threading sync.
Jitter, often thought to be a problem in pulsing output, is actually used as a
benificial effect in Mach3, and the amount of jitter is tightly controlled to
take advantage of its good effects, and keep it low enough to minimise its
negative effects on the drivers phase timing stability. All digital based output
timing has jitter, its a matter of understanding it and using it effectively. In
threading , Mach3 uses a system of control very similar to Mariss's look forward
trajectory smoothing technique, but it was developed long before that.
End analysis: stay with INDEX when using a PP unless you have some inherent
reason for trying the TIMING input. The theoretical advantages dont outweigh the
mathmatical disadvantages.
Thanks,
Art ( just a user who knows a little bit about timing. :-) )