Rotary encoder: another try