Waveform measuring instrument, measurement method, and measurement program

The waveform measuring device synchronizes zero position determination with multiple zero detection timings during the Z-phase signal HI period, addressing the challenge of directional dependence in encoder angle measurement, ensuring precise and flexible angle determination.

JP2026102387APending Publication Date: 2026-06-23YOKOGAWA TEST & MEASUREMENT CORP

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
YOKOGAWA TEST & MEASUREMENT CORP
Filing Date
2024-12-11
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Encoders attached to motors face challenges in accurately determining the zero position of an angle regardless of the motor's rotation direction due to varying pulse widths of the Z-phase signal, leading to errors in angle measurement.

Method used

A waveform measuring device and method that converts encoder signals into rotation angles, using a zero position determination circuit to synchronize the zero reset timing based on multiple zero position detection timings during the HI period of the Z-phase signal, regardless of rotation direction, and includes a counter to adjust the rotation angle count accordingly.

Benefits of technology

Accurately determines the zero position of the angle with high precision irrespective of the motor's rotation direction, reducing measurement errors and increasing operational flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026102387000001_ABST
    Figure 2026102387000001_ABST
Patent Text Reader

Abstract

This invention provides a waveform measuring instrument, a measurement method, and a measurement program that can accurately determine the zero position of an angle regardless of the direction of rotation. [Solution] The waveform measuring instrument 1 converts the count signal output by the encoder 10 into a rotation angle. The waveform measuring instrument 1 includes a zero position determination circuit 114 that generates a set signal based on a Z-phase signal having a pulse width over a period including multiple zero position detection timings based on the count signal, and a counter 107 that increases or decreases the rotation angle based on the count signal, and sets the count to zero when increasing the rotation angle and sets the count to the maximum value when decreasing the rotation angle based on the set signal. The zero position determination circuit 114 outputs a set signal when a predetermined number of zero position detection timings corresponding to forward rotation or reverse rotation occur during the HI period of the Z-phase signal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to a waveform measuring device, a measuring method, and a measurement program for measuring a waveform obtained by converting a signal of a rotary encoder into an angle.

Background Art

[0002] As described in Patent Document 1, an encoder that determines an origin by memorizing the contact position of a stopper is known.

Prior Art Documents

Patent Documents

[0003]

Patent Document 1

Summary of the Invention

Problems to be Solved by the Invention

[0004] An encoder attached to a motor may determine an origin of an angle, that is, a zero position, using a signal of an excitation position sensor of the motor. When the pulse width of the signal used to determine the zero position of the angle is long, the zero position of the angle may be determined at different angles depending on whether the motor rotates in the forward direction or the reverse direction. It is required to determine the zero position of the angle with high accuracy regardless of the rotation direction.

[0005] The present disclosure has been made in view of the above points, and an object thereof is to provide a waveform measuring device, a measuring method, and a measurement program that can determine the zero position of an angle with high accuracy regardless of the rotation direction.

Means for Solving the Problems

[0006] (1) Waveform measuring instruments according to several embodiments convert a count signal output by an encoder into a rotation angle. The waveform measuring instrument includes a zero position determination circuit that generates a set signal based on a Z-phase signal having a pulse width over a period including a plurality of zero position detection timings based on the count signal, and a counter that increases or decreases the rotation angle based on the count signal, and sets the count to zero when increasing the rotation angle and sets the count to the maximum value when decreasing the rotation angle based on the set signal. The zero position determination circuit outputs the set signal when a predetermined number of zero position detection timings corresponding to forward rotation or reverse rotation occur during the HI period of the Z-phase signal.

[0007] In this way, regardless of the pulse width of the Z-phase signal, the timing of resetting the rotation angle to zero can be synchronized for both forward and reverse rotation. As a result, the zero position of the rotation angle can be determined with high precision regardless of the direction of rotation.

[0008] (2) In the waveform measuring instrument described in (1) above, the sum of a predetermined number corresponding to forward rotation and a predetermined number corresponding to reverse rotation may be equal to the number of zero position detection timings during the HI period of the Z-phase signal plus 1. This makes it possible to reset the rotation angle to zero at any timing during the HI period of the Z-phase signal. As a result, the degree of freedom of operation is increased.

[0009] (3) In the waveform measuring instrument described in (2) above, the predetermined number corresponding to the reversal may be equal to the number of zero position detection timings during the HI period of the Z-phase signal. In this way, the determination circuit can be easily configured.

[0010] (4) The waveform measuring instrument described in any one of (1) to (3) above may further include a Z-phase counter that counts the zero position detection timing during the HI period of the Z-phase signal. This makes it possible to handle Z-phase signals with unknown pulse widths when they are input.

[0011] (5) Measurement methods according to some embodiments are measurement methods for converting a count signal output by an encoder into a rotation angle, and include generating a set signal when a predetermined number of zero position detection timings corresponding to forward or reverse rotation occur during the HI period of the Z-phase signal, based on a Z-phase signal having a pulse width over a period including a plurality of zero position detection timings based on the count signal; increasing or decreasing the rotation angle based on the count signal; and setting the count to zero when increasing the rotation angle and setting the count to the maximum value when decreasing the rotation angle based on the set signal.

[0012] (6) In the measurement method described in (5) above, the sum of the predetermined number corresponding to forward rotation and the predetermined number corresponding to reverse rotation may be the number of zero position detection timings during the HI period of the Z-phase signal plus 1.

[0013] (7) In the measurement method described in (6) above, the predetermined number corresponding to the reversal may be equal to the number of zero position detection timings during the HI period of the Z-phase signal.

[0014] (8) The measurement method described in any one of (5) to (7) above may further include counting the zero position detection timings during the HI period of the Z-phase signal.

[0015] (9) Measurement programs according to some embodiments are measurement programs that convert a count signal output by an encoder into a rotation angle, and cause a processor to perform the following actions based on a Z-phase signal having a pulse width over a period including a plurality of zero position detection timings based on the count signal: generate a set signal when a predetermined number of zero position detection timings corresponding to forward rotation or reverse rotation occur during the HI period of the Z-phase signal; increase or decrease the rotation angle based on the count signal; and set the count to zero when increasing the rotation angle and set the count to the maximum value when decreasing the rotation angle based on the set signal.

[0016] (10) In the measurement program according to (9) above, the sum of the predetermined number corresponding to the forward rotation and the predetermined number corresponding to the reverse rotation may be the number obtained by adding 1 to the number of zero position detection timings in the HI period of the Z-phase signal.

[0017] (11) In the measurement program according to (10) above, the predetermined number corresponding to the reverse rotation may be equal to the number of zero position detection timings in the HI period of the Z-phase signal.

[0018] (12) The measurement program according to any one of (9) to (11) above may further include counting the zero position detection timings in the HI period of the Z-phase signal.

Advantages of the Invention

[0019] According to the waveform measuring instrument, measuring method, and measurement program according to the present disclosure, the zero position of the angle is determined with high accuracy regardless of the rotation direction.

Brief Description of the Drawings

[0020] [Figure 1] It is a schematic diagram showing a configuration example in which an encoder is attached to a motor to be measured. [Figure 2] It is a graph showing signals when measuring the rotation angle with the device according to the comparative example. [Figure 3A] It is a graph showing the result of measuring the rotation angle only in the forward rotation based on the Z-phase signal that becomes HI during a period including only one count signal with the device according to the comparative example. [Figure 3B] It is a graph showing the result of measuring the rotation angle only in the forward rotation based on the Z-phase signal that becomes HI during a period including a plurality of count signals with the device according to the comparative example. [Figure 3C] It is a graph showing the result of measuring the rotation angle when changing from forward rotation to reverse rotation in the middle based on the Z-phase signal that becomes HI during a period including a plurality of count signals with the device according to the comparative example. [Figure 3D]It is a graph showing the result of measuring the rotation angle when changing from forward rotation to reverse rotation in the middle of forward rotation based on the Z-phase signal that becomes HI during a period including a plurality of count signals in the device according to the comparative example. [Figure 4] It is a block diagram showing a configuration example of the waveform measuring device according to the present disclosure. [Figure 5] It is a graph showing an example of signals when measuring the rotation angle with the waveform measuring device according to the present disclosure. [Figure 6A] It is a diagram showing an example of the condition for counting up the rotation angle during forward rotation. [Figure 6B] It is a diagram showing an example of the condition for counting down the rotation angle during reverse rotation. [Figure 7A] It is a diagram showing an example of the generation condition of the forward rotation zero position timing. [Figure 7B] It is a diagram showing an example of the generation condition of the reverse rotation zero position timing. [Figure 8] It is a diagram showing an example of the operation of the count period creation circuit during forward rotation. [Figure 9] It is a diagram showing an example of the operation of the count period creation circuit during reverse rotation. [Figure 10A] It is a diagram showing an example of the operation of the rotation direction detection circuit when forward rotation continues. [Figure 10B] It is a diagram showing an example of the operation of the rotation direction detection circuit when reverse rotation continues. [Figure 10C] It is a diagram showing an example of the operation of the rotation direction detection circuit when changing from forward rotation to reverse rotation starting from forward rotation. [Figure 10D] It is a diagram showing an example of the operation of the rotation direction detection circuit when changing from reverse rotation to forward rotation starting from reverse rotation. [Figure 11A] It is a diagram showing an example of signals in the operation during forward rotation. [Figure 11B] It is a diagram showing an example of signals in the operation during reverse rotation. [Figure 12A] It is a diagram showing an example of the operation when starting from reverse rotation. [Figure 12B] It is a graph showing an example of signals when measuring the rotation angle when starting from reverse rotation. [Figure 13]This graph shows an example of a signal used to measure the rotation angle when the rotation changes from forward to reverse midway through. [Figure 14] This graph shows an example of a signal used to measure the rotation angle when the rotation changes to forward during reverse rotation. [Figure 15A] This graph shows an example of the results of measuring the rotation angle in forward rotation only in this disclosure. [Figure 15B] This graph shows an example of the results of measuring the rotation angle when the rotation changes from forward to reverse midway through the process, as described in this disclosure. [Figure 16] This flowchart shows an example of the procedure for the measurement method related to this disclosure. [Modes for carrying out the invention]

[0021] The waveform measuring instrument 1 according to this disclosure (see Figure 4) measures the rotation angle of the motor 20 based on the A-phase signal and B-phase signal, which are pulse signals output by an encoder 10 attached to the motor 20, as shown in Figure 1, for example. The waveform measuring instrument 1 also sets the rotation angle of the motor 20 to 0 based on the Z-phase signal, which is a pulse signal output from the excitation position sensor 21 of the motor 20. Embodiments of the waveform measuring instrument 1 according to this disclosure and the measurement method or measurement program executed by the waveform measuring instrument 1 will be described below. The encoder 10 may be a rotary encoder. The object to be measured is not limited to the motor 20. The device that outputs the Z-phase signal is not limited to the excitation position sensor 21.

[0022] (Comparative example) The apparatus in the comparative example increases or decreases the measured rotation angle of the motor 20 based on the A-phase signal and B-phase signal output by the encoder 10, and sets the rotation angle to the zero position when the Z-phase signal is HI and the A-phase signal and B-phase signal meet predetermined conditions. Whether the motor 20 is rotating in the forward or reverse direction is determined according to the state of the A-phase signal and B-phase signal when they change from LO to HI or from HI to LO, that is, according to the combination of whether the A-phase signal and B-phase signal are HI or LO.

[0023] Figure 2 shows a graph of an example of the signals when measuring the rotation angle of motor 20 using the apparatus of the comparative example. As shown in the enlarged portion of Figure 2, the apparatus of the comparative example increases the rotation angle using the timing of the change in the state of the A-phase signal or B-phase signal between LO and HI as the timing for angle counting. Furthermore, the apparatus of the comparative example sets the rotation angle to the zero position using the timing of position detection when the Z-phase signal is HI and the B-phase signal is LO, and the A-phase signal changes from LO to HI.

[0024] As shown in Figure 3A, when the pulse width of the Z-phase signal is short, specifically when only one zero-position detection timing occurs while the Z-phase signal is HIGH, the rotation angle is set to zero only once. On the other hand, as shown in Figure 3B, when the pulse width of the Z-phase signal is long, specifically when multiple zero-position detection timings occur while the Z-phase signal is HIGH, the rotation angle remains set to zero while the Z-phase signal is HIGH.

[0025] Here, as shown in Figures 3C and 3D, the rotation may change to reverse during forward rotation. As shown in Figure 3C, if the pulse width of the Z-phase signal is short, even if the rotation changes to reverse during forward rotation, no error in the rotation angle occurs when the rotation angle is set to zero. On the other hand, as shown in Figure 3D, if the pulse width of the Z-phase signal is long, an error in the rotation angle during reverse rotation occurs due to the difference in the timing of the change to reverse during forward rotation.

[0026] As mentioned above, the output of the excitation position sensor 21 of the motor 20 may be used as the Z-phase signal. However, it is difficult to adjust the pulse width of the pulse signal output from the excitation position sensor 21. Therefore, it is difficult to adjust it so that only one zero position detection timing occurs while the Z-phase signal is HIGH. Even if multiple zero position detection timings occur while the Z-phase signal is HIGH, it is required to reduce the error in the rotation angle regardless of whether it is forward or reverse rotation, i.e., regardless of the direction of rotation.

[0027] (Overview of Waveform Measuring Instrument 1) The waveform measuring instrument 1 (see Figure 4) according to this disclosure converts the A-phase signal and B-phase signal output by the encoder 10, which detects the rotation of the motor 20, into the rotation angle of the motor 20 and measures it. Specifically, the waveform measuring instrument 1 counts the rotation angle from 0 to 360 degrees as a numerical value from 0 to M-1. The waveform measuring instrument 1 increases or decreases the rotation angle count when the A-phase signal and B-phase signal satisfy the counting conditions.

[0028] Furthermore, the waveform measuring instrument 1 according to this disclosure sets the rotation angle count to zero when the A-phase signal and B-phase signal satisfy the conditions for the occurrence of a zero position detection timing during the period when the Z-phase signal is HI. In this disclosure, multiple zero position detection timings occur during the period when the Z-phase signal is HI. In other words, in this disclosure, the Z-phase signal has a pulse width that spans a period including multiple zero position detection timings. The period when the Z-phase signal is HI is also referred to as the HI period of the Z-phase signal.

[0029] When the Z-phase signal has a pulse width that spans a period including multiple zero-position detection timings, errors occur when setting the rotation angle to zero in both forward and reverse rotation, as described in the comparative example. The waveform measuring instrument 1 according to this disclosure sets the rotation angle to zero when a predetermined number of zero-position detection timings corresponding to forward or reverse rotation occur, so as to reduce errors when setting the rotation angle to zero regardless of the direction of rotation.

[0030] (Example configuration of waveform measuring device 1) The following describes an example configuration of the waveform measuring device 1 according to this disclosure, with reference to Figure 4.

[0031] The functions of each component of the waveform measuring instrument 1 described below may be implemented as dedicated circuits. The functions of each component of the waveform measuring instrument 1 may also be implemented by having at least one general-purpose processor execute a program. The general-purpose processor may include a CPU (Central Processing Unit) or a GPU (Graphics Processing Unit), etc. Each component of the waveform measuring instrument 1 may include a storage unit as needed. The storage unit may include, for example, semiconductor memory or an electromagnetic storage medium. Each component of the waveform measuring instrument 1 may include a communication interface as needed. The communication interface may be configured to communicate data or information using various communication standards.

[0032] The waveform measuring instrument 1 in Figure 4 operates as follows in general terms. The waveform measuring instrument 1 acquires the A-phase signal and B-phase signal, respectively, which are shown as A-phase and B-phase waveforms in the graph illustrated in Figure 5, from the encoder 10 of the motor 20. Based on the A-phase signal and B-phase signal, the waveform measuring instrument 1 calculates counts corresponding to the rotation angles of the motor 20 in the forward and reverse directions. The waveform measuring instrument 1 calculates angle calculation values ​​by converting the counts into the rotation angles of the motor 20. The angle calculation values ​​are the values ​​obtained by converting the rotation angle counts into actual angles from 0 degrees to 360 degrees. The horizontal axis of the graph in Figure 5 corresponds to time.

[0033] The waveform measuring instrument 1 acquires the Z-phase signal, whose waveform is shown as the Z-phase in the graph illustrated in Figure 5, from the excitation position sensor 21 of the motor 20, and detects the rotation position when the rotation angle of the motor 20 becomes zero, i.e., the zero-angle position, based on the Z-phase signal. In order to detect the zero-angle position, the waveform measuring instrument 1 counts the up or down signals during the period when the Z-phase signal is HI and calculates the Z-phase pulse width count value. When the motor 20 is rotating forward, the waveform measuring instrument 1 sets the count corresponding to the rotation angle to zero so that the angle calculation value becomes zero when the zero-angle position is detected. When the motor 20 is rotating forward, the waveform measuring instrument 1 counts the period when the Z-phase signal is HI using the up signal and calculates the Z-phase pulse width count value. When the motor 20 is rotating backward, the waveform measuring instrument 1 calculates the HI period of the Z-phase signal using the down signal from the Z-phase pulse width count value calculated during forward rotation, identifies the zero-angle position, and sets the count corresponding to the rotation angle to its maximum value so that the angle calculation value becomes the maximum value. The maximum value of the angle calculation is 359 degrees, for example, when the rotation angle is calculated in 1-degree increments. In this disclosure, let's assume that rotation angles from 0 degrees to 360 degrees are represented by M counts. In this case, the maximum value of the angle calculation is 360 × (M-1) / M degrees.

[0034] The waveform measuring instrument 1 includes an input amplifier 121 that acquires the A-phase signal from the encoder 10, an input amplifier 131 that acquires the B-phase signal from the encoder 10, and an input amplifier 141 that acquires the Z-phase signal from the excitation position sensor 21 of the motor 20.

[0035] The waveform measuring instrument 1 includes a sample timing generation circuit 101. The sample timing generation circuit 101 may be a clock generation circuit. The sample timing generation circuit 101 outputs a sample timing signal to the A / D converters 122, 132 and 142, interface circuits 123, 133 and 143 (described later), and the memory controller 102.

[0036] The waveform measuring instrument 1 includes an A / D converter 122 that converts the A-phase signal acquired by the input amplifier 121 into a digital signal, an A / D converter 132 that converts the B-phase signal acquired by the input amplifier 131 into a digital signal, and an A / D converter 142 that converts the Z-phase signal acquired by the input amplifier 141 into a digital signal. Hereinafter, the signals obtained by converting the A-phase signal, B-phase signal, and Z-phase signal into digital signals will be simply referred to as the A-phase signal, B-phase signal, and Z-phase signal, respectively. The A / D converters 122, 132, and 142 operate in synchronization with the sample timing signal.

[0037] The waveform measuring instrument 1 includes an interface circuit 123 that outputs an A-phase signal to each component, an interface circuit 133 that outputs a B-phase signal to each component, and an interface circuit 143 that outputs a Z-phase signal to each component. Interface circuits 123, 133, and 143 operate in synchronization with the sample timing signal.

[0038] The waveform measuring instrument 1 comprises a memory controller 102, a waveform memory 103, a display waveform creation circuit 104, and a display unit 105. The memory controller 102 acquires A-phase signals, B-phase signals, and Z-phase signals, as well as an angle signal (described later), in synchronization with the sample timing signal. The waveform memory 103 stores the waveforms of the various signals acquired by the memory controller 102. The display waveform creation circuit 104 creates images, etc., to display the waveforms stored in the waveform memory 103. The display unit 105 displays the images, etc., created by the display waveform creation circuit 104. The display unit 105 may include various displays such as a liquid crystal display.

[0039] The waveform measuring instrument 1 includes an edge detection circuit 124 that detects the edges of the A-phase signal, i.e., changes between the LO and HI states of the A-phase signal, and an edge detection circuit 134 that detects the edges of the B-phase signal, i.e., changes between the LO and HI states of the B-phase signal.

[0040] The waveform measuring instrument 1 includes a level determination circuit 125 that determines the level of the A-phase signal, i.e., whether the A-phase signal is LO or HI; a level determination circuit 135 that determines the level of the B-phase signal, i.e., whether the B-phase signal is LO or HI; and a level determination circuit 145 that determines the level of the Z-phase signal, i.e., whether the Z-phase signal is LO or HI.

[0041] The waveform measuring instrument 1 includes a count condition determination circuit 106. The count condition determination circuit 106 determines whether the motor 20 is rotating in the forward or reverse direction based on the edges and levels of the A-phase signal and the B-phase signal. Forward rotation may be either clockwise or counterclockwise. Reverse rotation is rotation in the opposite direction to forward rotation. In this disclosure, forward rotation is defined as clockwise rotation, and reverse rotation is defined as counterclockwise rotation. Forward rotation and reverse rotation are also represented as CW and CCW, respectively. The count condition determination circuit 106 increases the rotation angle count when the motor 20 is rotating in the forward direction, and decreases the rotation angle count when the motor 20 is rotating in the reverse direction. In other words, the A-phase signal and the B-phase signal are used to determine whether to increase or decrease the rotation angle count. The A-phase signal and the B-phase signal are also collectively referred to as count signals. The count condition determination circuit 106 outputs an up signal when it decides to increase the rotation angle count, and outputs a down signal when it decides to decrease the rotation angle count. In Figure 4, an up signal is represented as "up," and a down signal is represented as "down."

[0042] The count condition determination circuit 106 outputs an up signal when the edge and level of the A-phase signal and the edge and level of the B-phase signal satisfy the conditions shown in Table 1 below. The waveforms of the A-phase signal and B-phase signal corresponding to each condition (1) to (4) in Table 1 are shown in Figure 6A.

[0043] [Table 1]

[0044] Furthermore, the count condition determination circuit 106 outputs a down signal when the edge and level of the A-phase signal and the edge and level of the B-phase signal satisfy the conditions shown in Table 2 below. The waveforms of the A-phase signal and B-phase signal corresponding to each of the conditions (1) to (4) in Table 2 are shown in Figure 6B.

[0045] [Table 2]

[0046] The count condition determination circuit 106 determines the forward rotation zero position timing and the reverse rotation zero position timing based on the edges and levels of the A-phase signal and the B-phase signal. The forward rotation zero position timing and the reverse rotation zero position timing are collectively referred to as the zero position timing. The forward rotation zero position timing is the timing that identifies the zero position when the motor 20 is rotating in the forward direction. The reverse rotation zero position timing is the timing that identifies the zero position when the motor 20 is rotating in the reverse direction.

[0047] The count condition determination circuit 106 determines that the forward rotation zero position timing has occurred when the A-phase signal and the B-phase signal satisfy the conditions shown in Table 3 below, that is, when the condition in Table 1 and Figure 6A (1) is satisfied. Figure 7A shows that the forward rotation zero position timing occurs when the condition in Table 3 and Figure 6A (1) is satisfied.

[0048] [Table 3]

[0049] The count condition determination circuit 106 determines that a reverse zero position timing has occurred when the A-phase signal and the B-phase signal satisfy the conditions shown in Table 4 below, that is, when the condition in Table 2 and Figure 6B (4) is satisfied. Figure 7B shows that a reverse zero position timing occurs when the condition in Table 4 and Figure 6B (4) is satisfied.

[0050] [Table 4]

[0051] The waveform measuring instrument 1 includes an up / down counter 107. The up / down counter 107 increases the rotation angle count when it receives an up signal from the count condition determination circuit 106, and decreases the rotation angle count when it receives a down signal from the count condition determination circuit 106. In this disclosure, the up / down counter 107 represents the rotation angle from 0 to 360 degrees with M values ​​from 0 to M-1. That is, the rotation angle count is a value from 0 to M-1. When the zero angle position shown in Figure 5 is detected, the up / down counter 107 sets the rotation angle count to zero during forward rotation, and sets the rotation angle count to M-1, i.e., the maximum value of the count in this disclosure, during reverse rotation. The up / down counter 107 is also simply referred to as a counter.

[0052] The waveform measuring instrument 1 is equipped with an angle conversion circuit 108. The angle conversion circuit 108 acquires the rotation angle count from the up / down counter 107, converts the rotation angle into a numerical value in the range of 0 to 360 degrees, and outputs it as an angle signal to the memory controller 102.

[0053] The waveform measuring instrument 1 includes a count period creation circuit 109. The operation of the count period creation circuit 109 during forward rotation will be explained with reference to the graph in Figure 8. The horizontal axis of the graph in Figure 8 represents time. When the count period creation circuit 109 obtains the forward rotation zero position timing from the count condition determination circuit 106, it detects whether it is the first acquisition of the forward rotation zero position timing after the Z-phase signal has become HI. The count period creation circuit 109 sets the count period signal to HI when the forward rotation zero position timing is first acquired, and sets the count period signal to LO when the Z-phase signal becomes LO.

[0054] The operation of the count period creation circuit 109 during reversal will be explained with reference to the graph in Figure 9. The horizontal axis of the graph in Figure 9 represents time. When the count period creation circuit 109 obtains the reversal zero position timing from the count condition determination circuit 106, it detects whether it is the first acquisition of the reversal zero position timing after the Z-phase signal has become HI. The count period creation circuit 109 sets the count period signal to HI when the reversal zero position timing is first acquired, and sets the count period signal to LO when the Z-phase signal becomes LO.

[0055] The waveform measuring instrument 1 comprises a Z-phase up / down counter 112 and a first hold memory 113. The Z-phase up / down counter 112 is also simply called a Z-phase counter.

[0056] The Z-phase up-down counter 112 activates its counting operation when the counting period signal output from the counting period creation circuit 109 becomes HI. When the Z-phase up-down counter 112 is in forward rotation, it is set to zero when the counting operation is activated, and counts the count signal while the counting period signal is HI by incrementing the count in accordance with the up signal.

[0057] The first hold memory 113 stores the number of count signals that occurred when the forward rotation zero position timing occurred, as counted by the Z-phase up-down counter 112 during forward rotation, while the count period signal was HI. In other words, each time the forward rotation zero position timing occurs, the Z-phase up-down counter 112 stores the number of up signals counted in the first hold memory 113. In this disclosure, the number of count signals while the count period signal is HI is assumed to be N. Also, when the forward rotation zero position timing occurs under the conditions in Table 3 described above, the forward rotation zero position timing occurs once for every four up signals. Therefore, in this case, N is a multiple of 4.

[0058] The number counted by the Z-phase up / down counter 112 corresponds to the Z-phase pulse width count value shown in Figure 5.

[0059] When the Z-phase up-down counter 112 is rotating in the forward direction, if the count period signal output from the count period creation circuit 109 becomes LO, it loads N from the first hold memory 113.

[0060] When the Z-phase up-down counter 112 reverses, if the count period signal output from the count period creation circuit 109 becomes HI, it counts down in accordance with the down signal. As shown in Figure 5, when switching from forward rotation to reverse rotation, when the count period signal output from the count period creation circuit 109 becomes LO during forward rotation, N is loaded into the Z-phase up-down counter 112 from the first hold memory 113. Therefore, when reversing, the Z-phase up-down counter 112 decrements N, i.e., subtracts 1, in accordance with the down signal.

[0061] During reverse rotation, the Z-phase up / down counter 112 decrements from N in response to the down signal, and when it reaches 0, it is determined to be the 0 position of the rotation angle during reverse rotation.

[0062] If the motor 20 starts rotating in reverse and no forward rotation occurs, the Z-phase up / down counter 112 cannot calculate the number of count signals (N) while the count period signal is HI, and therefore no value is stored in the first hold memory 113. The waveform measuring instrument 1 is equipped with a reverse Z-phase up counter 115 so that N can be counted when the motor 20 starts rotating in reverse. The reverse Z-phase up counter 115 activates its counting operation when the count period signal becomes HI. The reverse Z-phase up counter 115 counts the down signals while the count period signal is HI by incrementing in accordance with the down signals. When reversing, the reverse Z-phase up counter 115 stores the number of down signals counted in the first hold memory 113 each time a reversal zero position timing occurs. If the reversal continues until the Z-phase signal becomes LO, the operation of the reverse Z-phase up counter 115 stores the number of count signals (N) while the count period signal is HI in the first hold memory 113. Similar to forward rotation, when reverse rotation occurs under the conditions shown in Table 4 above, the reverse zero position timing occurs once for every four down signals. Therefore, in this case as well, N is a multiple of 4.

[0063] Even during reversal, the Z-phase up-down counter 112 loads N from the first hold memory 113 when the count period signal output from the count period creation circuit 109 becomes LO.

[0064] From the above explanation, the value stored in the first hold memory 113 is, during forward rotation, the value of the Z-phase up / down counter 112 at the last forward rotation zero position timing before the Z-phase signal falls, i.e., before the Z-phase signal becomes LO, and during reverse rotation, the value of the reverse Z-phase up counter 115 at the last reverse rotation zero position timing.

[0065] The timing at which the value of the first hold memory 113 is loaded into the Z-phase up-down counter 112 is when the count period signal becomes LO, both during forward rotation and reverse rotation.

[0066] While the Z-phase signal is HIGH, the rotation of motor 20 may change from forward to reverse. Also, while the Z-phase signal is HIGH, the rotation of motor 20 may change from reverse to forward.

[0067] For example, if the rotation of the motor 20 changes from forward to reverse while the Z-phase signal is HI, the Z-phase up / down counter 112 is cleared to 0 when the Z-phase signal becomes HI and incremented by the up signal. When the rotation changes to reverse and the down signal decrements it, and the Z-phase signal becomes LO, the value of the Z-phase up / down counter 112 becomes 0. The reverse Z-phase up counter 115 is incremented only by the down signal after the reverse. Therefore, when the Z-phase signal becomes LO, the value of the reverse Z-phase up counter 115 becomes a value smaller than N. Consequently, in this case, when the Z-phase signal becomes LO, the value stored in the first hold memory 113 from the reverse Z-phase up counter 115 will be a value smaller than N, and as a result, the value loaded into the Z-phase up / down counter 112 will also become smaller by N, and the waveform measuring instrument 1 will not be able to operate correctly.

[0068] The waveform measuring instrument 1 includes a second hold memory 116 and a rotation direction detection circuit 117 to accommodate cases where the rotation direction of the motor 20 changes while the Z-phase signal is HI.

[0069] The rotation direction detection circuit 117 stores information on whether a forward rotation zero position timing or a reverse rotation zero position timing was detected when the first zero position timing after the Z-phase signal becomes HIGH is detected in the count period creation circuit 109. When a new zero position timing is detected, the rotation direction detection circuit 117 compares the newly detected zero position timing with the first zero position timing. The rotation direction detection circuit 117 becomes 0 if both the newly detected zero position timing and the first zero position timing are forward rotation zero position timings or both are reverse rotation zero position timings. The rotation direction detection circuit 117 becomes 1 if the newly detected zero position timing is forward rotation zero position timing and the first zero position timing is reverse rotation zero position timing, or if the newly detected zero position timing is reverse rotation zero position timing and the first zero position timing is forward rotation zero position timing. In other words, the rotation direction detection circuit 117 becomes 0 if both the newly detected zero position timing and the first zero position timing are zero position timings in the same rotation direction, and becomes 1 if they are zero position timings in different rotation directions. The rotation direction detection circuit 117 holds the value when the Z-phase signal becomes LO, that is, when the count period signal becomes LO, i.e., 0 or 1.

[0070] The rotation direction detection circuit 117 operates as shown in Figure 10A when the motor 20 continues to rotate in the forward direction, and as shown in Figure 10B when the motor 20 continues to rotate in the reverse direction. The rotation direction detection circuit 117 operates as shown in Figure 10C when the rotation of the motor 20 starts in the forward direction and changes to the reverse direction, and as shown in Figure 10D when the rotation of the motor 20 starts in the reverse direction and changes to the forward direction.

[0071] When the rotation direction detection circuit 117 is 0, the value of the first hold memory 113 is loaded into the Z-phase up / down counter 112 when the Z-phase signal falls, and the value of the first hold memory 113 is stored in the second hold memory 116. When the rotation direction detection circuit 117 is 1, the value of the first hold memory 113 is not stored in the second hold memory 116. In other words, when the rotation direction detection circuit 117 is 1, the value of the second hold memory 116 is retained as is.

[0072] Here, a value of 0 in the rotation direction detection circuit 117 means that the rotation direction did not change during the period when the count period signal was HI. In that case, when the rotation direction detection circuit 117 is 0, the value in the first hold memory 113 when the Z-phase signal falls is the number of count signals (N) during which the count period signal was HI. In other words, the value stored in the second hold memory 116 in this case is the number of count signals (N) during which the count period signal was HI.

[0073] On the other hand, when the rotation direction detection circuit 117 becomes 1, it means that the rotation direction changed during the period when the count period signal was HI. In that case, when the rotation direction detection circuit 117 becomes 1, the value in the first hold memory 113 when the Z-phase signal falls is smaller than the number of count signals (N) during the period when the count period signal was HI. In this case, the value of the first hold memory 113 is not stored in the second hold memory 116, and the value of the second hold memory 116 is kept as N. In other words, regardless of whether the rotation direction changes during the period when the count period signal is HI, the value stored in the second hold memory 116 is kept as the number of count signals (N) during the period when the count period signal was HI.

[0074] The counting operation of the Z-phase up / down counter 112 described above is summarized in Table 5 below.

[0075] [Table 5]

[0076] Furthermore, the counting operation of the inverted Z-phase up counter 115 described above is summarized in Table 6 below.

[0077] [Table 6]

[0078] The waveform measuring instrument 1 is equipped with a zero position determination circuit 114. When rotating forward, the zero position determination circuit 114 outputs an instruction to the up-down counter 107 to set the rotation angle count to zero, according to the value counted by the Z-phase up-down counter 112. This instruction to set the rotation angle count to zero is also called a set signal to zero and is represented as zero in Figure 4. When rotating in reverse, the zero position determination circuit 114 outputs an instruction to the up-down counter 107 to load the maximum value of the rotation angle count, according to the value counted by the Z-phase up-down counter 112. This instruction to load the maximum value is also called a set signal to the maximum value and is represented as borrow in Figure 4. As described above, the waveform measuring instrument 1 represents rotation angles from 0 to 360 degrees with M values ​​from 0 to M-1. Therefore, the maximum value of the rotation angle count is M-1.

[0079] (Example of operation of waveform measuring instrument 1) The specific operational examples of each component of the waveform measuring device 1 described above will now be explained.

[0080] Referring to Figure 11A, the operation of the waveform measuring instrument 1 during forward rotation will be explained. The Z-phase up-down counter 112 is set to zero when the count period signal becomes HI, that is, when the first forward rotation zero position timing occurs after the Z-phase signal becomes HI. Thereafter, the Z-phase up-down counter 112 increments, i.e., adds 1, in response to the input of the up signal that occurs during forward rotation while the count period signal is HI. When the Z-phase signal becomes LO, that is, when the count period signal becomes LO, the Z-phase up-down counter 112 holds the value counted while the count period signal was HI, i.e., N in this disclosure, in the first hold memory 113. In other words, the Z-phase up-down counter 112 holds the count value at the time the last forward rotation zero position timing occurred during the period when the count period signal was HI in the first hold memory 113. The value (N) stored in the first hold memory 113 is loaded into the Z-phase up-down counter 112 on the falling edge of the count period signal, i.e., the L edge. Furthermore, since the rotation direction does not change while the count period signal is HIGH, the rotation direction detection circuit 117 is 0. Because the rotation direction detection circuit 117 is 0, N is stored in the second hold memory 116 from the first hold memory 113. The Z-phase up-down counter 112 repeats the above operation each time the Z-phase signal becomes HIGH when forward rotation is repeated.

[0081] The zero position determination circuit 114 outputs a zero-set signal to the up-down counter 107 when it determines that the Z-phase up-down counter 112 has become zero. During forward rotation, the Z-phase up-down counter 112 becomes zero when the count period signal becomes HIGH. Therefore, during forward rotation, the zero position determination circuit 114 outputs a zero-set signal to the up-down counter 107 when the count period signal becomes HIGH.

[0082] The up / down counter 107 is set to zero when it receives a set signal to zero from the zero position determination circuit 114. In other words, the up / down counter 107 is set to zero when the count period signal becomes HIGH, that is, when the first forward rotation zero position timing occurs after the Z phase signal becomes HIGH. Thereafter, the up / down counter 107 counts up each time it receives an up signal.

[0083] Referring to Figure 11B, the operation of the waveform measuring instrument 1 during reverse rotation will be explained, assuming that the rotation starts in the forward direction and N is stored in the first hold memory 113. As described above, N is loaded into the Z-phase up-down counter 112 from the first hold memory 113. While the count period signal is HIG, the Z-phase up-down counter 112 performs decrement, i.e., subtraction of 1, in response to the input of the down signal that occurs during reverse rotation.

[0084] The reverse Z-phase up counter 115 performs counting while the count period signal is HIGH during the reverse rotation shown in Figure 11B, and stores N, the count during the period when the count period signal was HIGH, in the first hold memory 113 when the count period signal becomes LO. In other words, the Z-phase up counter 115 holds the count value at the time the last reverse zero position timing occurred during the period when the count period signal was HIGH in the first hold memory 113. The value (N) stored in the first hold memory 113 is loaded into the Z-phase up / down counter 112 on the falling edge of the count period signal, i.e., the L edge. Also, since the direction of rotation does not change while the count period signal is HIGH, the rotation direction detection circuit 117 is 0. Because the rotation direction detection circuit 117 is 0, N stored in the first hold memory 113 is also stored in the second hold memory 116. The Z-phase up counter 115 repeats the above operation each time the Z-phase signal becomes HIGH when the reverse rotation is repeated.

[0085] The zero position determination circuit 114 outputs an instruction to the up-down counter 107 to load the maximum value of the rotation angle count, i.e., M-1 in this disclosure, in synchronization with the timing when a down signal is input after the count of the Z-phase up-down counter 112 has become zero. This operation realizes the operation of setting the rotation angle count to the maximum value, i.e., M-1, when reversing.

[0086] The up / down counter 107 increments and decrements the rotation angle count based on the up and down signals from the count condition determination circuit 106, in both the forward rotation shown in Figure 11A and the reverse rotation shown in Figure 11B. It also sets the rotation angle count to zero based on the instruction from the zero position determination circuit 114, i.e., the set signal to zero, or loads M-1 into the rotation angle count based on the set signal to the maximum value. The rotation angle count of the up / down counter 107 is converted into a rotation angle by the angle conversion circuit 108.

[0087] In both forward and reverse rotation, count-up and count-down are performed with reference to a value corresponding to the pulse width of the Z-phase signal, i.e., N.

[0088] A comparison of Figure 11A and Figure 11B reveals that the position at which the up / down counter 107 counts to zero is the same during forward rotation and reverse rotation.

[0089] Referring to Figure 12A, an example of the operation of the waveform measuring instrument 1 when starting from reverse rotation will be explained. In principle, the operation when starting from reverse rotation is the same as when starting from forward rotation, but there are differences in the following points. The Z-phase up-down counter 112 starts counting from zero, so each time the reverse zero position timing occurs, it becomes a value less than zero. Therefore, the zero position determination circuit 114 outputs a set signal to M-1 to the up-down counter 107 not only when the value of the Z-phase up-down counter 112 becomes zero, but also when the value of the Z-phase up-down counter 112 becomes a value less than zero. Similar to the operation during forward rotation, at the last reverse zero position timing before the count period signal becomes LO, the value of the reverse Z-phase up-counter 115 and the value of the first hold memory 113 become N. Also, when the count period signal becomes LO, N is loaded from the first hold memory 113 into the Z-phase up-down counter 112.

[0090] Figure 12B shows the rotation angle count of the up / down counter 107 when it operates as described above. When starting from reverse, the waveform measuring instrument 1 first counts the number of A-phase and B-phase pulses, i.e., down signals, during the period when the Z-phase signal is HIGH. When the Z-phase signal next becomes HIGH, the waveform measuring instrument 1 performs a countdown from N with the Z-phase up / down counter 112, and sets the rotation angle count of the up / down counter 107 to its maximum value, i.e., M-1, at the timing when the Z-phase signal becomes LO. As shown in Figure 12B, when starting from reverse, the angle cannot be measured correctly for the first time because the value of N is not determined, but from the second time onward, the value of N can be determined and the angle can be measured correctly.

[0091] Referring to Figure 13, the operation of the waveform measuring instrument 1 when the rotation changes from forward to reverse while the count period signal is HI is explained.

[0092] In the explanation above, the value stored in the first hold memory 113 is the value of the Z-phase up-down counter 112 when the last zero position timing before the count period signal falls is the forward zero position timing, and the value of the reverse Z-phase up-counter 115 when it is the reverse zero position timing. Furthermore, the Z-phase up-down counter 112 loads the value stored in the first hold memory 113 after the count period signal falls.

[0093] When the rotation changes from forward to reverse, the Z-phase up / down counter 112 performs a countdown. The reverse Z-phase up counter 115 performs a countup from the start of the reverse rotation. Let K be the number of counts in the reverse Z-phase up counter 115 from the start of the reverse rotation until the falling edge of the Z-phase signal. If the reverse Z-phase up counter 115 stores K in the first hold memory 113, K is loaded into the Z-phase up / down counter 112. K is a different value from the count value N during the period when the count period signal is HI. Therefore, the waveform measuring instrument 1 will not be able to operate correctly when K is loaded into the Z-phase up / down counter 112. The waveform measuring instrument 1 can load N into the Z-phase up / down counter 112 by using the rotation direction detection circuit 117 and the second hold memory 116, even if the rotation changes from forward to reverse while the count period signal is HI.

[0094] As a premise, it is assumed that forward or reverse rotation is performed while the count period signal is HIGH. In this case, as described above, the second hold memory 116 stores the count (N) during which the count period signal is HIGH.

[0095] The rotation direction detection circuit 117 retains whether the first zero position timing after the Z-phase signal rises is the forward rotation zero position timing or the reverse rotation zero position timing. The rotation direction detection circuit 117 compares the zero position timing that occurs during the period when the count period signal is HIGH with the first zero position timing that it has retained. The rotation direction detection circuit 117 becomes 0 if the two compared zero position timings are both forward rotation zero position timings or both reverse rotation zero position timings, and becomes 1 if the two compared zero position timings are different from each other. In the example in Figure 13, the rotation direction detection circuit 117 retains that the first forward rotation zero position timing occurred, so it becomes 0 while forward rotation continues, and becomes 1 when the first reverse rotation zero position timing occurs after the rotation changes to reverse. The rotation direction detection circuit 117 holds 1 when the count period signal falls.

[0096] The rotation direction detection circuit 117 becomes 1 because the rotation direction changed from forward to reverse while the count period signal was HI. Therefore, the value to be held in the first hold memory 113, i.e., a value smaller than N, is not stored in the second hold memory 116. In other words, the value in the second hold memory 116 remains N. The Z-phase up-down counter 112 can correctly load N by loading the value in the second hold memory 116 when the count period signal becomes LO.

[0097] Referring to Figure 14, the operation of the waveform measuring instrument 1 when the rotation changes from reverse to forward while the count period signal is HI is explained.

[0098] The Z-phase up-down counter 112 performs a countdown during reverse rotation. Assume that the count of the Z-phase up-down counter 112 is L at the timing when the rotation changes from reverse to forward. The Z-phase up-down counter 112 performs a count-up after the rotation changes to forward. In this state, the count of the Z-phase up-down counter 112 returns from L to N, so when the count period signal becomes LO, the count of the Z-phase up-down counter 112 returns to N. As a result, when the count period signal becomes LO, N is stored in the first hold memory 113 from the Z-phase up-down counter 112. In this case, when the count period signal becomes LO, the values ​​in both the first hold memory 113 and the second hold memory 116 are N, and the waveform measuring instrument 1 can operate correctly even if the value is loaded into the Z-phase up-down counter 112 from either of them. However, in this case, since the output of the rotation direction detection circuit 117 is 1, the operation logic can be simplified by unifying the operation to load from the second hold memory 116.

[0099] As described above, when the rotation changes from forward to reverse while the count period signal is HIGH, the timing at which the rotation angle count is set by loading the value of the second hold memory 116 is the same for the Z-phase signal, which is symmetrical between forward and reverse rotation. As a result, no error in the zero position occurs between forward and reverse rotation.

[0100] Furthermore, even if the rotation switches from forward to reverse and then back to forward during the period when the Z-phase signal is HIGH, or if it switches from reverse to forward and then back to reverse, the count during the period when the count period signal is HIGH will still be N. In this case, the rotation direction at the first zero position timing and the rotation direction at the last zero position timing are the same, so the rotation direction detection circuit 117 becomes 0. Even in this state, the count during the period when the count period signal is HIGH will still be N.

[0101] If there are multiple forward and reverse rotations within the period when the Z-phase signal is HIGH, the rotation direction detection circuit 117 will be 0 if the rotation direction when the count period signal is HIGH is the same as the rotation direction when the count period signal is LO, and 1 if they are different. The operation is the same in this case as well, and the count during the period when the count period signal is HIGH will be N.

[0102] Figures 15A and 15B show an example of the results of measuring the rotation angle by the waveform measuring instrument 1 according to this disclosure. As shown in Figure 15A, when the instrument remains in forward rotation during measurement, the rotation angle is set to zero at the first zero position detection timing during the period when the count period signal is HI. As a result, the timing at which the rotation angle is set to zero remains constant regardless of the pulse width of the Z-phase signal. Furthermore, as shown in Figure 15B, even when the rotation changes from forward to reverse during measurement, the rotation angle is set to zero at the first zero position detection timing during forward rotation, and to zero at the timing when the count of the Z-phase up-down counter 112 becomes 0 during reverse rotation. As a result, there is no error in the zero position between forward and reverse rotation.

[0103] In the operation example described above, the waveform measuring instrument 1 sets the rotation angle count to zero at the first zero position detection timing during forward rotation, and sets the rotation angle count to M-1 when the count of the Z-phase up-down counter 112 counts down from N to zero during reverse rotation. The waveform measuring instrument 1 may also set the rotation angle count to zero at any timing during the period when the count period signal is HIGH. Specifically, during the period when the count period signal is HIGH, the waveform measuring instrument 1 may set the rotation angle count to zero when the zero position detection timing occurs P times during forward rotation, and set the rotation angle count to the maximum value, i.e., M-1, when the zero position detection timing occurs (N-P+1) times during reverse rotation. In other words, a predetermined number corresponding to forward and reverse rotation may be set, and the rotation angle count may be set to zero or the maximum value when the zero position detection timing occurs a predetermined number of times. In this operation example, the conditions for the occurrence of a zero position detection timing coincide with one of the four conditions for the occurrence of a count signal. Therefore, the number of times a zero position detection timing occurs is 1 / 4 of the number of count signals. The Z-phase up / down counter 112 and the reverse Z-phase up counter 115 are considered to be counting four times the number of times a zero position detection timing occurs. The Z-phase up / down counter 112 and the reverse Z-phase up counter 115 may also count the number of times a zero position detection timing occurs. In the example above, P is a predetermined number corresponding to forward rotation. N-P+1 is a predetermined number corresponding to reverse rotation. Therefore, the sum of the predetermined number corresponding to forward rotation and the predetermined number corresponding to reverse rotation is the number of count signals during the HI period of the count period signal plus 1, i.e., N+1. By setting the rotation angle count to zero when a predetermined number of zero position detection timings corresponding to forward rotation occur during forward rotation, and setting the rotation angle count to the maximum value, i.e., M-1, when a predetermined number of zero position detection timings corresponding to reverse rotation occur during reverse rotation, it becomes possible to set the rotation angle to zero during forward rotation and to M-1 during reverse rotation at any timing during the HI period of the count period signal. As a result, the degree of freedom of operation is increased.

[0104] The embodiments described above correspond to the case where the predetermined number corresponding to forward rotation, i.e., P, is 1. In this case, the predetermined number corresponding to reverse rotation becomes N. That is, the predetermined number corresponding to reverse rotation is equal to the number of count signals during the HI period of the count period signal. In this way, the determination circuit can be easily configured.

[0105] In the operation examples described above, the number of count signals during the period when the count period signal is HI, i.e., the HI period of the count period signal, was counted by the Z-phase up / down counter 112 on the first attempt and stored in the first hold memory 113. However, it may also be stored in the first hold memory 113 in advance as a known value without being counted by the waveform measuring instrument 1. If the waveform measuring instrument 1 is equipped with a second hold memory 116, the number of count signals during the HI period of the count period signal may also be stored in the second hold memory 116. By pre-storing the number of count signals during the HI period of the count period signal, the circuit configuration of the waveform measuring instrument 1 can be simplified. The waveform measuring instrument 1 can also handle Z-phase signals with unknown pulse widths when they are input by counting the count signals during the HI period of the count period signal.

[0106] <Example of measurement procedure> Each component of the waveform measuring instrument 1 may perform a measurement method including the example procedure shown in the flowchart in Figure 16. The measurement method may be implemented as a measurement program to be executed by the processor provided in each component of the waveform measuring instrument 1. The measurement program may be stored in a non-temporary computer-readable medium.

[0107] The waveform measuring instrument 1 acquires a count signal from the encoder 10 (step S1). The waveform measuring instrument 1 determines whether the Z-phase signal is HI (step S2). If the Z-phase signal is not HI (step S2: NO), i.e., the Z-phase signal is LO, the waveform measuring instrument 1 proceeds to step S8.

[0108] If the Z-phase signal is HIGH (Step S2: YES), the waveform measuring instrument 1 determines whether a zero position signal has occurred at least once since the Z-phase signal became HIGH (Step S3). If the waveform measuring instrument 1 has not generated a zero position signal at all (Step S3: NO), it proceeds to Step S7. If the waveform measuring instrument 1 has generated a zero position signal at least once (Step S3: YES), it sets the count period signal HIGH, increments the count of the Z-phase up / down counter 112 when an up signal is acquired, and decrements the count of the Z-phase up / down counter 112 and increments the count of the inverted Z-phase up counter 115 when a down signal is acquired (Step S4).

[0109] The waveform measuring instrument 1 determines whether the count of the Z-phase up-down counter 112 has reached a predetermined value (step S5). The predetermined value is a value set for forward rotation and reverse rotation, respectively. If the count of the Z-phase up-down counter 112 has not reached the predetermined number (step S5: NO), the waveform measuring instrument 1 proceeds to step S7.

[0110] When the count of the Z-phase up-down counter 112 reaches a predetermined number (step S5: YES), the waveform measuring instrument 1 sets the rotation angle count to zero with the forward rotation zero position signal and sets the rotation angle count to the maximum value, i.e., M-1, with the reverse rotation zero position signal (step S6). After executing the procedure in step S6, the waveform measuring instrument 1 completes the procedure in the flowchart of Figure 16. After executing the procedure in step S6, the waveform measuring instrument 1 may return to the procedure in step S1.

[0111] If no zero position signal is generated (step S3: NO), or if the count of the Z-phase up-down counter 112 is not at a predetermined value (step S5: NO), the waveform measuring instrument 1 does not set the rotation angle count to zero, but increases the rotation angle count during forward rotation and decreases the rotation angle count during reverse rotation (step S7). After executing the procedure in step S7, the waveform measuring instrument 1 completes the procedure in the flowchart of Figure 16. After executing the procedure in step S6, the waveform measuring instrument 1 may return to the procedure in step S1.

[0112] If the Z-phase signal is not HI (step S2: NO), the waveform measuring instrument 1 determines whether the Z-phase signal has changed from HI to LO (step S8). If the Z-phase signal has not changed from HI to LO (step S8: NO), the waveform measuring instrument 1 proceeds to step S7 and increases or decreases the rotation angle count.

[0113] If the Z-phase signal changes from HI to LO (step S8: YES), the waveform measuring instrument 1 determines whether the rotation direction detection circuit 117 is 0 (step S9). If the rotation direction detection circuit 117 is 0 (step S9: YES), the waveform measuring instrument 1 loads the value of the first hold memory 113 into the Z-phase up / down counter 112 (step S10), proceeds to step S7, and increases or decreases the rotation angle count. If the rotation direction detection circuit 117 is not 0 (step S9: NO), i.e., if the rotation direction detection circuit 117 is 1, the waveform measuring instrument 1 loads the value of the second hold memory 1163 into the Z-phase up / down counter 112 (step S11), proceeds to step S7, and increases or decreases the rotation angle count.

[0114] (summary) As described above, the waveform measuring instrument 1 according to this disclosure can synchronize the timing of setting the rotation angle to zero during forward rotation and reverse rotation, regardless of the pulse width length of the Z-phase signal. As a result, the zero position of the rotation angle can be determined with high precision regardless of the direction of rotation.

[0115] (Other embodiments) In the embodiments described above, a rotary encoder was used as the encoder 10. A linear encoder may also be used as the encoder 10. In this case, instead of a count corresponding to the rotation angle, a count corresponding to the displacement along a straight line is measured.

[0116] The conditions for outputting an up or down signal are not limited to those based on Tables 1 and 2. For example, an up or down signal may be output only at one of the timings of the H edge or L edge of the A-phase signal, or the H edge or L edge of the B-phase signal. In this case, the measurement resolution of the rotation angle or displacement becomes 1 / 4. Alternatively, an up or down signal may be output only at the timing of the H edge and L edge of the A-phase signal, or the timing of the H edge and L edge of the B-phase signal. In this case, the measurement resolution of the rotation angle or displacement becomes 1 / 2.

[0117] While embodiments relating to this disclosure have been described above with reference to the drawings, the specific configuration is not limited to these embodiments and may include various modifications without departing from the spirit of this disclosure. [Explanation of symbols]

[0118] 1. Waveform measuring instrument (101: Sample timing generation circuit, 102: Memory controller, 103: Waveform memory, 104: Display waveform creation circuit, 105: Display unit, 106: Count condition judgment circuit, 107: Up / down counter, 108: Angle conversion circuit, 109: Count period creation circuit, 112: Z-phase up / down counter, 113: First hold memory, 114: Zero position judgment circuit, 115: Reverse Z-phase up counter, 116: Second hold memory, 117: Rotation direction detection circuit, 121: Input amplifier, 122: A / D converter, 123: Interface circuit, 124: Edge detection circuit, 125: Level judgment circuit, 131: Input amplifier, 132: A / D converter, 133: Interface circuit, 134: Edge detection circuit, 135: Level judgment circuit, 141: Input amplifier, 142: A / D converter, 143: Interface circuit, 145: Level judgment circuit) 10 encoders 20 Motor (21: Excitation position sensor)

Claims

1. A waveform measuring instrument that converts the count signal output by an encoder into a rotation angle, A zero position determination circuit that generates a set signal based on a Z-phase signal having a pulse width over a period including multiple zero position detection timings based on the count signal, A counter that increases or decreases the rotation angle based on the count signal, sets the count to zero when increasing the rotation angle and sets the count to the maximum value when decreasing the rotation angle based on the set signal. Equipped with, The zero position determination circuit is a waveform measuring instrument that outputs the set signal when a predetermined number of zero position detection timings corresponding to forward rotation or reverse rotation occur during the HI period of the Z-phase signal.

2. The waveform measuring instrument according to claim 1, wherein the sum of a predetermined number corresponding to forward rotation and a predetermined number corresponding to reverse rotation is equal to the number of zero position detection timings during the HI period of the Z-phase signal plus 1.

3. The waveform measuring instrument according to claim 2, wherein the predetermined number corresponding to the inversion is equal to the number of zero position detection timings during the HI period of the Z-phase signal.

4. The waveform measuring instrument according to any one of claims 1 to 3, further comprising a Z-phase counter for counting the count signal during the HI period of the Z-phase signal.

5. A measurement method that converts a count signal output by an encoder into a rotation angle, Based on a Z-phase signal having a pulse width over a period including multiple zero-position detection timings based on the count signal, a set signal is generated when a predetermined number of zero-position detection timings corresponding to forward or reverse rotation occur during the HI period of the Z-phase signal. The rotation angle is increased or decreased based on the count signal, Based on the set signal, the count is set to zero when the rotation angle is increased, and the count is set to the maximum value when the rotation angle is decreased. Measurement methods, including those mentioned above.

6. The measurement method according to claim 5, wherein the sum of a predetermined number corresponding to forward rotation and a predetermined number corresponding to reverse rotation is equal to the number of zero position detection timings during the HI period of the Z-phase signal plus 1.

7. The measurement method according to claim 6, wherein the predetermined number corresponding to the reversal is equal to the number of zero position detection timings during the HI period of the Z-phase signal.

8. The measurement method according to any one of claims 5 to 7, further comprising counting the count signal during the HI period of the Z-phase signal.

9. A measurement program that converts the count signal output by an encoder into a rotation angle, Based on a Z-phase signal having a pulse width over a period including multiple zero-position detection timings based on the count signal, a set signal is generated when a predetermined number of zero-position detection timings corresponding to forward or reverse rotation occur during the HI period of the Z-phase signal. The rotation angle is increased or decreased based on the count signal, Based on the set signal, the count is set to zero when the rotation angle is increased, and the count is set to the maximum value when the rotation angle is decreased. A measurement program that causes the processor to execute.

10. The measurement program according to claim 9, wherein the sum of a predetermined number corresponding to forward rotation and a predetermined number corresponding to reverse rotation is equal to the number of zero position detection timings during the HI period of the Z-phase signal plus 1.

11. The measurement program according to claim 10, wherein the predetermined number corresponding to the reversal is equal to the number of zero position detection timings during the HI period of the Z-phase signal.

12. The measurement program according to any one of claims 9 to 11, further comprising counting the count signal during the HI period of the Z-phase signal.