An automatically compensated readout channel for rotary encoder systems