Time measuring device and time measuring method

The time measuring device improves accuracy by using a low-speed and high-speed clock system to select appropriate reference pulse numbers based on the overage period, addressing inaccuracies in existing devices.

JP7565882B2Active Publication Date: 2024-10-11AZBIL CORP
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2021108334
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2021-06-30
Publication Date
2024-10-11
Estimated Expiration
2041-06-30

AI Technical Summary

Technical Problem

Existing time measuring devices face inaccuracies in measuring the time length of a target period due to variations in the overage period, which is influenced by the time length of the target and reference periods, leading to inconsistent measurement accuracy.

Method used

A time measuring device that utilizes a low-speed clock and a high-speed clock to measure the target period by selecting one of multiple reference pulse numbers based on the time length of the overage period, calculating the time length of the target period using the count numbers of low-speed and high-speed clock pulses during the overage period.

Benefits of technology

Enhances measurement accuracy of the target period by adapting to variations in the overage period, ensuring precise time length calculation despite changes in the high-speed clock period stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007565882000001
    Figure 0007565882000001
  • Figure 0007565882000002
    Figure 0007565882000002
  • Figure 0007565882000003
    Figure 0007565882000003
Patent Text Reader

Abstract

To provide a time measurement device and a time measurement method with which it is possible to improve the accuracy of measurement.SOLUTION: Provided is a time measurement device 100 for measuring the length of time of a target period from a measurement start time to a measurement end time. The time measurement device 100 comprises: a low-speed clock generation unit 11A for generating a low-speed clock pulse of a reference cycle; a high-speed clock generation unit 11B for generating a high-speed clock pulse the cycle of which is shorter than the low-speed clock pulse; a reference selection unit 15 for acquiring a first reference pulse count that is the number of pulses of the high-speed clock pulse counted in a first reference period and a second reference pulse count that is the number of pulses of the high-speed clock pulse counted in a second reference period and selecting one of these as a reference pulse count; and a time calculation unit 17 for calculating the length of time of a target period on the basis of the reference pulse count, the length of time of the period in which the reference pulse count was counted, the length of time of the reference cycle, the count of a low-speed clock counter, the count of a high-speed clock counter in a period of the same length of time as an excess period.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a time measurement device and a time measurement method. [Background technology]

[0002] A known time measurement device measures the length of a target period from the start of measurement to the end of measurement by combining a low-speed clock with a reference period and a high-speed clock with a period shorter than the reference period and counting the number of pulses from these (see Patent Document 1). This time measurement device measures an outline of the period from the start of measurement to an elapsed measurement time point that is synchronized with the reference period that arrives after the end of measurement using the low-speed clock, measures an overage period from the end of measurement to the elapsed measurement time using the high-speed clock, and subtracts the overage period from the outline of the period to measure the length of the target period.

[0003] Generally, the period of the high-speed clock is not stable at the beginning of generation, and the period changes over time. Therefore, the above-mentioned time measurement device sets a reference clock number that is the intermediate pulse number between the number of pulses of the high-speed clock for the first reference period and the number of pulses of the high-speed clock for the next reference period adjacent to the first reference period, and calculates the number of pulses of the low-speed clock corresponding to the overage period based on this reference clock number, the number of pulses of the high-speed clock in the overage period, and the time length of the reference period, thereby reducing measurement errors. [Prior art documents] [Patent documents]

[0004] [Patent Document 1] JP 2020-204472 A Summary of the Invention [Problem to be solved by the invention]

[0005] The length of the overrun period varies depending on the length of the target period and the length of the reference period, but the above-mentioned time measurement device measures in the same way regardless of the length of the overrun period. Therefore, depending on the selection of the reference clock number and the length of the overrun period, there may be variations in the measurement accuracy, and there was a demand for further improvements in measurement accuracy.

[0006] The present invention has been made to solve the above-mentioned problems, and has an object to provide a time measurement device and a time measurement method that can improve measurement accuracy. [Means for solving the problem]

[0007] The time measurement device according to the present invention is a time measurement device that measures the length of a target period from a measurement start point to a measurement end point, and includes a low-speed clock generation unit that generates low-speed clock pulses at a reference period, a high-speed clock generation unit that generates high-speed clock pulses having a shorter period than the low-speed clock pulses in a first reference period from a first point in time until a first several times the reference period has elapsed, a second reference period from a second point in time until a second several times the reference period that is different from the first several times the reference period has elapsed, and an overrun period from the measurement end point to an overrun point that is synchronized with the reference period after the measurement end point, a low-speed clock counter that counts the number of low-speed clock pulses generated by the low-speed clock generation unit in the period from the measurement start point to the overrun point, and a pulse counter that counts the number of high-speed clock pulses generated by the high-speed clock generation unit. the high-speed clock counter for counting the number of pulses during periods of the same time as a first reference period, a second reference period, and an overtime period; a reference selection unit for acquiring a first reference pulse number, which is the number of pulses of the high-speed clock pulses counted during the first reference period, and a second reference pulse number, which is the number of pulses of the high-speed clock pulses counted during the second reference period, and selecting either the first reference pulse number or the second reference pulse number as a reference pulse number according to the length of the overtime period; and a time calculation unit for calculating the length of the target period based on the reference pulse numbers, the length of the period during which the reference pulse numbers were counted, the count number of the high-speed clock counter during a period of the same time as the overtime period, the length of the reference period, and the count number of the low-speed clock counter. Effect of the Invention

[0008] According to the present invention, either a first reference pulse number or a second reference pulse number having a different time length is selected as a reference pulse depending on the length of the overrun period, and the length of the target period is calculated based on this reference pulse number, the time length of the reference period, the count number of the low-speed clock counter, and the count number of the high-speed clock counter during the overrun period. Therefore, even if, for example, the period of the high-speed clock pulse changes over time from the start of generation, it is possible to measure the length of the overrun period with high accuracy, and the measurement accuracy of the length of the target period can be improved. [Brief description of the drawings]

[0009] [Figure 1] 1 is a block diagram showing a part of a hardware configuration of a time measurement device according to a first embodiment. [Diagram 2] 4 is a flowchart showing a process performed by a control unit according to the first embodiment. [Diagram 3] 11 is a timing chart in which the length of an overrun period is close to one reference period when the control unit according to the first embodiment measures time. [Figure 4] 11 is a timing chart in which the length of an overrun period is close to two reference periods when the control unit according to the first embodiment measures time. [Diagram 5] 11 is a timing chart in which the length of an overrun period is close to 1.5 reference cycles when the control unit according to the first embodiment measures time. [Figure 6] 3 is a block diagram showing a calculation process of a process performed by the time measurement device according to the first embodiment. FIG. [Figure 7] 11 is a flowchart showing a process performed by a control unit according to the second embodiment. [Figure 8] 13 is a timing chart in the case where the length of an overrun period is close to one reference period when the control unit according to the second embodiment measures time. [Figure 9] 13 is a timing chart in which the length of an overrun period is close to two reference periods when the control unit according to the second embodiment measures time. [Figure 10]13 is a timing chart in which the length of an overrun period is close to one reference period when a control unit according to the third embodiment measures time. [Figure 11] 13 is a timing chart in which the length of an overrun period is close to two reference periods when a control unit according to the third embodiment measures time. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0010] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. Embodiment 1 First, the configuration of a time measurement device 100 according to the first embodiment will be described with reference to Fig. 1. Fig. 1 is a block diagram showing a part of the hardware configuration of the time measurement device 100. The time measurement device 100 according to the first embodiment is a device that is mounted on, for example, an ultrasonic flowmeter (not shown) and measures the time length of a target period Tm, which is a period between two signals input at different times, by using a low-speed clock pulse and a high-speed clock pulse.

[0011] The ultrasonic flowmeter has, for example, an output vibrator that oscillates when a voltage is applied to output a drive pulse at a substantially constant period, and an input vibrator that is disposed at a distance from the output vibrator, vibrates when a drive pulse is input, and converts the vibration into an electrical signal, and outputs a start pulse Pstart to the time measurement device 100 with the output of the drive pulse, and outputs a stop pulse Pstop to the time measurement device 100 when the input vibrator detects the drive pulse. For example, the ultrasonic flowmeter determines that the point in time when the amplitude of the vibration input to the input vibrator exceeds a predetermined threshold and then becomes 0 is the point in time when the drive pulse is detected (zero cross point), and outputs a stop pulse Pstop to the time measurement device 100.

[0012] For example, when a start pulse Pstart and a stop pulse Pstop are input from the ultrasonic flowmeter or the like at different times, the time measurement device 100 according to the first embodiment calculates and outputs the time length of a target period Tm, which is the period between these two signals. In other words, the time measurement device 100 calculates and outputs the time length of the target period Tm from the measurement start point, which is the time when the start pulse Pstart is input, to the measurement end point, which is the time when the stop pulse Pstop is input, i.e., the time difference between the times when these two signals are input.

[0013] The time measurement device 100 includes an input unit 10 to which a signal is input, a low-speed clock generation unit 11A that generates a low-speed clock pulse CL, a high-speed clock generation unit 11B that generates a high-speed clock pulse, a low-speed clock counter 13A that counts the number of pulses of the low-speed clock pulse generated by the low-speed clock generation unit 11A, a high-speed clock counter 13B that counts the number of pulses of the high-speed clock pulse generated by the high-speed clock generation unit 11B, an enable signal generation unit 14 that generates an enable signal EN for controlling the generation period of the high-speed clock pulse by the high-speed clock generation unit 11B, a reference selection unit 15, a storage unit 16 that stores various information for calculating the time length of the target period Tm, a time calculation unit 17 that calculates the time length of the target period Tm, and a control unit 12 that controls each component of the time measurement device 100. The reference selection unit 15 will be described later.

[0014] The time measurement device 100 has a processing circuit having a CPU, ROM, RAM, I / O ports, etc. (not shown), and the processing circuit realizes each of the functions of the input unit 10, the low-speed clock generating unit 11A, the high-speed clock generating unit 11B, the low-speed clock counter 13A, the high-speed clock counter 13B, the enable signal generating unit 14, the reference selecting unit 15, the memory unit 16, the time calculating unit 17, and the control unit 12.

[0015] The input unit 10 receives a signal from a device to which the time measurement device 100 is connected. For example, a start pulse Pstart and a stop pulse Pstop are input from the above-mentioned ultrasonic flowmeter, etc. When the input unit 10 receives the signal input, it outputs the signal to the low-speed clock generating unit 11A and the high-speed clock generating unit 11B.

[0016] The low-speed clock generating unit 11A generates a low-speed clock pulse CL at a reference period that is a substantially constant period during a predetermined period. For example, the low-speed clock generating unit 11A has an oscillator that oscillates when a voltage is applied, and generates a low-speed clock pulse CL such as a square wave. Also, for example, the low-speed clock counter 13A starts generating a low-speed clock pulse CL based on a signal input from the input unit 10. The low-speed clock pulse CL generated by the low-speed clock generating unit 11A is output to the low-speed clock counter 13A.

[0017] The high-speed clock generating unit 11B generates a high-speed clock pulse CH at a period shorter than a reference period. For example, the high-speed clock generating unit 11B is configured with a high-frequency type clock pulse generating circuit such as a ring oscillator, and generates a high-speed clock pulse CH that is a square wave. Also, for example, the high-speed clock generating unit 11B starts generating a high-speed clock pulse CH based on the input of a stop pulse Pstop to the time measurement device 100. The high-speed clock pulse CH generated by the high-speed clock generating unit 11B is output to the high-speed clock counter 13B.

[0018] The low-speed clock counter 13A counts and accumulates the number of low-speed clock pulses CL output by the low-speed clock generating unit 11A during a predetermined period. For example, the low-speed clock counter 13A starts counting the low-speed clock pulses CL based on the input of a start pulse Pstart to the time measurement device 100.

[0019] The high-speed clock counter 13B counts and accumulates the number of high-speed clock pulses CH output by the high-speed clock generating unit 11B during a predetermined period. For example, the high-speed clock counter 13B starts counting the high-speed clock pulses CH based on the input of a stop pulse Pstop to the time measurement device 100.

[0020] In general, when the length of time of a target period Tm from the measurement start point to the measurement end point is measured by a time measurement device, the time measurement device measures the time by combining a low-speed clock pulse and a high-speed clock pulse. For example, the time measurement device first counts the number of pulses of the low-speed clock pulse CL generated in the reference period during a measurement period T that is a period from the measurement start time when generation of the low-speed clock pulse CL starts to the overrun time after the measurement end time when the time measurement device synchronizes with the reference period. In other words, the time measurement device first counts the number of pulses of the low-speed clock pulse CL generated in the reference period during a measurement period T that is a period from the measurement start time to the overrun time after the measurement end time when the elapsed time from the measurement start time becomes an integer multiple of the reference period. In addition, the time measurement device converts the count of the number of pulses of high-speed clock pulses CH generated during the overrun period, which is the period from the end of measurement to the overrun time, into the number of pulses of low-speed clock pulses CL generated during this period, based on the reference period and the period of the high-speed clock pulse.

[0021] Next, the time measurement device subtracts the converted value of the low-speed clock pulses CL in the overrun period from the count number of the low-speed clock pulses CL in the measurement period. In this way, the time measurement device obtains the number of pulses of the low-speed clock pulses CL in the target period Tm, and calculates the time length of the target period Tm by multiplying this number of pulses by a reference period, which is the period of the low-speed clock pulses CL.

[0022] Incidentally, when a high-frequency clock pulse generating circuit such as a ring oscillator is used as the high-speed clock pulse generating unit, the power consumption required to generate a high-speed clock pulse is larger than that of a low-speed clock, so it is desirable to suppress the power consumption by generating a high-speed clock pulse only during the period required for time measurement, for example, during an overage period, rather than generating a high-speed clock pulse from the start point of measurement to the end point of measurement. However, the period of such a high-speed clock pulse does not stabilize until a sufficient amount of time has passed since the generation of the clock pulse, and the period may change over time.

[0023] Therefore, in the first embodiment, the time measurement device 100 causes the high-speed clock generating unit 11B to generate high-speed clock pulses CH for a time length that is an integer multiple of the reference period, and calculates the number of pulses of low-speed clock pulses CL generated in the overtime period based on the count number of high-speed clock pulses CH at that time and the count number of high-speed clock pulses CH in the overtime period. For example, the number of pulses of low-speed clock pulses CL generated in the overtime period can be calculated by dividing the count number of high-speed clock pulses CH generated in the overtime period by the count number of high-speed clock pulses CH generated in the time length of one reference period. As a result, even if the period of the high-speed clock pulse CH changes while the high-speed clock pulse CH is being counted, the number of low-speed clock pulses CL generated during the overrun period can be calculated.

[0024] Also, when generating high-speed clock pulses, depending on the circuit configuration, the period may expand or contract over time until a sufficient amount of time has passed since the generation of the clock pulses. In such a case, even if an attempt is made to calculate the number of pulses of low-speed clock pulses CL generated in an overage period based on the count number of high-speed clock pulses CH generated with a time length that is an integer multiple of the reference period and the count number of high-speed clock pulses CH in the overage period, sufficient accuracy may not be obtained depending on the difference between the time length that is an integer multiple of the reference period for generating the high-speed clock pulses CH and the time length of the overage period.

[0025] For this reason, in the first embodiment, high-speed clock pulses CH are generated in a plurality of periods having different time lengths, and the number of counts of the obtained plurality of high-speed clock pulses CH and the number of counts of high-speed clock pulses CH generated in the overrun period are used to calculate the number of pulses of low-speed clock pulses CL generated in the overrun period with higher accuracy.

[0026] In the time measurement device 100 according to the first embodiment, the high-speed clock counter 13B counts the number of high-speed clock pulses CH generated in a first reference period from a first point in time until a time length that is a first several times the reference period has elapsed as a first reference pulse number, and counts the number of high-speed clock pulses CH generated in a second reference period from a second point in time until a time length that is a second several times the reference period different from the first number has elapsed as a second reference pulse number, and the reference selection unit 15 selects either the first reference pulse number or the second reference pulse number as the reference pulse number depending on the time length of the overrun period, and calculates the number of pulses of low-speed clock pulses CL generated in the overrun period based on this reference pulse number and the count number of high-speed clock pulses CH generated in a period having the same time length as the overrun period.

[0027] For example, in the time measurement device 100 according to the first embodiment, when the overrun time is defined as the time point that is first synchronized with the reference period after the measurement end time, the high-speed clock counter 13B counts the number of high-speed clock pulses CH generated in a first reference period from the measurement start time until the time length of one reference period has elapsed as the first reference pulse number, and counts the number of high-speed clock pulses CH generated in a second reference period that is after the first reference period and until the time length of two reference periods has elapsed from a second time point in the target period as the second reference pulse number, and the reference selection unit 15 selects either the first reference pulse number or the second reference pulse number, whichever is closer to the time length of the overrun time, as the reference pulse number, and calculates the number of pulses of low-speed clock pulses CL generated in the overrun time based on the ratio between the count number of high-speed clock pulses CH generated in the overrun time and the reference pulse number. The reference selection unit 15 may be configured to select one of three or more pulse numbers as the reference pulse number.

[0028] As a result, the time measurement device 100 of embodiment 1 calculates the number of pulses of low-speed clock pulses CL generated in the overrun period based on the ratio between the reference pulse number, which is the count number of the high-speed clock counter 13B in either the first reference period or the second reference period that is closest to the length of the overrun period, and the count number of the high-speed clock counter in the overrun period. Therefore, even if, for example, the period of the high-speed clock pulse expands or contracts over time from the start of generation, it is possible to measure the length of the overrun period with high accuracy, and the measurement accuracy of the length of the target period can be improved.

[0029] The process performed by the control unit 12 of the time measurement device 100 according to the first embodiment will be described in detail below. FIG. 2 is a flowchart showing the process performed by the control unit 12 according to the first embodiment. FIG. 3 is a timing chart showing a case where the time length of the overage period ΔT is close to one reference period (the same time length as the reference period Ts) when the time measurement device according to the first embodiment measures time. FIG. 4 is a timing chart showing a case where the time length of the overage period ΔT is close to two reference periods (twice the time length of the reference period Ts) when the time measurement device according to the first embodiment measures time. FIG. 5 is a timing chart showing a case where the time length of the overage period ΔT is close to 1.5 reference periods (1.5 times the time length of the reference period Ts) when the time measurement device according to the first embodiment measures time.

[0030] The control unit 12 first determines whether or not a start pulse Pstart has been input to the input unit 10 (step ST1). In this process, the control unit 12 determines whether or not a target period Tm, the time length of which is to be calculated, has started by determining whether or not a start pulse Pstart, which is an input signal from an ultrasonic flowmeter or the like, has been input to the input unit 10. The start pulse Pstart constitutes a first signal indicating the measurement start time point. In the process of step ST1, if the start pulse Pstart is not input (NO in step ST1), the control unit 12 determines that the target period Tm has not yet started, and waits for the subsequent processes.

[0031] In the process of step ST1, if a start pulse Pstart is input (YES in step ST1), the control unit 12 determines that the target period Tm, for which the time length is to be calculated, has started, and starts counting the low-speed clock pulses CL by the low-speed clock generating unit 11A at the measurement start time t0, which is the time when the target period Tm started (step ST2). Also, the control unit 12 makes the enable signal generating unit 14 output the enable signal EN at the measurement start time t0, and makes the high-speed clock generating unit 11B start generating the high-speed clock pulses CH for obtaining the first reference pulse number.

[0032] When the time t1 is reached when one reference period has elapsed since the measurement start time t0, the control unit 12 causes the high-speed clock generating unit 11B to end the generation of the high-speed clock pulses CH, and stores the count number of the high-speed clock pulses CH in the first reference period P1 from the measurement start time t0 until the time of one reference period, i.e., one time of the reference period Ts, as the first reference pulse number in the storage unit 16 (step ST3). In this process, the control unit 12 stores the first reference pulse number, which is the number of high-speed clock pulses CH generated in the time length of one reference period, as the reference pulse number when the time length of the excess period is close to the time length of one reference period, in the storage unit 16.

[0033] After performing the process of step ST3, the control unit 12 judges whether or not a predetermined period has elapsed since the generation of the high-speed clock pulse CH was started in the first reference period P1 (step ST4). In this process, the predetermined period is a period that is an integer multiple of a predetermined reference cycle Ts, and is, for example, a period in which the generation of the high-speed clock pulse CH in the first reference period P1 has no effect on the cycle of the high-speed clock pulse CH when the generation of the high-speed clock pulse CH is started after this predetermined period, or the effect is so small that it can be ignored. In the process of step ST4, if a predetermined period has not elapsed since the generation of high-speed clock pulses CH was started in the first reference period P1 (NO in step ST4), the control section 12 waits for the subsequent process.

[0034] In the processing of step ST4, if it is time t4 when a predetermined period of time has elapsed since the generation of high-speed clock pulses CH was started in the first reference period P1 (YES in step ST4), the control unit 12 causes the enable signal generating unit 14 to output an enable signal EN, and causes the high-speed clock generating unit 11B to start generating high-speed clock pulses CH to obtain the second reference pulse number (step ST6).

[0035] When time t5 is reached when two reference periods have elapsed since measurement start time t0, the control unit 12 causes the high-speed clock generating unit 11B to end generation of the high-speed clock pulses CH, and stores the count number of the high-speed clock pulses CH in the second reference period P2 from measurement start time t4 until the time of two reference periods, i.e., twice the time of the reference period Ts, as the second reference pulse number in the storage unit 16 (step ST7). In this process, the control unit 12 stores the second reference pulse number, which is the number of high-speed clock pulses CH generated in the time length of two reference periods, in the storage unit 16 as the reference pulse number when the time length of the excess period is close to the time length of two reference periods.

[0036] After performing the process of step ST7, the control unit 12 calculates a third reference pulse number, which is the average value of the first reference pulse number and half the value of the second reference pulse number, based on the first reference pulse number and the second reference pulse number, and stores the third reference pulse number in the storage unit 16 (step ST8). In this process, the control unit 12 calculates the third reference pulse number, which is the average value of the first reference pulse number and half the value of the second reference pulse number, as the reference pulse number when the time length of the excess period ΔT is close to the time length of 1.5 reference periods, and stores the third reference pulse number in the storage unit 16. The control unit 12 calculates the average value of the first reference pulse number and the value obtained by dividing the second reference pulse number by 2, based on the fact that the time length of the second reference period is twice the reference period Ts.

[0037] After performing the process of step ST8, the control unit 12 judges whether or not a stop pulse Pstop has been input (step ST9). In this process, the control unit 12 judges whether or not a target period Tm for which the time length is to be calculated has ended by judging whether or not a stop pulse Pstop, which is an input signal from an ultrasonic flowmeter or the like, has been input to the input unit 10. In the process of step ST9, if there is no input of the stop pulse Pstop (NO in step ST9), the control unit 12 judges that the target period Tm has not yet ended and waits for subsequent processes. Note that in the first embodiment, the stop pulse Pstop constitutes a second signal indicating the end of measurement.

[0038] In the process of step ST9, if the stop pulse Pstop is input (YES in step ST9), the control unit 12 determines that the target period Tm for which the time length is to be calculated has ended, and causes the high-speed clock generating unit 11B to start generating high-speed clock pulses CH at the measurement end time t8, which is the time when the stop pulse Pstop is input (step ST11). In this process, in order to calculate the number of pulses of the low-speed clock pulses CL generated in the overrun period ΔT, the control unit 12 causes the high-speed clock generating unit 11B to start generating high-speed clock pulses CH in the overrun period ΔT from the measurement end time t8 to the overrun time t9 that is synchronized with the reference period Ts after the measurement end time t8.

[0039] In the first embodiment, the time when the clock first synchronizes with the reference period Ts after one reference period Ts or more has elapsed from the measurement end time t8, for example, the time when the rising edge of the low-speed clock pulse is detected, is set as the overrun time t9. As a result, in the first embodiment, the time length of the overrun period ΔT is one reference period or more and less than two reference periods.

[0040] When the time reaches the overrun time t9 after the high-speed clock generating unit 11B starts generating the high-speed clock pulse CH, the control unit 12 makes the reference selecting unit 15 determine whether the time length of the overrun period ΔT from the measurement end time t8 to the overrun time t9 is close to the time length of the first reference period P1, that is, the time length of one reference period (step ST12). In other words, the control unit 12 makes the reference selecting unit 15 determine whether the time length of the overrun period ΔT is within a range determined to be close to the time length of the first reference period P1. For example, the control unit 12 causes the reference selection unit 15 to determine whether the time length of the overrun period ΔT is in a range of one reference period or more and less than 4 / 3 reference periods (a time length 4 / 3 times the reference period Ts). In this process, the control unit 12 causes the reference selection unit 15 to compare the time length of the overrun period ΔT with the time length of the first reference period P1, and to determine whether the first reference pulse number should be selected as the reference pulse number.

[0041] In the process of step ST12, if the time length of the overrun period ΔT is close to the time length of the first reference period P1 (YES in step ST12), the control unit 12 causes the reference selection unit 15 to select the first reference number of pulses as the reference pulse number from the first reference number of pulses, the second reference number of pulses, and the third reference number of pulses (step ST13). In this process, the control unit 12 causes the reference selection unit 15 to select the first reference number of pulses as the reference pulse number based on the fact that the time length of the overrun period ΔT is close to the time length of the first reference period P1.

[0042] In the process of step ST12, if the time length of the overrun period ΔT is not close to the time length of the first reference period P1 (NO in step ST12), the control unit 12 causes the reference selection unit 15 to determine whether or not the time length of the overrun period ΔT is close to the time length of the second reference period P2, i.e., the time length of two reference periods (step ST14). In other words, the control unit 12 causes the reference selection unit 15 to determine whether or not the time length of the overrun period ΔT is within a range that is determined to be close to the time length of the second reference period P2. For example, the control unit 12 causes the reference selection unit 15 to determine whether or not the time length of the overrun period ΔT is within a range of 5 / 3 reference periods (a time length 5 / 3 times the reference period Ts) or more and less than two reference periods. In this process, the control unit 12 causes the reference selection unit 15 to compare the time length of the overrun period ΔT with the time length of the second reference period P2, and to determine whether or not the second reference pulse number should be selected as the reference pulse number.

[0043] In the process of step ST14, if the time length of the overrun period ΔT is close to the time length of the second reference period P2 (YES in step ST14), the control unit 12 causes the reference selection unit 15 to select the second reference pulse number as the reference pulse number from the first reference pulse number, the second reference pulse number, and the third reference pulse number (step ST16). In this process, the control unit 12 causes the reference selection unit 15 to select the second reference pulse number as the reference pulse number based on the fact that the time length of the overrun period ΔT is close to the time length of the second reference period P2.

[0044] Thus, in the first embodiment, the control unit 12 causes the reference selection unit 15 to select either the first reference period P1 or the second reference period P2 as a reference pulse when the time length of the overage period ΔT is within a predetermined range. Specifically, the control unit 12 causes the reference selection unit 15 to select, as a reference pulse, one of the first reference period P1 and the second reference period P2, the time length of which is closer to the overage period ΔT, when the time length of the overage period ΔT is within a predetermined range. More specifically, the control unit 12 causes the reference selection unit 15 to select, as a reference pulse, one of the first reference period P1 and the second reference period P2, the time length of which is closer to the overage period ΔT, when the time length of the overage period ΔT is within a range of 1 reference period or more and less than 4 / 3 reference periods, and 5 / 3 reference periods or more and less than 2 reference periods.

[0045] In the process of step ST14, if the time length of the overrun period ΔT is not close to the time length of the second reference period P2 (NO in step ST14), the control unit 12 causes the reference selection unit 15 to select the third reference pulse number from the first reference pulse number, the second reference pulse number, and the third reference pulse number as the reference pulse number (step ST17). For example, if the time length of the overrun period ΔT is less than 5 / 3 reference cycles, the control unit 12 causes the reference selection unit 15 to select the third reference pulse number from the first reference pulse number, the second reference pulse number, and the third reference pulse number as the reference pulse number. In this process, the control unit 12 causes the reference selection unit 15 to select the third reference pulse number as the reference pulse number based on the fact that the time length of the overrun period ΔT is close to the time length of 1.5 reference cycles, for example, the time length of the overrun period ΔT is equal to or greater than 4 / 3 reference cycles and less than 5 / 3 reference cycles.

[0046] After performing the processing of step ST13, step ST16 or step ST17, the control unit 12 causes the time calculation unit 17 to calculate the number of low-speed clock pulses CL generated in the overrun period ΔT based on the reference pulse number, the time length of the period during which the reference pulse number was counted, and the count number of high-speed clock pulses CH in the overrun period ΔT (step ST18).

[0047] 6 is a block diagram showing a calculation process of the process performed by the time measurement device according to the first embodiment. When the first reference pulse number is selected as the reference pulse number, for example, the control unit 12 causes the time calculation unit 17 to calculate the number of pulses of the low-speed clock pulses CL generated in the overage period ΔT by dividing the number of counts of the high-speed clock pulses CH in the overage period ΔT by the first reference pulse number. In this process, the control unit 12 causes the time calculation unit 17 to calculate the number of pulses of the low-speed clock pulses CL generated in the overage period ΔT (how many times the time length of the overage period ΔT is one reference period) by dividing the number of counts of the high-speed clock pulses CH in the overage period ΔT by the first reference pulse number. When the second reference pulse number is selected as the reference pulse number, for example, the control unit 12 causes the time calculation unit 17 to calculate the number of pulses of low-speed clock pulses CL generated in the overrun period ΔT by dividing the count number of high-speed clock pulses CH in the overrun period ΔT by the second reference pulse number and dividing the obtained value by 2. In this process, the control unit 12 causes the time calculation unit 17 to calculate the number of pulses of low-speed clock pulses CL generated in the overrun period ΔT (how many times the time length of the overrun period ΔT is one reference period) by dividing the value obtained by dividing the count number of high-speed clock pulses CH in the overrun period ΔT by the second reference pulse number by 2 based on the fact that the time length of the period during which the reference pulse number is counted is two reference periods. When the third reference pulse number (not shown) is selected as the reference pulse number, for example, the control unit 12 causes the time calculation unit 17 to calculate the number of pulses of the low-speed clock pulses CL generated in the overrun period ΔT by dividing the count number of the high-speed clock pulses CH in the overrun period ΔT by the third reference pulse number. In this case as well, the control unit 12 causes the time calculation unit 17 to calculate the number of pulses of the low-speed clock pulses CL generated in the overrun period ΔT (how many times the time length of the overrun period ΔT is one reference period) by dividing the count number of the high-speed clock pulses CH in the overrun period ΔT by the first reference pulse number. The number of pulses of the low-speed clock pulses CL generated in the overrun period ΔT constitutes the number of excess pulses.

[0048] After performing the process of step ST18, the control unit 12 causes the time calculation unit 17 to calculate the time length of the target period Tm based on the number of pulses of the low-speed clock pulses CL generated in the overtime period ΔT, the number of pulses of the low-speed clock pulses CL generated in the measurement period T, and the reference period Ts (step ST19). For example, the control unit 12 causes the time calculation unit 17 to calculate the time length of the target period Tm by multiplying the value obtained by subtracting the number of pulses of the low-speed clock pulses CL generated in the overtime period ΔT from the number of pulses of the low-speed clock pulses CL generated in the measurement period T by the reference period Ts. After performing the process of step ST19, the control section 12 outputs the time length of the target period Tm calculated by the time calculation section 17 (step ST20).

[0049] In this way, the time measurement device 100 of embodiment 1 selects as a reference pulse either one of the first reference pulse number and the second reference pulse number, which have different time lengths, depending on the length of the overrun period ΔT, and calculates the length of the target period Tm based on this reference pulse number, the length of the reference period Ts, the count number of the low-speed clock counter, and the count number of the high-speed clock counter during the overrun period ΔT. Therefore, for example, even if the period of the high-speed clock pulse changes over time from the start of generation, it is possible to measure the length of the overrun period with high accuracy, and the measurement accuracy of the length of the target period Tm can be improved.

[0050] In addition, in the time measurement device 100 according to the first embodiment, the high-speed clock generating unit 11B generates high-speed clock pulses CH for measuring the number of reference pulses in a first reference period P1 that starts from a first point in the target period Tm and a second reference period that starts from a second point in the target period Tm. In general, the period of the high-speed clock pulses CH may be affected by environmental conditions such as the temperature of the device and may cause an error in each measurement. However, by simultaneously measuring the number of reference pulses during the measurement of the target period Tm in this manner, the number of reference pulses can be measured under the environmental conditions when the length of the target period Tm is measured, and therefore the measurement accuracy of the length of the target period Tm can be improved. In addition, the time required for the entire process can be shortened compared to measuring the number of reference pulses before the start of the target period Tm and then starting to calculate the length of the target period Tm.

[0051] In the first embodiment, the control unit 12 causes the time calculation unit 17 to calculate the number of pulses of low-speed clock pulses CL generated in the overrun period ΔT based on the reference pulse number, the count number of high-speed clock pulses CH in the overrun period ΔT, and the time length of the reference period Ts. However, it is sufficient for the control unit to calculate the number of pulses of low-speed clock pulses CL generated in the overrun period ΔT based on at least the reference pulse number, the count number of high-speed clock pulses CH in the overrun period ΔT, and the time length of the reference period Ts, and may calculate the number of pulses of low-speed clock pulses CL generated in the overrun period ΔT based on other numerical values ​​in addition to the above numerical values.

[0052] For example, the control unit may cause the time calculation unit to calculate the number of low-speed clock pulses CL generated in the overrun period ΔT based on the reference pulse number, the count number of high-speed clock pulses CH in the overrun period ΔT, the time length of the reference period Ts, and the count number of high-speed clock pulses CH in an additional measurement period from the time when the stop pulse Pstop is input, which is the measurement end time t8, that is, the time when a half-period Td of the drive pulse has elapsed since the measurement end time t8, to the time when a time the same length as the overrun period ΔT has elapsed since the next stop pulse Pstop is input.

[0053] Specifically, the control unit may cause the time calculation unit to calculate the number of pulses of the low-speed clock pulses CL generated in the overage period ΔT based on the reference pulse number, the average value of the count number of the high-speed clock pulses CH in the overage period ΔT and the count number of the high-speed clock pulses CH in the additional measurement period, and the time length of the reference period Ts. This improves the accuracy of the count number of the high-speed clock pulses CH generated in the overage period ΔT compared to the case where the number of pulses of the low-speed clock pulses CL generated in the overage period ΔT is calculated based on the count number of the high-speed clock pulses CH in one overage period ΔT, the reference pulse number, and the reference period Ts, and therefore improves the measurement accuracy of the time length of the target period Tm.

[0054] In the first embodiment, the time measurement device 100 is configured to calculate the length of the target period based on the reference pulse number, the time length of the period in which the reference pulse number is counted, the time length of the reference period, the count number of the low-speed clock counter, and the count number of the high-speed clock counter in the overrun period, but is not limited to this. The time measurement device only needs to be configured to calculate the length of the target period based on the reference pulse number, the time length of the period in which the reference pulse number is counted, the time length of the reference period, the count number of the low-speed clock counter, and the count number of the high-speed clock counter in a period of the same length as the overrun period, and the period of the same length as the overrun period may be the overrun period itself, or may be a period different from the overrun period that has the same length as the overrun period.

[0055] Next, a second embodiment of the present invention will be described in detail with reference to the drawings. Embodiment 2 Fig. 7 is a flowchart showing the processing performed by control unit 212 according to the second embodiment. Fig. 8 is a timing chart showing a case where the length of overage period ΔT is close to one reference period when time measurement device 200 according to the second embodiment measures time. Fig. 9 is a timing chart showing a case where the length of overage period ΔT is close to two reference periods when time measurement device 200 according to the second embodiment measures time. The second embodiment is different from the first embodiment in the procedure for measuring the reference pulse number and the procedure for calculating the number of pulses of low-speed clock pulses CL generated in the overrun period ΔT. However, other configurations and other processes are the same, and the same reference symbols are used for the contents similar to those of the first embodiment, and the description thereof will be omitted.

[0056] In order to improve the measurement accuracy of the time length of the target period Tm, the control unit 212 according to the second embodiment generates high-speed clock pulses CH multiple times in accordance with the period of the drive pulse when measuring the reference pulse number and calculating the number of low-speed clock pulses CL generated in the overrun period ΔT.

[0057] For example, as in the first embodiment, the control unit 212 causes the high-speed clock generating unit 11B to generate high-speed clock pulses CH in a first reference period P1 from the first point in time t2 to time t3 when a time equivalent to a reference period has elapsed, and in a second reference period P2 from the second point in time t6 to time t7 when a time equivalent to two reference periods has elapsed. In addition, the control unit 212 also causes the high-speed clock generating unit 11B to generate high-speed clock pulses CH in a third reference period P3 from a point in time half a drive pulse before the first point in time t2, that is, before the input period of the stop pulse Pstop, to a point in time t1 when a time equivalent to the first reference period P1 has elapsed, and in a fourth reference period P4 from a point in time t4 half a drive pulse before the second point in time t6 to a point in time when a time equivalent to the second reference period P2 has elapsed. In the second embodiment, the start point of the third reference period P3, which is a half cycle of the drive pulse before the first point in time t2, is set as the measurement start point in time t0.

[0058] Furthermore, in the second embodiment, a stop pulse Pstop is input to the input unit 10 each time the amplitude of the vibration input to the input vibrator exceeds a predetermined threshold and the amplitude becomes 0. That is, in the second embodiment, the stop pulse Pstop is repeatedly input to the input unit 10 multiple times with an input period that is the same as the half period Td of the drive pulse. Note that in the second embodiment, the stop pulse Pstop includes a signal indicating the measurement end point, and constitutes a second signal that is repeated multiple times in the input period.

[0059] The control unit 212, like the first embodiment, causes the high-speed clock generating unit 11B to generate a high-speed clock pulse CH in an overage period ΔT from the measurement end time t8, i.e., the time when the stop pulse Pstop is input, to an overage time t9 that is synchronized with the reference period Ts after the measurement end time t8, but in addition, the control unit 212 causes the high-speed clock pulse CH to be generated in an additional measurement period ΔT1 from time t10, which is a half period Td of the drive pulse after the measurement end time t8, i.e., from the time when the stop pulse Pstop, which is the measurement end time t8, is input, to time t11, which is a time the same as the overage period ΔT has elapsed since the next stop pulse Pstop is input. Note that in the second embodiment, the additional measurement period ΔT1 constitutes a period of the same length as the overage period ΔT.

[0060] The control unit 212 causes the reference selection unit 15 to select, as a reference pulse number, either a first reference pulse number which is the count number of high-speed clock pulses CH generated in the first reference period P1 or a second reference pulse number which is the count number of high-speed clock pulses CH generated in the second reference period P2, depending on the time length of the excess period ΔT, and calculates the excess pulse number which is the pulse number of low-speed clock pulses CL in the excess period ΔT, based on the reference pulse number selected by the reference selection unit 15, the time length of the period during which the reference pulse number was counted, and the count number of the high-speed clock counter in the additional measurement period ΔT1.

[0061] In FIG. 7, the control section 212 first determines whether or not a start pulse Pstart has been input to the input section 10 (step ST1). In the process of step ST1, if a start pulse Pstart is input (YES in step ST1), the control unit 212 determines that the target period Tm, the time length of which is to be calculated, has started, and causes the low-speed clock generating unit 11A to start generating a low-speed clock pulse CL at the measurement start time t0, which is the time when the start pulse Pstart is input (step ST2). The control unit 12 also causes the enable signal generating unit 14 to output an enable signal EN, and causes the high-speed clock generating unit 11B to start generating a high-speed clock pulse CH at the measurement start time t0, which is the start time of the third reference period P3, which is a preparation period for enabling the generation of a high-speed clock pulse at a stable cycle in the first reference period P1. When time t1 is reached, which is the time equivalent to one reference period from measurement start time t0, the control unit 212 determines that the third reference period P3 has ended, and causes the high-speed clock generating unit 11B to end the generation of the high-speed clock pulse CH.

[0062] After performing the process of step ST2, the control unit 212 judges whether or not a time equivalent to four reference periods (four times the reference period Ts) has elapsed since the generation of the high-speed clock pulse CH was started at t0 (step ST33). In this process, the control unit 212 judges whether or not a time equivalent to a half period Td of the drive pulse has elapsed since the generation of the high-speed clock pulse CH was started, which is the time when the generation of the high-speed clock pulse CH is started in the first reference period P1. In the process of step ST33, if a time period equivalent to four reference periods has not elapsed since the generation of the high-speed clock pulse CH started at t0 (NO in step ST33), the control section 212 waits for the subsequent process.

[0063] In the processing of step ST33, if a time equivalent to four reference periods has elapsed since the generation of high-speed clock pulses CH was started at t0 (YES in step ST33), the high-speed clock generating unit 11B is made to start generating high-speed clock pulses CH to obtain the first reference pulse number (step ST34).

[0064] When time t3 is reached after one reference period has elapsed since time t2, the control unit 212 causes the high-speed clock generating unit 11B to end generation of the high-speed clock pulses CH, and stores the count number of the high-speed clock pulses CH in the first reference period P1 from time t2 until one reference period, i.e., one time of the reference period Ts, has elapsed as the first reference pulse number in the storage unit 16 (step ST36). In this process, the control unit 212 stores the first reference pulse number, which is the number of high-speed clock pulses CH generated in the time length of one reference period, in the storage unit 16 as the reference pulse number when the time length of the excess period is close to the time length of one reference period.

[0065] After performing the process of step ST36, the control unit 12 judges whether or not a predetermined period has elapsed since the generation of the high-speed clock pulse CH was started in the first reference period P1 (step ST37). In this process, the predetermined period is a period that is an integer multiple of a predetermined reference period Ts, and is, for example, a period in which the generation of the high-speed clock pulse CH in the first reference period P1 has no effect on the period of the high-speed clock pulse CH when the generation of the high-speed clock pulse CH is started after this predetermined period, or the effect is so small that it can be ignored. In the process of step ST37, if a predetermined period has not elapsed since the generation of high-speed clock pulses CH was started in the first reference period P1 (NO in step ST37), the control section 212 waits for the subsequent process.

[0066] In the processing of step ST37, if the time t4 has been reached after a predetermined period of time has elapsed since the generation of high-speed clock pulses CH was started in the first reference period P1 (YES in step ST37), the control unit 12 causes the enable signal generating unit 14 to output the enable signal EN, and causes the high-speed clock generating unit 11B to start generating high-speed clock pulses CH at the measurement start time t4, which is the start time of the fourth reference period P4, which serves as a preparatory period for enabling the generation of high-speed clock pulses at a stable cycle in the second reference period P2 (step ST38). When the time reaches time t5, which is two reference periods after the measurement start time t4, the control unit 212 determines that the fourth reference period P4 has ended, and causes the high-speed clock generating unit 11B to end the generation of the high-speed clock pulse CH.

[0067] After performing the process of step ST38, the control unit 212 judges whether or not a time equivalent to four reference periods has elapsed since the generation of the high-speed clock pulse CH started at t4 (step ST39). In this process, the control unit 212 judges whether or not the time t6 has been reached at which a time equivalent to a half period Td of the drive pulse has elapsed since the generation of the high-speed clock pulse CH started, which is the time when the generation of the high-speed clock pulse CH starts in the second reference period P2. In the process of step ST39, if a time period of four reference cycles has not elapsed since the generation of the high-speed clock pulse CH started at t4 (NO in step ST39), the control section 212 waits for the subsequent process.

[0068] In the processing of step ST39, if a time equivalent to four reference cycles has elapsed since the generation of high-speed clock pulses CH was started at t4 (YES in step ST39), the high-speed clock generating unit 11B is made to start generating high-speed clock pulses CH to obtain the second reference pulse number (step ST41).

[0069] When time t7 is reached, which is the time equivalent to two reference periods from time t6, the control unit 212 causes the high-speed clock generating unit 11B to end generation of the high-speed clock pulses CH, and stores the count number of the high-speed clock pulses CH in the second reference period P2 from time t6 until the time equivalent to two reference periods, i.e., twice the time equivalent to the reference period Ts, as the second reference pulse number in the storage unit 16 (step ST42). In this process, the control unit 212 stores the second reference pulse number, which is the number of high-speed clock pulses CH generated in the time length equivalent to two reference periods, in the storage unit 16 as the reference pulse number when the time length of the excess period is close to the time length of two reference periods.

[0070] After performing the process of step ST42, the control section 212 determines whether or not a first stop pulse Pstop has been input (step ST9). In the process of step ST9, if the stop pulse Pstop is not input (NO in step ST9), the control section 212 determines that the target period Tm has not yet ended, and waits for the subsequent processes.

[0071] In the process of step ST9, when the first stop pulse Pstop is input (YES in step ST9), the control unit 212 determines that the target period Tm for which the time length is to be calculated has ended, and causes the high-speed clock generating unit 11B to start generating high-speed clock pulses CH at the measurement end time t8, which is the time when the stop pulse Pstop is input (step ST44). In this process, the control unit 12 causes the high-speed clock generating unit 11B to start generating high-speed clock pulses CH in the overrun period ΔT from the measurement end time t8 to the overrun time t9 synchronized with the reference period Ts after the measurement end time t8, in order to generate high-speed clock pulses CH with a stable period in the additional measurement period ΔT1 for calculating the number of pulses of low-speed clock pulses CL generated in the overrun period ΔT.

[0072] After performing the process of step ST44, the control unit 212 judges whether or not a second stop pulse Pstop has been input (step ST46). In this process, the control unit 212 judges whether or not it has reached time t10, when the additional measurement period ΔT1 starts, which is the time when four reference periods have elapsed since the generation of the high-speed clock pulse CH started at the measurement end time t8. In the process of step ST46, if the second stop pulse Pstop is not input (NO in step ST46), the control section 212 waits for the subsequent processes.

[0073] In the process of step ST46, when the first stop pulse Pstop is input (YES in step ST46), the control unit 212 determines that the additional measurement period ΔT1 has started, and causes the high-speed clock generating unit 11B to start generating high-speed clock pulses CH at the measurement end time t10, which is the time when the stop pulse Pstop is input (step ST47). In this process, the control unit 12 causes the high-speed clock generating unit 11B to start generating high-speed clock pulses CH in the additional measurement period ΔT1 for calculating the number of low-speed clock pulses CL generated in the overtime period ΔT. After starting generation of the high-speed clock pulse CH in the additional measurement period ΔT1, when the time for one reference period has elapsed and the time reaches time t11 at which the high-speed clock pulse CH is first synchronized with the reference period Ts, the control unit 212 causes the high-speed clock generating unit 11 to end generation of the high-speed clock pulse CH. In other words, when the time equal to the excess period ΔT has elapsed since starting generation of the high-speed clock pulse CH in the additional measurement period ΔT1, the control unit 212 causes the high-speed clock generating unit 11 to end generation of the high-speed clock pulse CH.

[0074] After processing step ST47, the control unit 212 causes the reference selection unit 15 to determine whether the length of the excess period ΔT from the measurement end point t8 to the excess point t9 is close to the length of the first reference period P1, i.e., the length of one reference period (step ST12). In the processing of step ST12, if the duration of the excess period ΔT is close to the duration of the first reference period P1 (YES in step ST12), the control unit 12 causes the reference selection unit 15 to select the first reference pulse number as the reference pulse number from among the first reference pulse number, the second reference pulse number, and the third reference pulse number (step ST13).

[0075] In the process of step ST12, if the time length of the overrun period ΔT is not close to the time length of the first reference period P1 (NO in step ST12), the control unit 212 causes the reference selection unit 15 to select the second reference pulse number as the reference pulse number from the first reference pulse number and the second reference pulse number (step ST51). In this process, the control unit 12 causes the reference selection unit 15 to select the second reference pulse number as the reference pulse number based on the fact that the time length of the overrun period ΔT is close to the time length of the second reference period P2.

[0076] After performing the processing of step ST13 or step ST51, the control unit 212 causes the time calculation unit 17 to calculate the number of low-speed clock pulses CL generated in the excess period ΔT based on the reference pulse number, the time length of the period during which the reference pulse number was counted, and the count number of high-speed clock pulses CH in the additional measurement period ΔT1 (step ST52).

[0077] For example, the control unit 212 causes the time calculation unit 17 to calculate the number of pulses of low-speed clock pulses CL generated in the overrun period ΔT by dividing the count number of high-speed clock pulses CH in the additional measurement period ΔT1 by the first reference pulse number. In this process, the control unit 12 causes the time calculation unit 17 to calculate the number of pulses of low-speed clock pulses CL generated in the overrun period ΔT by dividing the count number of high-speed clock pulses CH in the additional measurement period ΔT1, which is a period of the same time length as the overrun period ΔT, by the first reference pulse number. When the second reference pulse number is selected as the reference pulse number, for example, the control unit 212 causes the time calculation unit 17 to calculate the number of pulses of the low-speed clock pulse CL generated in the overrun period ΔT by dividing the count number of the high-speed clock pulse CH in the additional measurement period ΔT1 by the second reference pulse number, and dividing the obtained value by 2. In this process, the control unit 212 causes the time calculation unit 17 to calculate the number of pulses of the low-speed clock pulse CL generated in the overrun period ΔT by dividing the value obtained by dividing the count number of the high-speed clock pulse CH in the additional measurement period ΔT1, which is a period of the same time length as the overrun period ΔT, by the second reference pulse number, based on the fact that the time length of the period during which the reference pulse number is counted is two reference cycles. After performing the process of step ST52, the control unit 212 causes the time calculation unit 17 to calculate the time length of the target period Tm based on the number of pulses of the low-speed clock pulses CL generated during the overtime period ΔT, the number of pulses of the low-speed clock pulses CL generated during the measurement period T, and the reference period Ts (step ST53).

[0078] The high-speed clock pulses CH generated in the first reference period P1, the second reference period P2, and the additional measurement period ΔT1 have more stable periods than the high-speed clock pulses CH generated in the third reference period P3, the fourth reference period P4, and the overage period ΔT, which are periods immediately preceding these periods. Therefore, the time measurement device 200 according to the second embodiment can calculate the number of pulses of the low-speed clock pulses CL generated in the overage period ΔT based on the count number of the high-speed clock pulses CH in a state in which the period is more stable than the reference pulse number and the count number of the high-speed clock pulses CH in the overage period ΔT generated in the first embodiment, thereby improving the measurement accuracy of the time length of the target period Tm.

[0079] In the second embodiment, the control unit 212 is configured to cause the reference selection unit 15 to select either the first reference pulse number or the second reference pulse number as the reference pulse number regardless of the length of the overrun period ΔT, but is not limited to this. The control unit may be configured to cause the reference selection unit to select either the first reference pulse number or the second reference pulse number as the reference pulse number depending on the length of the overrun period ΔT, and for example, as in the first embodiment, the control unit may be configured to cause the reference selection unit to select either the first reference pulse number or the second reference pulse number as the reference pulse number when the length of the overrun period ΔT is within a predetermined range.

[0080] Next, a third embodiment of the present invention will be described in detail with reference to the drawings. Embodiment 3 Fig. 10 is a timing chart showing a case where the length of the overrun period ΔT is close to one reference period when the time measurement device according to the third embodiment measures time. Fig. 11 is a timing chart showing a case where the length of the overrun period ΔT is close to two reference periods when the time measurement device according to the third embodiment measures time. The third embodiment is different from the second embodiment in the procedure for measuring the reference pulse number and the procedure for calculating the number of low-speed clock pulses CL generated in the overrun period ΔT. However, other configurations and other processes are the same, and the same reference symbols are used for the same contents as the first embodiment, and the description thereof will be omitted.

[0081] The control unit 312 of the time measurement device 300 according to the third embodiment calculates the average value of the count numbers of high-speed clock pulses CH generated in a plurality of periods having the same time length as the overtime period ΔT after the measurement end time t8, and calculates the pulse number of low-speed clock pulses CL in the overtime period ΔT based on the average value, the reference pulse number, and the reference period Ts. This improves the accuracy of the count number of high-speed clock pulses CH generated in the overtime period ΔT compared to the case of calculating the pulse number of low-speed clock pulses CL generated in the overtime period ΔT based on the count number of high-speed clock pulses CH in one overtime period ΔT or one additional measurement period ΔT1, the reference pulse number, and the reference period Ts as in the first and second embodiments, and therefore improves the measurement accuracy of the time length of the target period Tm.

[0082] In any of the above-described embodiments, various calculation procedures are possible for calculating the target period Tm, and the above-described calculation procedures include mathematically equivalent procedures. For example, in the above-described embodiments, the time measurement device 100 calculates the length of the target period Tm by multiplying the value obtained by subtracting the number of pulses of the low-speed clock pulses CL generated in the measurement period T from the number of pulses of the low-speed clock pulses CL generated in the overtime period ΔT by the reference period Ts, but the length of the target period Tm may be calculated by subtracting the length of the overtime period ΔT obtained by multiplying the number of pulses of the low-speed clock pulses CL generated in the overtime period ΔT by the reference period Ts from the length of the measurement period T obtained by multiplying the number of pulses of the low-speed clock pulses CL generated in the measurement period T by the reference period Ts. [Explanation of symbols]

[0083] 11A Low-speed clock generator 11B High-speed clock generation section 13A Low-speed clock counter 13B High-Speed ​​Clock Counter 15 Criteria Selection Section 17 Time calculation section 100, 200, 300 Time measuring device P1 First base period P2 Second base period P3 Third Reference Period P4 4th reference period t0: Start of measurement (first time point) t4 Second time point t8 End of measurement Ts Reference period Tm Target period ΔT excess period ΔT1 Additional measurement period

Claims

1. A time measurement device that measures a time length of a target period from a measurement start point to a measurement end point, a low-speed clock generating unit that generates a low-speed clock pulse at a reference period; a high-speed clock generating unit that generates a high-speed clock pulse having a shorter period than the low-speed clock pulse during a first reference period from a first point in time until a first multiple of the reference period has elapsed, a second reference period from a second point in time until a second multiple of the reference period, the second multiple being different from the first multiple, and an overrun period from the measurement end point to an overrun point after the measurement end point that is synchronized with the reference period; a low-speed clock counter that counts the number of low-speed clock pulses generated by the low-speed clock generating unit during a period from the measurement start time to the exceeding time; a high-speed clock counter that counts the number of high-speed clock pulses generated by the high-speed clock generating unit during a period having the same time length as the first reference period, the second reference period, and the overtime period; a reference selection unit that acquires a first reference pulse number, which is the number of pulses of a high-speed clock pulse counted in the first reference period, and a second reference pulse number, which is the number of pulses of a high-speed clock pulse counted in the second reference period, and selects one of the first reference pulse number and the second reference pulse number as a reference pulse number according to the time length of the excess period; a time calculation unit that calculates the length of time of the target period based on the reference pulse number, the length of time of the period during which the reference pulse number is counted, the length of time of the reference period, the count number of the low-speed clock counter, and the count number of the high-speed clock counter during a period of the same length as the overtime period. A time measuring device characterized by:

2. The reference selection unit selects, as the reference pulse number, one of the first reference period and the second reference period, the one having a time length closer to the excess period.

2. The time measurement device according to claim 1.

3. The time calculation unit calculates the number of excess pulses of low-speed clock pulses that can be generated by the low-speed clock generation unit in the overtime period based on the reference pulse number, the time length of the period during which the reference pulse number was counted, the time length of the reference period, and the count number of the high-speed clock counter in a period having the same time length as the overtime period, and calculates the time length of the target period based on the number of excess pulses, the time length of the reference period, and the count number of the low-speed clock counter.

3. The time measurement device according to claim 1 or 2.

4. The high-speed clock generating unit generates a high-speed clock pulse in the first reference period starting from the first time point in the target period and in the second reference period starting from the second time point in the target period.

4. The time measurement device according to claim 1, wherein the time measurement device is a time measuring device.

5. an input unit for receiving a first signal indicating a measurement start point and a second signal including a signal indicating a measurement end point and repeated multiple times in an input period; the high-speed clock generating unit generates the high-speed clock pulse during an additional measurement period from a point when the input period has elapsed since the measurement end point until a point when a time length equal to the excess period has elapsed; the high-speed clock counter counts the number of high-speed clock pulses generated by the high-speed clock generating unit during the additional measurement period; The time calculation unit calculates the time length of the target period based on the reference pulse number, the time length of the period during which the reference pulse number was counted, the count number of the high-speed clock counter during the overtime period, the time length of the reference period, and the count number of the low-speed clock counter.

5. The time measurement device according to claim 1, wherein the time measurement device is a time measuring device.

6. the high-speed clock generating unit generates a high-speed clock during a third reference period from a time point that is the input cycle before the first time point until a time period that is the same as the first reference period has elapsed, and during a fourth reference period from a time point that is the input cycle before the second time point until a time period that is the same as the second reference period has elapsed.

6. The time measurement device according to claim 5.

7. A time measurement method for measuring a time length of a target period from a measurement start point to a measurement end point, comprising: A low-speed clock generating unit generates a low-speed clock pulse at a reference period; a high-speed clock generating unit generating a high-speed clock pulse having a shorter period than the low-speed clock pulse in a first reference period from a first point in time until a first multiple of the reference period has elapsed, a second reference period from a second point in time until a second multiple of the reference period, the second multiple being different from the first multiple, has elapsed, and an overrun period from the measurement end point in time to an overrun point in time that is synchronized with the reference period after the measurement end point; a step of counting the number of low-speed clock pulses generated by the low-speed clock generating unit during a period from the measurement start time to the exceeding time by a low-speed clock counter; A high-speed clock counter counts the number of high-speed clock pulses generated by the high-speed clock generating unit during a period having the same time length as the first reference period, the second reference period, and the excess period; a reference selection unit acquiring a first reference pulse number, which is the number of pulses of a high-speed clock pulse counted in the first reference period, and a second reference pulse number, which is the number of pulses of a high-speed clock pulse counted in the second reference period, and selecting one of the first reference pulse number and the second reference pulse number as a reference pulse number according to a time length of the excess period; a time calculation unit calculating a time length of the target period based on the reference pulse number, a time length of the period during which the reference pulse number is counted, a time length of the reference period, a count number of the low-speed clock counter, and a count number of the high-speed clock counter during a period having the same time length as the overtime period. A time measurement method comprising:

Citation Information

Patent Citations

  • Measurement method for ring oscillator clock frequency, measurement circuit for ring oscillator clock frequency, and microcomputer

    JP2001013179A

  • Pulse interval measurement circuit and semiconductor integrated circuit device

    JP2012242352A

  • Non-contact power feeding device and elevator

    JP2017137151A

  • Time measuring device and method

    JP2020204472A