A Digital Self-Calibration Circuit for Absolute Optical Rotary Encoders