---------- > From: Keith Howell > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: quadrature encoders for telescope automation > Date: Tuesday, January 27, 1998 11:22 AM > Quarature decoding is not very hard to do in software. It can be implemented as a small state machine tracking the progress of the quadature from position to position up and down. 00 01 11 10 00 01 11 10 There are a number of ways the transition can be detected. You can asyncronously sample the port with the bits and develop four possible actions based on the current position and the last position sampled. The four actions are 1) increment position, 2) decrement position, 3) no action 4) error For example assume you are at the 00 position and syncronously read the port again. old new 00 00 - noaction 00 01 - increment position 00 10 - decrement position 00 11 - error not a valid next position The same table needs to be completed for each of the 4 starting positions 00 01 11 10 or a total of 16 combinations of old and new readings. Errors can be ignored in mice (They are generally caused by dust covered sensors) On the telescope mount they need to be formally dealt with. It is almost as easy to process two axis with asyncronous sampling. There are 9 possile actions plus errors. If you are implementing mice a useful number is the maximum hand speed is 40 inches / second. Walter Banks