FIX: phase driver in emcmot.c




Further to my previous inquiry on the phase driver, I believe I have a bug
fix.
I would like the original author (Will?) to review the change and update the
CVS as required.
Both changes relate to the actual output data written to the parallel port
for the new phase drive module.

fix 1:
at the beginning of phasefunc() in emcmot.c about line 3400
remove the 2 lines of code:
hiByte = 0;
loByte = 0;
clearing these bytes causes extra transitions on the outputs each cycle
(outputs
got cleared even when all axis are idle).
the output bit patterns must be preserved between cycles.

fix 2:
at about line 3460 before turning the new phase bit patterns on by oring in
the new pattern,
add the line:

loByte &= ~(3 << (axis << 1));   /* clear phase bits in prep for new ones */

and a couple of lines lower before setting the high axis bits,

hiByte &= ~(3 << ((axis-4) << 1 ));

This way, only the bits that need to be updated get changed... idle axis
(not enabled) bits stay constant.

I would have submitted a patch, but I have severely polluted my version of
code with debugging info. I hope to test this on my machine in the next few
days. It displays results as expected on the test jig I have attached to the
parallel port.

Thanks guys, things are starting to look up... I am actually running the
software with a speaker hanging off one of the x axis phase bits to measure
the frequency and to listen for burbles in the real-time scheduling. I have
a P133 running at 4000 steps/sec (1000 cps on 1 of the phase drive lines).
Next step is trying it on the machinery to see if there are any lost step
problems.

=======================================================
Lawrence Glaister VE7IT             email: lg-at-jfm.bc.ca
1462 Madrona Drive                  http://jfm.bc.ca
Nanoose Bay BC Canada
V9P 9C9
=======================================================




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

Problems or questions? Contact