In the software and hostmot2 encoders we use a different technique for
improved feedback.  The arrival time of the last encoder edge is
recorded and used to generate a high-quality velocity estimate; that
velocity estimate can optionally be used to calculate a sub-count
interpolated position.

Example: Encoder times are recorded with an accuracy of 1us and sampled
every 1ms.  The encoder is turning at a constant rate of 1100 edges per
second.

    Period 0 [time=   0us]: counts=0, last count at 0us
    Period 1 [time=1000us]: counts=1, last count at 909us

    Velocity estimate = (1-0) counts / (909-0) us = 1100.11 Hz

Besides requiring a time stamp with the encoder count (so that this is
not possible, for instance, on a motenc card), another difficulty is for
encoder rates below one edge per sample:

    Period 1 [time=1000us]: counts = 1, last count at  909us
    Period 2 [time=2000us]: counts = 1, last count at  909us (no change)

Does this represent a stopped encoder?  Well, maybe it does, or maybe
the next edge was going to arrive at 2001us.  You could use the
knowledge that the next count did not arrive before 2000us, so therefore
the rate is no higher than 1/(2001-909)us = 915Hz.  At some point,
however, you want to give up assuming the next count is ever coming and
just output a zero velocity.

In the software encoder there is a tunable parameter
'min-velocity-estimate', and in hostmot2 there is a parameter
'vel-timeout' which allow the choice of an appropriate cut-off for a
particular system.

Jeff

------------------------------------------------------------------------------

_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to