Interpolation apparatus for encoder, controlling method of interpolation apparatus for encoder, non-transitory storage medium storing controlling program of interpolation apparatus for encoder and encoder
An AD converter acquires first and second input values. A first multiplication unit multiplies a first tangent value, which is based on a first boundary angle based on a phase range of a reference value, by the reference value to calculate a first threshold value. A second multiplication unit multiplies a second tangent value, which is based on a second boundary angle based on the phase range, by the reference value to calculate a second threshold. A comparison unit determines whether the comparison value is within a particular phase range specified by the first and the second thresholds. The comparison unit determines magnitude of the comparison value when the comparison value is not within the particular phase range. A phase estimation unit updates the particular phase range to a phase range adjacent to a direction corresponding to the result of determination.
1. An interpolation apparatus for an encoder comprising:
an AD converter which converts a first sine wave signal generated in accordance with a change of a position of a measurement object into a digital signal to acquire a first input value, and converts 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; and
a processor comprising hardware, the processor configured to:
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;
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 from 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 from the processor on the basis of the phase range of the reference value;
determine that the comparison value is higher or lower than the first threshold, wherein the comparison value is within a particular phase range specified by the first threshold and the second threshold, the comparison unit and that the comparison value is higher or lower than the second threshold when the comparison unit 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 by the comparison unit as to whether the comparison value is higher or lower than the first threshold and the second threshold when the comparison unit determines that the comparison value is not within the particular phase range.
2. The interpolation apparatus for the encoder according to claim 1 , wherein an operation from the acquisition of the first input value and the second input value by the AD converter to the update of the particular phase range by the processor is repeated at a constant cycle.
3. The interpolation apparatus for the encoder according to claim 2 , wherein the constant cycle is shorter than a period of one phase range.
4. The interpolation apparatus for the encoder according to claim 1 , wherein the processor is further configured to:
determine a region corresponding to the first input value and the second input value among regions of one cycle of the first sine wave signal and the second sine wave signal split into octants by 45° on the basis of signs of the first input value and the second input value and magnitude relation of absolute values of the first input value and the second input value,
wherein the processor sets the phase range by splitting the determined region to make the determination.
5. The interpolation apparatus for the encoder according to claim 4 , wherein the number of splits of the region is smaller when the change of the phase relation between the first sine wave signal and the second sine wave signal is greater.
6. The interpolation apparatus for the encoder according to claim 4 , wherein the number of splits of the region is smaller when velocity of the measurement object is lower.
7. The interpolation apparatus for the encoder according to claim 5 , wherein the processor is further configured to:
record a threshold table to associate the first boundary angles with the first tangent values and associate the second boundary angles with the second tangent values,
wherein the number of splits of the region is changed by changing a reference method of the threshold table.
8. The interpolation apparatus for the encoder according to claim 5 , wherein the processor is further configured to:
record threshold tables that are different in association of the first boundary angles with the first tangent values and the association of the second boundary angles with the second tangent values,
wherein the number of splits of the region is changed by selecting one of the threshold tables.
9. A driver comprising:
a drive unit which drives the measurement object;
an encoder which generates the first sine wave signal and the second sine wave signal in accordance with the change of the position of the measurement object; and
the interpolation apparatus for the encoder according to claim 1 .
10. 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.
11. A non-transitory storage medium storing a controlling program of an interpolation apparatus for an encoder, the controlling program causing a computer 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 convert 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 use 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 computer 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 computer 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 determine 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 computer 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 a judgment 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.