andy pugh wrote: > How do the various encoder modules cope with rawcount rollover? > I am thinking specifically in terms of spindle-mounted encoders which > may roll over an s32 in a few hours. It is obviously unlikely that any > axis could rotate in one direction for that long. > > Actually, a 24-bit counter can rollover in a few minutes. But, the PPMC driver, for instance, extends this to 32-bits of signed integer. I'm not sure what happens, but some recent work with timestamps that definitely do rollover quite often seems to indicate that some operations on signed integers rollover quite benignly. For instance, if you have a signed integer that is just incrementing, and you take the difference between two samples, you get a correct difference at all times! > I have a HAL component that uses rawcounts and an offset to compute > motor rotor angle to determine the correct phase currents. If > rawcounts rolls over this is likely to go rather wrong. I think that I > might have to watch for it happening, and then recalculate the offset > applied on the basis of modulo arithmetic on the max value of an s32 > and the encoder to phase scaling value. > (Or perhaps copy the thread-to-thread rawcounts deltas into an s64 ) > > Yes, unless it was a case where the rollover was an even multiple of one encoder revolution, this could be a problem.
Jon ------------------------------------------------------------------------------ Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
