A controlling method of an interpolation apparatus for an encoder, the controlling method comprising a processor comprising hardware, the processor configured to:
- convert a first sine wave signal generated in accordance with the change of a position of a measurement object into a digital signal to acquire a first input value, and converting a second sine wave signal which is generated in accordance with the change of the position of the measurement object and which is 90° different in phase from the first sine wave signal into a digital signal to acquire a second input value;
- output one of the first input value and the second input value as a reference value and the other as a comparison value;
- record a threshold table to associate upper limit thresholds as first boundary angles and lower limit thresholds as second boundary angles with tangent values;
- use one of the first input value and the second input value as a reference value and using the other as a comparison value to multiply a first tangent value by the reference value to calculate a first threshold, the first tangent value being based on a first boundary angle decided by the processor on the basis of a phase range of the reference value;
- multiply a second tangent value by the reference value to calculate a second threshold, the second tangent value being based on a second boundary angle decided by the processor on the basis of the phase range of the reference value;
- determine whether the comparison value is within a particular phase range specified by the first threshold and the second threshold, and determining that the comparison value is higher or lower than the first threshold and that the comparison value is higher or lower than the second threshold when the processor determines that the comparison value is not within the particular phase range;
- and
- update the particular phase range to a phase range adjacent to a direction corresponding to the result of determination as to whether the comparison value is higher or lower than the first threshold and the second threshold when the comparison value is determined not to be within the particular phase range.