Abstract: A system working to detect a reciprocating motion of an object such as a scanner mirror of an optical scanner. The system is designed to compensate for an error which is concluded in an amplified sensor signal used to determine a reference position of the scanner mirror and which is sensitive to a change in environmental condition of use such as a change in ambient temperature. The system also works to monitor a change in amplitude of swing of the scanner mirror accurately to keep it constant.