On 7 April 2010 20:04, Andy Pugh <[email protected]> wrote:

> The spindles are linked in HAL, not on G-Code. This means that they
> keep synch even when there is no program running.

This is what worked: using ddt to spot a change in the tooth count,
then resetting the encoder and latching a new offset into the stepgen
using a mux2 wired to itself as a floating-point version of the
sample-and-hold function. (there is no way to reset a stepgen to zero,
which would have been simpler).


# Electronic gearing of stepgen position to encoder position
net invratio invert.0.out => scale.0.gain => ddt.0.in           # the ratio is
linked in the postgui.hal to invert.0.in
net spindlepos hm2_7i43.0.encoder.00.position => scale.0.in
net gearpos scale.0.out => hm2_7i43.0.stepgen.03.position-cmd
net aenable axis.3.amp-enable-out => hm2_7i43.0.stepgen.03.enable =>
hm2_7i43.0.gpio.044.out

# Reset Logic. Zeroes the encoder and stores the current stepgen
position as an offset.
# This is to prevent the gear rotating on tooth-count changes (often
quite interminably)
net scale-change ddt.0.out => abs.0.in
net abs-scale-change    abs.0.out => comp.0.in1
setp comp.0.in0 0.01    # this is looking for changes in 1/teeth as the
raw value is not available until postgui.hal has run
net reset-spindles comp.0.out => hm2_7i43.0.encoder.00.reset =>
mux2.0.sel # this bit toggles high on a ratio change
net sample-hold mux2.0.out => mux2.0.in0        => scale.0.offset # the mux
is wired to itself as a floating point sample-and-hold
net gear-spindle-position hm2_7i43.0.stepgen.03.position-fb =>
mux2.0.in1 # wire the stepgen position to the sample and hold, and
thence to the scale




-- 
atp

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to