Angle-Measurement Technology of an Optical Pattern Rotary Encoder and Its Hardware Implementation