Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP7565882B2 - Time measuring device and time measuring method - Google Patents
[go: Go Back, main page]

JP7565882B2 - Time measuring device and time measuring method - Google Patents

Time measuring device and time measuring method Download PDF

Info

Publication number
JP7565882B2
JP7565882B2 JP2021108334A JP2021108334A JP7565882B2 JP 7565882 B2 JP7565882 B2 JP 7565882B2 JP 2021108334 A JP2021108334 A JP 2021108334A JP 2021108334 A JP2021108334 A JP 2021108334A JP 7565882 B2 JP7565882 B2 JP 7565882B2
Authority
JP
Japan
Prior art keywords
period
speed clock
time
pulse
length
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2021108334A
Other languages
Japanese (ja)
Other versions
JP2023005988A (en
Inventor
太一郎 加藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Azbil Corp
Original Assignee
Azbil Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Azbil Corp filed Critical Azbil Corp
Priority to JP2021108334A priority Critical patent/JP7565882B2/en
Publication of JP2023005988A publication Critical patent/JP2023005988A/en
Application granted granted Critical
Publication of JP7565882B2 publication Critical patent/JP7565882B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Measurement Of Unknown Time Intervals (AREA)

Description

本発明は、時間計測装置及び時間計測方法に関する。 The present invention relates to a time measurement device and a time measurement method.

従来、基準周期の低速クロックと、基準周期よりも短い周期の高速クロックと、を組み合わせてこれらのパルス数をカウントすることによって、計測開始時点から計測終了時点までの対象期間の時間長を計測する時間計測装置が知られている(特許文献1参照)。この時間計測装置は、計測開始時点から、計測終了時点以降に到来した基準周期と同期する計測経過時点までの概要期間を低速クロックで計測し、計測終了時点から計測経過時点までの超過期間を高速クロックで計測し、超過期間を概要期間から減算することで、対象期間の時間長を計測している。 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 the outline period from the start of measurement to the measurement elapsed time point that is synchronized with the reference period that arrives after the measurement end point using the low-speed clock, measures the excess period from the measurement end point to the measurement elapsed time point using the high-speed clock, and subtracts the excess period from the outline period to measure the length of the target period.

一般に、高速クロックの周期は、生成開始時には安定せず、時間の経過とともに周期が変化してしまう。このため、上述した時間計測装置は、最初の基準周期分の高速クロックのパルス数と、最初の基準周期に隣接する次の基準周期分の高速クロックのパルス数と、の中間のパルス数である基準クロック数を設定し、この基準クロック数と、超過期間における高速クロックのパルス数と、基準周期の時間長と、に基づいて超過期間に相当する低速クロックのパルス数を計算することで、測定誤差の低減を図っている。 In general, the period of a high-speed clock is not stable when it starts to be generated, and the period changes over time. For this reason, the time measurement device described above sets a reference clock number that is the intermediate number of pulses 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.

特開2020-204472号公報JP 2020-204472 A

対象期間の時間長と基準周期の時間長とに応じて超過期間の時間長は変化するが、上述した時間計測装置では、超過期間の時間長によらず同じように計測を行うため、基準クロック数の選び方及び超過期間の時間長によっては、計測精度にばらつきが発生する場合があり、更なる計測精度の向上が求められていた。 The length of the overrun period varies depending on the length of the target period and the length of the reference period. However, the time measurement device described above measures the same regardless of the length of the overrun period. Therefore, depending on the selection of the reference clock count and the length of the overrun period, there may be variations in measurement accuracy, and further improvements in measurement accuracy are needed.

本発明は、上記課題を解決するものであり、計測精度を向上させることができる時間計測装置及び時間計測方法を提供することを目的とする。 The present invention aims to solve the above problems and provide a time measurement device and a time measurement method that can improve measurement accuracy.

本発明に係る時間計測装置は、計測開始時点から計測終了時点までの対象期間の時間長を計測する時間計測装置であって、基準周期で低速クロックパルスを生成する低速クロック生成部と、低速クロックパルスよりも周期が短い高速クロックパルスを、第1時点から基準周期の第1数倍の時間が経過するまでの第1基準期間、第2時点から基準周期の第1数とは異なる第2数倍の時間が経過するまでの第2基準期間、及び計測終了時点から計測終了時点以降に基準周期と同期する超過時点までの超過期間と同じ時間長の期間において生成する高速クロック生成部と、低速クロック生成部が生成した低速クロックパルスのパルス数を、計測開始時点から超過時点までの期間においてカウントする低速クロックカウンタと、高速クロック生成部が生成した高速クロックパルスのパルス数を、第1基準期間、第2基準期間、及び超過期間と同じ時間長の期間においてカウントする高速クロックカウンタと、第1基準期間においてカウントされた高速クロックパルスのパルス数である第1基準パルス数と、第2基準期間においてカウントされた高速クロックパルスのパルス数である第2基準パルス数と、を取得し、超過期間の時間長に応じて、第1基準パルス数及び第2基準パルス数のいずれか一方を基準パルス数として選択する基準選択部と、基準パルス数と、前記基準パルス数がカウントされた期間の時間長と、前記超過期間と同じ時間長の期間における高速クロックカウンタのカウント数と、基準周期の時間長と、低速クロックカウンタのカウント数と、に基づいて、対象期間の時間長を算出する時間計算部と、を備えることを特徴とするものである。 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 period shorter than that of the low-speed clock pulses 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 that is different from the first multiple 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 pulses of the 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 pulses of the high-speed clock pulses generated by the high-speed clock generation unit. The device is characterized by comprising: a high-speed clock counter that counts the number of pulses in a period of 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 the high-speed clock pulse counted in the first reference period, and a second reference pulse number, which is the number of pulses of the 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 the reference pulse number according to the length of the overtime period; and a time calculation unit that calculates the length of the target period based on the reference pulse number, the length of the period during which the reference pulse number was counted, the count number of the high-speed clock counter during the period of the same time length as the overtime period, the time length of the reference period, and the count number of the low-speed clock counter.

本発明によれば、超過期間の時間長に応じて、時間長が異なる第1基準パルス数及び第2基準パルス数のいずれか一方を基準パルスとして選択し、この基準パルス数と、基準周期の時間長と、低速クロックカウンタのカウント数と、超過期間における高速クロックカウンタのカウント数と、に基づいて対象期間の時間長を算出するので、例えば、高速クロックパルスの周期が生成開始から時間の経過とともに変化する場合であっても、超過期間の時間長を高い精度で測定することが可能となり、対象期間の時間長の計測精度を向上させることができる。 According to the present invention, either the first reference pulse number or the second reference pulse number, which have different time lengths, are selected as the 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, 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 can be improved.

実施の形態1に係る時間計測装置のハードウェア構成の一部を示すブロック図である。2 is a block diagram showing a part of the hardware configuration of the time measurement device according to the first embodiment; 実施の形態1に係る制御部が行う処理を示すフローチャートである。5 is a flowchart showing a process performed by a control unit according to the first embodiment. 実施の形態1に係る制御部が時間計測を行う際に、超過期間の時間長が1基準周期分に近い場合のタイミングチャートである。11 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 first embodiment measures time. 実施の形態1に係る制御部が時間計測を行う際に、超過期間の時間長が2基準周期分に近い場合のタイミングチャートである。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. 実施の形態1に係る制御部が時間計測を行う際に、超過期間の時間長が1.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. 実施の形態1に係る時間計測装置が行う処理の計算過程を示すブロック図である。4 is a block diagram showing a calculation process of a process performed by the time measurement device according to the first embodiment; 実施の形態2に係る制御部が行う処理を示すフローチャートである。13 is a flowchart showing a process performed by a control unit according to the second embodiment. 実施の形態2に係る制御部が時間計測を行う際に、超過期間の時間長が1基準周期分に近い場合のタイミングチャートである。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. 実施の形態2に係る制御部が時間計測を行う際に、超過期間の時間長が2基準周期分に近い場合のタイミングチャートである。13 is a timing chart showing a case where the length of an overrun period is close to two reference periods when the control unit according to the second embodiment measures time. 実施の形態3に係る制御部が時間計測を行う際に、超過期間の時間長が1基準周期分に近い場合のタイミングチャートである。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 third embodiment measures time. 実施の形態3に係る制御部が時間計測を行う際に、超過期間の時間長が2基準周期分に近い場合のタイミングチャートである。13 is a timing chart in the case where the length of an overrun period is close to two reference periods when the control unit according to the third embodiment measures time.

以下、本発明に係る実施の形態について図面を参照しながら詳細に説明する。
実施の形態1.
先ず、実施の形態1に係る時間計測装置100の構成について、図1を用いて説明する。図1は、時間計測装置100のハードウェア構成の一部を示すブロック図である。実施の形態1に係る時間計測装置100は、例えば、不図示の超音波流量計等に搭載されて、互いに異なる時刻に入力された2つの信号の間の期間である対象期間Tmの時間長を、低速クロックパルス及び高速クロックパルスを用いて計測する装置である。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, preferred embodiments of the present invention will be described in
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.

超音波流量計は、例えば、電圧の印加で発振することによって、略一定の周期で駆動パルスを出力する出力振動子と、出力振動子に対して距離を存して配置され、駆動パルスが入力されることによって振動するとともに、振動を電気信号へ変換する入力振動子と、を有し、駆動パルスの出力に伴って時間計測装置100へスタートパルスPstartを出力し、入力振動子が駆動パルスを検知した際に時間計測装置100へストップパルスPstopを出力する。例えば、超音波流量計は、入力振動子に入力された振動の振幅が所定の閾値を超えた後、振幅が0になった時点を、駆動パルスを検知した時点(ゼロクロス点)であると判定し、時間計測装置100へストップパルスPstopを出力する。 The ultrasonic flowmeter has, for example, an output vibrator that oscillates when a voltage is applied to it, thereby outputting 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. The ultrasonic flowmeter outputs a start pulse Pstart to the time measurement device 100 in response to 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 at which the amplitude of the vibration input to the input vibrator exceeds a predetermined threshold and then becomes 0 is the point at which the drive pulse was detected (zero cross point), and outputs a stop pulse Pstop to the time measurement device 100.

実施の形態1に係る時間計測装置100は、例えば、上記超音波流量計等からスタートパルスPstartとストップパルスPstopとが互いに異なる時刻に入力された際に、これら2つの信号の間の期間である対象期間Tmの時間長を算出して出力する。言い換えると、時間計測装置100は、例えば、スタートパルスPstartが入力された時刻である計測開始時点からストップパルスPstopが入力された時刻である計測終了時点までの対象期間Tmの時間長、即ちこれら2つの信号が入力された時刻の時間差を算出して出力する。 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 length of the target period Tm, which is the period between these two signals. In other words, the time measurement device 100 calculates and outputs the 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.

時間計測装置100は、信号が入力される入力部10と、低速クロックパルスCLを生成する低速クロック生成部11Aと、高速クロックパルスを生成する高速クロック生成部11Bと、低速クロック生成部11Aが生成した低速クロックパルスのパルス数をカウントする低速クロックカウンタ13Aと、高速クロック生成部11Bが生成した高速クロックパルスのパルス数をカウントする高速クロックカウンタ13Bと、高速クロック生成部11Bによる高速クロックパルスの生成期間を制御するためのイネーブル信号ENを生成するイネーブル信号生成部14と、基準選択部15と、対象期間Tmの時間長を算出するための各種情報を記憶する記憶部16と、対象期間Tmの時間長を算出する時間計算部17と、時間計測装置100の各構成を制御する制御部12と、を備えている。基準選択部15については、後述する。 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.

時間計測装置100は、図示しないCPU、ROM、RAM、I/Oポート等を有する処理回路を有しており、当該処理回路によって、入力部10、低速クロック生成部11A、高速クロック生成部11B、低速クロックカウンタ13A、高速クロックカウンタ13B、イネーブル信号生成部14、基準選択部15、記憶部16、時間計算部17及び制御部12の各機能が実現される。 The time measurement device 100 has a processing circuit with a CPU, ROM, RAM, I/O ports, etc. (not shown), and the processing circuit realizes the functions of the input unit 10, low-speed clock generation unit 11A, high-speed clock generation unit 11B, low-speed clock counter 13A, high-speed clock counter 13B, enable signal generation unit 14, reference selection unit 15, memory unit 16, time calculation unit 17, and control unit 12.

入力部10は、時間計測装置100が接続される装置からの信号が入力される。例えば、上述した超音波流量計等から、スタートパルスPstartとストップパルスPstopとが入力される。入力部10は、信号の入力を受けると、低速クロック生成部11Aと、高速クロック生成部11Bと、に信号を出力する。 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 ultrasonic flowmeter described above. When the input unit 10 receives a signal, it outputs the signal to the low-speed clock generating unit 11A and the high-speed clock generating unit 11B.

低速クロック生成部11Aは、所定の期間において略一定の周期である基準周期で、低速クロックパルスCLを生成する。例えば、低速クロック生成部11Aは、電圧を印加することによって発振する発振子を有し、矩形波等の低速クロックパルスCLを生成する。また、例えば、低速クロックカウンタ13Aは、入力部10から信号が入力されたことに基づいて、低速クロックパルスCLの生成を開始する。低速クロック生成部11Aが生成した低速クロックパルスCLは、低速クロックカウンタ13Aに向けて出力される。 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 to it, 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 being 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.

高速クロック生成部11Bは、基準周期よりも短い周期で、高速クロックパルスCHを生成する。例えば、高速クロック生成部11Bは、リングオシレータ等の高周波タイプのクロックパルス生成回路によって構成され、矩形波である高速クロックパルスCHを生成する。また、例えば、高速クロック生成部11Bは、時間計測装置100にストップパルスPstopが入力されたことに基づいて、高速クロックパルスCHの生成を開始する。高速クロック生成部11Bが生成した高速クロックパルスCHは、高速クロックカウンタ13Bに向けて出力される。 The high-speed clock generating unit 11B generates high-speed clock pulses CH at a period shorter than the 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 high-speed clock pulses CH that are rectangular waves. Also, for example, the high-speed clock generating unit 11B starts generating high-speed clock pulses CH based on the input of a stop pulse Pstop to the time measurement device 100. The high-speed clock pulses CH generated by the high-speed clock generating unit 11B are output to the high-speed clock counter 13B.

低速クロックカウンタ13Aは、所定の期間において低速クロック生成部11Aが出力した低速クロックパルスCLのパルス数をカウントして積算する。例えば、低速クロックカウンタ13Aは、時間計測装置100にスタートパルスPstartが入力されたことに基づいて、低速クロックパルスCLのカウントを開始する。 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 start pulse Pstart being input to the time measurement device 100.

高速クロックカウンタ13Bは、所定の期間において高速クロック生成部11Bが出力した高速クロックパルスCHのパルス数をカウントして積算する。例えば、高速クロックカウンタ13Bは、時間計測装置100にストップパルスPstopが入力されたことに基づいて、高速クロックパルスCHのカウントを開始する。 The high-speed clock counter 13B counts and accumulates the number of pulses of the high-speed clock pulse 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 pulse CH based on the input of a stop pulse Pstop to the time measurement device 100.

一般に、計測開始時点から計測終了時点までの対象期間Tmの時間長を時間計測装置によって計測する場合、時間計測装置は、低速クロックパルスと高速クロックパルスとを組合せることにより、計測する。
例えば、時間計測装置は、まず、低速クロックパルスCLの生成を開始する計測開始時点から、計測終了時点以降に基準周期と同期する超過時点までの期間である計測期間において、基準周期で生成した低速クロックパルスCLのパルス数をカウントする。言い換えると、時間計測装置は、まず、計測開始時点から、計測終了時点以降であって計測開始時点からの経過時間が基準周期の整数倍となる超過時点までの期間である計測期間Tにおいて、基準周期で生成した低速クロックパルスCLのパルス数をカウントする。
また、時間計測装置は、基準周期と高速クロックパルスの周期とに基づいて、計測終了時点から超過時点までの期間である超過期間において生成した高速クロックパルスCHのパルス数のカウント数を、この期間に生成した低速クロックパルスCLのパルス数に換算する。
In general, when the length 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 point, 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.

次に、時間計測装置は、計測期間における低速クロックパルスCLのカウント数から、超過期間における低速クロックパルスCLの換算値を減算する。これにより、時間計測装置は、対象期間Tmの低速クロックパルスCLのパルス数を取得し、このパルス数と低速クロックパルスCLの周期である基準周期とを乗算することによって、対象期間Tmの時間長を算出する。 Next, the time measurement device subtracts the conversion value of the low-speed clock pulse CL in the overage period from the count number of the low-speed clock pulse CL in the measurement period. In this way, the time measurement device obtains the pulse number of the low-speed clock pulse CL in the target period Tm, and calculates the time length of the target period Tm by multiplying this pulse number by the reference period, which is the period of the low-speed clock pulse CL.

ところで、高速クロックパルス生成部として、例えば、リングオシレータなどの高周波タイプのクロックパルス生成回路を用いた場合、高速クロックパルスを生成する際に要する消費電力は、低速クロックに比較して大きいため、計測開始時点から計測終了時点に亘って高速クロックパルスを生成するのではなく、時間計測に必要な期間、例えば、超過期間でのみ高速クロックパルスを生成することで、消費電力を抑制することができる望ましい。しかしながら、このような高速クロックパルスは、クロックパルスの生成から十分な時間が経過するまでは周期が安定せず、周期が時間の経過とともに変化する場合がある。 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 greater than that of a low-speed clock. Therefore, it is desirable to suppress 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 to end 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 clock pulse was generated, and the period may change over time.

このため、実施の形態1では、時間計測装置100は、高速クロック生成部11Bに、基準周期の整数倍の時間長において高速クロックパルスCHを生成させ、その際の高速クロックパルスCHのカウント数と、超過期間における高速クロックパルスCHのカウント数と、に基づいて、超過期間において生成された低速クロックパルスCLのパルス数を算出している。例えば、超過期間において生成された高速クロックパルスCHのカウント数を、1基準周期分の時間長において生成された高速クロックパルスCHのカウント数で割ると、超過期間において生成された低速クロックパルスCLのパルス数を算出することができる。
これにより、高速クロックパルスCHのカウント中に高速クロックパルスCHの周期が変化する場合であっても、超過期間において生成された低速クロックパルスCLのパルス数を算出することができる。
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.

また、高速クロックパルスを生成する際、回路構成によっては、クロックパルスの生成から十分な時間が経過するまで時間の経過とともに周期が拡大する、又は時間の経過とともに周期が縮小する場合がある。このような場合、基準周期の整数倍の時間長で生成した高速クロックパルスCHのカウント数と、超過期間における高速クロックパルスCHのカウント数と、に基づいて、超過期間において生成された低速クロックパルスCLのパルス数を算出しようとしても、高速クロックパルスCHを生成する基準周期の整数倍の時間長と、超過期間の時間長と、の差の大きさによっては、十分な精度が得られない場合がある。 In addition, when generating high-speed clock pulses, depending on the circuit configuration, the period may expand over time until a sufficient amount of time has passed since the generation of the clock pulse, or the period may contract over time. In such cases, even if an attempt is made to calculate the number of pulses of low-speed clock pulses CL generated in the 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.

このため、実施の形態1では、互いに時間長が異なる複数の期間において高速クロックパルスCHを生成し、得られた複数の高速クロックパルスCHのカウント数と、超過期間において生成された高速クロックパルスCHのカウント数と、を用いることによって、超過期間において生成された低速クロックパルスCLのパルス数を、より高い精度で算出することを可能としている。 For this reason, in the first embodiment, high-speed clock pulses CH are generated in multiple periods of different time lengths, and the number of counts of the resulting multiple high-speed clock pulses CH and the number of counts of the high-speed clock pulses CH generated in the overage period are used to calculate the number of pulses of the low-speed clock pulses CL generated in the overage period with higher accuracy.

実施の形態1に係る時間計測装置100は、高速クロックカウンタ13Bが、第1時点から基準周期の第1数倍の時間長が経過するまでの第1基準期間において生成した高速クロックパルスCHのカウント数を第1基準パルス数としてカウントし、第2時点から基準周期の第1数とは異なる第2数倍の時間長が経過するまでの第2基準期間において生成した高速クロックパルスCHのカウント数を第2基準パルス数としてカウントし、基準選択部15が、超過期間の時間長に応じて第1基準パルス数又は第2基準パルス数のいずれか一方を基準パルス数として選択し、この基準パルス数と、超過期間と同じ時間長の期間において生成された高速クロックパルスCHのカウント数と、に基づいて、超過期間において生成された低速クロックパルスCLのパルス数を算出している。 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 multiple of 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 multiple of the reference period that is 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 overage period, and calculates the number of pulses of the low-speed clock pulses CL generated in the overage period based on this reference pulse number and the count number of high-speed clock pulses CH generated in a period of the same time length as the overage period.

例えば、実施の形態1に係る時間計測装置100は、計測終了時点以降に最初に基準周期と同期する時点を超過時点とした場合、高速クロックカウンタ13Bが、計測開始時点から1基準周期分の時間長が経過するまでの第1基準期間において生成した高速クロックパルスCHのカウント数を第1基準パルス数としてカウントし、第1基準期間よりも後でかつ対象期間内の第2時点から2基準周期分の時間長が経過するまでの第2基準期間において生成した高速クロックパルスCHのカウント数を第2基準パルス数としてカウントし、基準選択部15が、第1基準パルス数又は第2基準パルス数のいずれか超過期間の時間長に近い方を基準パルス数として選択し、超過期間において生成された高速クロックパルスCHのカウント数と基準パルス数との比に基づいて、超過期間において生成された低速クロックパルスCLのパルス数を算出する。
なお、基準選択部15は、3つ以上のパルス数から、いずれか1つのパルス数を基準パルス数として選択するように構成されていてもよい。
For example, in the time measurement device 100 according to the first embodiment, when the overrun time point is determined to be the first time point synchronized with the reference period after the measurement end time point, 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 to the time length of one reference period elapses 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 from a second time point in the target period to the time length of two reference periods elapses 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 point, as the reference pulse number, and calculates the number of pulses of low-speed clock pulses CL generated in the overrun time period based on the ratio between the count number of high-speed clock pulses CH generated in the overrun time period 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.

これにより、実施の形態1に係る時間計測装置100は、第1基準期間及び第2基準期間のうち、超過期間の時間長に近いいずれか一方の期間における高速クロックカウンタ13Bのカウント数である基準パルス数と、超過期間における高速クロックカウンタのカウント数と、の比に基づいて、超過期間において生成された低速クロックパルスCLのパルス数を算出しているので、例えば、高速クロックパルスの周期が生成開始から時間の経過とともに拡大又は縮小する場合であっても、超過期間の時間長を高い精度で測定することが可能となり、対象期間の時間長の計測精度を向上させることができる。 As a result, the time measurement device 100 according to the first embodiment calculates the number of pulses of the low-speed clock pulse 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 or 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, thereby improving the measurement accuracy of the length of the target period.

以下、実施の形態1に係る時間計測装置100の制御部12が行う処理の詳細について説明する。図2は、実施の形態1に係る制御部12が行う処理を示すフローチャートである。図3は、実施の形態1に係る時間計測装置が時間計測を行う際に、超過期間ΔTの時間長が1基準周期分(基準周期Tsと同じ時間長)に近い場合のタイミングチャートである。図4は、実施の形態1に係る時間計測装置が時間計測を行う際に、超過期間ΔTの時間長が2基準周期分(基準周期Tsの2倍の時間長)に近い場合のタイミングチャートである。図5は、実施の形態1に係る時間計測装置が時間計測を行う際に、超過期間ΔTの時間長が1.5基準周期分(基準周期Tsの1.5倍の時間長)に近い場合のタイミングチャートである。 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 the case where the time length of the overage period ΔT is close to one reference period (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 the 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 the 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.

制御部12は、まず、入力部10に対してスタートパルスPstartの入力があったか否かを判定する(ステップST1)。この処理において、制御部12は、例えば、超音波流量計等からの入力信号であるスタートパルスPstartの入力部10への入力の有無を判定することにより、時間長を算出する対象である対象期間Tmが開始されたか否かを判定している。なお、スタートパルスPstartが、計測開始時点を示す第1信号を構成する。
ステップST1の処理において、スタートパルスPstartの入力がない場合(ステップST1のNO)、制御部12は、対象期間Tmが未だ開始されていないと判定し、以降の処理を待機する。
The control unit 12 first judges whether or not a start pulse Pstart has been input to the input unit 10 (step ST1). In this process, the control unit 12 judges whether or not a target period Tm, which is a target for calculating a time length, has started by judging 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.

ステップST1の処理において、スタートパルスPstartの入力があった場合(ステップST1のYES)、制御部12は、時間長を算出する対象である対象期間Tmが開始されたと判定し、対象期間Tmが開始された時刻である計測開始時点t0において、低速クロック生成部11Aによる低速クロックパルスCLのカウントを開始する(ステップST2)。また、制御部12は、計測開始時点t0において、イネーブル信号生成部14からイネーブル信号ENを出力させ、高速クロック生成部11Bに第1基準パルス数を取得するための高速クロックパルスCHの生成を開始させる。 When a start pulse Pstart is input in the processing of step ST1 (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). In addition, the control unit 12 causes the enable signal generating unit 14 to output an enable signal EN at the measurement start time t0, and causes the high-speed clock generating unit 11B to start generating high-speed clock pulses CH for obtaining the first reference pulse number.

計測開始時点t0から1基準周期分の時間が経過した時刻t1に達すると、制御部12は、高速クロック生成部11Bに高速クロックパルスCHの生成を終了させて、計測開始時点t0から1基準周期分の時間、即ち基準周期Tsの1倍の時間が経過するまでの第1基準期間P1における高速クロックパルスCHのカウント数を、第1基準パルス数として記憶部16に記憶させる(ステップST3)。この処理において、制御部12は、超過期間の時間長が1基準周期分の時間長に近い場合の基準パルス数として、1基準周期分の時間長において生成される高速クロックパルスCHのパルス数である第1基準パルス数を記憶部16に記憶させている。 When time t1 is reached, which is the time equivalent to one reference period from 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 measurement start time t0 until the time equivalent to one reference period, i.e., one time equivalent to the reference period Ts, as the first reference pulse number in the memory unit 16 (step ST3). In this process, the control unit 12 stores the first reference pulse number, which is the number of pulses of the high-speed clock pulses CH generated in the time length of one reference period, in the memory 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.

ステップST3の処理を行うと、制御部12は、第1基準期間P1において高速クロックパルスCHの生成を開始してから所定期間が経過したか否かを判定する(ステップST4)。この処理において、所定期間とは、予め決められた基準周期Tsの整数倍の期間であって、例えば、この所定期間の後で高速クロックパルスCHの生成を開始した場合の高速クロックパルスCHの周期に、第1基準期間P1において高速クロックパルスCHを生成した影響が無いか、又は影響が無視できる程小さくなる期間である。
ステップST4の処理において、第1基準期間P1で高速クロックパルスCHの生成を開始してから所定期間が経過していない場合(ステップST4のNO)、制御部12は、以降の処理を待機する。
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 the high-speed clock pulse CH was started in the first reference period P1 (NO in step ST4), the control section 12 waits for the subsequent process.

ステップST4の処理において、第1基準期間P1で高速クロックパルスCHの生成を開始してから所定期間が経過した時刻t4に達している場合(ステップST4のYES)、制御部12は、イネーブル信号生成部14からイネーブル信号ENを出力させ、高速クロック生成部11Bに第2基準パルス数を取得するための高速クロックパルスCHの生成を開始させる(ステップST6)。 In the processing of step ST4, if a time t4 is reached at which a predetermined period 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).

計測開始時点t0から2基準周期分の時間が経過した時刻t5に達すると、制御部12は、高速クロック生成部11Bに高速クロックパルスCHの生成を終了させて、計測開始時点t4から2基準周期分の時間、即ち基準周期Tsの2倍の時間が経過するまでの第2基準期間P2における高速クロックパルスCHのカウント数を、第2基準パルス数として記憶部16に記憶させる(ステップST7)。この処理において、制御部12は、超過期間の時間長が2基準周期分の時間長に近い場合の基準パルス数として、2基準周期分の時間長において生成される高速クロックパルスCHのパルス数である第2基準パルス数を記憶部16に記憶させている。 When time t5 is reached, which is the time equivalent to two reference periods from 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 equivalent to two reference periods, i.e., twice the time equivalent to the reference period Ts, as the second reference pulse number in the memory unit 16 (step ST7). In this process, the control unit 12 stores the second reference pulse number, which is the number of pulses of the high-speed clock pulses CH generated in the time length of two reference periods, in the memory 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.

ステップST7の処理を行うと、制御部12は、第1基準パルス数及び第2基準パルス数に基づいて、第1基準パルス数と、第2基準パルス数の2分の1の値と、の平均値である第3基準パルス数を算出し、記憶部16に記憶させる(ステップST8)。この処理において、制御部12は、超過期間ΔTの時間長が1.5基準周期分の時間長に近い場合の基準パルス数として、第1基準パルス数と、第2基準パルス数の2分の1の値と、の平均値である第3基準パルス数を算出して記憶部16に記憶させている。制御部12は、第2基準期間の時間長が基準周期Tsの2倍であることに基づいて、第2基準パルス数を2で割った値と、第1基準パルス数との平均値を算出している。 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 it in the memory unit 16 (step ST8). In this process, 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, 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 it in the memory 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.

ステップST8の処理を行うと、制御部12は、ストップパルスPstopの入力があったか否かを判定する(ステップST9)。この処理において、制御部12は、例えば、超音波流量計等からの入力信号であるストップパルスPstopの入力部10への入力の有無を判定することにより、時間長を算出する対象である対象期間Tmが終了したか否かを判定している。ステップST9の処理において、ストップパルスPstopの入力がない場合(ステップST9のNO)、制御部12は、対象期間Tmが未だ終了していないと判定し、以降の処理を待機する。なお、実施の形態1において、ストップパルスPstopが、計測終了時点を示す第2信号を構成する。 After performing the process of step ST8, the control unit 12 determines whether or not a stop pulse Pstop has been input (step ST9). In this process, the control unit 12 determines whether or not a stop pulse Pstop, which is an input signal from, for example, an ultrasonic flowmeter, has been input to the input unit 10, thereby determining whether or not the target period Tm, for which the time length is to be calculated, has ended. In the process of step ST9, if a stop pulse Pstop has not been input (NO in step ST9), the control unit 12 determines 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.

ステップST9の処理において、ストップパルスPstopの入力があった場合(ステップST9のYES)、制御部12は、時間長を算出する対象である対象期間Tmが終了したと判定し、ストップパルスPstopが入力された時刻である計測終了時点t8において、高速クロック生成部11Bに高速クロックパルスCHの生成を開始させる(ステップST11)。この処理において、制御部12は、超過期間ΔTにおいて生成される低速クロックパルスCLのパルス数を算出するため、計測終了時点t8から、計測終了時点t8以降に基準周期Tsと同期する超過時点t9までの超過期間ΔTにおいて、高速クロックパルスCHの生成を高速クロック生成部11Bに開始させている。 In the process of step ST9, if a 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 was input (step ST11). 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 overage period ΔT from the measurement end time t8 to the overage time t9 that is synchronized with the reference period Ts after the measurement end time t8, in order to calculate the number of pulses of the low-speed clock pulses CL generated in the overage period ΔT.

実施の形態1では、計測終了時点t8から1基準周期Ts以上の時間が経過した以降、最初に基準周期Tsと同期する時点、例えば、低速クロックパルスの立ち上がりを検知した時点を超過時点t9とする。これにより、実施の形態1において、超過期間ΔTの時間長は、1基準周期分以上かつ2基準周期分未満となる。 In the first embodiment, the overrun time t9 is the time when the clock first synchronizes with the reference period Ts after one reference period Ts or more has elapsed since the measurement end time t8, for example, when the rising edge of the low-speed clock pulse is detected. As a result, in the first embodiment, the length of the overrun period ΔT is one reference period or more and less than two reference periods.

高速クロック生成部11Bが高速クロックパルスCHの生成を開始してから、時刻が超過時点t9に達すると、制御部12は、基準選択部15に、計測終了時点t8から超過時点t9までの超過期間ΔTの時間長が、第1基準期間P1の時間長、即ち1基準周期分の時間長に近いか否かを判定させる(ステップST12)。言い換えると、制御部12は、基準選択部15に、超過期間ΔTの時間長が、第1基準期間P1の時間長に近いと判定される範囲にあるか否かを判定させる。
例えば、制御部12は、基準選択部15に、超過期間ΔTの時間長が1基準周期分以上かつ4/3基準周期分(基準周期Tsの4/3倍の時間長)未満の範囲にあるか否かを判定させる。この処理において、制御部12は、基準選択部15に超過期間ΔTの時間長と、第1基準期間P1の時間長と、を比較させ、基準パルス数として第1基準パルス数を選択すべきか否かを判定させている。
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 causes the reference selecting unit 15 to 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, i.e., the time length of one reference period (step ST12). In other words, the control unit 12 causes the reference selecting unit 15 to determine whether the time length of the overrun period ΔT is within a range that is 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.

ステップST12の処理において、超過期間ΔTの時間長が第1基準期間P1の時間長に近い場合(ステップST12のYES)、制御部12は、基準選択部15に、第1基準パルス数、第2基準パルス数及び第3基準パルス数のうちから第1基準パルス数を基準パルス数として選択させる(ステップST13)。この処理において、制御部12は、超過期間ΔTの時間長が第1基準期間P1の時間長に近いことに基づいて、基準選択部15に基準パルス数として第1基準パルス数を選択させている。 In the process of step ST12, if the length of the excess period ΔT is close to the 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 length of the excess period ΔT is close to the length of the first reference period P1.

ステップST12の処理において、超過期間ΔTの時間長が第1基準期間P1の時間長に近くない場合(ステップST12のNO)、制御部12は、基準選択部15に、超過期間ΔTの時間長が、第2基準期間P2の時間長、即ち2基準周期分の時間長に近いか否かを判定させる(ステップST14)。言い換えると、制御部12は、基準選択部15に、超過期間ΔTの時間長が、第2基準期間P2の時間長に近いと判定される範囲にあるか否かを判定させる。例えば、制御部12は、基準選択部15に、超過期間ΔTの時間長が5/3基準周期分(基準周期Tsの5/3倍の時間長)以上かつ2基準周期分未満の範囲にあるか否かを判定させる。この処理において、制御部12は、基準選択部15に超過期間ΔTの時間長と、第2基準期間P2の時間長と、を比較させ、基準パルス数として第2基準パルス数を選択すべきか否かを判定させている。 In the process of step ST12, if the time length of the excess 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 the time length of the excess 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 the time length of the excess 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 the time length of the excess period ΔT is in 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 excess period ΔT with the time length of the second reference period P2 and determine whether the second reference pulse number should be selected as the reference pulse number.

ステップST14の処理において、超過期間ΔTの時間長が第2基準期間P2の時間長に近い場合(ステップST14のYES)、制御部12は、基準選択部15に、第1基準パルス数、第2基準パルス数及び第3基準パルス数のうちから第2基準パルス数を基準パルス数として選択させる(ステップST16)。この処理において、制御部12は、超過期間ΔTの時間長が第2基準期間P2の時間長に近いことに基づいて、基準選択部15に基準パルス数として第2基準パルス数を選択させている。 In the process of step ST14, if the length of the excess period ΔT is close to the 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 among 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 length of the excess period ΔT is close to the length of the second reference period P2.

このように、実施の形態1において、制御部12は、基準選択部15に、超過期間ΔTの時間長が所定の範囲内にある場合、第1基準期間P1及び第2基準期間P2のいずれか一方を基準パルスとして選択させている。具体的には、制御部12は、基準選択部15に、超過期間ΔTの時間長が所定の範囲内にある場合、第1基準期間P1及び第2基準期間P2のうち、時間長が超過期間ΔTに近い方を基準パルスとして選択させている。より具体的には、制御部12は、基準選択部15に、超過期間ΔTの時間長が、1基準周期分以上かつ4/3基準周期分未満、及び5/3基準周期分以上かつ2基準周期分未満の範囲内にある場合、第1基準期間P1及び第2基準期間P2のうち、時間長が超過期間ΔTに近い方を基準パルスとして選択させている。 In this way, 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 the 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 the reference pulse, one of the first reference period P1 and the second reference period P2 whose time length 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 the reference pulse, one of the first reference period P1 and the second reference period P2 whose time length 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.

ステップST14の処理において、超過期間ΔTの時間長が第2基準期間P2の時間長に近くない場合(ステップST14のNO)、制御部12は、基準選択部15に、第1基準パルス数、第2基準パルス数及び第3基準パルス数のうちから第3基準パルス数を基準パルス数として選択させる(ステップST17)。例えば、超過期間ΔTの時間長が5/3基準周期分未満である場合、制御部12は、基準選択部15に、第1基準パルス数、第2基準パルス数及び第3基準パルス数のうちから第3基準パルス数を基準パルス数として選択させる。この処理において、制御部12は、超過期間ΔTの時間長が1.5基準周期分の時間長に近いこと、例えば、超過期間ΔTの時間長が4/3基準周期分以上かつ5/3基準周期分未満であることに基づいて、基準選択部15に基準パルス数として第3基準パルス数を選択させている。 In the process of step ST14, if the time length of the excess 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 excess period ΔT is less than 5/3 of the reference period, 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 excess period ΔT is close to the time length of 1.5 reference periods, for example, the time length of the excess period ΔT is equal to or greater than 4/3 of the reference period and less than 5/3 of the reference period.

ステップST13、ステップST16又はステップST17の処理を行うと、制御部12は、時間計算部17に、基準パルス数と、基準パルス数がカウントされた期間の時間長と、超過期間ΔTにおける高速クロックパルスCHのカウント数と、に基づいて、超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数を算出させる(ステップST18)。 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 pulses of the 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 the high-speed clock pulses CH in the overrun period ΔT (step ST18).

図6は、実施の形態1に係る時間計測装置が行う処理の計算過程を示すブロック図である。基準パルス数として第1基準パルス数が選択されている場合、例えば、制御部12は、時間計算部17に、超過期間ΔTにおける高速クロックパルスCHのカウント数を第1基準パルス数で割ることで、超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数を算出させる。この処理において、制御部12は、時間計算部17に、超過期間ΔTにおける高速クロックパルスCHのカウント数を第1基準パルス数で割ることで、超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数(超過期間ΔTの時間長が1基準周期分の何倍であるか)を算出させている。
基準パルス数として第2基準パルス数が選択されている場合、例えば、制御部12は、時間計算部17に、超過期間ΔTにおける高速クロックパルスCHのカウント数を第2基準パルス数で割り、得られた値を2で割ることで、超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数を算出させる。この処理において、制御部12は、時間計算部17に、超過期間ΔTにおける高速クロックパルスCHのカウント数を第2基準パルス数で割って得られた値を、基準パルス数がカウントされた期間の時間長が2基準周期分であることに基づいて2で割ることで、超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数(超過期間ΔTの時間長が1基準周期分の何倍であるか)を算出させている。
なお、基準パルス数として上述した第3基準パルス数(不図示)が選択されている場合、例えば、制御部12は、時間計算部17に、超過期間ΔTにおける高速クロックパルスCHのカウント数を第3基準パルス数で割ることで、超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数を算出させる。この場合も同様に、制御部12は、時間計算部17に、超過期間ΔTにおける高速クロックパルスCHのカウント数を第1基準パルス数で割ることで、超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数(超過期間ΔTの時間長が1基準周期分の何倍であるか)を算出させる。なお、超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数は、超過パルス数を構成する。
6 is a block diagram showing the 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 pulse CL generated in the overage period ΔT by dividing the count number of the high-speed clock pulse 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 pulse 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 count number of the high-speed clock pulse 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 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 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 the low-speed clock pulse 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 the high-speed clock pulse 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.
In addition, when the above-mentioned 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 pulse CL generated in the overage period ΔT by dividing the count number of the high-speed clock pulse CH in the overage period ΔT by the third reference pulse number. In this case, the control unit 12 also causes the time calculation unit 17 to calculate the number of pulses of the low-speed clock pulse 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 count number of the high-speed clock pulse CH in the overage period ΔT by the first reference pulse number. In addition, the number of pulses of the low-speed clock pulse CL generated in the overage period ΔT constitutes the number of excess pulses.

ステップST18の処理を行うと、制御部12は、時間計算部17に、超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数と、計測期間Tにおいて生成された低速クロックパルスCLのパルス数と、基準周期Tsと、に基づいて、対象期間Tmの時間長を算出させる(ステップST19)。例えば、制御部12は、時間計算部17に、計測期間Tにおいて生成された低速クロックパルスCLのパルス数から超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数を減算した値に、基準周期Tsを乗算することで、対象期間Tmの時間長を算出させる。
ステップST19の処理を行うと、制御部12は、時間計算部17に算出させた対象期間Tmの時間長を出力する(ステップST20)。
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 overage 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 overage 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).

このように、実施の形態1に係る時間計測装置100は、超過期間ΔTの時間長に応じて、時間長が異なる第1基準パルス数及び第2基準パルス数のいずれか一方を基準パルスとして選択し、この基準パルス数と、基準周期Tsの時間長と、低速クロックカウンタのカウント数と、超過期間ΔTにおける高速クロックカウンタのカウント数と、に基づいて対象期間Tmの時間長を算出するので、例えば、高速クロックパルスの周期が生成開始から時間の経過とともに変化する場合であっても、超過期間の時間長を高い精度で測定することが可能となり、対象期間Tmの時間長の計測精度を向上させることができる。 In this way, the time measurement device 100 according to the first embodiment selects as a reference pulse either one of the first and second reference pulse numbers, 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.

また、実施の形態1に係る時間計測装置100は、高速クロック生成部11Bが対象期間Tm内の第1時点から開始される第1基準期間P1と、対象期間Tm内の第2時点から開始される第2基準期間と、において、基準パルス数を計測するための高速クロックパルスCHを生成する。一般に、高速クロックパルスCHの周期は、装置の温度等の環境の条件に影響を受けて、計測毎に誤差が生じる場合があるが、このように対象期間Tmの計測を行う期間内に基準パルス数の計測を合わせて行うことにより、対象期間Tmの時間長を計測する際の環境の条件での基準パルス数を計測することができるので、対象期間Tmの時間長の計測精度を向上させることができる。また、対象期間Tmの開始前に基準パルス数の計測を行ってから対象期間Tmの時間長の算出を開始するよりも、全体の処理に必要な時間を短縮することができる。 In addition, in the time measurement device 100 according to the first embodiment, the high-speed clock generating unit 11B generates a high-speed clock pulse 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 in a second reference period that starts from a second point in the target period Tm. In general, the period of the high-speed clock pulse CH may be affected by environmental conditions such as the temperature of the device, and an error may occur for 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 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.

なお、実施の形態1において、制御部12は、時間計算部17に、基準パルス数と、超過期間ΔTにおける高速クロックパルスCHのカウント数と、基準周期Tsの時間長と、に基づいて、超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数を算出させているが、制御部は、少なくとも上記基準パルス数と、超過期間ΔTにおける高速クロックパルスCHのカウント数と、基準周期Tsの時間長と、に基づいて超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数を算出すればよく、上記数値に加えて、他の数値に基づいて超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数を算出させてもよい。 In the first embodiment, the control unit 12 causes the time calculation unit 17 to calculate the number of pulses of the low-speed clock pulse CL generated in the overage period ΔT based on the reference pulse number, the count number of the high-speed clock pulse CH in the overage period ΔT, and the time length of the reference period Ts. However, the control unit only needs to calculate the number of pulses of the low-speed clock pulse CL generated in the overage period ΔT based on at least the reference pulse number, the count number of the high-speed clock pulse CH in the overage period ΔT, and the time length of the reference period Ts, and may calculate the number of pulses of the low-speed clock pulse CL generated in the overage period ΔT based on other numerical values in addition to the above numerical values.

例えば、制御部は、時間計算部に、基準パルス数と、超過期間ΔTにおける高速クロックパルスCHのカウント数と、基準周期Tsの時間長と、計測終了時点t8よりも駆動パルスの半周期Td分の時間が経過した時刻、即ち計測終了時点t8となるストップパルスPstopが入力された時点以降、次にストップパルスPstopが入力されてから超過期間ΔTと同じ長さの時間が経過した時刻までの追加計測期間における高速クロックパルスCHのカウント数と、に基づいて、超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数を算出させてもよい。 For example, the control unit may cause the time calculation unit to calculate the number of pulses of the low-speed clock pulse CL generated in the overage period ΔT based on the reference pulse number, the count number of the high-speed clock pulse CH in the overage period ΔT, the time length of the reference period Ts, and the count number of the high-speed clock pulse CH in the 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 the next stop pulse Pstop is input and the same length of time as the overage period ΔT has elapsed.

具体的には、制御部は、時間計算部に、基準パルス数と、超過期間ΔTにおける高速クロックパルスCHのカウント数及び追加計測期間における高速クロックパルスCHのカウント数の平均値と、基準周期Tsの時間長と、に基づいて、超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数を算出させてもよい。これにより、1回の超過期間ΔTにおける高速クロックパルスCHのカウント数と、基準パルス数と、基準周期Tsと、に基づいて超過期間ΔTにおいて生成される低速クロックパルスCLのパルス数の算出を行う場合と比較して、超過期間ΔTに生成される高速クロックパルスCHのカウント数の精度を向上させることができるので、対象期間Tmの時間長の計測精度を向上させることができる。 Specifically, the control unit may cause the time calculation unit to calculate the number of pulses of the low-speed clock pulse 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 pulse CH in the overage period ΔT and the count number of the high-speed clock pulse 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 pulse CH generated in the overage period ΔT compared to the case where the number of pulses of the low-speed clock pulse CL generated in the overage period ΔT is calculated based on the count number of the high-speed clock pulse 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.

また、実施の形態1において、時間計測装置100は、基準パルス数と、基準パルス数がカウントされた期間の時間長と、基準周期の時間長と、低速クロックカウンタのカウント数と、超過期間における高速クロックカウンタのカウント数と、に基づいて、対象期間の時間長を算出するように構成されているが、これに限定されない。時間計測装置は、基準パルス数と、基準パルス数がカウントされた期間の時間長と、基準周期の時間長と、低速クロックカウンタのカウント数と、超過期間と同じ時間長の期間における高速クロックカウンタのカウント数と、に基づいて、対象期間の時間長を算出するように構成されていればよく、超過期間と同じ時間長の期間とは、超過期間そのものでもよいし、超過期間と同じ時間長となる超過期間とはことなる期間であってもよい。 In addition, 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.

次に、本発明に係る実施の形態2について図面を参照しながら詳細に説明する。
実施の形態2.
図7は、実施の形態2に係る制御部212が行う処理を示すフローチャートである。図8は、実施の形態2に係る時間計測装置200が時間計測を行う際に、超過期間ΔTの時間長が1基準周期分に近い場合のタイミングチャートである。図9は、実施の形態2に係る時間計測装置200が時間計測を行う際に、超過期間ΔTの時間長が2基準周期分に近い場合のタイミングチャートである。
実施の形態2は、実施の形態1に対し、基準パルス数の計測手順及び超過期間ΔTにおいて生成される低速クロックパルスCLのパルス数を算出する手順が異なるが、他の構成及び他の処理については同様であり、実施の形態1と同様の内容については同一符号を付して説明を省略する。
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 the control unit 212 according to the second embodiment. Fig. 8 is a timing chart showing a case where the length of the overage period ΔT is close to one reference period when the time measurement device 200 according to the second embodiment measures time. Fig. 9 is a timing chart showing a case where the length of the overage period ΔT is close to two reference periods when the 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.

実施の形態2に係る制御部212は、対象期間Tmの時間長の計測精度を向上させるため、基準パルス数の計測、及び超過期間ΔTにおいて生成される低速クロックパルスCLのパルス数の算出を行うに際し、駆動パルスの周期に合わせて複数回高速クロックパルスCHの生成を行う。 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 pulses of the low-speed clock pulses CL generated in the overrun period ΔT.

例えば、制御部212は、実施の形態1と同様、高速クロック生成部11Bに、第1時点t2から基準周期分の時間が経過する時刻t3までの第1基準期間P1、第2時点である時刻t6から2基準周期分の時間が経過する時刻t7までの第2基準期間P2において、高速クロックパルスCHを生成させるが、制御部212は、これに加えて、第1時点t2よりも駆動パルスの半周期分前、即ちストップパルスPstopの入力周期分前の時点から第1基準期間P1と同じ長さの時間が経過した時点t1までの第3基準期間P3、及び第2時点t6よりも駆動パルスの半周期分前の時点t4から第2基準期間P2と同じ長さの時間が経過した時点までの第4基準期間P4においても、高速クロックパルスCHを生成させる。
なお、実施の形態2において、第3基準期間P3の開始時点である、第1時点t2よりも駆動パルスの半周期分前の時点は、計測開始時点t0としている。
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 length equal 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 length equal 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.

また、実施の形態2においては、入力部10に対して、入力振動子に入力された振動の振幅が所定の閾値を超えた後、振幅が0になる毎に、ストップパルスPstopが入力される。即ち、実施の形態2においては、入力部10に対して、駆動パルスの半周期Tdと同じ入力周期でストップパルスPstopが複数回繰り返し入力される。なお、実施の形態2において、ストップパルスPstopは、計測終了時点を示す信号を含み、入力周期で複数回繰り返される第2信号を構成する。 In addition, 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. 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 with the input period.

制御部212は、実施の形態1と同様、高速クロック生成部11Bに、計測終了時点t8、即ちストップパルスPstopの入力があった時点から、計測終了時点t8以降に基準周期Tsと同期する超過時点t9までの超過期間ΔTにおいて高速クロックパルスCHを生成させるが、制御部212は、これに加えて、計測終了時点t8よりも駆動パルスの半周期Td分の時間が経過した時刻t10、即ち計測終了時点t8となるストップパルスPstopが入力された時点以降、次にストップパルスPstopが入力されてから超過期間ΔTと同じ長さの時間が経過した時刻t11までの追加計測期間ΔT1において、高速クロックパルスCHを生成させる。なお、実施の形態2において、追加計測期間ΔT1は、超過期間ΔTと同じ時間長の期間を構成する。 As in the first embodiment, the control unit 212 causes the high-speed clock generating unit 11B to generate a high-speed clock pulse CH in the overage period ΔT from the measurement end time t8, i.e., the time when the stop pulse Pstop is input, to the overage time t9 that is synchronized with the reference period Ts after the measurement end time t8. 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.

制御部212は、基準選択部15に、超過期間ΔTの時間長に応じて、第1基準期間P1において生成された高速クロックパルスCHのカウント数である第1基準パルス数及び第2基準期間P2において生成された高速クロックパルスCHのカウント数である第2基準パルス数のいずれか一方を基準パルス数として選択させて、基準選択部15に選択させた基準パルス数と、基準パルス数がカウントされた期間の時間長と、追加計測期間ΔT1における高速クロックカウンタのカウント数と、に基づいて、超過期間ΔTにおける低速クロックパルスCLのパルス数である超過パルス数を算出する。 The control unit 212 causes the reference selection unit 15 to select, as the reference pulse number, either the first reference pulse number, which is the count number of high-speed clock pulses CH generated in the first reference period P1, or the 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.

図7において、制御部212は、まず、入力部10に対してスタートパルスPstartの入力があったか否かを判定する(ステップST1)。
ステップST1の処理において、スタートパルスPstartの入力があった場合(ステップST1のYES)、制御部212は、時間長を算出する対象である対象期間Tmが開始されたと判定し、スタートパルスPstartが入力された時刻である計測開始時点t0において、低速クロック生成部11Aに低速クロックパルスCLの生成を開始させる(ステップST2)。また、制御部12は、イネーブル信号生成部14からイネーブル信号ENを出力させ、高速クロック生成部11Bに、第1基準期間P1において安定した周期で高速クロックパルスを生成可能とさせるための準備期間としての第3基準期間P3の開始時点である計測開始時点t0において、高速クロックパルスCHの生成を開始させる。
計測開始時点t0から1基準周期分の時間が経過した時刻t1に達すると、制御部212は、第3基準期間P3が終了したと判定し、高速クロック生成部11Bに高速クロックパルスCHの生成を終了させる。
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 the 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 the 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 the enable signal EN, and causes the high-speed clock generating unit 11B to start generating the 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 high-speed clock pulses at a stable cycle in the first reference period P1.
When the time reaches time t1, which is the time equivalent to one reference period from the 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.

ステップST2の処理を行うと、制御部212は、t0において高速クロックパルスCHの生成を開始してから、4基準周期分(基準周期Tsの4倍)の時間が経過したか否かを判定する(ステップST33)。この処理において、制御部212は、高速クロックパルスCHの生成を開始してから、第1基準期間P1において高速クロックパルスCHの生成を開始する時点である、駆動パルスの半周期Td分の時間が経過した時点t2に達したか否かを判定している。
ステップST33の処理において、t0において高速クロックパルスCHの生成を開始してから4基準周期分の時間が経過していない場合(ステップST33のNO)、制御部212は、以降の処理を待機する。
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 the time t2 has been reached, which is the time when the generation of the high-speed clock pulse CH is started in the first reference period P1 after the generation of the high-speed clock pulse CH has been started and the time equivalent to a half period Td of the drive pulse has elapsed.
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.

ステップST33の処理において、t0で高速クロックパルスCHの生成を開始してから4基準周期分の時間が経過している場合(ステップST33のYES)、高速クロック生成部11Bに第1基準パルス数を取得するための高速クロックパルスCHの生成を開始させる(ステップST34)。 In the processing of step ST33, if a time equivalent to four reference periods has elapsed since the generation of the high-speed clock pulse CH was started at t0 (YES in step ST33), the high-speed clock generating unit 11B is made to start generating the high-speed clock pulse CH to obtain the first reference pulse number (step ST34).

時点t2から1基準周期分の時間が経過した時刻t3に達すると、制御部212は、高速クロック生成部11Bに高速クロックパルスCHの生成を終了させて、時点t2から1基準周期分の時間、即ち基準周期Tsの1倍の時間が経過するまでの第1基準期間P1における高速クロックパルスCHのカウント数を、第1基準パルス数として記憶部16に記憶させる(ステップST36)。この処理において、制御部212は、超過期間の時間長が1基準周期分の時間長に近い場合の基準パルス数として、1基準周期分の時間長において生成される高速クロックパルスCHのパルス数である第1基準パルス数を記憶部16に記憶させている。 When time t3 is reached, which is the time equivalent to one reference period from time t2, the control unit 212 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 time t2 until the time equivalent to one reference period, i.e., one time equivalent to the reference period Ts, as the first reference pulse number in the memory unit 16 (step ST36). In this process, the control unit 212 stores the first reference pulse number, which is the number of pulses of the high-speed clock pulses CH generated in the time length of one reference period, in the memory 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.

ステップST36の処理を行うと、制御部12は、第1基準期間P1において高速クロックパルスCHの生成を開始してから所定期間が経過したか否かを判定する(ステップST37)。この処理において、所定期間とは、予め決められた基準周期Tsの整数倍の期間であって、例えば、この所定期間の後で高速クロックパルスCHの生成を開始した場合の高速クロックパルスCHの周期に、第1基準期間P1において高速クロックパルスCHを生成した影響が無いか、又は影響が無視できる程小さくなる期間である。
ステップST37の処理において、第1基準期間P1で高速クロックパルスCHの生成を開始してから所定期間が経過していない場合(ステップST37のNO)、制御部212は、以降の処理を待機する。
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.

ステップST37の処理において、第1基準期間P1で高速クロックパルスCHの生成を開始してから所定期間が経過した時刻t4に達している場合(ステップST37のYES)、制御部12は、イネーブル信号生成部14からイネーブル信号ENを出力させ、高速クロック生成部11Bに、第2基準期間P2において安定した周期で高速クロックパルスを生成可能とさせるための準備期間としての第4基準期間P4の開始時点である計測開始時点t4において、高速クロックパルスCHの生成を開始させる(ステップST38)。
計測開始時点t4から2基準周期分の時間が経過した時刻t5に達すると、制御部212は、第4基準期間P4が終了したと判定し、高速クロック生成部11Bに高速クロックパルスCHの生成を終了させる。
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 of the fourth reference period P4, which serves as a preparation period to enable the generation of high-speed clock pulses at a stable cycle in the second reference period P2 (step ST38).
When time t5 is reached, which is two reference periods after 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.

ステップST38の処理を行うと、制御部212は、t4において高速クロックパルスCHの生成を開始してから、4基準周期分の時間が経過したか否かを判定する(ステップST39)。この処理において、制御部212は、高速クロックパルスCHの生成を開始してから、第2基準期間P2において高速クロックパルスCHの生成を開始する時点である、駆動パルスの半周期Td分の時間が経過した時点t6に達したか否かを判定している。
ステップST39の処理において、t4において高速クロックパルスCHの生成を開始してから4基準周期分の時間が経過していない場合(ステップST39のNO)、制御部212は、以降の処理を待機する。
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 was 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 was started, which is the time when the generation of the high-speed clock pulse CH is started in the second reference period P2.
In the process of step ST39, if a time period equivalent to 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.

ステップST39の処理において、t4で高速クロックパルスCHの生成を開始してから4基準周期分の時間が経過している場合(ステップST39のYES)、高速クロック生成部11Bに第2基準パルス数を取得するための高速クロックパルスCHの生成を開始させる(ステップST41)。 In the processing of step ST39, if a time equivalent to four reference periods has elapsed since the generation of the high-speed clock pulse CH was started at t4 (YES in step ST39), the high-speed clock generating unit 11B is made to start generating the high-speed clock pulse CH to obtain the second reference pulse number (step ST41).

時点t6から2基準周期分の時間が経過した時刻t7に達すると、制御部212は、高速クロック生成部11Bに高速クロックパルスCHの生成を終了させて、時点t6から2基準周期分の時間、即ち基準周期Tsの2倍の時間が経過するまでの第2基準期間P2における高速クロックパルスCHのカウント数を、第2基準パルス数として記憶部16に記憶させる(ステップST42)。この処理において、制御部212は、超過期間の時間長が2基準周期分の時間長に近い場合の基準パルス数として、2基準周期分の時間長において生成される高速クロックパルスCHのパルス数である第2基準パルス数を記憶部16に記憶させている。 When time t7 is reached, which is two reference cycles after time t6, the control unit 212 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 second reference period P2 from time t6 until two reference cycles, i.e., twice the reference period Ts, has elapsed as the second reference pulse number in the memory unit 16 (step ST42). In this process, the control unit 212 stores the second reference pulse number, which is the number of pulses of the high-speed clock pulses CH generated in the time length of two reference cycles, in the memory unit 16 as the reference pulse number when the time length of the excess period is close to the time length of two reference cycles.

ステップST42の処理を行うと、制御部212は、1度目のストップパルスPstopの入力があったか否かを判定する(ステップST9)。
ステップST9の処理において、ストップパルスPstopの入力がない場合(ステップST9のNO)、制御部212は、対象期間Tmが未だ終了していないと判定し、以降の処理を待機する。
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.

ステップST9の処理において、1度目のストップパルスPstopの入力があった場合(ステップST9のYES)、制御部212は、時間長を算出する対象である対象期間Tmが終了したと判定し、ストップパルスPstopが入力された時刻である計測終了時点t8において、高速クロック生成部11Bに高速クロックパルスCHの生成を開始させる(ステップST44)。この処理において、制御部12は、超過期間ΔTにおいて生成される低速クロックパルスCLのパルス数を算出するための追加計測期間ΔT1において安定した周期で高速クロックパルスCHを生成させるため、計測終了時点t8から、計測終了時点t8以降に基準周期Tsと同期する超過時点t9までの超過期間ΔTにおいて、高速クロックパルスCHの生成を高速クロック生成部11Bに開始させている。 In the process of step ST9, if 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 was 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 overage period ΔT from the measurement end time t8 to the overage time t9 that is 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 during the additional measurement period ΔT1 for calculating the number of pulses of the low-speed clock pulses CL generated during the overage period ΔT.

ステップST44の処理を行うと、制御部212は、2度目のストップパルスPstopの入力があったか否かを判定する(ステップST46)。この処理において、制御部212は、計測終了時点t8において高速クロックパルスCHの生成を開始してから4基準周期分の時間が経過した時点である、追加計測期間ΔT1が開始される時点t10に達したか否かを判定している。
ステップST46の処理において、2度目のストップパルスPstopの入力がない場合(ステップST46のNO)、制御部212は、以降の処理を待機する。
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 at which 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.

ステップST46の処理において、1度目のストップパルスPstopの入力があった場合(ステップST46のYES)、制御部212は、追加計測期間ΔT1が開始されたと判定し、ストップパルスPstopが入力された時刻である計測終了時点t10において、高速クロック生成部11Bに高速クロックパルスCHの生成を開始させる(ステップST47)。この処理において、制御部12は、超過期間ΔTにおいて生成される低速クロックパルスCLのパルス数を算出するための追加計測期間ΔT1において高速クロックパルスCHの生成を高速クロック生成部11Bに開始させている。
追加計測期間ΔT1における高速クロックパルスCHの生成を開始した後、1基準周期分の時間が経過してから、最初に基準周期Tsと同期する時点t11に達すると、制御部212は、高速クロック生成部11に高速クロックパルスCHの生成を終了させる。言い換えると、追加計測期間ΔT1における高速クロックパルスCHの生成を開始してから、超過期間ΔTと同じ時間が経過すると、制御部212は、高速クロック生成部11に高速クロックパルスCHの生成を終了させる。
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 pulses of the low-speed clock pulses CL generated in the overage period ΔT.
After starting the 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 t11 is reached 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 the generation of the high-speed clock pulse CH. In other words, when the time equal to the excess period ΔT has elapsed since starting the 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 the generation of the high-speed clock pulse CH.

ステップST47の処理を行うと、制御部212は、基準選択部15に、計測終了時点t8から超過時点t9までの超過期間ΔTの時間長が、第1基準期間P1の時間長、即ち1基準周期分の時間長に近いか否かを判定させる(ステップST12)。
ステップST12の処理において、超過期間ΔTの時間長が第1基準期間P1の時間長に近い場合(ステップST12のYES)、制御部12は、基準選択部15に、第1基準パルス数、第2基準パルス数及び第3基準パルス数のうちから第1基準パルス数を基準パルス数として選択させる(ステップST13)。
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 time t8 to the excess time t9 is close to the length of the first reference period P1, i.e., the length of one reference cycle (step ST12).
In the processing of step ST12, if the length of the excess period ΔT is close to the 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 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 ST13).

ステップST12の処理において、超過期間ΔTの時間長が第1基準期間P1の時間長に近くない場合(ステップST12のNO)、制御部212は、基準選択部15に、第1基準パルス数及び第2基準パルス数のうちから第2基準パルス数を基準パルス数として選択させる(ステップST51)。この処理において、制御部12は、超過期間ΔTの時間長が第2基準期間P2の時間長に近いことに基づいて、基準選択部15に基準パルス数として第2基準パルス数を選択させている。 In the process of step ST12, if the length of the excess period ΔT is not close to the 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 length of the excess period ΔT is close to the length of the second reference period P2.

ステップST13又はステップST51の処理を行うと、制御部212は、時間計算部17に、基準パルス数と、基準パルス数がカウントされた期間の時間長と、追加計測期間ΔT1における高速クロックパルスCHのカウント数と、に基づいて、超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数を算出させる(ステップST52)。 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 pulses of the 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 the high-speed clock pulses CH in the additional measurement period ΔT1 (step ST52).

例えば、制御部212は、時間計算部17に、追加計測期間ΔT1における高速クロックパルスCHのカウント数を第1基準パルス数で割ることで、超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数を算出させる。この処理において、制御部12は、時間計算部17に、超過期間ΔTと同じ時間長の期間である追加計測期間ΔT1における高速クロックパルスCHのカウント数を第1基準パルス数で割ることで、超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数を算出させている。
基準パルス数として第2基準パルス数が選択されている場合、例えば、制御部212は、時間計算部17に、追加計測期間ΔT1における高速クロックパルスCHのカウント数を第2基準パルス数で割り、得られた値を2で割ることで、超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数を算出させる。この処理において、制御部212は、時間計算部17に、超過期間ΔTと同じ時間長の期間である追加計測期間ΔT1における高速クロックパルスCHのカウント数を第2基準パルス数で割って得られた値を、基準パルス数がカウントされた期間の時間長が2基準周期分であることに基づいて2で割ることで、超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数を算出させている。
ステップST52の処理を行うと、制御部212は、時間計算部17に、超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数と、計測期間Tにおいて生成された低速クロックパルスCLのパルス数と、基準周期Tsと、に基づいて、対象期間Tmの時間長を算出させる。(ステップST53)
For example, the control unit 212 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 count number of the 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 the low-speed clock pulses CL generated in the overage period ΔT by dividing the count number of the high-speed clock pulses CH in the additional measurement period ΔT1, which is a period of the same time length as 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 212 causes the time calculation unit 17 to calculate the number of pulses of low-speed clock pulses CL generated in the overage period ΔT by dividing the count number of high-speed clock pulses 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 low-speed clock pulses CL generated in the overage period ΔT by dividing the value obtained 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 overage 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 in the overage 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 ST53).

第1基準期間P1、第2基準期間P2及び追加計測期間ΔT1において生成された高速クロックパルスCHは、これらの直前の期間である第3基準期間P3、第4基準期間P4及び超過期間ΔTにおいて生成された高速クロックパルスCHよりも、周期が安定している。このため、実施の形態2に係る時間計測装置200は、実施の形態1で生成した、基準パルス数及び超過期間ΔTにおける高速クロックパルスCHのカウント数よりも、周期が安定している状態の高速クロックパルスCHのカウント数に基づいて超過期間ΔTにおいて生成される低速クロックパルスCLのパルス数の算出を行うことができるので、対象期間Tmの時間長の計測精度を向上させることができる。 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 a more stable period than the high-speed clock pulses CH generated in the immediately preceding periods, the third reference period P3, the fourth reference period P4, and the overage period ΔT. 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.

なお、実施の形態2において、制御部212は、基準選択部15に、超過期間ΔTの時間長によらず、第1基準パルス数及び第2基準パルス数のいずれか一方を基準パルス数として選択させるように構成されているが、これに限定されない。制御部は、基準選択部に、超過期間ΔTの時間長に応じて、第1基準パルス数及び第2基準パルス数のいずれか一方を基準パルス数として選択させるように構成されていればよく、例えば、実施の形態1と同様に、制御部は、基準選択部に、超過期間ΔTの時間長が所定の範囲にある場合に、第1基準パルス数及び第2基準パルス数のいずれか一方を基準パルス数として選択させるように構成されていてもよい。 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. 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.

次に、本発明に係る実施の形態3について図面を参照しながら詳細に説明する。
実施の形態3.
図10は、実施の形態3に係る時間計測装置が時間計測を行う際に、超過期間ΔTの時間長が1基準周期分に近い場合のタイミングチャートである。図11は、実施の形態3に係る時間計測装置が時間計測を行う際に、超過期間ΔTの時間長が2基準周期分に近い場合のタイミングチャートである。
実施の形態3は、実施の形態2に対し、基準パルス数の計測手順及び超過期間ΔTにおいて生成される低速クロックパルスCLのパルス数を算出する手順が異なるが、他の構成及び他の処理については同様であり、実施の形態1と同様の内容については同一符号を付して説明を省略する。
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 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.

実施の形態3に係る時間計測装置300の制御部312は、計測終了時点t8以降に、超過期間ΔTと同じ時間長の複数の期間において生成した高速クロックパルスCHのカウント数の平均値を算出し、当該平均値と、基準パルス数と、基準周期Tsと、に基づいて、超過期間ΔTにおける低速クロックパルスCLのパルス数を算出する。これにより、実施の形態1及び実施の形態2のように、1回の超過期間ΔT又は1回の追加計測期間ΔT1における高速クロックパルスCHのカウント数と、基準パルス数と、基準周期Tsと、に基づいて超過期間ΔTにおいて生成される低速クロックパルスCLのパルス数の算出を行う場合と比較して、超過期間ΔTに生成される高速クロックパルスCHのカウント数の精度を向上させることができるので、対象期間Tmの時間長の計測精度を向上させることができる。 The control unit 312 of the time measurement device 300 according to the third embodiment calculates the average value of the count number of the high-speed clock pulse CH generated in a plurality of periods having the same time length as the overage period ΔT after the measurement end time t8, and calculates the pulse number of the low-speed clock pulse CL in the overage 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 the high-speed clock pulse CH generated in the overage period ΔT compared to the case of calculating the pulse number of the low-speed clock pulse CL generated in the overage period ΔT based on the count number of the high-speed clock pulse CH in one overage period ΔT or one additional measurement period ΔT1, the reference pulse number, and the reference period Ts as in the first and second embodiments, thereby improving the measurement accuracy of the time length of the target period Tm.

以上説明したいずれの実施の形態においても、対象期間Tmを算出する際の計算手順としては様々な手順が考えられ、上述した計算手順には、数学的に等価な手順を含むものとする。例えば、上述した実施の形態において、時間計測装置100は、対象期間Tmを算出する際、計測期間Tにおいて生成された低速クロックパルスCLのパルス数から超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数を減算した値に、基準周期Tsを乗算することで、対象期間Tmの時間長を算出しているが、計測期間Tにおいて生成された低速クロックパルスCLのパルス数に基準周期Tsを乗算して得られた計測期間Tの時間長から、超過期間ΔTにおいて生成された低速クロックパルスCLのパルス数に基準周期Tsを乗算して得られた超過期間ΔTの時間長を減算して、対象期間Tmの時間長を算出してもよい。 In any of the above-described embodiments, various calculation procedures can be considered 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 pulse CL generated in the overage period ΔT from the number of pulses of the low-speed clock pulse CL generated in the measurement period T by the reference period Ts, but the length of the target period Tm may be calculated by subtracting the length of the overage period ΔT obtained by multiplying the number of pulses of the low-speed clock pulse CL generated in the overage 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 pulse CL generated in the measurement period T by the reference period Ts.

11A 低速クロック生成部
11B 高速クロック生成部
13A 低速クロックカウンタ
13B 高速クロックカウンタ
15 基準選択部
17 時間計算部
100,200,300 時間計測装置
P1 第1基準期間
P2 第2基準期間
P3 第3基準期間
P4 第4基準期間
t0 計測開始時点(第1時点)
t4 第2時点
t8 計測終了時点
Ts 基準周期
Tm 対象期間
ΔT 超過期間
ΔT1 追加計測期間
11A Low-speed clock generating unit 11B High-speed clock generating unit 13A Low-speed clock counter 13B High-speed clock counter 15 Reference selecting unit 17 Time calculating unit 100, 200, 300 Time measuring device P1 First reference period P2 Second reference period P3 Third reference period P4 Fourth reference period t0 Measurement start time point (first time point)
t4 Second time point t8 Measurement end time point Ts Reference period Tm Target period ΔT Excess period ΔT1 Additional measurement period

Claims (7)

計測開始時点から計測終了時点までの対象期間の時間長を計測する時間計測装置であって、
基準周期で低速クロックパルスを生成する低速クロック生成部と、
前記低速クロックパルスよりも周期が短い高速クロックパルスを、第1時点から前記基準周期の第1数倍の時間が経過するまでの第1基準期間、第2時点から前記基準周期の前記第1数とは異なる第2数倍の時間が経過するまでの第2基準期間、及び前記計測終了時点から前記計測終了時点以降に前記基準周期と同期する超過時点までの超過期間と同じ時間長の期間において生成する高速クロック生成部と、
前記低速クロック生成部が生成した低速クロックパルスのパルス数を、前記計測開始時点から前記超過時点までの期間においてカウントする低速クロックカウンタと、
前記高速クロック生成部が生成した高速クロックパルスのパルス数を、前記第1基準期間、前記第2基準期間、及び前記超過期間と同じ時間長の期間においてカウントする高速クロックカウンタと、
前記第1基準期間においてカウントされた高速クロックパルスのパルス数である第1基準パルス数と、前記第2基準期間においてカウントされた高速クロックパルスのパルス数である第2基準パルス数と、を取得し、前記超過期間の時間長に応じて、前記第1基準パルス数及び前記第2基準パルス数のいずれか一方を基準パルス数として選択する基準選択部と、
前記基準パルス数と、前記基準パルス数がカウントされた期間の時間長と、前記基準周期の時間長と、前記低速クロックカウンタのカウント数と、前記超過期間と同じ時間長の期間における前記高速クロックカウンタのカウント数と、に基づいて、前記対象期間の時間長を算出する時間計算部と、を備える
ことを特徴とする時間計測装置。
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 a time length of the excess period;
and a time calculation unit that calculates the length of the target period based on the reference pulse number, the length of the period during which the reference pulse number is counted, the 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 a period of the same length as the overrun period.
前記基準選択部は、前記第1基準期間及び前記第2基準期間のうち、時間長が前記超過期間に近い方を前記基準パルス数として選択する
ことを特徴とする請求項1記載の時間計測装置。
2. The time measurement device according to claim 1, wherein the reference selection section selects, as the reference pulse number, one of the first reference period and the second reference period, the one whose time length is closer to the overtime period.
前記時間計算部は、前記基準パルス数と、前記基準パルス数がカウントされた期間の時間長と、前記基準周期の時間長と、前記超過期間と同じ時間長の期間における前記高速クロックカウンタのカウント数と、に基づいて、前記超過期間において前記低速クロック生成部が生成可能な低速クロックパルスの超過パルス数を算出し、前記超過パルス数と、前記基準周期の時間長と、前記低速クロックカウンタのカウント数と、に基づいて、前記対象期間の時間長を算出する
ことを特徴とする請求項1又は2記載の時間計測装置。
3. The time measurement device according to claim 1, wherein the time calculation unit calculates the number of excess pulses of low-speed clock pulses that can be generated by the low-speed clock generating unit during the overrun 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 during a period of the same time length as the overrun 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.
前記高速クロック生成部は、前記対象期間内の前記第1時点から開始される前記第1基準期間と、前記対象期間内の前記第2時点から開始される前記第2基準期間と、において高速クロックパルスを生成する
ことを特徴とする請求項1乃至3のいずれか1項記載の時間計測装置。
4. The time measurement device according to claim 1, wherein the high-speed clock generating unit generates a high-speed clock pulse in the first reference period starting from the first time point within the target period and in the second reference period starting from the second time point within the target period.
計測開始時点を示す第1信号と、計測終了時点を示す信号を含み、入力周期で複数回繰り返される第2信号と、が入力される入力部を備え、
前記高速クロック生成部は、前記計測終了時点よりも前記入力周期が経過した時点から、前記超過期間と同じ長さの時間が経過した時点までの追加計測期間において前記高速クロックパルスを生成し、
前記高速クロックカウンタは、前記追加計測期間において前記高速クロック生成部が生成した高速クロックパルスのパルス数をカウントし、
前記時間計算部は、前記基準パルス数と、前記基準パルス数がカウントされた期間の時間長と、前記超過期間における前記高速クロックカウンタのカウント数と、前記基準周期の時間長と、前記低速クロックカウンタのカウント数と、に基づいて、前記対象期間の時間長を算出する
ことを特徴とする請求項1乃至4のいずれか1項記載の時間計測装置。
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 measurement device according to any one of claims 1 to 4, characterized in that the time calculation unit calculates the length of the target period based on the reference pulse number, the length of the period during which the reference pulse number was counted, the count number of the high-speed clock counter during the excess period, the length of the reference period, and the count number of the low-speed clock counter.
前記高速クロック生成部は、前記第1時点よりも前記入力周期分前の時点から前記第1基準期間と同じ長さの時間が経過した時点までの第3基準期間、及び前記第2時点よりも前記入力周期分前の時点から前記第2基準期間と同じ長さの時間が経過した時点までの第4基準期間において生成する、
ことを特徴とする請求項5記載の時間計測装置。
the high-speed clock generating unit generates the 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.
計測開始時点から計測終了時点までの対象期間の時間長を計測する時間計測方法であって、
低速クロック生成部が、基準周期で低速クロックパルスを生成するステップと、
高速クロック生成部が、前記低速クロックパルスよりも周期が短い高速クロックパルスを、第1時点から前記基準周期の第1数倍の時間が経過するまでの第1基準期間、第2時点から前記基準周期の前記第1数とは異なる第2数倍の時間が経過するまでの第2基準期間、及び前記計測終了時点から前記計測終了時点以降に前記基準周期と同期する超過時点までの超過期間と同じ時間長の期間において生成するステップと、
低速クロックカウンタが、前記低速クロック生成部が生成した低速クロックパルスのパルス数を、前記計測開始時点から前記超過時点までの期間においてカウントするステップと、
高速クロックカウンタが、前記高速クロック生成部が生成した高速クロックパルスのパルス数を、前記第1基準期間、前記第2基準期間、及び前記超過期間と同じ時間長の期間においてカウントするステップと、
基準選択部が、前記第1基準期間においてカウントされた高速クロックパルスのパルス数である第1基準パルス数と、前記第2基準期間においてカウントされた高速クロックパルスのパルス数である第2基準パルス数と、を取得し、前記超過期間の時間長に応じて、前記第1基準パルス数及び前記第2基準パルス数のいずれか一方を基準パルス数として選択するステップと、
時間計算部が、前記基準パルス数と、前記基準パルス数がカウントされた期間の時間長と、前記基準周期の時間長と、前記低速クロックカウンタのカウント数と、前記超過期間と同じ時間長の期間における前記高速クロックカウンタのカウント数と、に基づいて、前記対象期間の時間長を算出するステップと、を備えた
ことを特徴とする時間計測方法。
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 has elapsed, the second multiple being different from the first multiple, 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 step of a time calculation unit calculating 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 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 a period of the same time length as the overrun period.
JP2021108334A 2021-06-30 2021-06-30 Time measuring device and time measuring method Active JP7565882B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2021108334A JP7565882B2 (en) 2021-06-30 2021-06-30 Time measuring device and time measuring method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2021108334A JP7565882B2 (en) 2021-06-30 2021-06-30 Time measuring device and time measuring method

Publications (2)

Publication Number Publication Date
JP2023005988A JP2023005988A (en) 2023-01-18
JP7565882B2 true JP7565882B2 (en) 2024-10-11

Family

ID=85107304

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2021108334A Active JP7565882B2 (en) 2021-06-30 2021-06-30 Time measuring device and time measuring method

Country Status (1)

Country Link
JP (1) JP7565882B2 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001013179A (en) 1999-06-29 2001-01-19 Mitsubishi Electric Corp Ring oscillator clock frequency measuring method, ring oscillator clock frequency measuring circuit, and microcomputer
JP2012242352A (en) 2011-05-24 2012-12-10 Renesas Electronics Corp Pulse interval measurement circuit and semiconductor integrated circuit device
JP2017137151A (en) 2016-02-01 2017-08-10 株式会社日立製作所 Non-contact power feeding device and elevator
JP2020204472A (en) 2019-06-14 2020-12-24 アズビル株式会社 Time measuring device and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001013179A (en) 1999-06-29 2001-01-19 Mitsubishi Electric Corp Ring oscillator clock frequency measuring method, ring oscillator clock frequency measuring circuit, and microcomputer
JP2012242352A (en) 2011-05-24 2012-12-10 Renesas Electronics Corp Pulse interval measurement circuit and semiconductor integrated circuit device
JP2017137151A (en) 2016-02-01 2017-08-10 株式会社日立製作所 Non-contact power feeding device and elevator
JP2020204472A (en) 2019-06-14 2020-12-24 アズビル株式会社 Time measuring device and method

Also Published As

Publication number Publication date
JP2023005988A (en) 2023-01-18

Similar Documents

Publication Publication Date Title
TW201237378A (en) Semiconductor temperature sensors
US20070296396A1 (en) Phase Difference Measurement Circuit
JP3432210B2 (en) Flow measurement device
JP2019049423A (en) Ultrasonic flowmeter
TW201027101A (en) Measurement apparatus for improving performance of standard cell library
JP2008541619A5 (en)
JP7565882B2 (en) Time measuring device and time measuring method
JP2002196087A (en) Circuit for measuring time
TWI390225B (en) Phase detecting apparatus, test apparatus and adjusting method
KR20190063492A (en) Time-to-digital converter supporting run-time calibration
JP5787096B2 (en) Physical quantity measuring device, physical quantity measuring method
JP4955196B2 (en) AC signal measuring device
JP3651124B2 (en) Ultrasonic measuring device and flow measuring device including the same
JP5294718B2 (en) Frequency converter
JP7211902B2 (en) Time measuring device and method
JP2009216617A (en) Sampling clock generation circuit and alternating current signal measuring device
JP5152479B2 (en) Flow meter input signal generator and flow meter system
JP2019124478A (en) Time measuring circuit
JP5549833B2 (en) Ultrasonic flow meter and flow measurement method
JP3864583B2 (en) Variable delay circuit
JP2008014801A (en) Ultrasonic flow meter
JP2009282047A (en) Phase difference detection circuit and inclination angle measurement device
JP5055721B2 (en) Vibration sensor type differential pressure / pressure transmitter
JP2008203112A (en) Ultrasonic anemometer
JPH06347550A (en) Time measuring instrument

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20240304

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20240828

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20240903

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20241001

R150 Certificate of patent or registration of utility model

Ref document number: 7565882

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150