JP4126117B2 - Flowmeter - Google Patents

Flowmeter Download PDF

Info

Publication number
JP4126117B2
JP4126117B2 JP25980798A JP25980798A JP4126117B2 JP 4126117 B2 JP4126117 B2 JP 4126117B2 JP 25980798 A JP25980798 A JP 25980798A JP 25980798 A JP25980798 A JP 25980798A JP 4126117 B2 JP4126117 B2 JP 4126117B2
Authority
JP
Japan
Prior art keywords
signal
flow rate
output
unit
frequency
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.)
Expired - Fee Related
Application number
JP25980798A
Other languages
Japanese (ja)
Other versions
JP2000088899A (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.)
Saginomiya Seisakusho Inc
Original Assignee
Saginomiya Seisakusho Inc
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 Saginomiya Seisakusho Inc filed Critical Saginomiya Seisakusho Inc
Priority to JP25980798A priority Critical patent/JP4126117B2/en
Priority to US09/787,134 priority patent/US6611785B1/en
Priority to PCT/JP1999/004979 priority patent/WO2004074856A1/en
Publication of JP2000088899A publication Critical patent/JP2000088899A/en
Application granted granted Critical
Publication of JP4126117B2 publication Critical patent/JP4126117B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Measuring Frequencies, Analyzing Spectra (AREA)

Description

【0001】
【発明の属する技術分野】
この発明は、センサからの流量に対応する周波数を有するパルス信号により流体の流量を測定する流量計、及び、測定した流量と予め設定された設定流量値とを比較し、該比較結果に対応するディジタル出力を外部装置に出力する流量に関する。
【0002】
【従来の技術】
被測定物理量を検出してパルス信号を発するセンサからの信号を測定する装置として、周波数計、回転数計、パルスカウンタ等が知られている。
例えば、静電容量式圧力センサは発振器を構成し、圧力に対応する周波数の信号を発生する。そこで、この圧力センサからの信号の周波数を測定することにより圧力を測定することができる。また、羽根車式流量センサにおいては、着磁された羽根車が流れによって回転し、固定されたホール素子がその磁気を検出して流量に対応する周波数を有するパルス信号を出力する。このパルス信号の周波数を測定することにより流量を測定することができる。
【0003】
このような物理量測定装置の一つとしてカルマン渦式流量センサがある。このカルマン渦式流量センサは、流路の中に設けられた柱状の渦発生体の両側から交互に発生するカルマン渦列の周波数を超音波センサや圧電素子センサにより検出して、気体や液体など流体の流量を測定するものである。
流路の口径と流量センサの配管部の材質とにより、流量測定範囲と前記流量に対応するカルマン渦の発生周波数は決定される。ここで、周波数値をfとすると、瞬時流量値Qは次の一次式(1)により求められる。
Q=a×f+b ……(1)
また、上の式(1)は精度確保が困難であるため、流量測定範囲を複数nの区間に分割し、下の式(2)に示すように、各々の区間i(i=1〜n)毎の一次式を定めることによりフルスケール精度±1%程度を確保することが行なわれている(特開昭60−238720号公報)。
Q=ai×f+bi ……(2)
さらに精度を向上させる場合は、1台毎に前記ai値、bi値を決定し、個別に決定された値Ai、BiをRAMまたはEEPROMに格納しておき、次の式(3)によってフルスケール精度±0.5%を確保することも提案されている(特願平9−345742号)。
Q=Ai×f+Bi ……(3)
ここで、Ai,Bi(i=1〜n)は、各機器1台毎に決定される補正された係数である。
【0004】
また、上記周波数値fについても、その測定精度が問題となる。一般に、パルス信号の周波数を測定する場合には、所定期間(ゲートタイム)内に入力されるパルスの数を計数すること、あるいは、入力パルスの周期を測定し、その逆数から当該周波数を算出することが行われている。しかしながら、流量測定においては、上の式からも明らかなように、大流量時には発生するパルスの周波数は高く(周期は短く)なり、小流量時には低く(周期は長く)なる。したがって、大流量時および小流量時のいずれにおいても、所定の測定精度を得ることが求められる。
【0005】
そこで、一定時間のタイマ、クロック発生器、クロック計数用カウンタ、クロックによる計数動作を制御するカウンタ制御手段、パルス信号の検出と計数と所定の演算制御を行なう処理手段とを備える周波数測定装置が提案されている(特開平5−297036号公報)。
この周波数測定装置によれば、前記タイマに測定下限周波数の周期の2倍以上の時間を設定して、パルス信号の検出と計数とを開始する。そして、パルス信号を検出したときは、前記クロック計数用カウンタが前記クロック発生器からのクロックの計数を開始するように前記カウンタ制御手段を制御し、パルス信号を検出するごとにクロック計数用カウンタの計数値を確認する。そして、前記計数値が所定値に達しないときは、検出と計数とを継続する。一方、前記計数値が所定値に達したときは、前記検出と計数とを停止し、前記カウンタ制御手段を制御して前記クロック計数用カウンタの計数値から周波数測定値を演算により算出する。また、前記タイマの計時終了時に、クロックの計数が終了していないときはパルス信号の検出と計数とを停止し、さらに前記カウンタ制御手段を制御してクロック計数用カウンタによる計数を終了する。
これにより、パルス信号のN回分の周期をクロック計数用カウンタで計数し、計数値が所望の分解能を確保するまで周期の積算を続けることにより、パルス信号の周波数値によらずに一定値以上の測定分解能を得るようにしている。
【0006】
また、大流量時における平均周期の算出精度を高め、且つ小流量時における応答性をも向上させることを目的とするカルマン渦式空気流量センサ出力パルスの平均周期算出装置も提案されている(特公平5−70086号公報)。
この平均周期算出装置は、パルス数計数手段、パルス周期計測手段、計測周期と第1の所定時間とを比較するパルス周期比較手段と、前回の平均算出終了時から前記パルス数計数手段で第1の所定値に相当するパルス数が計数されたとき、前記パルス周期比較手段から大なる比較結果が第2の所定値に相当する回数だけ出力されたとき、および、前記パルス周期比較手段から小なる比較結果に続いて大なる比較結果が出力される状態が第3の所定値に相当する回数だけ現れたときの各条件のいずれかが成立するごとにパルス信号の周期の平均を算出する平均周期算出手段とを備えたものである。さらに、前記第2の所定値と前記パルス周期比較手段との比較結果により平均周期を算出する第2の平均周期算出手段、あるいは、前記計測周期と第2の所定時間とを比較する第2のパルス周期比較手段および前記第2のパルス周期比較手段の出力により平均周期を算出する第2の平均周期算出手段をさらに備えたものである。
これらの構成により、小流量時、中流量時、大流量時に亘って、センサから入力されるパルス信号の平均周期を速やかに算出することができる。
【0007】
他方、このような流量センサ(流量計)において、流量発信器あるいは流量伝送器として測定した流量を所定の信号形態に変換して外部の装置に信号を出力することも行なわれている。一般に、このような流量発信器においては、測定値に対応する8ビットのディジタルデータを前記所定の信号形態に変換して送信することが行われている。
また、このような流量計において、測定した流量(瞬時流量)を積算して積算流量を算出し、表示部において瞬時流量だけではなく積算流量も表示するようにしたものも知られている。
【0008】
さらに、このような流量計の応用例として、流路を流れる流体の流量と予め設定された基準流量値(設定流量値)とを比較し、この比較結果によって外部機器を制御する信号を出力する流量検出スイッチが提案されている(特開平9−89613号公報)。
この提案されている流量検出スイッチにおいては、カルマン渦の発生周期に対応する周波数を有するパルス信号の周期を計測し、該計測した周期に基づいてテーブル参照により当該流量値を求めるようにしている。また、測定精度を向上するために、複数のパルスの周期を測定して平均化するようにしている。そして、予め設定されたしきい値と前記測定した流量とを比較し、この比較結果をLEDにより表示するとともに、コレクタが出力端子に接続されたトランジスタのベースに印加し、該出力端子に接続された負荷への電源供給などを制御するようにしている。
【0009】
【発明が解決しようとする課題】
一般に、入力パルスの数を計数する周波数測定の方法では、ゲートタイムの値が何であれ、低い周波数の入力のときの測定の分解能が粗く精度が得られないという問題点がある。例えば、上述のようにゲートタイムを1秒間とすれば、200Hz以上の周波数でないと±0.5%の精度を得ることができない。
また、周期測定による場合には、周期の長さ、あるいは、計測用基準クロックの値が何であれ、高い周波数の入力のときの測定の分解能が粗く、精度が得られないという問題点がある。例えば、カウント数として200以上が必要となる。
【0010】
また、前述した周波数測定装置においては、測定下限周波数の周期の2倍以上の時間が設定されたタイマを用いているために、測定下限周波数付近の周波数を測定する場合には、その周期の2倍以上の測定時間を必要としている。また、タイマの計時時間の終了前に、パルス信号のN回分の周期をクロック計数用カウンタで計数し、前記計数値が所定値に達したときは、検出と計数とを停止し、前記計数値から周波数測定値を演算するようにしている。この場合、タイマの設定時間内をすべて測定していないため、入力されるパルス信号の真の周波数測定を行なっていることにはならないという問題点があった。
【0011】
また、前述した平均周期算出装置によれば、4〜5つのパラメータの設定により、小流量時、中流量時および大流量時にわたってセンサから入力されるパルス信号の平均周期を速やかに算出することができるが、パルス数計数手段、パルス周期計測手段、第1および第2のパルス周期比較手段、第1および第2の平均周期算出手段を用いているため、複雑な構成となってしまう。また、これらの各手段による処理をマイクロコンピュータなどにより実行させる場合には、プログラムに膨大なメモリを必要とし、また、処理に要する時間も長くなり、平均周期算出処理に占有する割合が多く、他の処理を実行する余裕がなくなってしまうという問題点があった。
【0012】
さらに、上述したように、流量発信器においては測定値に対応する8ビットのディジタルデータを前記所定の信号形態に変換して送信することが行われている。この場合、ディジタルの量子化誤差が±1ディジット生じるので誤差は約±0.4%となり、高精度の検出を行ない良質の信号を外部の装置に送出しようとする場合には、誤差の伝搬を防ぐために8ビットよりもビット数の多いディジタルデータを用いる必要があることを示している。
【0013】
さらにまた、従来の積算流量値を表示する機能を有する流量計においては、固定小数点方式で積算流量を表示しているに過ぎず、長期間に亘る積算流量値を知るためには、はなはだ不便であるという問題点があった。
さらにまた、上述のように、カルマン渦式流量センサにおいては、流量測定範囲とカルマン渦の発生周波数は、流路の口径と流量センサの配管部の材質とにより決定されるものであり、単一種類の流量計を、それが挿入される配管部に容易に対応させることが求められている。
【0014】
さらにまた、前述した流量検出スイッチにおいては、カルマン渦の発生周期を測定しているため、周波数が高い場合は周期が短くなってしまい、測定分解能が得られず、測定精度が悪くなってしまうという問題点があった。また、周期の逆数より得られた周波数からデータテーブルを参照して流量を決定しているため、1つの周波数に対して1つの流量データを定義することとなり、膨大な容量のメモリを必要とし、多種類の口径のデータテーブルや制御プログラムを1つのマイコンに収容することができず、何種類ものマイコンを準備しなければならないという問題点があった。
さらに、流量検出スイッチは、その用途に応じて、高速なスイッチ出力が必要とされる場合がある。例えば、溶接ガンや放電加工機などにおいて、前記流量検出スイッチを冷却水の流路に配設し、該冷却水の流量の異常によりチップ抜けなどの異常を検出するような場合には、機器の焼損を防止するために、高速なスイッチ出力が要求される。
【0015】
そこで本発明は、簡単な構成で、高速かつ高精度の測定を行なうことができる流量計を提供することを目的としている。
また、処理が簡単、操作も簡単で、低価格の流量計を提供することを目的としている。
さらに、積算流量値の実質的な表示桁数を多くすることにより実用性に優れた流量計を提供することを目的としている。
さらにまた、キー操作部の操作により容易に流路の特性を選択することのできる流量計を提供することと目的としている。
さらにまた、瞬時流量を検出し、設定値と比較してスイッチ(離れた場所に設置された外部の制御装置に対して出力信号を送出する)として使用する際、設定値の確認変更を容易に行なうことができ、設定ミス、操作ミスが無く操作者にとって使い勝手のよい流量を提供することを目的としている。
さらにまた、流体の流れに異変が生じたとき、高速にスイッチ出力を作動させることのできる流量計を提供することを目的としている。
さらにまた、伝送信号を出力するタイミングを所定のタイミングで送出することのできる流量計を提供することを目的としている。
さらにまた、外部の装置に対して良質の伝送信号を発信することのできる流量計を提供することを目的としている。
【0018】
【課題を解決するための手段】
上記目的を達成するために、本発明の流量計は、被測定流量に対応する周波数を有するパルス信号を出力するセンサ部と、第1の周期を有する第1の信号を発生する第1の信号発生部と、前記第1の信号に応じて、前記第1の周期の期間に前記センサ部から出力されるパルスの数を計数する第1の測定部と、前記第1の信号をその周期中に含むパルスにおける前記第1の信号の位置を測定する第2の測定部と、前記第1の測定部による計数値と前記第2の測定部による測定結果とに基づいて、前記第1の周期毎に前記パルス信号の周波数を算出する第1の演算部と、該算出されたパルス信号の周波数に基づいて瞬時流量を算出する第2の演算部とを有する流量計であって、前記第1の信号と同期し、かつ、前記第1の周期を測定下限周波数で除算した第2の周期を有する第2の信号を発生する第2の信号発生部と、前記パルス信号中のパルスの周期が、商用交流電源周波数に対応する周期と等しい状態が所定回数連続したときは、当該測定結果を無効とする手段とを有し、前記第2の信号発生部の出力に基づいて前記各演算部の演算動作のタイミングが制御されるようになされているものである。
【0019】
また、本発明の他の流量計は、被測定流量に対応する周波数を有するパルス信号を出力するセンサ部と、第1の周期を有する第1の信号を発生する第1の信号発生部と、前記第1の信号に応じて、前記第1の周期の期間に前記センサ部から出力されるパルスの数を計数する第1の測定部と、前記第1の信号をその周期中に含むパルスにおける前記第1の信号の位置を測定する第2の測定部と、前記第1の測定部による計数値と前記第2の測定部による測定結果とに基づいて、前記第1の周期毎に前記パルス信号の周波数を算出する第1の演算部と、該算出されたパルス信号の周波数に基づいて瞬時流量を算出する第2の演算部とを有する流量計であって、予め設定された設定流量値と前記第2の演算部により算出された瞬時流量値とを比較する比較部と、該比較結果をディジタル信号として出力するスイッチ出力部とを有し、前記比較部は、前記第1の周期毎に前記第1の演算部の出力に基づいて算出された瞬時流量値と前記設定流量値とを比較する通常モードと、前記第1の周期を測定下限周波数で除算した第2の周期毎に前記第1の測定部の測定値に基づいて算出された瞬時流量値と前記設定流量値とを比較する高速モードの2つの動作モードを有するものである。
さらに、前記設定流量値として複数の値が設定可能とされており、前記スイッチ出力部は、該複数の設定流量値に対する比較結果の論理和により制御されるようになされているものである。
【0026】
【発明の実施の形態】
図1は、本発明の流量計の周波数測定方法が適用された周波数測定の構成例を示すブロック図である。この図において、1は被測定対象となるパルス信号を出力する周波数検出部である。2は第1カウンタ、4は測定開始および終了時点を規定する第1の信号を発生する第1タイマであり、第1カウンタ2は、前記第1タイマ4からの第1の信号により規定される測定開始時点から測定終了時点までの期間に入力される入力パルスの個数を計数する。3は第2のカウンタ、5は基準クロック信号を発生する基準クロック発生部であり、第2カウンタ3は、前記周波数検出部1からの入力パルスの立上がりエッジ(または立下がりエッジ)から次の入力パルスの立上がりエッジ(または立下がりエッジ)までの期間に前記基準クロック発生部5から入力される基準クロックを計数することにより、入力パルスの周期を計測する。また、図示するように、前記第1タイマ4からの第1の信号は、前記第2カウンタ3に制御信号として印加されており、前記第2カウンタ3は前記第1の信号の発生タイミングにおける計数値を出力することができるようになされている。
また、6は演算処理部であり、前記第1カウンタ2および前記第2カウンタ3からの計数出力に基づいて、前記入力パルス信号の周波数を算出する。8は前記演算処理部6により算出された周波数を表示する表示部、9は前記算出された周波数を外部の装置に出力する出力部、7は前記各構成要素の動作を制御する制御部である。
なお、図中破線で囲んだ第1カウンタ2、第2カウンタ3、第1タイマ4、基準クロック発生部5、演算処理部6および制御部7は、例えば、シングルチップマイクロコンピュータにより構成することができる。
【0027】
このように構成された周波数測定部において実行される本発明の流量計の周波数測定方法における測定原理について、図2を参照して説明する。この図において、(a)は前記周波数検出部1からの入力パルス信号の一例、(b)は前記第1タイマ4から出力される第1の信号、(c)は前記第1カウンタ2の計数値、(d)は前記第2カウンタ3における計数内容を示している。ここで、前記(b)の第1の信号は、この周波数測定における測定開始点と測定終了点を規定するものであり、被測定パルス信号の周波数に応じた周期の信号とすることができるが、説明を簡単にするために、ここでは、1秒周期の出力信号とされている。なお、前記測定終了点を次の測定周期における測定開始点とすることにより、前記第1の信号の周期(第1の周期)ごとに連続的に周波数を測定することができる。また、前記入力パルス信号の周期を計測するための基準クロックの周期は、測定の精度を決定するものであるが、ここでは、1msec周期のクロック信号とされているものとする。
【0028】
さて、前記第1のカウンタ2は、前記第1の信号により規定される測定開始点から測定終了点までの測定期間(この例においては1秒間)に入力されるパルスの個数を計数する。このときに、入力パルスの立上がりおよび立下がりのいずれを用いても計数することができるが、ここでは、入力パルスの立上がりを計数するものとする。図示した例においては5個のパルスが計数される。この場合には、測定期間が1秒であるため、この5という値は、この入力信号の周波数の整数部に対応している。
【0029】
しかしながら、このようにパルスの個数を計数するだけでは、図2の(a)に示すように、計数開始時点から第1番目のパルス(パルス1)の立ち上がり時点までの期間Aについては当該計数値に反映されていない。また、第5番目のパルス(パルス5)については、測定終了点以後次のパルス(パルス6)の立上がり時点までの期間Bについても含まれているものとしてカウントされていることとなる。したがって、入力パルス信号の周波数を正確に測定するためには、前記AおよびBの部分についても考慮することが必要となる。
すなわち、前記測定開始時点からパルス1の立上がり時点までの期間Aがパルス0の周期T1に占めている割合、および、前記測定終了点からパルス6の立上がり時点までの期間Bのパルス5の周期T2に占めている割合を求め、これにより、前記パルスの個数を修正することにより、正確な周波数fを得ることができる。
【0030】
前述したAの部分およびBの部分を測定するため、前記周波数測定における前記第2カウンタ3は、図2の(d)に示すように、前記入力パルス信号の立ち上がりエッジで前記基準クロックの計数を開始し、次の入力パルス信号の立ち上がりエッジで当該計数値(N1)を出力するとともに、再び0から計数を開始する。前記計数の途中に前記第1タイマからの第1の信号が入力されたときには、その時点の計数値(n1)を出力するようになされている。これにより、前述した時間T1,T2,t1,t2にそれぞれ対応する計数出力N1,N2,n1,n2を得ることができる。なお、前記入力パルスの周期の計測中に第1の信号の入力がなければ、その計測値を捨てて次の計測を行なえばよい。
そして、前記演算処理部6は、前記第1カウンタ2からの計数値f0および前記第2カウンタ3からの計数値N1,N2,n1,n2に基づいて、次の式(4)の演算を行ない、周波数値fを算出する。
f=f0+(1−n1/N1)−(1−n2/N2)
=f0−n1/N1+n2/N2 ……(4)
【0031】
なお、上記においては、前記測定期間(第1の信号の周期)を1秒間であるとして説明したが、この期間は、被測定信号周波数に応じて任意の値とすることができ、前記測定期間をT秒とした場合には、次の式(5)により、周波数値fを求めることができる。
f=(f0−n1/N1+n2/N2)×(1/T) ……(5)
【0032】
上述した本発明の流量計の周波数測定方法においては、前記測定期間中に入力されるパルスが1つ以上あるときに、上記式(5)を用いて当該周波数を算出することができる。したがって、測定下限周波数の周期以上の測定期間で、高精度の周波数測定が可能となり、従来の測定方法のように、精度をあげるために測定時間を長くする必要がない。例えば、測定下限周波数が1Hzの場合には1秒、5Hzの場合には0.2秒の測定期間で精度良く当該周波数を測定することができる。
また、測定下限周波数における測定精度は前記基準クロックの周期により決定される。例えば、前記第1の信号の周期を1秒(測定下限周波数が1Hz)とした場合、必要とする分解能が200(精度±0.5%)であるときは基準クロックを5msecとすればよく、分解能が1000(精度±0.1%)のときは基準クロックを1msecとすればよい。また、測定下限周波数が5Hzであれば周期は200msecであるので、基準クロックを1msecとすれば分解能200が得られる。
【0033】
このように、本発明の流量計の周波数測定方法によれば、測定開始点から測定終了点までの測定期間に含まれている入力パルスの周期をその小数部まで正確に算出することができ、入力パルス信号の周波数を測定期間の長短にかかわらず高精度に算出することが可能となる。
また、測定を連続して繰り返し実行する場合には、前記測定終了点における小数部(前記Bの時間に対応する小数部)は次の測定における測定開始点における小数部(前記Aの時間に対応する小数部)となり、演算処理が簡単化され、第1の信号の周期毎に正確な周波数データを得ることが可能となる。
なお、上記においては、入力パルスの立ち上がり時点により、その周期の計測を開始しているものとしたが、立ち下がり時点により計測を開始するようにしてもよいことは明らかである。
また、前記第1カウンタ2による測定の結果、200≦f0であるときには、前記第2カウンタ3の測定結果を算出するまでもなく0.5%の測定精度が得られるので、上述した小数部分測定処理を省略することができる。
【0034】
上述した測定原理に基づいて動作する前記図1に示した周波数測定の動作について、図3〜5のフローチャートに基づいて詳細に説明する。なお、簡単のため、ここでは、前記第1の周期が1秒間に設定されているものとして説明する。
ここで、前記図1において破線で囲んだ部分はシングルチップマイクロコンピュータ(以下、単にマイコンという)により構成されており、前記第1カウンタ2および第2カウンタ3は、該マイコンの内蔵カウンタが用いられ、前記第1タイマ4および前記基準クロック発生部5は前記マイコンの内蔵タイマが用いられる。そして、前記制御部7は、図示しないプログラムメモリに格納されたプログラムにしたがって、演算処理部6を用いて入力パルスの周波数を算出する。
【0035】
以下、この周波数測定の動作について、図3〜図5に示すフローチャートおよび図6のタイムチャートを参照して説明する。図3はこの周波数測定のメインルーチンを示すフローチャート、図4は、前記第1タイマ4からの第1の信号により起動される第1タイマ割込処理ルーチンのフローチャート、図5は前記入力パルスの立上がりエッジ(立下がりエッジ)により発生される割込により起動される第2カウンタの計数処理ルーチンのフローチャートである。
前記制御部7は、順次格納フラグ1および順次格納フラグ2、演算許可フラグ1および演算許可フラグ2、第2カウンタ有効フラグなどの各種フラグに基づいて処理を進行するようになされている。ここで、順次格納フラグ1および2は動作開始時にセットされるフラグであり、演算許可フラグ1および2は前記演算処理部6において周波数を算出する演算を実行すべきタイミングを示すフラグ、前記第2カウンタ有効フラグは前記第2カウンタ3の計数内容をレジスタに格納すべきタイミングであることを示すフラグである。
【0036】
この周波数測定が起動されると(図6にt0のタイミング)、図3に示すメインルーチンが起動され、まず、ステップS1において各レジスタの初期化など各部の初期化処理が行われる。そして、ステップS2に進み、順次格納フラグ1および順次格納フラグ2がともにセットされるとともに、前記演算許可フラグ1および2、前記第2カウンタ有効フラグがリセットされる。次に、ステップS3において前記第1タイマ4の計時が開始される。これにより、前記第1の周期後に前記第1タイマ4からの割込処理(図4)が実行されることとなる。次に、ステップS4において、前記第1カウンタ2の計数を開始する。続いて、ステップS5において前記入力パルスの立上がりエッジによる割込を許可する。これにより、入力パルスの立上がりエッジのタイミングで、第2カウンタ3の計数処理(図5)が実行されることとなる。なお、立上がりエッジにより割込を行うようにする代わりに、立下がりエッジにより行うようにしてもよい。
【0037】
次に、ステップS6に進み、演算許可フラグ1および2がともにセットされているか否かを判定する。前述のように、動作開始直後においては、演算許可フラグ1および2のいずれもリセットされているため、この判定の結果はNOとなる。一方、この判定の結果がYESのときは、ステップS7に進み、前記式(4)に基づいて周波数fを算出し、前記演算許可フラグ1および2をリセットする(ステップS8)。前記ステップS6の判定結果がNOのとき、あるいは前記ステップS8の処理が終了した後に、ステップS9の表示、出力処理、ステップS10のその他の処理が実行され、再び、前記ステップS6以降の処理が繰り返し実行される。
【0038】
図4は、前記第1タイマ4による第1の周期の信号により起動される第1タイマ割込処理の処理フローチャートである。前述のように、時刻t0で動作が開始されたときには、時刻t1にこの処理が開始される。まず、ステップS11において、前記第1タイマの計時を再開させる。これにより、正確なタイミング(t2、t3…)での第1タイマ割込が保証される。次に、ステップS12において、この時点における前記第1カウンタの計数値をレジスタf0に格納するとともに、ステップS13において該第1カウンタを初期化し、再び第1カウンタの計数を開始させる。これにより、前記第1の周期毎の入力パルスの個数をレジスタf0に格納することができる。この場合には、前記t0〜t1までの1秒間に入力されたパルスの個数がレジスタf0に格納されることとなる。
【0039】
続いて、ステップS14に進み、前記順次格納フラグ1がセットされているか否かを判定する。前述のように、順次格納フラグ1は前記ステップS2(図3)においてセットされており、時刻t1の第1信号による割込時には、この判定結果はYESとなる。このときは、ステップS15に進み、この時点の前記第2カウンタの計数値(nt1)をレジスタn2に格納するとともに、レジスタn1にも格納する(ステップS16)。そして、ステップS17において、前記順次格納フラグ1をリセットする。これにより、時刻t1の直前の入力パルスの立上がり時点から時刻t1までの時間に対応する計数値nt1がレジスタn1およびn2に格納されることとなる。
【0040】
一方、時刻t2以降のこの第1タイマ割込処理ルーチンにおいては、前記ステップS17において、順次格納フラグ1がリセットされているため、前記ステップS14の判定結果がNOとなる。この場合には、ステップS18において、前記レジスタn2に格納されている前回の割込時における第2カウンタの計数値をレジスタn1に転送するとともに、この時点における第2カウンタの計数値を前記レジスタn2に格納する。すなわち、時刻t2の割込時においては時刻t1における計数値nt1をレジスタn1に転送するとともに、時刻t2における第2カウンタの計数値nt2をレジスタn2に転送する。
前記ステップS17あるいはS19が実行された後、ステップS20において、前記第2カウンタ有効フラグをセットし、さらに、ステップS21において、前記演算許可フラグ1をセットして、この第1タイマ割込処理ルーチンを終了する。
【0041】
図5は、前記第2カウンタの計数処理ルーチンのフローチャートである。前述のように、このルーチンは、前記入力パルスの立上がり(あるいは立下がり)エッジにより起動される。入力パルスの立ち上がりにより割込みが発生されると、まず、前記第2カウンタ有効フラグがセットされているか否かが判定される(ステップS22)。前述のように、前記第2カウンタ有効フラグはメインルーチンの起動時(ステップS2)においてリセットされ、前記第1タイマ割込処理ルーチンのステップS20においてセットされるようになされている。したがって、図6に示す時刻t1より前には、この第2カウンタ有効フラグはリセット状態とされている。したがって、この時間までに、入力されるパルスの立上がりにより起動されるこの割込処理ルーチンにおいては、前記ステップS22の判定結果はNOとなるため、ステップS23に進み、前記第2カウンタを0にリセットして再び前記入力パルスの周期の計測を再開する。なお、後述する説明から明らかなように、前記メインルーチンにおいて周波数算出処理(ステップS7)が実行され、演算許可フラグ1および2がリセット(ステップS8)された後、前記第1の信号が発生されるタイミング(t2、t3…)までの時間においても、このステップS22の判定結果はNOとなり、これらの時間においては、第2カウンタは、入力パルスの周期の計測をただ単に繰り返すこととなる。
【0042】
一方、前記第1タイマ割込処理ルーチンにおけるステップS20(図4)が実行された直後のこの割込処理ルーチン(図6における時刻t1、t2、t3…の直後の入力パルスの立上がりエッジによる第2カウンタの計数処理ルーチン)においては、前記第2カウンタ有効フラグがセット状態とされているため、このステップS22の判定結果がYESとなる。このときには、ステップS24に進み、順次格納フラグ2がセットされているか否かが判定される。前述のように、順次格納フラグ2は、動作開始直後における前記メインルーチンのステップS2においてセットされており、図6に示す時刻t1の直後の入力パルスの立上がりエッジによるこの割込処理ルーチンにおいては、このステップS24の判定結果がYESとなる。したがって、このときには、ステップS25に進み、この時点(時刻t1の直後の入力パルスの立上がり時点)における第2カウンタの計数値(図6におけるNt1)をレジスタN2に格納するとともに、レジスタN1にも格納する(ステップS26)。そして、ステップS27において、前記順次格納フラグ2をリセットする。これにより、前記時刻t1における第1の信号をその周期中に含む入力パルスの周期Nt1が前記レジスタN2およびN1に格納されることとなる。
【0043】
一方、前記時刻t2以降においては、前記ステップS27において前記順次格納フラグ2がリセットされているため、前記ステップS24の判定結果がNOとなる。このときは、ステップS28において、前記レジスタN2に格納されている前記第2カウンタの計数値(時刻t2の直後のこの割込処理においては、前記Nt1)を前記レジスタN1に転送するとともに、前記レジスタN2にこの時点における第2カウンタの計数値(時刻t2の直後のこの割込処理においては、Nt2)を前記レジスタN2に格納する(ステップS29)。これにより、第1の信号の発生タイミングをその周期中に含む入力パルスの周期を前記レジスタN2に格納することができ、その直前の第1の信号の発生タイミングをその周期中に含む入力パルスの周期を前記レジスタN1に格納することができる。
前記ステップS27あるいはS29が実行された後、ステップS30に進み、前記第2カウンタ有効フラグ2をリセットする。そして、ステップS31に進み、前記第2カウンタを0に初期化した後、再び、入力パルスの周期の計数を再開する。そして、ステップS32において、前記演算許可フラグ2をセットし、この割込処理ルーチンを終了する。
【0044】
以上のように、前記第2カウンタ有効フラグは、前記第1の信号をその周期中に含む入力パルスの該第1の信号の発生タイミングまでの時間n2(n1)をレジスタに格納した後(ステップS20)、該入力パルスの周期N2(N1)をレジスタに格納する(ステップS30)までの期間セットされるようになされている。これにより、前記第1の信号の発生タイミングをその周期中に含む入力パルスについて、該第1の信号の発生タイミングまでの時間および該入力パルスの周期を確実にレジスタに格納することができる。
また、前記順次格納フラグ1および2は、動作開始時において、前記レジスタn1、n2およびN1、N2に、最初の第1の信号に対応する第2カウンタの計数値を格納するために設けらているフラグであり、それ以降においてはリセットされる。
【0045】
さらに、前記演算許可フラグ1は、前記第1の信号が発生したときに実行される前記第1タイマ割込処理ルーチン(図4)において、前記レジスタn1およびn2に第1の信号の発生タイミングにおける第2カウンタの計数値、すなわち、前記第1の信号をその周期中に含む入力パルスにおける前記第1の信号の位置に対応するデータをレジスタに格納したときにセットされる。
さらにまた、前記演算許可フラグ2は、前記第2カウンタ有効フラグがセットされているときに立上がりエッジが検出されたときの前記第2カウンタの計数値、すなわち、前記第1の信号をその周期中に含む入力パルスの周期(および前回の入力パルスの周期)を前記レジスタN2(およびN1)に格納したときにセットされる。
そして、前記メインルーチンは、前記演算許可フラグ1および2がともにセットされているときに、前記式(4)(第1の信号の周期が1秒以外とされているときは、式(5))の演算を行い(ステップS7,図3)、前記第1の演算許可フラグ1および2をリセットしている。
【0046】
したがって、図6に示したように、時刻t1以降の最初の入力パルスの立上がり時点以後に前記メインルーチンのステップS6の判定結果がYESとなり、最初の周波数算出処理(ステップS7)が実行される。ただし、この場合は、前述のように、前記レジスタn1およびn2にともにnt1が格納されており、前記レジスタN1およびN2にともにNt1が格納されているために、この回の周波数算出結果は前記第1カウンタの計数値f0となる。時刻t2以降の最初の入力パルスの立上がり時点以後にメインルーチンのステップS7が実行されたときは、前記式(4)に基づいて、正確な周波数を得ることができる。
【0047】
このように、本発明の流量計の周波数測定によれば、前記第1の信号の周期(第1の周期)毎に、正確な周波数を小数部まで算出することが可能となる。したがって、高精度の測定を行うために長時間を必要とすることがなく、短時間で正確な周波数測定を行うことができる。
また、前回の測定周期における第2のカウンタの計数値(n1、N1)を次回の測定周期における周波数の算出に用いているため、演算効率のよい周波数測定を行うことができる。
【0048】
次に、上述した本発明の流量計の周波数測定方法適用た流量計について説明する。図7は、上述した本発明の流量計の周波数測定方法適用た流量計の基本構成の一例を示すブロック図である。
図示するように、この流量計は、大別すると、流体の流量に対応する周波数のパルス信号を出力するセンサ部11と、この流量計の機能を選択するための機能選択部12と、各種指示及び各種データを手動で入力するための手動操作部13と、電源のオン/オフを検出してリセット信号を出力するリセット信号出力部14と、コントロール部20が正常に動作しているか否かを判定し、異常時に割込み信号を出力するウォッチドッグタイマ部15と、電源電圧を監視し、電源電圧の低下を検出したときに割込み信号を出力する電圧低下検出部16と、この流量計全体の制御を行うコントロール部20と、各種データを保持する不揮発性記憶部17と、計測した流量値等の各種表示を行う表示部30と、集中監視装置などの外部装置EXCTに信号の出力を行う信号出力部40と、電源部45を備えて構成されている。
【0049】
ここで、前記コントロール部20は、各種比較を行うための比較ユニット21と、比較ユニット21における比較結果に基づいて各種判断を行う判断ユニット22と、各種演算を行うための演算ユニット23と、コントロール部20全体を制御するための制御ユニット24と、各種タイマ割込を発生させるためなどに用いられるタイマユニット25と、制御プログラムや各種のデータを記憶するためのROM、RAMなどで構成された記憶ユニット26とを備えて構成されている。なお、このコントロール部20は、例えば、シングルチップマイクロコンピュータにより構成される。
【0050】
また、前記表示部30は、計測した流量値を表示するデータ表示ユニット31と、該データ表示ユニット31で表示される流量の単位を表示する単位表示ユニット32と、後述する信号出力時などに点灯制御される出力1表示ユニット33および出力2表示ユニット34とを備えて構成されている。なお、流量の表示単位が固定されているときには、前記単位表示ユニット32はあえて設けなくともよい。
【0051】
さらに、前記信号出力部40は、測定した流量値をPWM(パルス幅変調)信号に変換して、集中監視装置などの外部装置EXCTの第1のデータ入力端子DIN1に出力するPWM信号出力ユニット40−1、測定流量値が第1の所定の値以下(あるいは以上)になったときに、そのことを示す出力1を外部装置EXCTのスイッチ1入力SW1に出力するスイッチ出力1出力ユニット40−3、および、測定流量値が第2の所定の値以上(あるいは以下)になったときにそのことを示す出力2を外部装置EXCTのスイッチ2入力SW2に出力するスイッチ出力2出力ユニット40−4を備えている。
なお、前記PWM信号出力ユニット40−1に代えてあるいは加えて、破線で示すように、4〜20[mA]の電流範囲を有し、測定した流量値に対応するアナログ流量信号を集中監視装置などの外部装置EXCTのアナログ入力端子に出力する4〜20mA伝送信号出力ユニット40−2を備えるようしてもよい。
また、45は電源部であり、例えば、前記外部装置EXCTから供給される直流12〜24[V]の電源をこの流量計の動作電圧に変換して供給する。また、電源として電池を使用するようにしてもよい。
【0052】
このように構成された流量計の動作の概要について説明する。
この流量計が起動されると、前記制御ユニット24は、まず、この流量計の初期設定を行なう。そして、前記機能選択部12の設定状態を読み込み、この流量計の動作モードを判定する。ここでは、瞬時流量計モードが設定されているものとする。
次に、前記機能選択部12により設定されている流路の口径および材質、制御プログラムのバージョンなどの各種設定状態を前記表示部30に表示し、前記センサ部11から入力される被測定流量に対応する周波数を有するパルス信号の周波数の測定を開始する。
【0053】
この測定は、前述のように、第1タイマ(1秒タイマ)の出力に応じて、前記入力信号のパルスの数を計数して被測定周波数の整数部を測定するとともに、該入力パルスの周期および前記第1タイマの出力タイミングを1msec周期の前記基準クロックで計数することにより被測定周波数の小数部を測定することにより行なわれる。
そして、前記比較ユニット21、判断ユニット22および演算ユニット23を用いて、前記式(4)に基づいて周波数を算出するとともに、該算出した周波数から前記式(2)あるいは(3)により瞬時流量を算出する。そして、該算出した瞬時流量値を前記表示部30に表示し、また、前記信号出力部40から外部装置EXCTに出力する。そして、前記比較ユニット21および前記判断ユニット22により、該測定された瞬時流量と予め設定された設定流量値とを比較し、該比較結果に応じて、前記スイッチ出力ユニット40−3あるいは40−4から前記外部装置EXCTにスイッチ出力を供給する。さらに、前記算出した瞬時流量値を積算した積算流量値を算出する。この積算流量値は、前記手動操作部13の操作に応じて前記表示部30に表示される。
【0054】
次に、この本発明の流量計の周波数測定方法適用た本発明の流量計(瞬時流量計)のより具体的な実施の形態について詳細に説明する。なお、この実施の形態においては、この流量計を瞬時流量計および積算バッチ流量計のいずれとしても使用することができるように両流量計に共通の制御プログラムが使用されているものとする。
図8は、この流量計の一実施の形態の構造を示す図であり、(a)は表示及び操作パネル面を示す上面図、(b)は内部構造を示す断面図、(c)は一部分を破断して示す側面図である。この図において、瞬時流量計は、流量を計測すべき流体が流れる流路の途中に接続される計量部本体50と、この計量部本体50の上方に90°毎に位置出し可能に取付けられた計測表示部とからなっている。ここで、前記計量部本体50はそれが接続される配管に合わせたサイズとされており、前記計測表示部は多種類(例えば、64種類)の配管の材質や口径に共通に適用することができるものとされている。すなわち、前記計測表示部は多数の機種に共通に使用することができるようになされており、後述するように、手動操作部(キー入力部)の操作により配管の口径や材質を選択設定することができるようになされている。
【0055】
前記計量部本体50は、その入口が上流側に、出口が下流側にそれぞれ接続され、流れの中に置かれた柱状物体51の下流側に形成されるカルマン渦の発生周波数が広いレイノルズ数において流速に比例していることを利用し、この渦流の発生周波数を計測することにより、流速或いは流量を知ることができるカルマン渦流式のものとして構成されている。このカルマン渦流式のものは、摺動部がなくシンプルな構造で、信頼性、耐久性が優れているほか、流体流路には渦発生体と渦検出器があるだけで、流路の絞りが小さいので、圧力損失が小さくなっているという特徴を有している。
そして、前記計量部本体50には、渦流の発生によって変化する流路中の圧力を検知するためホルダの内部にセンサとしての圧電素子52が取付けられている。該圧電素子52は渦流の発生周波数に等しい周波数で変化する電気信号からなる流量信号を出力し、これをリード線を介して計測表示部内に設けられた電子回路に供給する。
【0056】
計測表示部は、防水パッキンを介して突き合わされた上ケース54と下ケース55とからなるケース53、このケース53内に収容された第1のプリント基板(表示基板)61、第2のプリント基板(CPU基板)62、第3のプリント基板(センサ基板)63、上ケース54の上面に配置されたLED33、34、例えば3桁の7セグメントLED表示器により構成されたデータ表示ユニット31及び操作キー41、42および43などにより構成され、下ケース55の底部にあけた孔に計量部本体50の上にネジ59により固定された中空の回転軸56が防水パッキンを介して回転自在に嵌合され、計量部本体50に対して90°毎に位置出し可能に調整できるようになっている。前記圧電素子52からのリード線は回転軸56の中空部を通ってセンサ基板63上に形成された電子回路まで導かれている。なお、60は外部装置に接続するためのシールド線からなる信号線である。
【0057】
また、前記表示基板61および前記CPU基板62は、金属スペーサを介して取付ネジ58により前記上ケース54に取り付けられており、前記センサ基板63は金属スペーサを介して取付ネジ58により下ケース55に取り付けられている。ここで、前記上ケース54と下ケース55は、例えば、内部に導電性シールド材が塗布された樹脂製とされており、前記プリント基板61〜63におけるネジ58および金属スペーサが当接する箇所に設けられた金属部を介して、前記ケース53とプリント基板61〜63との電気的接続がとられるようになされている。
また、前記上ケース54は前記下ケース55に対してネジ57によって開閉自在に取付けられ、各種の設定操作を行うときに開けられるようになっている。
【0058】
なお、上述した例においては、前記上ケース54上に表示部として、2つのLED33および34と前記データ表示ユニットとしての3桁の7セグメント表示器31が設けられている例を示したが、これに限られることはない。図9は、前記表示部の他の例を示す図であり、この図に示した例においては、前述したLED33および34、3桁の表示器31の他に、表示単位を示す2つのLED35および36を有し、LED35の右方には「m3」、LED36の右方には「L」の表示がなされている。これにより、この図9に示した例においては、LED35が点灯することにより、前記3桁の表示器31において表示されている数値の単位が立方メートルであることを示し、また、LED36が点灯することにより前記表示器31において表示されている数値の単位がリットルであることを示すことができる。すなわち、この例においては、前記LED35および36により、前記単位表示ユニット32が構成されている。
また、前記LED33およびLED34は、後述するように、第1の出力および第2の出力が外部装置に出力されているときに点等制御されるものである。なお、前記LED33として赤色のLEDを用い、前記LED34として緑色のものを用いるといったように、LEDの色を変更するようにしてもよい。
【0059】
図10は、前記3つのプリント基板、すなわち、表示基板61、CPU基板62およびセンサ基板63上における各回路部品の配置の一例を示す図である。この図において、(a)は前記プリント基板61〜63が前記ケース53内に組み上げられている状態を示す図、(b)は前記表示基板61の表面図、(c)は前記CPU基板62の裏面図、(d)は前記センサ基板63の表面図、(e)は前記センサ基板63の裏面図である。
図10の(a)に示すように、前記表示基板61と前記CPU基板62はコネクタ64を介して電気的に接続されており、前記CPU基板62とセンサ基板63はフラットケーブル65を介して電気的に接続されている。また、前記CPU基板62上には、前記コントロール部として動作するマイクロコンピュータ20が設けられ、その裏面に前記不揮発性記憶素子17として動作するEEPROMが設けられている。
また、図10の(b)に示すように、前記表示基板61の表面には、2つのピンから成る検査モード設定ピン18が設けられており、この検査モード設定ピン18を短絡することにより、後述する検査モードとすることができるようになされている。
【0060】
さらに、同図(c)に示すように、前記CPU基板62の裏面には前記機能選択部12を構成する2組のジャンパーピンJ1およびJ2からなる機能選択用ピンが設けられている。ジャンパーピンJ1は、この流量計を瞬時流量計として動作させるかあるいは積算バッチ流量計として動作させるかを選択するためのものであり、ジャンパー線によりジャンパーピンJ1を短絡したときには瞬時流量計として動作し、開放されているときには積算バッチ流量計として動作するように設定される。また、ジャンパーピンJ2は、この流量計による測定データを4〜20mA伝送方式で外部装置に伝送するかあるいはPWM変調された信号で伝送するかを選択するためのものであり、ジャンパー線により短絡したときには4〜20mA伝送方式で測定流量データを伝送し、開放されているときにはPWM変調信号を外部装置に伝送するように設定される。
【0061】
図10の(d)に示すように、前記センサ基板63の表面には前記圧電素子52からのリード線が接続される端子S+およびS−が設けられており、さらに、調整用のトリマVR、各種のオペアンプ、ダイオード、バリスタやコンデンサなど各種の電子部品が配置されている。また、66は前記外部装置との接続ケーブル60が接続される端子である。さらに、同図(e)に示すように、前記センサ基板63の裏面には、後述するPWM出力用のトランジスタ76などの各種出力トランジスタや前記電源部45として動作する3端子安定化電源回路78など各種の電子部品が設けられている。
【0062】
この流量計の回路構成の一例について、図11および図12のブロック図を参照して説明する。
図11において、20はこの流量計の全体の制御を行うマイコンであり、その内部には、第1カウンタ(主カウンタ)81、第2カウンタ(副カウンタ)82、タイマ1〜タイマnの複数個のタイマからなるタイマレジスタ群83、制御プログラムおよび後述する演算係数テーブル等を格納するROM84、各種のデータを格納するデータエリアおよびワークエリアなどとして使用されるRAM85、および表示部30を駆動するための表示ドライバ、および、PWM信号を出力ポートから出力するためのPWM出力機能部等が搭載されている。このPWM出力機能部は、例えば10ビットの分解能を有しており、PWM周期を設定するPWMプリスケーラ、出力パルスの「H」レベルの期間を設定するPWMレジスタなどから構成されている。
なお、前記タイマレジスタ群83の中には、前記第1タイマに相当する第1周期タイマ(1秒タイマ)、1msecの基準クロックを発生するタイマおよび第2周期タイマ(0.2秒タイマ)などが含まれている。ここで、前記第2周期タイマは、前記第1周期タイマの出力信号と同期し、かつ、前記第1周期タイマの出力信号周期を測定下限周波数で除算した第2の周期を有する信号を出力するものであり、この例では、前記第1タイマ出力の周期1秒を測定下限周波数5Hzで除算した0.2秒の周期を有する信号とされている。そして、後述するように、この第2周期タイマの出力信号に応じて、演算部の演算動作のタイミングを制御するようにしている。
また、前記第1周期タイマと前記第2周期タイマは別個に設けても良いが、ここでは、前記第2周期タイマの出力に基づいて前記第1周期タイマ出力を得るようにしている。例えば、前記第2周期タイマの出力を計数し、5を計数するごとに前記第1周期タイマ出力を出力するようにすればよい。
さらに、前記主カウンタ81および副カウンタ82は、前記センサ部11からの入力信号が印加される入力ポート(カウント信号入力ポート)に接続されており、前記主カウンタ81は、1秒間(第1周期タイマ出力信号の周期)に入力される入力パルスの個数を計数し、前記副カウンタ82は前記入力パルスの周期を1msec単位で測定する。
【0063】
11は、前記圧電素子52、この圧電素子52からの電気信号を増幅する増幅器67およびこの増幅器67の出力信号を波形整形してパルス信号として出力する波形整形回路68からなるセンサ部であり、このセンサ部11の出力βは、前記マイコン20のカウント信号入力ポートに入力される。また、このセンサ部11の出力βは、図12に示した信号出力部にも印加されており、出力トランジスタ77を介して、調整検査装置等の外部装置EXCTに直接出力することができるようになされている。
12は機能選択部であり、前述のように、瞬時流量計として動作させるかあるいは積算バッチ流量計として動作させるかを選択するジャンパーピンJ1および計測出力を4〜20mA伝送信号により外部装置に伝送するかあるいはPWM(Pulse Width Modulation:パルス幅変調)信号により外部装置に出力するかを選択するジャンパーピンJ2が設けられている。この各ジャンパーピンJ1およびJ2の出力は前記マイコン20の入力ポートに接続されている。
また、18は検査モード設定ピンであり、前述のように、この検査モード設定ピン18を短絡することにより、この流量計を検査モードとすることができる。工場出荷前の検査時にこの検査モード設定ピン18により検査モードとし、後述するように、前記外部装置EXCTとして調整検査装置を接続して検査を実行する。この検査モード設定ピン18の出力は前記マイコン20の入力ポートに接続される。
【0064】
13は手動操作部(キー入力部)であり、前述のように、設定キー(ENTキー)41、アップキー(△キー)42、ダウンキー(▽キー)43の3つの操作キーが設けられ、それぞれ前記マイコン20の入力ポートに接続されている。
15はウォッチドッグタイマであり、マイコン20の出力ポートからの信号が所定時間入力されなかったときに、マイコン20に割り込み信号を入力する。この割り込み入力によりマイコン20は後述する第2のスタート処理を開始することとなる。なお、このウォッチドッグタイマへの定時出力は、例えば所定周期毎に実行されるようになされたタイマ割り込み処理ルーチンにより実行されるようになされている。
さらに、14はパワーオンリセット回路であり、電源電圧Vccが印加されたときに、これを検出して前記マイコン20のリセット端子にパルス信号を印加する。これにより、マイコン20は後述する第1のスタート処理を実行することとなる。
【0065】
30は前記表示部であり、図示するように、データ表示ユニットとしての3桁の7セグメントLED表示器31、第1の出力OUT1(あるいは積算バッチ流量計として使用される場合には出力信号OUT)の出力時に点灯されるOUT1LED33、第2の出力OUT2(積算バッチ流量計として使用される場合には、入力IN)の出力(入力)時に点灯されるOUT2(IN)LED34、駆動桁選択回路37およびLED駆動回路38を有している。また、前記図9に示した単位表示部32を有する実施例の場合には、前記3桁の表示器31における数値がm3(立方メートル)単位の数値であることを表示するLED35およびL(リットル)単位の数値であることを表示するLED36がさらに設けられる。そして、前記マイコン20に内蔵されている表示駆動回路から、出力ポートを介して前記駆動桁選択回路37およびLED駆動回路38に当該表示を行なうためのデータが出力され、所望の表示を行なうことができるようになされている。
なお、ここでは表示素子としてLEDを使用した例を示したが、これに限られることはなく液晶(LCD)など他の表示素子を採用することができる。
また、前記表示器31の桁数も3桁に限られることはなく、例えば、8桁など任意の桁数としてもよい。
【0066】
17は前記不揮発性記憶素子であるEEPROM(Electrically Erasable Programmable ROM)であり、積算流量値データ、各種設定値、後述する調整検査時に補正された一次式傾きデータや切片データなどが格納される。これにより、電源電圧低下時におけるデータの消失を防止することが可能となる。
また、69は電源端子に並列に接続された大容量コンデンサであり、電源電圧の一時的な低下時におけるバックアップに用いられる。
さらに、16は、電源電圧を監視し、所定電圧以下になったときに、電源電圧チェック割込を行なう電圧検出器である。
【0067】
前記マイコン20の出力ポートから、第1の出力OUT1および第2の出力OUT2が図12に示す信号出力部40に供給される。ここで、第1の出力OUT1は測定した瞬時流量値が第1の設定流量値(例えば、下限流量値)QLよりも低くなったときに出力される信号であり、第2の出力OUT2は計測した瞬時流量値が第2の設定流量値(例えば、上限流量値)QUよりも多くなったときに出力される信号である。前述したように、この第1の出力OUT1および第2の出力OUT2を外部装置に遅滞なく出力することにより、外部機器に対する迅速な制御が可能となる。
なお、この流量計が積算バッチ流量計として使用される場合には、前記第1の出力OUT1は出力OUTとされ、前記第2の出力OUT2に代えて、点線で示すように、信号出力部40/電源部45を介して外部装置EXCTからの入力INがマイコン20の入力ポートに入力されることとなるが、ここでは、これ以上の説明は省略する。
【0068】
図12において、70は前記第1の比較結果である第1の出力OUT1がそのゲートに印加される出力トランジスタ、71は前記第2の比較結果である第2の出力OUT2がそのゲートに印加される出力トランジスタである。これら各出力トランジスタ70および71のドレインは、対応する出力端子から外部装置に出力される。これにより、外部装置側では、このOUT1出力およびOUT2出力を用いて迅速なスイッチ制御などを行なうことができる。図示するように、前記各出力端子と接地との間には、保護用のツェナーダイオードZDが接続されている。
なお、前述のように、積算バッチ流量計として使用される場合には、前記外部装置EXCTからの入力信号INがしきい値回路72により整形されて入力されることとなる。入力信号INとしきい値回路72との間には、保護用の抵抗Rと保護用のダイオードDとが接続されている。
【0069】
また、上記においては、第1の比較結果出力OUT1と第2の比較結果出力OUT2に対してそれぞれ対応して出力トランジスタ70および71を設けているが、図12の下部に他の例として記載したように、前記第1の出力OUT1と第2の出力OUT2をオア回路ORに入力してその論理和をとり、該論理和出力によりトランジスタ70の導通非導通を制御するようにしてもよい。この場合には、少ない出力トランジスタにより多数の比較結果を出力することが可能となる。ただし、外部装置側において、測定出力データから第1および第2のいずれの比較結果により前記出力トランジスタが導通あるいは非導通とされたのかを判定することが必要となる。また、3種類以上の比較結果を出力するようにしてもよい。
【0070】
さらに、前記マイコン20の出力ラッチ付きの出力ポートから10ビットの測定出力データが前記信号出力部40に供給されている。この10ビットの測定データは、図12に示す信号出力部40におけるデジタルアナログ(D/A)変換部73に入力されるとともに、検査モード時に調整検査装置が接続される検査用信号出力端子に供給される。前記10ビットのD/A変換部73においてアナログ信号に変換された測定データは電圧電流変換部(V/I変換部)74を介して、4〜20mA伝送信号出力部75に入力され、4〜20mA伝送信号として前記外部装置EXCTに出力されることとなる。この4〜20mA伝送信号出力部75の出力と接地との間には、図示するように、コンデンサCとバリスタVとが並列に接続されており、ノイズやサージを吸収するようになされている。
【0071】
さらにまた、前記マイコン20の出力ポートから測定した流量値に対応する前述した10ビットの分解能を有するPWM信号が出力され、該PWM信号は、図12に示した出力トランジスタ76のゲートに印加され、PWM出力端子を介して外部装置EXCTに出力される。なお、前記PWM出力端子と接地との間には保護用のツェナーダイオードZDが接続されている。
このように、本発明においては、測定流量値に対応する前記4〜20mA伝送信号あるいは前記PWM信号は、いずれも、10ビットの分解能を有する測定データに基づいて生成されているため、誤差の伝搬のない信号を外部装置に出力することが可能となる。
【0072】
さらに、前記センサ部11の波形整形部68からの被測定パルス信号βは前記信号出力部40の出力トランジスタ77のゲートに印加されており、このトランジスタ77のドレインは、信号出力部40の検査用信号出力端子を介して、検査モード時に接続される調整検査装置に接続される。
なお、図12においては、各出力トランジスタとしてMOSトランジスタを使用しているが、バイポーラトランジスタを用いるようにしてもよい。この場合には、出力OUT1およびOUT2はそれぞれバイポーラトランジスタのベースに印加され、それらのコレクタが前記出力端子に接続されることとなる。
また、78は直流安定化電源回路であり、この実施の形態においては、前記外部装置EXCTから供給される12〜24Vの直流電圧を入力とし、この流量計の駆動電圧に変換して出力する。また、図12に示すように、前記外部装置から供給される電源ライン(+DC、−DCおよびGND)の各線間には、サージ防止用のバリスタVとノイズ除去用のコンデンサCがそれぞれ並列に接続されている。また、電源ライン+DCと直流安定化電源78との間に挿入されているダイオードDは、電源ラインの極性の逆接続に対して回路の破損を防止する。
【0073】
前記ROM84、前記RAM85および前記EEPROM17に格納される各種のデータについて説明する。
図13の(a)は、前記ROM84およびRAM85のメモリマップの一例を示す図である。この図に示すように、前記RAM85の領域には、各種のレジスタ領域、後述する補正係数や各種フラグなどを格納する領域、ワークエリア、積算流量値データを格納する領域、積算バッチ流量値を格納する領域などが設けられている。
また、ROM84の領域には、制御プログラム、口径設定データテーブル、割込みベクトル等が格納されている。ここで、口径設定データテーブルは、前記配管の口径および材質にそれぞれ対応した係数データ(前記式(2)における傾きデータaiおよび切片データbi)であり、例えば64種類の機種(口径および材質)に対応するデータが格納されている。
【0074】
図13の(b)は、前記口径設定データテーブルの構成を説明するための図である。この図に示すように、口径設定データテーブルは、それぞれ16種類の設定データを1ページとする4ページの構成とされている。そして、各設定データとしては、図示するように、当該設定データを識別する設定コード(機種設定コード)、口径を指定するコード、本体材質を指定する材質コード、流れ有り周波数f1〜定格流量の110%の瞬時流量値に対応する周波数f6までを5つの区間に区切る周波数データf1〜f6、周波数と流量との関数を前記5つの区間に対応する折れ線で近似したときの一次式傾きデータa1〜a5および切片データb1〜b5が格納されている。なお、前記流れ有り周波数はf1は、当該機種、すなわち、前記計量部本体50(図8)の口径および材質により決定される測定下限周波数であり、例えば、5Hz程度の値となる。
なお、このデータa1〜a5およびb1〜b5は器差のばらつきの平均値であり、このデータをそのまま用いて流量を算出しても高精度の計測結果は期待できない。そこで、本発明においても、後述する調整検査工程において、1台ごとに補正した一次式傾きデータA1〜A5および一次式切片データB1〜B5(以下、これらをまとめて「補正係数」とよぶ)を求め、前記式(3)に示したように、この補正係数を用いて流量を算出している。これにより、非常に精度の良い計測を行うことが可能となっている。
【0075】
図13の(c)は、前記EEPROM17のメモリマップの一例を示す図である。この図に示すように、EEPROM17には、検査終了フラグ、前記補正された一次式傾きデータA1〜A5、前記補正された一次式切片データB1〜B5、積算流量データ、積算バッチ流量値データ、機種設定コード決定データ、積算表示方式決定データ、バッチ流量値設定データ、上限流量値設定データ、下限流量値設定データおよびスイッチ出力周期決定データが格納される。なお、これらのデータの詳細については、後述するフローチャートにおける対応する個所で説明することとする。
【0076】
次に、この流量計(瞬時流量計)の動作について詳細に説明する。なお、前述のように、この流量計は瞬時流量計と積算バッチ流量計のいずれとしても動作することができるようになされているが、ここでは、瞬時流量計として動作させる場合について説明する。
この流量計は、全体として、流量計としてのメインルーチンと、周波数測定割込処理、1msecクロック計数割込処理および電源電圧チェック割込処理の3種類の割込処理により動作するようになされている。
ここで、前記周波数測定割込処理および前記1msecクロック計数割込処理により、前述した本発明の流量計の周波数測定方法にしたがった前記主カウンタによる被測定信号の周波数の整数部の測定および前記副カウンタによる小数部の測定に関する処理が実行され、前記メインルーチンにより前述した式(4)あるいは式(5)を用いた当該周波数の算出、該周波数に基づく瞬時流量値の算出および表示、外部装置への出力、さらには、スイッチ出力信号出力などの各種処理が実行される。
【0077】
図14は、前記メインルーチンの処理フローを示す図である。この図に示すように、メインルーチンには、第1のスタート(スタート1)と第2のスタート(スタート2)の2つのスタート位置がある。ここで、前記パワーオンリセット回路14からのリセット信号が入力されたときには前記スタート1から動作が開始され、前記ウォッチドッグタイマ15からの割込入力があったときには前記スタート2から動作が開始される。
【0078】
さて、前記外部装置EXCTとこの流量計とが接続されるなどにより、前記直流安定化電源回路78から電源の供給が開始されると、前記パワーオンリセット回路14がこのことを検知し、マイコン20にパワーオンリセットパルスが印加される。これにより、スタート1から処理が開始され、まず、ステップS41の第1の初期化処理が実行される。このパワーオンリセットに基づく第1の初期化処理では、この瞬時流量計の所定の初期化処理を実行するとともに前記RAM85の内容がすべてリセットされる。次に、ステップS42に進み、前記タイマ群83の各タイマの計時動作を開始する。ただし、ここでは、前記第2周期タイマ(0.2秒タイマ)と前記1msecの基準クロックを発生するタイマの動作は開始されない。したがって、前述のように第1周期タイマからの信号も出力されない。
続いて、前記EEPROM17から前記検査終了フラグ、積算流量データおよび積算バッチ流量値データなどを読み出して、前記RAM85の所定の領域に格納する(ステップS43)。最初の状態、すなわち、工場出荷前に外部装置EXCTとして調整検査装置が接続された状態においては、前記検査終了フラグおよび両積算データはいずれも初期値0とされている。次に、前記第1の出力OUT1(OUT)を2秒間だけオン状態にする(ステップS44)。これにより、前記外部装置EXCT(調整検査装置)に対して、この瞬時流量計のパワーオンリセットによる起動(スタート1)を報知することができる。また、同時に、前記OUT1LED33も2秒間だけ点灯される。
【0079】
一方、制御プログラムの暴走など何らかの原因により所定期間内に前記ウォッチドッグタイマ15への定時信号が出力されなかった場合には、前記ウォッチドッグタイマ15から割込信号が入力される。このときには前記スタート2から開始され、ステップS45の第2の初期化処理が実行される。この第2の初期化処理においては、この瞬時流量計の所定の初期化処理を実行するが、前記第1の初期化処理とは異なり、前記RAM85中に格納されている補正係数、積算流量値データおよび積算バッチデータ等のクリアは行なわれない。そして、前記ステップS42と同様に、前記第2周期タイマ(0.2秒タイマ)および1msecの基準クロックを除く各タイマの計時動作が開始される(ステップS46)。
【0080】
前記ステップS44あるいはステップS46が実行された後、ステップS47に進み、前記機能選択部12におけるジャンパーピンJ2により4〜20mA伝送方式に設定されているか否かが判定される。この判定の結果がYESのときは、ステップS48に進み、前記信号出力部40のD/A変換部73、V/I変換部74および4〜20mA伝送信号出力部75の動作を可能として、外部出力を4〜20mA伝送方式にするように設定する。また、前記ステップS47の判定結果がNOのときは、ステップS49に進み、マイコン20に内蔵されている前記PWM出力機能部を動作可能に設定して、PWM方式で外部に測定データを出力するように設定する。
【0081】
次に、ステップS50に進み、前記ジャンパーピンJ1が瞬時流量計モードに設定されているか否かを判定する。前記ジャンパーピンJ1が短絡されており瞬時流量計モードとされているときは、この判定結果がYESとなり、ステップS51の瞬時流量計処理プログラムが実行される。一方、前記ジャンパーピンJ1が開放されているときには、ステップS52の積算バッチ流量計処理プログラムが実行されることと成る。本明細書では、瞬時流量計を対象としているため、以下、前記ステップS50の判定結果がYESとなった場合における瞬時流量計処理プログラム(ステップS51)について詳細に説明する。
【0082】
図15は、前記ステップS51の瞬時流量計処理プログラムの動作を説明するためのフローチャートである。
この瞬時流量計処理プログラムが開始されると、まず、ステップS60において、前記第2の出力OUT2を有効とし、入力INを無効とする。
次に、ステップS61に進み、検査終了フラグがセットされているか否かを判定する。この検査終了フラグは、後述する調整検査工程においてこの瞬時流量計の検査および係数データの補正処理が行なわれたときにセットされるフラグであり、初期状態においては、この検査終了フラグはセットされておらず、このステップS61の判定結果はNOとなる。このときには、ステップS62に進み、この瞬時流量計の機種設定コードを前記手動操作部13、すなわち、前記設定キー41、アップキー42およびダウンキー43を用いて設定する。これにより、この瞬時流量計が用いられる流路の口径および材質が設定される。なお、上述したように、このステップS62は検査終了フラグがセットされていないときに実行されるものであり、実際にはメーカにおいて実行される。
【0083】
一方、検査終了フラグがセットされているときには、ステップS63に進み、前記EEPROM17に格納されている各種データ(前記補正された一次式傾きデータA1〜A5および一次式切片データB1〜B5など)を読み出して、前記RAM85の所定のエリアに格納する。
なお、調整検査工程が実施されていない場合には、前記ROM84に格納されている標準的な一次式傾きデータa1〜a5および一次式切片データb1〜b5が前述した流量の算出に用いられることとなる。
【0084】
前記ステップS62あるいはステップS63が実行された後、ステップS64に進み、前記設定コードおよび前記EEPROM17から読み出された情報に基づき、当該流路の口径、材質および当該制御プログラムのバージョン情報を前記表示部30に順次所定時間ずつ表示する。
図16に、このステップS64による前記表示部30の表示形態の一例を示す。図16において、(a)は口径の表示形態の一例、(b)は材質の表示形態の一例、(c)はソフトウエアのバージョンの表示の一例を示しており、(a)→(b)→(c)→(a)の順に所定時間(例えば、1秒間)ずつ順次繰り返し表示される。
【0085】
ここで、口径としては、ミリメートル(mm)単位の表示(数字の後にAが付されている)とインチ単位の表示(数字の後にBが付されている)とがある。そこで、これらの口径を図16(a)の右側に示すような形態で3桁のデータ表示器31を用いて表示する。図16の(a)に示した例においては、「10A」が表示されている。なお、図16の(a)中各口径の左に記載されている小、中、大は、それぞれの口径を大、中、小の3通りに分類したときに、各口径が属する分類を示している。
また、材質としては、例えばL−PPS、PPS(ポリフェニレンスルフィド)、PVC(ポリ塩化ビニル)、PFA、SUS(ステンレス)等があり、これらを、図16の(b)に示す形態で、前記データ表示器31に表示している。図示した例では、材質がPVCであることを示している。
さらに、図16の(c)は、制御プログラムのバージョンの表示例を示しており、この例では、この制御プログラムのバージョンはV3.8であることが示されている。
このように本発明の瞬時流量計においては、動作開始時に当該制御プログラムのバージョンを計測データの表示を行なう表示器31に表示させるようにしているため、メンテナンス等を行なうときに非常に便利になっている。
【0086】
さて、このように、口径、材質、プログラムのバージョンの表示(ステップS64)を行なった後、ステップS65に進み、前記0.2秒タイマおよび前記1msecクロックの計時処理を開始するとともに、前記主、副両カウンタの計数処理を開始する。そして、0.2秒割込が1秒のうちのどの位置にあるかを示す値jを記憶するレジスタjに0をセットする。このレジスタjの内容は、0.2秒周期の第2の信号が前記第1の信号の1秒の周期のうちのどの位置にあるかを示すものであり、第1の信号(1秒タイマ)と同じタイミングのときに、j=1、以下、順に、2、3、4と計数され、j=5のときにはj=0に変換され、再び、j=1,2,3…と順に計数される。
なお、上述のように、この実施の形態では、この第2周期タイマ(0.2秒タイマ)の出力から前記第1周期タイマの出力を生成しているが、第1周期タイマ(1秒タイマ)と第2周期タイマ(0.2秒タイマ)を別個に設けて前記第1の信号および第2の信号を発生させるようにしてもよい。
【0087】
次にステップS66に進み、検査モードであるか否かが判定される。この判定は、前記検査モード設定ピン18が接続されている入力ポートからの信号を入力し、前記検査モード設定ピン18が短絡されているか否かを判定することにより行なわれる。前記検査モード設定ピン18が短絡されて検査モードに設定されているときには、ステップS67に進み、検査終了フラグがセットされているか否かを判定する。そして、検査終了フラグがセットされていないときには、後述するステップS68の検査工程が実行され、その後にステップS69の流量算出処理が実行される。
一方、検査モードに設定されていないとき、あるいは、前記ステップS67の判定結果がYESのときには、そのまま、ステップS69の流量算出処理に進む。以下、ステップS70の表示処理、ステップS71の外部出力処理、ステップS72のスイッチ出力処理およびステップS73のキー入力処理が順次実行される。そして、前記ステップS73のキー入力処理が実行された後、再び、前記ステップS66に戻り、前記ステップS66〜S73の処理が繰り返し実行される。なお、前記ステップS69〜S73の各処理の詳細については、後述する。
以上が、瞬時流量計処理プログラムの概要である。
【0088】
図17は前記電源電圧チェック割込処理の動作を説明するためのフローチャートである。前記電圧検出器16は電源電圧Vccが所定の電圧以上であるか否かを判定し、電源電圧Vccが第1の所定電圧よりも低くなったことを検出したときに、前記マイコン20に対し電源電圧チェック割込を発生する。これにより、この電源電圧チェック割込処理が起動される。この電源電圧チェック割込み処理が起動されると、まず、ステップS81において、前記RAM85中の積算データ、前記口径および材質データ、前記積算表示方式を指定するデータ、前記上限流量値設定データ、前記下限流量値設定データ、および、前記スイッチ出力周期決定データなどの選択された所定のデータを前記EEPROM17に格納する。これにより、これらのデータの消失を防止することができる。
【0089】
前記ステップS81において必要なデータをEEPROM17に退避した後、前記マイコン20はウェイト状態とされる(ステップS82)。そして、電源電圧Vccが前記第1の所定電圧よりも低い第2の所定電圧に達することなく再び前記第1の所定電圧以上に復帰したときには、前記ウェイト状態が解除され(ステップS83)、再び、メインルーチンの処理に復帰する。この場合には、電源電圧Vccが前記第2の所定電圧以下に低下しなかったため、前記RAM85中のデータは失われていないものと考えられ、メインルーチンの処理に復帰することとなる。
一方、電源電圧Vccが、前記第2の所定電圧以下に低下したときには、前記RAM85中のデータは失われたものと考えられるため、電源電圧Vccが復帰したときには、前記パワーオンリセット回路14が動作し、前述した第1のスタート位置(図14のメインルーチン)から再び処理が開始されることとなる。
【0090】
次に、前記ステップS68(図15)の調整検査工程について、図18に示す調整検査工程時の接続図および図19のフローチャートを参照して説明する。
この調整検査工程は、図18に示すように前記外部装置EXCTとして調整検査装置が接続された状態で実行される。なお、前記図11および図12に示したように、信号出力部40/電源部45がこの場合の外部装置である調整検査装置EXCTに接続されるのであるが、この調整検査工程には前記4〜20mA伝送信号あるいはPWM信号の瞬時流量に対応する信号のオフセット調整、スパン調整については、この図18では記載を省略している。
【0091】
図18において、配管100には基準となる高精度基準流量計101、本発明の瞬時流量計の計量部本体50、ポンプ102、流量制御弁103が取り付けられている。そして、前述のように前記信号出力部40における出力トランジスタ70のOUT1出力、前記10ビットの測定データ出力および前記出力トランジスタ77を介する前記センサ部11の出力がコネクタを介して前記調整検査装置に入力されている。また、前記調整検査装置には前記高精度の基準流量計101の出力も入力されている。そして、前記調整検査装置からは前記流量制御弁103に対する制御信号が出力され、図19に示す予め定められた検査ステップにしたがって、所定の流量を前記配管100に流すように制御する。
なお、図11に示したように、実際には電源ライン、入力信号線、出力信号線も接続されているが、この図18では記載を省略している。
【0092】
このように接続された状態で前記調整検査工程S68は実行される。図19のフローチャートに示すように、まず、ステップS91において、予め定められている手順で流量計各部の検査を実行する。次に、ステップS92に進み、前記出力OUT1を所定の時間(例えば0.1秒間)だけオン状態とした後オフ状態として、前記調整検査装置に対し調整検査工程の最初のステップが開始されたことを報知する。これを受けて、前記調整検査装置は、選択決定された機種(型式)に対応する前記ROM84に格納されている6つの周波数f1〜f6に対応する基準流量Q1〜Q6を前記高精度基準流量計101で計測しながら、前記流量制御弁103を制御して前記配管に流す。ここでは、まず、前記配管100に第1の基準流量Q1が流れるように前記流量制御弁103を制御する。当該流量計は、このときの前記センサ部11からの入力信号に基いて前述の方法で周波数を算出し記憶する(ステップS93)。このときの周波数をF1とする。そして、該周波数F1とそのときの流量Q1を前記表示器31に表示するとともに、該周波数値F1を前記信号出力部40を介して前記調整検査装置に出力する(ステップS94)。
【0093】
次に、ステップS95に進み、再び前記出力OUT1を所定時間の間だけオン状態として、前記調整検査装置に対してステップの進行を報知する。これにより、前記調整検査装置は、第2番目の基準流量Q2を前記配管100に流すように制御する。そして、前記コントロール部20は、そのときのセンサ部11からの入力に基づいて周波数F2を算出記憶し(ステップS96)、その測定周波数値F2と基準流量Q2を表示するとともに、前記調整検査装置に出力する(ステップS97)。そして、ステップS98に進み、前記ステップS93において記憶した基準流量Q1における測定周波数F1と前記ステップS96において記憶した基準流量Q2における測定周波数F2とに基づいて、補正された一次式傾きデータA1および切片データB1を算出する。この補正係数A1、B1は、次の式(6)および式(7)に基づいて算出される。
A1=(Q2−Q1)/(F2−F1) ……(6)
B1=(Q1×F2−Q2×F1)/(F2−F1) ……(7)
そして、この算出された補正係数A1およびB1を前記RAM85の所定の領域に格納する。そして、ステップS99に進み、前記出力OUT1を所定期間だけオン状態とすることにより、前記調整検査装置に対してこのステップの処理が終了したことを報知する。
【0094】
以下、上述の場合と同様に、基準流量Q3〜Q6を順次流し、そのときの測定周波数値F3〜F6を用いて、同様に、補正係数A2〜A5およびB2〜B5を算出し、RAM85に格納する。そして、ステップS101において表示器31に検査工程の終了を表示し、さらにステップS102において前記RAM85に格納した各係数A1〜A5およびB1〜B5を前記EEPROM17に格納し、ステップS103で前記検査終了フラグをセットして、この検査工程を終了する。
なお、前記ステップS94、S97等において、調整検査装置に出力された周波数データF1〜F6は、前記調整検査装置に検査記録として保存される。また、前記ステップS94、S97等において、測定周波数値Fi、基準流量Qiは、表示器31において所定期間(例えば、0.5秒間)ずつ交互に点滅表示される。
【0095】
次に、前記周波数測定割込処理および1msecクロック計数割込処理について、図20、図21のフローチャートおよび図22のタイムチャートを用いて説明する。
図20は前記周波数測定割込処理のフローチャートである。この周波数測定割込処理は、0.2秒毎に発生される前記第2周期タイマ(0.2秒タイマ)の出力により起動される。この処理が起動されると、まず、ステップS111において、前記0.2秒タイマを再スタートさせる。これにより、毎回、正確な0.2秒ごとの割込みを保証することができる。また、前述のように、この実施の形態では、この0.2秒タイマの出力に基づいて前記第1周期タイマ出力を生成しているため、第1周期タイマ(1秒タイマ)出力の正確性も保証される。
【0096】
次に、ステップS112に進み、前記スイッチ出力周期決定データを参照し、スイッチ出力が高速にセットされているか否かを判断する。前述したように、この瞬時流量計の使用される態様によっては、測定した流量値が予め設定された下限流量値あるいは上限流量値を超えたときに高速な(例えば、1秒以内の)スイッチ出力が求められる場合がある。これに対応するために、本発明においては、前記スイッチ出力周期決定データにより、スイッチ出力を高速とするか否かを選択することができるようになされている。このスイッチ出力周期決定データの設定は、後に詳述するキー入力処理ルーチン(前記ステップS73)において、前記手動操作部13の各キースイッチ41〜43を用いてユーザが設定することができるようになされている。
このステップS112の判定の結果高速出力とされているときには、ステップS113においてスイッチ出力フラグをセットし、ステップS114に進む。一方、高速出力とされていないときには、そのままステップS114に進む。
【0097】
ステップS114においては、前記レジスタjの内容が0〜4のいずれであるのかを判定する。そして、j=0およびj=4のときは、そのままステップS119に進む。また、j=1のときは、ステップS115において主カウンタ81の計数内容f0をレジスタに格納し、ステップS116において主カウンタ81の計数内容を0にリセットして再び主カウンタ81による入力パルス信号の計数を再開し、ステップS119に進む。
これにより、図22に示すように、j=1のとき、すなわち、前記第1周期タイマの測定開始(終了)点において主カウンタの計数値f0がレジスタに格納されることとなる。したがって、レジスタには、1秒間に入力される入力信号パルスの数f0、すなわち、入力信号パルスの周波数の整数部が格納されることとなる。
また、j=2のときは、ステップS117において演算許可フラグ1をセットして、ステップS119に進む。さらに、j=3のときは、ステップS118において、外部出力許可フラグをセットして、ステップS119に進む。
【0098】
さて、前述のように、ステップS114においてj=0または4のとき、もしくは、ステップS116、S117またはS118が実行された後、ステップS119が実行され、前記レジスタjの内容はインクリメントされる。そして、ステップS120において、前記レジスタjの内容が2であるか否かが判定され、j=2のときは、ステップS121に進む。後述するように、前記副カウンタ82は前記センサ部11からの入力パルスの立上がりから立下がりまで前記1msec基準クロックを計数しており、このステップS121において、この時点における前記副カウンタ82の計数値n1をレジスタに格納する。そして、演算許可フラグ2をセットし(ステップS122)、今回の周波数測定割込み処理を終了する。
すなわち、図22に示すように、前記ステップS121により、前記計測開始(終了)点の直前の入力パルス信号の立上がりエッジから当該計測開始点までの1msec基準クロックにより計数した時間n1がレジスタ中に得られる。
一方、前記ステップS120の判定結果がNOのときは、ステップS123に進み、j=5であるか否かを判定する。そして、j=5のときは、レジスタjの内容を0にセットし、また、j≠5のときは、そのまま、この周波数測定割込み処理を終了する。
【0099】
図21は、前記1msecクロック計数割込処理を説明するためのフローチャートである。
前記入力パルス信号の立ち上がりエッジを検出したとき、この1msecクロック計数割込処理が開始され(ステップS131)、1msecクロックの計数が開始される(ステップS132)。なお、実際には、この計数処理は、前記副カウンタ82において実行される。そして、その計数値N1が200以上(すなわち、1msec×200=0.2sec以上)となったか否かを判定し(ステップS133)、200以上となったときは前記第2のカウンタをリセットして、次の入力パルス信号の立ち上がりエッジの検出を待つ(ステップS139)。前述のように、この例においては、測定下限周波数は5Hzとされており、入力パルスの周期が0.2sec以上のときは該測定下限周波数以下であるため、このように、次の入力パルスを待つこととしている。すなわち、流れ有り周波数が5Hzとされていれば、計測すべき流れはないのでパルスが入力されず、この入力パルスの測定を行う必要がないという現実的な側面もある。
【0100】
一方、前記ステップS133の判定結果がNOのときは、ステップS134に進み、次の立ち上がりエッジを検出するまで、上記計数を繰り返す(ステップS134のNO)。そして、次の立ち上がりエッジを検出したときは、それまでの副カウンタ82の計数値N1を前記RAM85の所定領域に格納する(ステップS135)。すなわち、図22に示すように、前記入力パルスの周期を順次1msecクロックにより計測し、該計測値を順次RAM85中に格納する。なお、このとき、前回の計数値とは異なるRAM85の領域に今回の計数値を格納するようにする。すなわち、RAM85の副カウンタ82の計数値N1を格納する領域として、例えば、最低3つの計数値を格納する領域を準備し、直前の3つの計数値N1を順次格納する。
【0101】
次に、ステップS136に進み、前記RAM85に格納されている計数値N1が、3回連続して、20あるいは16となっているか否かを判定する。これは、交流電源(50Hzあるいは60Hz)の誘導電圧がノイズとして前記測定信号に混入している場合に、これによる誤測定を防止するためである。このステップS136の判定結果がYESのときは、ステップS140に進み、前記主カウンタの計数値f0を0にリセットするとともに、次の計数開始時点、すなわち、j=0のときまで、前記主カウンタ81の計数動作を中止させる。
なお、一般に流量値は細かく変動しており、通常、同一の周波数が連続して検出されることはないので、このような手法により商用交流電源からの誘導ノイズを検出することを防止できる。
【0102】
一方、前記ステップS136の判定結果がNOのときは、ステップS137に進み、前記演算許可フラグ2がセットされているか否かを判定する。この判定の結果がNOのときは、前記ステップS132に戻り、前述した入力パルス信号の周期の計測を継続する。一方、演算許可フラグ2がセットされており、前記ステップS137の判定結果がYESのときは、ステップS137に進み、このときの計数値N1を前記RAM85から読み出して、前記レジスタに格納する。そして、再び、前記ステップS132以降の処理を繰り返す。すなわち、前述のように、j=1に対応するタイミングで前記演算許可フラグ2がセットされており(前記周波数測定割込処理におけるステップS122)、図22に示すように、測定開始点後の最初の入力パルスの立上がり時点で、前記計数値N1がレジスタに格納されることとなる。これにより、この1msecクロック計数割込処理により、前記j=1の時点をまたぐ入力パルス信号の周期N1をレジスタ中に得ることができる。
【0103】
このように、上記周波数測定割込処理および1msecクロック計数割込処理により、レジスタ中に主カウンタ81の計数内容f0および副カウンタ82の計数内容n1およびN1が書込まれることとなる。前記流量算出処理ステップS69(図15)以降の処理において、これらの計数値を用いて流量値を算出し、それを表示し、外部に出力し、さらに外部にスイッチ出力を行なう処理が行なわれる。
以下、これらの処理について詳細に説明する。
【0104】
図23は、前記ステップS69の流量算出処理を示すフローチャートである。この処理が開始されると、まず、前記演算許可フラグ1および前記演算許可フラグ2がともにセット状態となっているか否かが判定される(ステップS141)。ここで、前記演算許可フラグ1および2がともにセットされていないときには、レジスタに前記主カウンタの計数値f0および前記副カウンタの計数値N1およびn1が準備されておらず瞬時流量値および積算流量値の演算を実行するタイミングではないので、このままこの流量算出処理を終了する。
【0105】
一方、前記演算許可フラグ1および演算許可フラグ2の両方がセットされているとき(前記図22に示したように、j=2以降のタイミングであるとき)には、ステップS142に進み、前記レジスタに格納されている前記主カウンタ81により計数された1秒間の入力パルス信号の個数f0がレジスタfに格納される。次に、ステップS143に進み、測定開始点における小数部の減算を行なう。すなわち、前述したように、前記副カウンタ82により計数されレジスタに格納されているN1およびn1の値を用いて、前記式(4)前半部のf−n1/N1を算出し、前記レジスタfに格納する。続いて、ステップS144に進み、前記測定終了点における小数部の加算を行なう。すなわち、前記副カウンタ82により計数されレジスタに格納されているN2およびn2の値を用いて、前記式(4)後半部のf+n2/N2を算出し、前記レジスタfに格納する。すなわち、前記ステップS142、S143およびS144により、前述した式(4)の演算を実行して、1秒間の入力パルス信号の周波数fを高精度に算出する。
【0106】
次に、ステップS145に進み、このようにして算出された周波数fの値が前記流れ有り周波数F1以上であるか否かを判断する。この結果がNOのときは測定下限周波数以下であるため、ステップS148に進み、瞬時値を格納するレジスタQに0を格納する。一方、前記周波数fが流れ有り周波数F1以上のときは、ステップS146に進み、前記式(3)に基づいて、瞬時流量値Q(=Ai×f+Bi)を算出する。なお、ここで用いられている補正係数AiおよびBiは、前記ステップS63(図15)において前記EEPROM17から読み出された補正係数である。なお、ここで前記瞬時流量値Qは「L/min」を単位とした値とされている。
続いて、ステップS147に進み、前記ステップS146で算出した瞬時流量値Qを用いて、積算流量値Qtに対しQ/60を加算して該積算流量値Qtを更新する。ここで、Qを60で除算するのは1秒間の流量に変換するためである。前記ステップS148あるいは前記ステップS147の処理が終了した後、前記前記演算許可フラグ1および2をともにリセットして(ステップS149)、この流量算出処理を終了する。
【0107】
図24は、前記ステップS70(図15)の表示処理を説明するためのフローチャートである。この表示処理が開始されると、まず、ステップS151において、設定されている表示モードが判定される。ここで、表示モードが瞬時流量とされているときは、ステップS152に進み、前記表示器31に前記流量算出処理において算出した瞬時流量値Qを表示する。なお、この表示モードの設定は、後述するキー入力処理において設定される。
また、積算流量表示とされているときは、ステップS153に進み、固定桁表示に設定されているか否かを判定する。ここで、固定桁の表示(固定小数点方式の表示)に設定されているときには、ステップS154に進み、前記表示器31に上位桁の表示であることを示す記号「u.d.」と積算流量値のm3を単位とする上位桁データを所定期間(例えば、0.5秒毎に5秒間)交互に表示する。続いて、ステップS155に進み、前記表示器31に下位桁の表示であることを示す記号「L.d.」と積算流量値のLを単位とする下位桁データを、前記ステップS154と同様に所定期間交互に表示する。
【0108】
一方、浮動小数点方式の表示に設定されているときには、前記ステップS153の判定結果がNOとなり、ステップS156に進む。このステップS156においては、前記表示器31に上位桁の表示であることを示す記号「u.d.」と積算流量値の最上位桁から3桁のデータを所定期間交互に表示する。また、前記単位表示部32が設けられているときには、前記表示とともに、前記「m3」単位表示LED35を点灯表示する。そして、ステップS157に進み、前記表示器31に下位桁の表示であることを示す記号「L.d.」と積算流量値の最上位桁から第4〜6桁目のデータを所定期間交互に表示する。また、前記単位表示部32が設けられているときには、それと同時に、対応する単位表示用LED35あるいは36を点灯する。すなわち、表示している第4〜6桁目のデータの単位が立方メートルであるときは「m3」単位表示LED35を点灯し、リットルであるときは、「L」単位表示LED36を点灯する。
【0109】
図25は、前記外部出力処理S71(図15)のフローチャートである。この外部出力処理が起動されると、まず、ステップS161において、前記外部出力許可フラグがセットされているか否かが判定される。この外部出力許可フラグは、前記周波数測定割込処理(図20)におけるステップS118において、j=3のタイミングでセットされるフラグである(図22参照)。この外部出力許可フラグがセットされていないときは、外部出力のタイミングではないためこのままこの外部出力処理を終了する。
このように、本発明においては、外部出力のタイミングを所定のタイミングとしているため、外部装置において取得されるデータの偏差が少なくなり、高精度の監視が可能となる。
一方、外部出力許可フラグがセットされているときには、ステップS162において、設定されている外部出力の信号方式が判定される。前述したように、この出力方式の選択は、前記機能選択部12(図11)におけるジャンパーピンJ2により設定されている。
【0110】
ここで、信号方式として4〜20mA伝送方式が選択されているときは、ステップS163において、前記ステップS144(図23)で算出された周波数fが前記流れ有り周波数F1以上であるか否かを判定し、流れ有り周波数F1以上でないときには、ステップS164に進み、前記10ビットの出力ラッチに全て「0」を出力する。また、周波数fが流れ有り周波数F1以上のときは、ステップS165に進み、前記ステップS144(図23)で算出した瞬時流量値Qが定格の流量値の110%以上であるか否かを判定する。この判定結果がYESのときは、ステップS167に進み、前記10ビットのラッチ出力に全て「1」を出力する。一方、前記ステップS165の判定結果がNOのときは、ステップS166に進み、前記算出した瞬時流量値Qの値に対応する10ビットの出力を前記10ビットのラッチに出力する。これにより、前記信号出力部40(図12)における10ビットD/A変換部73においてこの10ビットラッチ出力がアナログ信号に変換され、V/I変換部74において対応する電流信号に変換され、4〜20mA伝送信号出力部75から前記外部装置EXCTに対応する4〜20mA伝送信号が出力されることとなる。
【0111】
一方、前記機能選択部12におけるジャンパーピンJ2が開放されており、出力方式としてPWM信号方式が選択されているときは、ステップS168に進む。そして、前述の場合と同様に、測定した周波数fが流れ有り周波数F1以上であるか否かを判定する。その結果がNOのときは、前記マイコン20に内蔵されているPWM出力機能部から10ビットの「0」に相当するデューティを有するパルス信号を前記出力トランジスタ76のゲートに出力する(ステップS169)。また、測定した周波数fが流れ有り周波数F1以上であるときには、ステップS170に進み、前記算出した瞬時流量値Qが定格の110%以上であるか否かを判定する。そして、この判定結果がNOのときは、ステップS171に進み、前記算出した瞬時流量値Q(これは10ビットのデータとされている)に対応するデューティを有するパルス信号を前記出力トランジスタ76のゲートに出力する。また、前記瞬時流量値Qが定格の110%以上であるときは、ステップS172に進み、10ビットのオール1に相当するデューティを有するパルス信号を前記出力トランジスタ76のゲートに出力する。これにより、前記出力トランジスタ76を介して、外部装置EXCTに測定した瞬時流量に対応する10ビットの分解能を有するPWM信号を出力することができる。
【0112】
前記ステップS167、S166またはS164、もしくは、前記ステップS172、S171またはS169により設定されている信号方式に基づく信号を外部装置EXCTに出力した後、ステップS173において前記外部出力許可フラグをリセットして、この外部出力処理を終了する。
このように本発明においては、10ビットの分解能を有する測定結果を用いているため、誤差の伝搬を防止し、高精度の測定結果を得ることが可能となる。
【0113】
図26は、前記スイッチ出力処理S72(図15)の動作を説明するフローチャートである。このスイッチ出力処理が開始されると、まず、ステップS181において、前記スイッチ出力フラグがセットされているか否かが判定される。このスイッチ出力フラグは、前記周波数測定割込み処理(図20)におけるステップS113においてセットされるフラグであり、高速スイッチ出力モードとされているときには、前記ステップS113(図20)において0.2秒毎にこのフラグがセットされることとなる。ここで、スイッチ出力フラグがセットされていない通常スイッチ出力モードのときは、ステップS185に進み、レジスタf’に前記測定周波数fを書込む。一方、前記スイッチ出力フラグがセットされている高速出力モードのときは、ステップS182に進み、前記主カウンタ81の計数値f0を読み込み、前回のこのスイッチ出力処理時において読み込んだ主カウンタの計数値f0(old)との差Δfを求め、レジスタf’に5×Δfを書込む(ステップS183)。そして、ステップS184において、前記スイッチ出力フラグをリセットする。なお、スイッチ出力フラグは、フローチャート中では、SW出力フラグと記述されている。
【0114】
すなわち、前記スイッチ出力フラグがセットされている高速スイッチ出力モードにおいては、0.2秒毎に実行されるこのスイッチ出力処理において読み込まれた主カウンタ81の計数値の差Δfを5倍した値をスイッチ出力のための周波数値f’として用い、通常スイッチ出力モードのときには、前記ステップS144(図23)で算出した周波数値f(この値は、ほぼ1秒毎に算出される)をスイッチ出力のための周波数値f’として用いている。
このようにしてスイッチ出力のための周波数値f’を決定した後、ステップS186に進み、前述した式(3)に基づいて、この周波数値f’に対応する瞬時流量値Q’(=Ai×f’+Bi)を算出する。
【0115】
次に、ステップS187に進み、前記ステップS186で算出した瞬時流量値Q’と予め設定されている下限流量値QLとを比較する。この結果、Q’≦QLのときはステップS188に進み、前記出力トランジスタ70のゲートにハイレベルを出力して第1の出力OUT1から「L」レベル信号を出力する。また、同時に前記第1の出力用のLED33を点灯する。
一方、Q’>QLのときは、ステップS189に進み、出力OUT1が「L」レベルとなっているか否かを判定する。この結果がYESのときは、さらに、ステップS190に進み、瞬時流量値Q’がQL+qL以上であるかどうかを判定する。この判定の結果がNOのときは、前記ステップS188に進む。
このように、このステップS189およびS190において、出力OUT1にヒステリシス特性を持たせている。これにより、図26中にも示したように、出力OUT1は瞬時流量値Q’が下限流量値QL未満となったときに「L」レベルとなり、瞬時流量が上昇してきたときには、QL+qL以上となったときに「H」レベルとなるようにヒステリシス特性を有するものとされている。
一方、前記ステップS189の判定結果がNOのとき、および、前記ステップS190の判定結果がYESのときは、ステップS191に進み、前記出力トランジスタ70のゲートにローレベルを出力し、第1の出力OUT1から「H」レベル信号を出力する。また、同時に前記OUT1LED33を消灯する。
【0116】
第1の出力OUT1に対する前記ステップS188あるいは前記ステップS191の処理を実行した後、ステップS192に進み、今度は、前記瞬時流量値Q’と上限流量値QUとの比較を行なう。その結果、QU≦Q’のときは、ステップS193に進み、前記出力トランジスタ71(図12)のゲートにハイレベルの信号を出力し、前記第2の出力OUT2に「L」レベルを出力するとともに、前記第2の出力LED34を点灯する。
一方、Q’<QUのときは、ステップS194に進み、第2の出力OUT2はローレベルか否かを判定する。この結果、ローレベルのときは、ステップS195に進み、前記瞬時流量値Q’がQU−qU以下であるか否かを判定する。ここで、qUは前記第2のスイッチ出力のヒステリシス特性を定める値であり、この第2のスイッチ出力OUT2は、瞬時流量値Q’が上限流量値QU以上となったときにハイレベルからローレベルに反転し、瞬時流量値Q’がQU−qU以下となったときに、ローレベルからハイレベルに反転するようになされている。したがって、前記ステップS195の判定結果がNOのときは、未だOUT2出力をローレベルからハイレベルに反転する流量ではないため、前記ステップS193に進む。
また、前記ステップS194の判定結果がNOのとき、あるいは、前記ステップS195の判定結果がYESのときは、ステップS196に進み、前記出力トランジスタ71(図12)のゲートにローレベルの信号を出力し、前記第2の出力OUT2に「H」レベルを出力するとともに、前記第2の出力LED34を消灯する。
【0117】
このように、本発明のスイッチ出力処理においては、0.2秒毎に前記主カウンタの計数値f0をチェックし、前回(0.2秒前)における計数値との差Δfを求め、5×Δfを1秒間の周波数として近似的な流量を算出している。そして、この0.2秒毎に算出した近似流量値を用いて、上限/下限流量値との比較を行っている。したがって、従来のように、測定周期(例えば、1秒)ごとに比較を行う場合と比較して、迅速に事故の発生を検出し信号を発信することが可能となり、前述した冷却水の流量を監視する応用例のような場合に、設備の焼損を防止することが可能となる。
【0118】
なお、上記においては、0.2秒毎の主カウンタ81の計数値の差Δfに基づいて近似周波数値を算出していたが、他の方法を採用することもできる。すなわち、0.2秒毎に、その時点が前記第1の周期のうちのどの時点であるかに応じて、その時点における主カウンタ81の計数値f0に異なる係数を乗算して近似的な1秒間の周波数を求め、これにより、近似的な流量を算出する方法である。具体的には、当該時点が0.2秒後のときは主カウンタの計数値f0×5を1秒間の周波数値として、0.4秒後のときはf0×2.5を、0.6秒後のときはf0×1.667を、0.8秒後のときはf0×1.25をそれぞれ1秒間の周波数値として、近似流量を算出し、この近似流量と前記上限/下限流量値とを比較する。この手法によれば、前述の場合よりも、より高精度の近似流量を得ることが可能となるが、異なる係数を用いているために制御プログラムが複雑となる。
【0119】
図27は、前記キー入力処理S73(図15)の処理フローチャートである。このキー入力処理が開始されると、まず、ステップS201において、前記手動操作部13の設定キー(ENTキー)41、アップキー(△キー)42あるいはダウンキー(▽キー)43のいずれかが操作されたか否かを判定する。ここで、キー操作が検出されなかったときは、ステップS202に進み、前記瞬時流量値Qの表示を行なって、このキー入力処理を終了する。
【0120】
上記操作キー41〜43のうちのいずれかの操作が検出されたときは、ステップS203に進み、操作されたキーがENTキー41であるか否かを判定する。操作されたキーがENTキー41であるときは、ステップS204に進み、積算流量値Qt表示フラグを所定期間(ここでは、10秒間)セット状態とする。これにより、前記表示処理(図24)のステップS151において、表示モードが積算流量モードとされ、前記積算流量値Qtが表示部30に表示されることとなる。そして、ステップS205に進み、前記ENTキー41が再度操作されたか否かを判定する。そして、ENTキー41が操作されなかったときは、そのままこのキー入力処理を終了する。
このように、操作者がENTキー41を1回操作することにより、前記表示部30に積算流量値Qtを所定期間表示させることができる。
【0121】
一方、ENTキー41が再度操作され前記ステップS205の判定結果がYESとなったときは、ステップS206に進み、前記表示器31に出力OUT1のLレベル点(下限流量値QL)を表示し、前記OUT1LED33を点滅表示する。操作者は、この状態にあるとき、前記△キー42あるいは▽キー43を用いて前記QLの値を変更し、ENTキー41で設定させることができる。ENTキー41が操作され、このQLの設定が終了されると、ステップS207に進み、同様にヒステリシス値qLが表示されて、このqLの変更および設定が行なわれる。以下、ENTキー41の操作により、ステップS208の上限流量値QUの表示、変更および設定、ステップS209のヒステリシス値qUの表示、変更および設定が同様に行なわれ、ステップS209においてENTキー41が操作されると、このキー入力処理が終了される。
このように、操作者がENTキー41を2度押すことにより、下限流量値QL、ヒステリシス値qL、上限流量値QU、ヒステリシス値qUの変更および設定を行なうことができる。
【0122】
一方、前記ステップS203においてNOと判定されたとき、すなわち、操作されたキーが△キー42あるいは▽キー43であるときは、ステップS210に進み、前記△キー42および▽キー43が同時に押圧されたか否かが判定される。そして、この判定結果がYESのときは、さらに、△キー42および▽キー43が同時に第1の所定時間(例えば、5秒)以上押圧されているか否かが判定される(ステップS211)。前記ステップS210の判定結果がNOのとき、あるいは、前記ステップS211の判定結果がNOのとき、すなわち、△キー42および▽キー43が同時に第1の所定時間(5秒)以上押圧されていなかったときは、このまま、このキー入力処理を終了する。
【0123】
一方、△キー42および▽キー43が同時に前記第1の所定時間以上押圧され、前記ステップS211の判定結果がYESのときは、ステップS212に進み、前記△キー42および▽キー43の同時押しが第2の所定時間(例えば、10秒)以上継続したか否かを判定する。この判定結果がYESのとき、すなわち、△キー42および▽キー43が例えば10秒以上継続して押されたときは、ステップS216に進み、前記RAM85およびEEPROM17中に記憶されている積算流量値Qtをクリアして、このキー入力処理を終了する。
これにより、積算流量値Qtをクリアして、再び0からの積算を開始させることができる。
【0124】
また、前記ステップS212の判定結果がNOのとき、すなわち、△キー42および▽キー43が同時に例えば5秒以上10秒未満押圧されたときは、ステップS213に進み、前記設定コードを読み出し、対応する口径、材質、ソフトのバージョン情報を所定期間ずつ順次表示する。これは、前記ステップS64(図15)における表示と同様である。
次に、ステップS214に進み、設定されている表示モードを前記表示器31に表示する。これは、例えば、表示モードが固定桁表示に設定されているときには、前記表示器31における3つの小数点を全て点灯し、浮動桁表示に設定されているときには、前記表示器31における3つの小数点を1つずつ循環点灯させることなどにより行なわれる。操作者は、このときに、前記△キー42あるいは▽キー43を操作することにより、表示モードを変更することができ、ENTキー41を操作することにより、表示モードを設定することができる。
【0125】
操作者がENTキー41を操作すると、ステップS215に進み、設定されているスイッチ出力周期が前記表示器31に表示される。これは、例えば、スイッチ出力周期が高速に設定されているときには前記表示器31に「0.2」を表示し、低速に設定されているときには「1.0」を表示することにより行なわれる。操作者は、前記△キー42あるいは▽キー43を操作することにより、このスイッチ出力周期の設定を変更することが出来、ENTキー41を操作することにより、該スイッチ出力周期を設定することができる。そして、ENTキー41が操作されたときに、このキー入力処理が終了する。
このように、このキー入力処理においては、前記△キー42および▽キー43を主として設定の変更に用い、ENTキー41を確定に用いることにより、各パラメータの設定および変更を容易に行なうことができる。
【0126】
なお、上述した実施の形態においては、入力パルスの立上がりにより、入力パルスの計数およびその周期の測定を行なうようにしていたが、入力パルスの立下がり時点を基準としてもよい。
また、前記第1の周期、第2の周期および基準クロックの周期は、いずれも、前述した実施の形態において用いた値とする必要は無く、個々の場合に応じて最適な値を用いればよい。例えば、基準クロックをより高速なものとすることにより、より分解能の高い測定を行なうことが可能となる。
さらに、上述した実施の形態においては、表示器31を3桁の表示部を有するLEDとしたが、これに限られることは無く、4桁、8桁等任意の桁数のものとすることができる。さらに、LED表示器に限られることはなく、例えばLCDなど他の表示素子を用いることもできる。
【0127】
【発明の効果】
以上詳細に説明したように、本発明の流量計によれば、短時間の測定で高精度の周波数測定をおこなうことが可能となる。
また、連続して測定を行なうときには、前回の測定に用いた計数値(n2,N2)を次回の測定にも用いることができ、高い処理効率で測定を行なうことができる。
本発明の流量計によれば、第1の周期毎に瞬時流量値を高精度に測定することができる。
また、積算流量を多桁で表示することが可能となり、使い勝手のよい流量計を提供することができる。
さらに、高分解能の測定結果に基づいて、所定のタイミングで外部装置に測定流量を伝送することができ、データの偏差が少なく、高精度の監視が可能となる。
さらにまた、使用者が用途に応じて外部スイッチ出力を高速で行なうか否かを選択することができる流量を提供することができる。
さらにまた、スイッチ出力の設定値を容易に設定変更することのできる流量を提供することができる。
【図面の簡単な説明】
【図1】 本発明の流量計の周波数測定方法が適用された周波数測定の構成例を示す図である。
【図2】 本発明の流量計の周波数測定方法を説明するための図である。
【図3】 図1に示す周波数測定におけるメインルーチンのフローチャートである。
【図4】 図1に示す周波数測定における第1タイマ割込処理ルーチンのフローチャートである。
【図5】 図1に示す周波数測定における第2カウンタの計数処理ルーチンのフローチャートである。
【図6】 図1に示す周波数測定の動作を説明するためのタイミングチャートである。
【図7】 本発明の流量計の周波数測定方法適用た流量計の基本構成の一例を示すブロック図である。
【図8】 本発明の流量計の一実施の形態の構造を示す図である。
【図9】 本発明の流量計の表示部の他の実施の形態を示す図である。
【図10】 本発明の流量計におけるプリント基板の配置およびプリント基板上の部品配置の一例を示す図である。
【図11】 本発明の流量計の回路構成を示すブロック図である。
【図12】 本発明の流量計の電源部および信号出力部の構成を示すブロック図である。
【図13】 本発明の流量計におけるROM、RAMおよびEEPROMのメモリマップの一例を示す図である。
【図14】 本発明の流量計のメインルーチンのフローチャートである。
【図15】 本発明の流量計の瞬時流量計処理プログラムのフローチャートである。
【図16】 図15におけるステップS64による表示形態を説明するための図である。
【図17】 本発明の流量計の電源電圧チェック割込処理のフローチャートである。
【図18】 本発明の流量計の調整検査工程時における接続状態を示す図である。
【図19】 本発明の流量計の調整検査工程のフローチャートである。
【図20】 本発明の流量計の周波数測定割込処理のフローチャートである。
【図21】 本発明の流量計の1msecクロック計数処理のフローチャートである。
【図22】 前記周波数測定割込処理および1msecクロック計数処理を説明するための図である。
【図23】 本発明の流量計の流量算出処理のフローチャートである。
【図24】 本発明の流量計の表示処理のフローチャートである。
【図25】 本発明の流量計の外部出力処理のフローチャートである。
【図26】 本発明の流量計のスイッチ出力処理のフローチャートである。
【図27】 本発明の流量計のキー入力処理のフローチャートである。
【符号の説明】
1 周波数検出部
2 第1カウンタ
3 第2カウンタ
4 第1タイマ
5 基準クロック発生部
6 演算処理部
7 制御部
8 表示部
9 出力部
11 センサ部
12 機能選択部
13 手動操作部(キー入力部)
14 リセット信号出力部(パワーオンリセット回路)
15 ウォッチドッグタイマ部
16 電圧低下検出部
17 不揮発性記憶部(EEPROM)
20 コントロール部(マイコン)
30 表示部
31 表示器(データ表示ユニット)
33 出力1表示ユニット(OUT1LED)
34 出力2表示ユニット(OUT2LED)
35、36 単位表示LED
40 信号出力部
41 設定キー(ENTキー)
42 アップキー(△キー)
43 ダウンキー(▽キー)
45 電源部
50 計量部本体
61〜63 プリント基板
70、71、76、77 出力トランジスタ
73 デジタルアナログ変換部(D/A変換部)
74 電圧電流変換部(V/I変換部)
75 4〜20mA伝送信号出力部
78 直流安定化電源回路
81 第1のカウンタ(主カウンタ)
82 第2のカウンタ(副カウンタ)
83 タイマレジスタ群
84 ROM
85 RAM
[0001]
BACKGROUND OF THE INVENTION
This invention , A flow meter that measures the flow rate of a fluid using a pulse signal having a frequency corresponding to the flow rate from the sensor ,as well as The flow rate of comparing the measured flow rate with a preset flow rate value and outputting a digital output corresponding to the comparison result to an external device Total About.
[0002]
[Prior art]
As a device for measuring a signal from a sensor that detects a physical quantity to be measured and generates a pulse signal, a frequency meter, a tachometer, a pulse counter, and the like are known.
For example, a capacitive pressure sensor constitutes an oscillator and generates a signal having a frequency corresponding to pressure. Therefore, the pressure can be measured by measuring the frequency of the signal from the pressure sensor. In the impeller-type flow rate sensor, the magnetized impeller rotates by the flow, and the fixed Hall element detects the magnetism and outputs a pulse signal having a frequency corresponding to the flow rate. The flow rate can be measured by measuring the frequency of the pulse signal.
[0003]
One such physical quantity measuring device is a Karman vortex flow sensor. This Karman vortex flow sensor detects the frequency of Karman vortex streets alternately generated from both sides of a columnar vortex generator provided in a flow path by means of an ultrasonic sensor or a piezoelectric element sensor to detect gas, liquid, etc. It measures the flow rate of fluid.
The flow rate measurement range and the Karman vortex generation frequency corresponding to the flow rate are determined by the diameter of the flow path and the material of the pipe portion of the flow rate sensor. Here, assuming that the frequency value is f, the instantaneous flow rate value Q is obtained by the following linear expression (1).
Q = a × f + b (1)
In addition, since it is difficult to ensure accuracy in the above formula (1), the flow rate measurement range is divided into a plurality of n sections, and each section i (i = 1 to n) as shown in the following formula (2). ) To secure a full scale accuracy of about ± 1% (Japanese Patent Laid-Open No. 60-238720).
Q = ai × f + bi (2)
To further improve the accuracy, the ai and bi values are determined for each unit, the individually determined values Ai and Bi are stored in RAM or EEPROM, and the full scale is calculated by the following equation (3). It has also been proposed to ensure an accuracy of ± 0.5% (Japanese Patent Application No. 9-345742).
Q = Ai × f + Bi (3)
Here, Ai and Bi (i = 1 to n) are corrected coefficients determined for each device.
[0004]
Also, the measurement accuracy of the frequency value f becomes a problem. Generally, when measuring the frequency of a pulse signal, the number of pulses input within a predetermined period (gate time) is counted, or the period of the input pulse is measured, and the frequency is calculated from the reciprocal thereof. Things have been done. However, in the flow rate measurement, as is clear from the above equation, the frequency of the pulse generated at a high flow rate is high (the cycle is short), and low at a low flow rate (the cycle is long). Therefore, it is required to obtain a predetermined measurement accuracy at both a large flow rate and a small flow rate.
[0005]
Therefore, a frequency measuring device is proposed that includes a timer for a fixed time, a clock generator, a counter for clock counting, a counter control means for controlling the counting operation by the clock, and a processing means for detecting and counting pulse signals and performing predetermined arithmetic control. (JP-A-5-297036).
According to this frequency measuring apparatus, a time that is at least twice the period of the measurement lower limit frequency is set in the timer, and detection and counting of pulse signals are started. When the pulse signal is detected, the counter control means is controlled so that the clock counting counter starts counting the clock from the clock generator, and every time the pulse signal is detected, the clock counting counter Check the count value. When the count value does not reach the predetermined value, detection and counting are continued. On the other hand, when the count value reaches a predetermined value, the detection and counting are stopped, and the counter control means is controlled to calculate the frequency measurement value from the count value of the clock counting counter by calculation. At the end of the timer timing, if the clock counting is not completed, the detection and counting of the pulse signal is stopped, and the counter control means is controlled to complete the counting by the clock counting counter.
As a result, the N cycles of the pulse signal are counted by the clock counting counter, and the integration of the cycles is continued until the count value secures a desired resolution, so that a certain value or more can be obtained regardless of the frequency value of the pulse signal. The measurement resolution is obtained.
[0006]
In addition, a Karman vortex air flow sensor output pulse average period calculation device has been proposed that aims to improve the calculation accuracy of the average period at a large flow rate and improve the responsiveness at a small flow rate. No. 5-70086).
The average period calculating device includes a pulse number counting means, a pulse period measuring means, a pulse period comparing means for comparing the measurement period with a first predetermined time, and a first pulse number counting means from the end of the previous average calculation. When the number of pulses corresponding to the predetermined value is counted, when a large comparison result is output from the pulse period comparing means for the number of times corresponding to the second predetermined value, and when the number is reduced from the pulse period comparing means An average period for calculating the average of the period of the pulse signal every time one of the conditions is satisfied when a state in which a large comparison result is output subsequent to the comparison result appears the number of times corresponding to the third predetermined value And a calculating means. Furthermore, a second average period calculating means for calculating an average period based on a comparison result between the second predetermined value and the pulse period comparing means, or a second means for comparing the measurement period with a second predetermined time. The apparatus further includes second average period calculating means for calculating an average period based on outputs of the pulse period comparing means and the second pulse period comparing means.
With these configurations, the average period of the pulse signal input from the sensor can be quickly calculated over a small flow rate, a medium flow rate, and a large flow rate.
[0007]
On the other hand, in such a flow sensor (flow meter), a flow rate measured as a flow rate transmitter or a flow rate transmitter is converted into a predetermined signal form and a signal is output to an external device. Generally, in such a flow rate transmitter, 8-bit digital data corresponding to a measured value is converted into the predetermined signal form and transmitted.
Further, in such a flow meter, there is also known a device in which the measured flow rate (instantaneous flow rate) is integrated to calculate an integrated flow rate, and the display unit displays not only the instantaneous flow rate but also the integrated flow rate.
[0008]
Furthermore, as an application example of such a flow meter, the flow rate of the fluid flowing through the flow path is compared with a preset reference flow rate value (set flow rate value), and a signal for controlling an external device is output based on the comparison result. A flow rate detection switch has been proposed (Japanese Patent Laid-Open No. 9-89613).
In this proposed flow rate detection switch, the cycle of a pulse signal having a frequency corresponding to the generation cycle of Karman vortex is measured, and the flow rate value is obtained by referring to a table based on the measured cycle. In order to improve measurement accuracy, the period of a plurality of pulses is measured and averaged. Then, the preset threshold value is compared with the measured flow rate, and the comparison result is displayed by the LED, and the collector is applied to the base of the transistor connected to the output terminal and connected to the output terminal. The power supply to the load is controlled.
[0009]
[Problems to be solved by the invention]
In general, the frequency measurement method for counting the number of input pulses has a problem in that the resolution of measurement at a low frequency input is coarse and accuracy cannot be obtained regardless of the gate time value. For example, if the gate time is 1 second as described above, an accuracy of ± 0.5% cannot be obtained unless the frequency is 200 Hz or higher.
Further, in the case of period measurement, there is a problem that the resolution of measurement at a high frequency input is rough and accuracy cannot be obtained regardless of the length of the period or the value of the measurement reference clock. For example, a count number of 200 or more is required.
[0010]
In addition, since the frequency measuring apparatus described above uses a timer in which a time that is twice or more the period of the measurement lower limit frequency is set, when measuring a frequency near the measurement lower limit frequency, 2 of the period. More than twice the measurement time is required. In addition, before the timer time expires, the period of N times of the pulse signal is counted by a clock counting counter, and when the count value reaches a predetermined value, detection and counting are stopped, and the count value The frequency measurement value is calculated from In this case, since the entire set time of the timer is not measured, there is a problem that the true frequency measurement of the input pulse signal is not performed.
[0011]
In addition, according to the above-described average period calculation device, it is possible to quickly calculate the average period of the pulse signal input from the sensor over a small flow rate, a medium flow rate, and a large flow rate by setting four to five parameters. However, since the pulse number counting means, the pulse period measuring means, the first and second pulse period comparing means, and the first and second average period calculating means are used, the configuration becomes complicated. Also, when the processing by each of these means is executed by a microcomputer or the like, the program requires a large amount of memory, and the time required for the processing becomes long, and the ratio occupied in the average period calculation processing is large. There was a problem that there was no room to execute the process.
[0012]
Further, as described above, in the flow rate transmitter, 8-bit digital data corresponding to the measured value is converted into the predetermined signal form and transmitted. In this case, because the digital quantization error is ± 1 digit, the error is about ± 0.4%. When high-precision detection is performed and a high-quality signal is to be sent to an external device, the error is propagated. This indicates that it is necessary to use digital data having more bits than 8 bits in order to prevent it.
[0013]
Furthermore, in the conventional flowmeter having a function of displaying the integrated flow rate value, the integrated flow rate is only displayed by a fixed-point method, and it is very inconvenient to know the integrated flow rate value over a long period of time. There was a problem that there was.
Furthermore, as described above, in the Karman vortex flow sensor, the flow rate measurement range and the Karman vortex generation frequency are determined by the diameter of the flow path and the material of the piping part of the flow sensor. There is a need to easily adapt the type of flow meter to the piping section into which it is inserted.
[0014]
Furthermore, in the above-described flow rate detection switch, the Karman vortex generation cycle is measured. Therefore, when the frequency is high, the cycle is shortened, the measurement resolution cannot be obtained, and the measurement accuracy is deteriorated. There was a problem. In addition, since the flow rate is determined by referring to the data table from the frequency obtained from the reciprocal of the cycle, one flow rate data is defined for one frequency, and a huge amount of memory is required. There was a problem that many kinds of microcomputers had to be prepared because data tables and control programs of various kinds of calibers could not be accommodated in one microcomputer.
Furthermore, the flow rate detection switch may require a high-speed switch output depending on its application. For example, in a welding gun, electric discharge machine, etc., when the flow rate detection switch is disposed in the flow path of the cooling water and an abnormality such as chip removal is detected due to an abnormality in the flow rate of the cooling water, In order to prevent burning, high-speed switch output is required.
[0015]
Therefore, the present invention can perform high-speed and high-precision measurement with a simple configuration. Flowmeter The purpose is to provide.
Also easy to handle, easy to operate, low price Rated The purpose is to provide a flow meter.
Furthermore, it aims at providing the flowmeter excellent in practicality by increasing the substantial display digit number of an integrated flow value.
It is another object of the present invention to provide a flow meter capable of easily selecting the characteristics of a flow path by operating a key operation unit.
Furthermore, when the instantaneous flow rate is detected and used as a switch (sending an output signal to an external control device installed at a remote location) in comparison with the set value, it is easy to check and change the set value. The flow rate is easy to use for the operator without any setting or operation errors. Total The purpose is to provide.
It is another object of the present invention to provide a flow meter capable of operating a switch output at a high speed when an abnormality occurs in the fluid flow.
Furthermore, the flow rate at which the transmission signal can be output at a predetermined timing. Total It is intended to provide.
Furthermore, the flow rate that can send a good quality transmission signal to external devices Total It is intended to provide.
[0018]
[Means for Solving the Problems]
In order to achieve the above object, a flow meter of the present invention includes a sensor unit that outputs a pulse signal having a frequency corresponding to a flow rate to be measured, and a first signal that generates a first signal having a first period. A generator, a first measuring unit that counts the number of pulses output from the sensor unit during the period of the first cycle in response to the first signal, and the first signal during the cycle Based on the second measurement unit for measuring the position of the first signal in the pulse included in the first measurement unit, the count value by the first measurement unit, and the measurement result by the second measurement unit. A flowmeter having a first calculation unit that calculates the frequency of the pulse signal every time and a second calculation unit that calculates an instantaneous flow rate based on the calculated frequency of the pulse signal, And the first period Measure A second signal generator for generating a second signal having a second period divided by the lower limit frequency And means for invalidating the measurement result when a state in which the period of the pulse in the pulse signal is equal to the period corresponding to the commercial AC power supply frequency continues for a predetermined number of times. Have Above The timing of the calculation operation of each calculation unit is controlled based on the output of the second signal generation unit.
[0019]
Also Of the present invention other The flow meter includes a sensor unit that outputs a pulse signal having a frequency corresponding to a flow rate to be measured, a first signal generation unit that generates a first signal having a first period, and a response to the first signal. A first measurement unit that counts the number of pulses output from the sensor unit during the period of the first cycle, and a position of the first signal in a pulse that includes the first signal in the cycle A frequency of the pulse signal is calculated for each of the first periods based on a second measurement unit that measures the frequency, a count value obtained by the first measurement unit, and a measurement result obtained by the second measurement unit. 1 is a flow meter having a first calculation unit and a second calculation unit that calculates an instantaneous flow rate based on the calculated frequency of the pulse signal, the preset set flow rate value and the second calculation unit. A comparison unit for comparing the instantaneous flow rate value calculated by A switch output unit that outputs a result as a digital signal, and the comparison unit includes an instantaneous flow rate value calculated based on an output of the first calculation unit and the set flow rate value for each first period; The first mode and the normal mode for comparing Measure It has two operation modes of a high speed mode for comparing the instantaneous flow rate value calculated based on the measurement value of the first measurement unit and the set flow rate value every second period divided by the lower limit frequency. is there.
Further, a plurality of values can be set as the set flow rate value, and the switch output unit is controlled by a logical sum of comparison results for the plurality of set flow rate values.
[0026]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 1 illustrates the present invention. Flow meter Frequency measurement with frequency measurement method applied Part It is a block diagram which shows the example of a structure. In this figure, reference numeral 1 denotes a frequency detector that outputs a pulse signal to be measured. 2 is a first counter, 4 is a first timer that generates a first signal that defines the start and end points of measurement, and the first counter 2 is defined by a first signal from the first timer 4. The number of input pulses input during the period from the measurement start time to the measurement end time is counted. 3 is a second counter, 5 is a reference clock generator for generating a reference clock signal, and the second counter 3 is input from the rising edge (or falling edge) of the input pulse from the frequency detector 1 to the next input. The period of the input pulse is measured by counting the reference clock input from the reference clock generator 5 during the period up to the rising edge (or falling edge) of the pulse. As shown in the figure, the first signal from the first timer 4 is applied to the second counter 3 as a control signal, and the second counter 3 measures the timing at which the first signal is generated. Numeric values can be output.
An arithmetic processing unit 6 calculates the frequency of the input pulse signal based on count outputs from the first counter 2 and the second counter 3. 8 is a display unit that displays the frequency calculated by the arithmetic processing unit 6, 9 is an output unit that outputs the calculated frequency to an external device, and 7 is a control unit that controls the operation of each component. .
Note that the first counter 2, the second counter 3, the first timer 4, the reference clock generation unit 5, the arithmetic processing unit 6 and the control unit 7 surrounded by a broken line in the figure can be configured by, for example, a single chip microcomputer. it can.
[0027]
Configured like this Frequency measurement section Of the present invention implemented in Flow meter The measurement principle in the frequency measurement method will be described with reference to FIG. In this figure, (a) is an example of an input pulse signal from the frequency detector 1, (b) is a first signal output from the first timer 4, and (c) is a total of the first counter 2. A numerical value (d) indicates the count content in the second counter 3. Here, the first signal of (b) defines the measurement start point and measurement end point in this frequency measurement, and can be a signal having a period according to the frequency of the pulse signal to be measured. In order to simplify the explanation, here, the output signal has a period of 1 second. Note that, by setting the measurement end point as a measurement start point in the next measurement cycle, the frequency can be continuously measured for each cycle of the first signal (first cycle). Further, the period of the reference clock for measuring the period of the input pulse signal determines the accuracy of the measurement. Here, it is assumed that the clock signal has a period of 1 msec.
[0028]
Now, the first counter 2 counts the number of pulses input in the measurement period (in this example, 1 second) from the measurement start point to the measurement end point defined by the first signal. At this time, counting can be performed using either rising or falling of the input pulse, but here, the rising of the input pulse is counted. In the example shown, 5 pulses are counted. In this case, since the measurement period is 1 second, this value of 5 corresponds to the integer part of the frequency of this input signal.
[0029]
However, by simply counting the number of pulses in this way, as shown in FIG. 2A, the count value is obtained for the period A from the counting start time to the rising edge of the first pulse (pulse 1). It is not reflected in. Further, the fifth pulse (pulse 5) is counted as being included in the period B from the measurement end point to the rise of the next pulse (pulse 6). Therefore, in order to accurately measure the frequency of the input pulse signal, it is necessary to consider the A and B portions.
That is, the ratio of the period A from the measurement start time to the rise time of the pulse 1 in the period T1 of the pulse 0, and the period T2 of the pulse 5 in the period B from the measurement end point to the rise time of the pulse 6 By calculating the ratio of the number of pulses, and correcting the number of pulses, an accurate frequency f can be obtained.
[0030]
In order to measure part A and part B described above, the frequency measurement Part As shown in FIG. 2D, the second counter 3 starts counting the reference clock at the rising edge of the input pulse signal and the count value (N1) at the rising edge of the next input pulse signal. ) And the counting starts again from 0. When the first signal from the first timer is input during the counting, the count value (n1) at that time is output. Thereby, the count outputs N1, N2, n1, and n2 respectively corresponding to the times T1, T2, t1, and t2 described above can be obtained. If there is no input of the first signal during the measurement of the period of the input pulse, the measured value may be discarded and the next measurement may be performed.
Then, the arithmetic processing unit 6 calculates the following equation (4) based on the count value f0 from the first counter 2 and the count values N1, N2, n1, and n2 from the second counter 3. The frequency value f is calculated.
f = f0 + (1-n1 / N1)-(1-n2 / N2)
= F0-n1 / N1 + n2 / N2 (4)
[0031]
In the above description, the measurement period (the period of the first signal) has been described as being 1 second. However, this period can be set to an arbitrary value according to the signal frequency to be measured. Is T seconds, the frequency value f can be obtained by the following equation (5).
f = (f0−n1 / N1 + n2 / N2) × (1 / T) (5)
[0032]
Of the present invention described above Flow meter In the frequency measurement method, when there are one or more pulses input during the measurement period, the frequency can be calculated using the above equation (5). Therefore, high-accuracy frequency measurement is possible in a measurement period equal to or greater than the period of the measurement lower limit frequency, and it is not necessary to lengthen the measurement time in order to improve accuracy as in the conventional measurement method. For example, when the measurement lower limit frequency is 1 Hz, the frequency can be accurately measured in a measurement period of 1 second when the measurement lower limit frequency is 5 Hz.
The measurement accuracy at the measurement lower limit frequency is determined by the period of the reference clock. For example, if the period of the first signal is 1 second (measurement lower limit frequency is 1 Hz) and the required resolution is 200 (accuracy ± 0.5%), the reference clock may be 5 msec, When the resolution is 1000 (accuracy ± 0.1%), the reference clock may be 1 msec. If the measurement lower limit frequency is 5 Hz, the period is 200 msec. Therefore, if the reference clock is 1 msec, a resolution of 200 can be obtained.
[0033]
Thus, the present invention Flow meter According to the frequency measurement method, the period of the input pulse included in the measurement period from the measurement start point to the measurement end point can be accurately calculated to the fractional part, and the frequency of the input pulse signal can be calculated as the length of the measurement period. It is possible to calculate with high accuracy regardless of the above.
When the measurement is repeated continuously, the decimal part at the measurement end point (the decimal part corresponding to the time B) corresponds to the decimal part at the measurement start point in the next measurement (corresponding to the time A). And the arithmetic processing is simplified, and accurate frequency data can be obtained for each cycle of the first signal.
In the above description, the measurement of the cycle is started at the rising time of the input pulse. However, it is obvious that the measurement may be started at the falling time.
Further, when 200 ≦ f0 as a result of the measurement by the first counter 2, a measurement accuracy of 0.5% can be obtained without calculating the measurement result of the second counter 3. Processing can be omitted.
[0034]
The frequency measurement shown in FIG. 1 that operates based on the measurement principle described above. Part Will be described in detail with reference to the flowcharts of FIGS. For the sake of simplicity, here, it is assumed that the first period is set to 1 second.
Here, the portion surrounded by a broken line in FIG. 1 is constituted by a single chip microcomputer (hereinafter simply referred to as a microcomputer), and the first counter 2 and the second counter 3 are built-in counters of the microcomputer. The first timer 4 and the reference clock generator 5 are built-in timers of the microcomputer. And the said control part 7 calculates the frequency of an input pulse using the arithmetic processing part 6 according to the program stored in the program memory which is not shown in figure.
[0035]
Below, this frequency measurement Part Will be described with reference to the flowcharts shown in FIGS. 3 to 5 and the time chart of FIG. Figure 3 shows this frequency measurement. Part FIG. 4 is a flowchart of a first timer interrupt processing routine started by a first signal from the first timer 4, and FIG. 5 is a rising edge (falling edge) of the input pulse. 5 is a flowchart of a counting process routine of a second counter activated by an interrupt generated by
The control unit 7 proceeds with processing based on various flags such as a sequential storage flag 1 and a sequential storage flag 2, an operation permission flag 1, an operation permission flag 2, and a second counter valid flag. Here, the sequential storage flags 1 and 2 are flags that are set at the start of the operation, and the calculation permission flags 1 and 2 are flags that indicate the timing at which the calculation processing unit 6 should execute the calculation for calculating the frequency. The counter valid flag is a flag indicating that it is time to store the count contents of the second counter 3 in a register.
[0036]
This frequency measurement Part 3 is started (timing t0 in FIG. 6), the main routine shown in FIG. 3 is started. First, in step S1, initialization processing of each unit such as initialization of each register is performed. In step S2, the sequential storage flag 1 and the sequential storage flag 2 are both set, and the calculation permission flags 1 and 2 and the second counter valid flag are reset. Next, the time measurement of the first timer 4 is started in step S3. Thereby, the interruption process (FIG. 4) from the first timer 4 is executed after the first period. Next, in step S4, the counting of the first counter 2 is started. Subsequently, in step S5, the interruption by the rising edge of the input pulse is permitted. Thereby, the counting process (FIG. 5) of the second counter 3 is executed at the timing of the rising edge of the input pulse. Instead of interrupting with a rising edge, it may be performed with a falling edge.
[0037]
Next, the process proceeds to step S6, where it is determined whether or not the calculation permission flags 1 and 2 are both set. As described above, immediately after the operation is started, since both the calculation permission flags 1 and 2 are reset, the result of this determination is NO. On the other hand, when the result of this determination is YES, the process proceeds to step S7, where the frequency f is calculated based on the equation (4), and the calculation permission flags 1 and 2 are reset (step S8). When the determination result of step S6 is NO or after the process of step S8 is completed, the display and output process of step S9 and other processes of step S10 are executed, and the processes after step S6 are repeated again. Executed.
[0038]
FIG. 4 is a process flowchart of a first timer interrupt process activated by a signal of the first period by the first timer 4. As described above, when the operation is started at time t0, this processing is started at time t1. First, in step S11, the timing of the first timer is restarted. This guarantees the first timer interrupt at the correct timing (t2, t3,...). Next, in step S12, the count value of the first counter at this time is stored in the register f0, and in step S13, the first counter is initialized, and the count of the first counter is started again. As a result, the number of input pulses for each first period can be stored in the register f0. In this case, the number of pulses input in one second from t0 to t1 is stored in the register f0.
[0039]
In step S14, it is determined whether the sequential storage flag 1 is set. As described above, the sequential storage flag 1 is set in step S2 (FIG. 3), and the determination result is YES when interrupted by the first signal at time t1. At this time, the process proceeds to step S15, and the count value (nt1) of the second counter at this time is stored in the register n2 and also stored in the register n1 (step S16). In step S17, the sequential storage flag 1 is reset. As a result, the count value nt1 corresponding to the time from the rising edge of the input pulse immediately before time t1 to time t1 is stored in the registers n1 and n2.
[0040]
On the other hand, in the first timer interrupt processing routine after time t2, since the storage flag 1 is sequentially reset in step S17, the determination result in step S14 is NO. In this case, in step S18, the count value of the second counter at the previous interrupt stored in the register n2 is transferred to the register n1, and the count value of the second counter at this time is transferred to the register n2. To store. That is, at the time of interruption at time t2, the count value nt1 at time t1 is transferred to the register n1, and the count value nt2 of the second counter at time t2 is transferred to the register n2.
After step S17 or S19 is executed, the second counter valid flag is set in step S20. Further, in step S21, the calculation permission flag 1 is set, and this first timer interrupt processing routine is executed. finish.
[0041]
FIG. 5 is a flowchart of the counting process routine of the second counter. As described above, this routine is triggered by the rising (or falling) edge of the input pulse. When an interrupt is generated at the rising edge of the input pulse, it is first determined whether or not the second counter valid flag is set (step S22). As described above, the second counter valid flag is reset when the main routine is started (step S2), and is set in step S20 of the first timer interrupt processing routine. Therefore, before the time t1 shown in FIG. 6, the second counter valid flag is in a reset state. Therefore, in this interrupt processing routine started by the rise of the input pulse by this time, the determination result in step S22 is NO, so the process proceeds to step S23, and the second counter is reset to zero. Then, the measurement of the cycle of the input pulse is resumed. As will be apparent from the description below, the frequency calculation process (step S7) is executed in the main routine, the calculation permission flags 1 and 2 are reset (step S8), and then the first signal is generated. Even during the time until the timing (t2, t3,...), The determination result of this step S22 is NO, and at these times, the second counter simply repeats the measurement of the period of the input pulse.
[0042]
On the other hand, the interrupt processing routine immediately after execution of step S20 (FIG. 4) in the first timer interrupt processing routine (second time due to the rising edge of the input pulse immediately after times t1, t2, t3... In FIG. 6). In the counter counting process routine), since the second counter valid flag is set, the determination result in step S22 is YES. At this time, the process proceeds to step S24, where it is determined whether the sequential storage flag 2 is set. As described above, the sequential storage flag 2 is set in step S2 of the main routine immediately after the start of operation. In this interrupt processing routine by the rising edge of the input pulse immediately after time t1 shown in FIG. The determination result in step S24 is YES. Therefore, at this time, the process proceeds to step S25, and the count value of the second counter (Nt1 in FIG. 6) at this time (the time when the input pulse rises immediately after time t1) is stored in the register N2 and also stored in the register N1. (Step S26). In step S27, the sequential storage flag 2 is reset. Thereby, the cycle Nt1 of the input pulse including the first signal at the time t1 in the cycle is stored in the registers N2 and N1.
[0043]
On the other hand, after the time t2, since the sequential storage flag 2 is reset in the step S27, the determination result in the step S24 is NO. At this time, in step S28, the count value of the second counter stored in the register N2 (Nt1 in the interrupt process immediately after time t2) is transferred to the register N1 and the register The count value of the second counter at this point (Nt2 in this interrupt process immediately after time t2) is stored in N2 in the register N2 (step S29). As a result, the cycle of the input pulse including the generation timing of the first signal in the cycle can be stored in the register N2, and the generation timing of the input pulse including the generation timing of the first signal immediately before is included in the cycle. The period can be stored in the register N1.
After step S27 or S29 is executed, the process proceeds to step S30, where the second counter valid flag 2 is reset. In step S31, the second counter is initialized to 0, and then the input pulse period is counted again. In step S32, the calculation permission flag 2 is set, and this interrupt processing routine is terminated.
[0044]
As described above, the second counter valid flag stores in the register the time n2 (n1) until the generation timing of the first signal of the input pulse including the first signal in its cycle (step S20), the period until the period N2 (N1) of the input pulse is stored in the register (step S30) is set. As a result, for the input pulse including the generation timing of the first signal in its cycle, the time until the generation timing of the first signal and the cycle of the input pulse can be reliably stored in the register.
The sequential storage flags 1 and 2 are provided to store the count value of the second counter corresponding to the first first signal in the registers n1, n2 and N1, N2 at the start of operation. This flag is reset after that.
[0045]
Further, the calculation permission flag 1 is set at the timing at which the first signal is generated in the registers n1 and n2 in the first timer interrupt processing routine (FIG. 4) executed when the first signal is generated. It is set when the count value of the second counter, that is, data corresponding to the position of the first signal in the input pulse including the first signal in its cycle is stored in the register.
Still further, the calculation permission flag 2 indicates the count value of the second counter when the rising edge is detected when the second counter valid flag is set, that is, the first signal during the cycle. Is set when the period of the input pulse included in (and the period of the previous input pulse) is stored in the register N2 (and N1).
Then, the main routine determines that when the calculation permission flags 1 and 2 are both set, the equation (4) (when the cycle of the first signal is other than 1 second, the equation (5) ) (Step S7, FIG. 3), and the first calculation permission flags 1 and 2 are reset.
[0046]
Therefore, as shown in FIG. 6, the determination result of step S6 of the main routine becomes YES after the rising point of the first input pulse after time t1, and the first frequency calculation process (step S7) is executed. However, in this case, as described above, nt1 is stored in both the registers n1 and n2, and Nt1 is stored in both the registers N1 and N2. It becomes the count value f0 of 1 counter. When step S7 of the main routine is executed after the rising edge of the first input pulse after time t2, an accurate frequency can be obtained based on the equation (4).
[0047]
Thus, the present invention Flow meter Frequency measurement Part Accordingly, it is possible to calculate an accurate frequency to the decimal part for each period (first period) of the first signal. Therefore, it is possible to perform accurate frequency measurement in a short time without requiring a long time to perform highly accurate measurement.
Further, since the count values (n1, N1) of the second counter in the previous measurement cycle are used for calculating the frequency in the next measurement cycle, it is possible to perform frequency measurement with high calculation efficiency.
[0048]
Next, according to the present invention described above. Flow meter Frequency measurement method The Apply Shi The flow meter will be described. FIG. 7 illustrates the above-described present invention. Flow meter Frequency measurement method The Apply Shi It is a block diagram which shows an example of the basic composition of the flowmeter.
As shown in the figure, this flow meter is roughly classified into a sensor unit 11 that outputs a pulse signal having a frequency corresponding to the flow rate of the fluid, a function selection unit 12 for selecting the function of the flow meter, and various instructions. And a manual operation unit 13 for manually inputting various data, a reset signal output unit 14 for detecting a power on / off and outputting a reset signal, and whether or not the control unit 20 is operating normally. A watchdog timer unit 15 that determines and outputs an interrupt signal when an abnormality occurs, a voltage drop detection unit 16 that monitors a power supply voltage and outputs an interrupt signal when a drop in the power supply voltage is detected, and control of the entire flow meter A control unit 20 that performs various operations, a non-volatile storage unit 17 that stores various data, a display unit 30 that performs various displays such as a measured flow rate value, and an external device EXCT such as a centralized monitoring device. A signal output unit 40 for outputting the issue, is configured to include a power supply unit 45.
[0049]
Here, the control unit 20 includes a comparison unit 21 for performing various comparisons, a determination unit 22 for performing various determinations based on the comparison results in the comparison unit 21, an arithmetic unit 23 for performing various calculations, and a control. A memory composed of a control unit 24 for controlling the entire unit 20, a timer unit 25 used for generating various timer interrupts, a ROM, a RAM, etc. for storing control programs and various data And a unit 26. The control unit 20 is configured by a single chip microcomputer, for example.
[0050]
Further, the display unit 30 is lit when a data display unit 31 for displaying the measured flow rate value, a unit display unit 32 for displaying a unit of the flow rate displayed by the data display unit 31, a signal output to be described later, and the like. An output 1 display unit 33 and an output 2 display unit 34 to be controlled are provided. Note that when the flow rate display unit is fixed, the unit display unit 32 may not be provided.
[0051]
Further, the signal output unit 40 converts the measured flow rate value into a PWM (pulse width modulation) signal, and outputs it to the first data input terminal DIN1 of the external device EXCT such as a centralized monitoring device. −1, switch output 1 output unit 40-3 for outputting output 1 indicating that to the switch 1 input SW1 of the external device EXCT when the measured flow rate value is less than (or more than) the first predetermined value And a switch output 2 output unit 40-4 for outputting an output 2 indicating that to the switch 2 input SW2 of the external device EXCT when the measured flow rate value is equal to or greater than (or less than) a second predetermined value. I have.
In place of or in addition to the PWM signal output unit 40-1, as indicated by a broken line, an analog flow rate signal having a current range of 4 to 20 [mA] and corresponding to the measured flow rate value is centrally monitored. For example, a 4 to 20 mA transmission signal output unit 40-2 that outputs to an analog input terminal of the external device EXCT may be provided.
Reference numeral 45 denotes a power supply unit, which supplies, for example, DC 12-24 [V] power supplied from the external device EXCT to an operating voltage of the flowmeter. Moreover, you may make it use a battery as a power supply.
[0052]
An outline of the operation of the flow meter configured as described above will be described.
When the flow meter is activated, the control unit 24 first performs initial setting of the flow meter. Then, the setting state of the function selection unit 12 is read to determine the operation mode of the flow meter. Here, it is assumed that the instantaneous flow meter mode is set.
Next, various setting states such as the diameter and material of the flow path set by the function selection unit 12 and the version of the control program are displayed on the display unit 30, and the measured flow rate input from the sensor unit 11 is displayed. The measurement of the frequency of the pulse signal having the corresponding frequency is started.
[0053]
As described above, this measurement is performed by counting the number of pulses of the input signal according to the output of the first timer (1 second timer) and measuring the integer part of the frequency to be measured. And by measuring the output timing of the first timer with the reference clock having a period of 1 msec, the fractional part of the frequency to be measured is measured.
Then, using the comparison unit 21, the determination unit 22, and the arithmetic unit 23, the frequency is calculated based on the equation (4), and the instantaneous flow rate is calculated from the calculated frequency by the equation (2) or (3). calculate. Then, the calculated instantaneous flow rate value is displayed on the display unit 30 and is output from the signal output unit 40 to the external device EXCT. Then, the comparison unit 21 and the determination unit 22 compare the measured instantaneous flow rate with a preset flow rate value, and depending on the comparison result, the switch output unit 40-3 or 40-4. Supplies the switch output to the external device EXCT. Further, an integrated flow value obtained by integrating the calculated instantaneous flow value is calculated. The integrated flow rate value is displayed on the display unit 30 according to the operation of the manual operation unit 13.
[0054]
Next, the present invention Flow meter Frequency measurement method The Apply Shi A more specific embodiment of the flow meter (instantaneous flow meter) of the present invention will be described in detail. In this embodiment, it is assumed that a common control program is used for both flow meters so that this flow meter can be used as both an instantaneous flow meter and an integrated batch flow meter.
8A and 8B are views showing the structure of an embodiment of the flow meter, wherein FIG. 8A is a top view showing a display and operation panel surface, FIG. 8B is a sectional view showing an internal structure, and FIG. It is a side view which fractures | ruptures and shows. In this figure, the instantaneous flow meter is attached to the measuring unit main body 50 connected in the middle of the flow path through which the fluid whose flow rate is to be measured, and is mounted above the measuring unit main body 50 so as to be positioned every 90 °. It consists of a measurement display. Here, the measuring unit main body 50 is sized according to the pipe to which it is connected, and the measurement display unit can be commonly applied to the material and the diameter of many types (for example, 64 types) of piping. It is supposed to be possible. In other words, the measurement display section can be used in common for many models, and as described later, the diameter and material of the pipe can be selected and set by operating the manual operation section (key input section). It is made to be able to.
[0055]
The measuring unit main body 50 has an inlet connected to the upstream side and an outlet connected to the downstream side, and the generation frequency of the Karman vortex formed on the downstream side of the columnar object 51 placed in the flow has a wide Reynolds number. By utilizing the fact that it is proportional to the flow velocity, by measuring the frequency of occurrence of this vortex flow, it is configured as a Karman vortex flow type that can know the flow velocity or flow rate. This Karman vortex flow type has a simple structure with no sliding parts and is excellent in reliability and durability. In addition, there are vortex generators and vortex detectors in the fluid flow path. Is small, the pressure loss is small.
The measuring unit main body 50 is provided with a piezoelectric element 52 as a sensor inside the holder for detecting the pressure in the flow path that changes due to the generation of vortex. The piezoelectric element 52 outputs a flow rate signal consisting of an electrical signal that changes at a frequency equal to the frequency of eddy current generation, and supplies the flow rate signal to an electronic circuit provided in the measurement display unit via a lead wire.
[0056]
The measurement display unit includes a case 53 composed of an upper case 54 and a lower case 55 which are abutted via a waterproof packing, a first printed board (display board) 61 accommodated in the case 53, and a second printed board. (CPU board) 62, third printed circuit board (sensor board) 63, LEDs 33 and 34 arranged on the upper surface of the upper case 54, for example, a data display unit 31 constituted by a three-digit 7-segment LED display and operation keys 41, 42, 43, etc., and a hollow rotating shaft 56 fixed on the measuring unit main body 50 with a screw 59 is rotatably fitted through a waterproof packing in a hole formed in the bottom of the lower case 55. The measuring unit main body 50 can be adjusted so as to be positioned every 90 °. The lead wire from the piezoelectric element 52 is led to the electronic circuit formed on the sensor substrate 63 through the hollow portion of the rotating shaft 56. Reference numeral 60 denotes a signal line including a shield line for connecting to an external device.
[0057]
Further, the display substrate 61 and the CPU substrate 62 are attached to the upper case 54 with a mounting screw 58 through a metal spacer, and the sensor substrate 63 is attached to the lower case 55 with a mounting screw 58 through a metal spacer. It is attached. Here, the upper case 54 and the lower case 55 are made of, for example, a resin in which a conductive shield material is applied, and are provided at a position where the screw 58 and the metal spacer in the printed circuit boards 61 to 63 abut. The case 53 and the printed circuit boards 61 to 63 are electrically connected to each other through the formed metal part.
The upper case 54 is attached to the lower case 55 by a screw 57 so as to be freely opened and closed, and can be opened when performing various setting operations.
[0058]
In the example described above, an example in which two LEDs 33 and 34 and a three-digit seven-segment display 31 as the data display unit are provided on the upper case 54 as a display unit has been shown. It is not limited to. FIG. 9 is a diagram showing another example of the display unit. In the example shown in this figure, in addition to the LEDs 33 and 34 described above and the three-digit display 31, two LEDs 35 and a display unit are shown. 36 to the right of LED 35 Three “L” is displayed on the right side of the LED 36. Accordingly, in the example shown in FIG. 9, the LED 35 is turned on to indicate that the unit of numerical values displayed on the three-digit display 31 is cubic meters, and the LED 36 is turned on. By this, it can be shown that the unit of the numerical value displayed on the display 31 is liters. That is, in this example, the unit display unit 32 is constituted by the LEDs 35 and 36.
Further, the LED 33 and the LED 34 are point-controlled when the first output and the second output are output to the external device, as will be described later. The LED color may be changed such that a red LED is used as the LED 33 and a green LED is used as the LED 34.
[0059]
FIG. 10 is a diagram showing an example of the arrangement of circuit components on the three printed boards, that is, the display board 61, the CPU board 62, and the sensor board 63. As shown in FIG. In this figure, (a) is a view showing a state in which the printed boards 61 to 63 are assembled in the case 53, (b) is a surface view of the display board 61, and (c) is a view of the CPU board 62. FIG. 4D is a rear view, FIG. 4D is a front view of the sensor substrate 63, and FIG. 4E is a rear view of the sensor substrate 63.
As shown in FIG. 10A, the display substrate 61 and the CPU substrate 62 are electrically connected via a connector 64, and the CPU substrate 62 and the sensor substrate 63 are electrically connected via a flat cable 65. Connected. A microcomputer 20 that operates as the control unit is provided on the CPU board 62, and an EEPROM that operates as the nonvolatile memory element 17 is provided on the back surface thereof.
Further, as shown in FIG. 10B, an inspection mode setting pin 18 composed of two pins is provided on the surface of the display substrate 61. By short-circuiting the inspection mode setting pin 18, An inspection mode to be described later can be set.
[0060]
Further, as shown in FIG. 5C, on the back surface of the CPU board 62, function selection pins including two sets of jumper pins J1 and J2 constituting the function selection unit 12 are provided. Jumper pin J1 is used to select whether to operate this flow meter as an instantaneous flow meter or an integrated batch flow meter. When jumper pin J1 is short-circuited by a jumper wire, it operates as an instantaneous flow meter. When it is open, it is set to operate as an integrating batch flow meter. The jumper pin J2 is used to select whether the measurement data from the flowmeter is transmitted to an external device by a 4 to 20 mA transmission method or a PWM modulated signal, and is short-circuited by a jumper wire. Sometimes the measurement flow rate data is transmitted by a 4 to 20 mA transmission method, and when it is opened, the PWM modulation signal is transmitted to an external device.
[0061]
As shown in FIG. 10 (d), terminals S + and S− to which lead wires from the piezoelectric element 52 are connected are provided on the surface of the sensor substrate 63, and an adjustment trimmer VR, Various electronic components such as various operational amplifiers, diodes, varistors and capacitors are arranged. Reference numeral 66 denotes a terminal to which a connection cable 60 to the external device is connected. Further, as shown in FIG. 5E, on the back surface of the sensor substrate 63, various output transistors such as a PWM output transistor 76 described later, a three-terminal stabilized power circuit 78 that operates as the power supply unit 45, and the like. Various electronic components are provided.
[0062]
An example of the circuit configuration of this flow meter will be described with reference to the block diagrams of FIGS.
In FIG. 11, reference numeral 20 denotes a microcomputer that controls the entire flow meter, and includes a first counter (main counter) 81, a second counter (sub counter) 82, and a plurality of timers 1 to n. For driving a timer register group 83 composed of timers, a ROM 84 for storing a control program and a calculation coefficient table (to be described later), a RAM 85 used as a data area and work area for storing various data, and a display unit 30 A display driver and a PWM output function unit for outputting a PWM signal from the output port are mounted. The PWM output function unit has, for example, a 10-bit resolution, and includes a PWM prescaler that sets a PWM cycle, a PWM register that sets an “H” level period of an output pulse, and the like.
The timer register group 83 includes a first period timer (1 second timer) corresponding to the first timer, a timer generating a 1 msec reference clock, a second period timer (0.2 second timer), and the like. It is included. Here, the second period timer outputs a signal having a second period synchronized with the output signal of the first period timer and having the output signal period of the first period timer divided by the measurement lower limit frequency. In this example, the signal has a period of 0.2 seconds obtained by dividing the period of 1 second of the output of the first timer by the measurement lower limit frequency of 5 Hz. As will be described later, the timing of the calculation operation of the calculation unit is controlled in accordance with the output signal of the second period timer.
The first cycle timer and the second cycle timer may be provided separately, but here, the first cycle timer output is obtained based on the output of the second cycle timer. For example, the output of the second period timer may be counted, and the first period timer output may be output every time 5 is counted.
Further, the main counter 81 and the sub counter 82 are connected to an input port (count signal input port) to which an input signal from the sensor unit 11 is applied, and the main counter 81 is 1 second (first cycle). The sub-counter 82 measures the period of the input pulse in units of 1 msec.
[0063]
Reference numeral 11 denotes a sensor unit including the piezoelectric element 52, an amplifier 67 that amplifies an electric signal from the piezoelectric element 52, and a waveform shaping circuit 68 that shapes the output signal of the amplifier 67 and outputs it as a pulse signal. The output β of the sensor unit 11 is input to the count signal input port of the microcomputer 20. Further, the output β of the sensor unit 11 is also applied to the signal output unit shown in FIG. 12 so that it can be directly output to an external device EXCT such as an adjustment inspection device via the output transistor 77. Has been made.
Reference numeral 12 denotes a function selection unit which, as described above, transmits the jumper pin J1 for selecting whether to operate as an instantaneous flow meter or an integrated batch flow meter, and the measurement output to an external device by a 4 to 20 mA transmission signal. Alternatively, a jumper pin J2 for selecting whether to output to an external device by a PWM (Pulse Width Modulation) signal is provided. The outputs of the jumper pins J1 and J2 are connected to the input port of the microcomputer 20.
Reference numeral 18 denotes an inspection mode setting pin. As described above, this flow meter can be set to the inspection mode by short-circuiting the inspection mode setting pin 18. At the time of inspection before shipment from the factory, the inspection mode setting pin 18 sets the inspection mode, and as will be described later, an adjustment inspection apparatus is connected as the external apparatus EXCT to execute inspection. The output of the inspection mode setting pin 18 is connected to the input port of the microcomputer 20.
[0064]
Reference numeral 13 denotes a manual operation unit (key input unit), which is provided with three operation keys, a setting key (ENT key) 41, an up key (Δ key) 42, and a down key (▽ key) 43, as described above. Each is connected to an input port of the microcomputer 20.
A watchdog timer 15 inputs an interrupt signal to the microcomputer 20 when a signal from the output port of the microcomputer 20 is not input for a predetermined time. With this interrupt input, the microcomputer 20 starts a second start process described later. The scheduled output to the watchdog timer is executed by, for example, a timer interrupt processing routine that is executed every predetermined period.
Further, reference numeral 14 denotes a power-on reset circuit, which detects when a power supply voltage Vcc is applied and applies a pulse signal to the reset terminal of the microcomputer 20. As a result, the microcomputer 20 executes a first start process described later.
[0065]
Reference numeral 30 denotes the display unit, as shown in the figure, a 3-digit 7-segment LED display 31 as a data display unit, a first output OUT1 (or an output signal OUT when used as an integrating batch flow meter). OUT1 LED 33 that is lit at the time of output, OUT2 (IN) LED 34 that is lit at the time of output (input) of the second output OUT2 (when used as an integrating batch flow meter), drive digit selection circuit 37, and An LED drive circuit 38 is provided. In the case of the embodiment having the unit display unit 32 shown in FIG. 9, the numerical value in the three-digit display 31 is m. Three There are further provided an LED 35 for indicating a numerical value in units of (cubic meters) and an LED 36 for indicating a numerical value in units of L (liters). Then, data for performing the display is output from the display drive circuit built in the microcomputer 20 to the drive digit selection circuit 37 and the LED drive circuit 38 via the output port, and a desired display can be performed. It has been made possible.
Although an example in which an LED is used as a display element is shown here, the present invention is not limited to this, and other display elements such as a liquid crystal (LCD) can be adopted.
Further, the number of digits of the display 31 is not limited to three digits, and may be any number of digits such as eight digits.
[0066]
Reference numeral 17 denotes an EEPROM (Electrically Erasable Programmable ROM) which is a non-volatile memory element, which stores integrated flow rate value data, various set values, and primary slope data and intercept data corrected at the time of adjustment inspection described later. As a result, it is possible to prevent data loss when the power supply voltage drops.
Reference numeral 69 denotes a large-capacitance capacitor connected in parallel to the power supply terminal, and is used for backup when the power supply voltage is temporarily lowered.
Furthermore, reference numeral 16 denotes a voltage detector that monitors the power supply voltage and performs a power supply voltage check interrupt when the voltage drops below a predetermined voltage.
[0067]
The first output OUT1 and the second output OUT2 are supplied from the output port of the microcomputer 20 to the signal output unit 40 shown in FIG. Here, the first output OUT1 is a signal output when the measured instantaneous flow rate value becomes lower than the first set flow rate value (for example, the lower limit flow rate value) QL, and the second output OUT2 is measured. This is a signal that is output when the instantaneous flow rate value that has been increased exceeds the second set flow rate value (for example, the upper limit flow rate value) QU. As described above, by outputting the first output OUT1 and the second output OUT2 to the external device without delay, it is possible to quickly control the external device.
When this flow meter is used as an integrated batch flow meter, the first output OUT1 is an output OUT, and instead of the second output OUT2, as shown by a dotted line, the signal output unit 40 / The input IN from the external device EXCT is input to the input port of the microcomputer 20 via the power supply unit 45, but further explanation is omitted here.
[0068]
In FIG. 12, reference numeral 70 denotes an output transistor to which the first output OUT1 as the first comparison result is applied to the gate, and reference numeral 71 denotes the second output OUT2 as the second comparison result to the gate. Output transistor. The drains of these output transistors 70 and 71 are output from the corresponding output terminals to an external device. Thereby, on the external device side, it is possible to perform rapid switch control using the OUT1 output and the OUT2 output. As shown in the figure, a protective Zener diode ZD is connected between each output terminal and the ground.
As described above, when the integrated batch flow meter is used, the input signal IN from the external device EXCT is shaped by the threshold circuit 72 and input. A protective resistor R and a protective diode D are connected between the input signal IN and the threshold circuit 72.
[0069]
Further, in the above, the output transistors 70 and 71 are provided corresponding to the first comparison result output OUT1 and the second comparison result output OUT2, respectively, but are described as another example in the lower part of FIG. As described above, the first output OUT1 and the second output OUT2 may be input to the OR circuit OR to obtain a logical sum, and the conduction / non-conduction of the transistor 70 may be controlled by the logical sum output. In this case, a large number of comparison results can be output with a small number of output transistors. However, on the external device side, it is necessary to determine whether the output transistor is turned on or off based on the first or second comparison result from the measured output data. Three or more types of comparison results may be output.
[0070]
Further, 10-bit measurement output data is supplied to the signal output unit 40 from an output port of the microcomputer 20 with an output latch. The 10-bit measurement data is input to the digital analog (D / A) conversion unit 73 in the signal output unit 40 shown in FIG. 12, and is supplied to the inspection signal output terminal to which the adjustment inspection apparatus is connected in the inspection mode. Is done. The measurement data converted into an analog signal by the 10-bit D / A converter 73 is input to a 4 to 20 mA transmission signal output unit 75 via a voltage / current converter (V / I converter) 74, and This is output to the external device EXCT as a 20 mA transmission signal. As shown in the figure, a capacitor C and a varistor V are connected in parallel between the output of the 4-20 mA transmission signal output unit 75 and the ground so as to absorb noise and surge.
[0071]
Furthermore, the PWM signal having the 10-bit resolution described above corresponding to the flow rate value measured from the output port of the microcomputer 20 is output, and the PWM signal is applied to the gate of the output transistor 76 shown in FIG. It is output to the external device EXCT via the PWM output terminal. A protective Zener diode ZD is connected between the PWM output terminal and the ground.
As described above, in the present invention, the 4 to 20 mA transmission signal or the PWM signal corresponding to the measured flow rate value is generated based on the measurement data having a 10-bit resolution, so that error propagation is performed. It is possible to output a signal having no error to an external device.
[0072]
Further, the measured pulse signal β from the waveform shaping unit 68 of the sensor unit 11 is applied to the gate of the output transistor 77 of the signal output unit 40, and the drain of the transistor 77 is used for testing the signal output unit 40. Via the signal output terminal, it is connected to the adjustment inspection apparatus connected in the inspection mode.
In FIG. 12, a MOS transistor is used as each output transistor, but a bipolar transistor may be used. In this case, the outputs OUT1 and OUT2 are respectively applied to the bases of the bipolar transistors, and their collectors are connected to the output terminals.
Reference numeral 78 denotes a DC stabilized power supply circuit. In this embodiment, a DC voltage of 12 to 24 V supplied from the external device EXCT is input, converted into a drive voltage for the flowmeter, and output. As shown in FIG. 12, a surge preventing varistor V and a noise removing capacitor C are connected in parallel between the power supply lines (+ DC, −DC and GND) supplied from the external device. Has been. Further, the diode D inserted between the power supply line + DC and the direct current stabilizing power supply 78 prevents damage to the circuit against reverse connection of the polarity of the power supply line.
[0073]
Various data stored in the ROM 84, the RAM 85, and the EEPROM 17 will be described.
FIG. 13A shows an example of a memory map of the ROM 84 and RAM 85. FIG. As shown in this figure, in the area of the RAM 85, various register areas, areas for storing correction coefficients and various flags to be described later, work areas, areas for storing integrated flow value data, and integrated batch flow values are stored. An area to be used is provided.
In the area of the ROM 84, a control program, an aperture setting data table, an interrupt vector, and the like are stored. Here, the diameter setting data table is coefficient data (inclination data ai and intercept data bi in the equation (2)) corresponding to the diameter and material of the pipe, for example, for 64 types of models (bore diameter and material). Corresponding data is stored.
[0074]
FIG. 13B is a diagram for explaining the configuration of the aperture setting data table. As shown in this figure, the aperture setting data table has a 4-page configuration in which 16 types of setting data are used as one page. As shown in the figure, each setting data includes a setting code (model setting code) for identifying the setting data, a code for specifying the diameter, a material code for specifying the main body material, a flow frequency f1 to 110 of the rated flow rate. Frequency data f1 to f6 that divide up to a frequency f6 corresponding to an instantaneous flow rate value of 5% into five sections, and linear gradient data a1 to a5 when a function of frequency and flow rate is approximated by a broken line corresponding to the five sections. And intercept data b1 to b5 are stored. The flow frequency f1 is a measurement lower limit frequency determined by the model, that is, the diameter and material of the measuring unit main body 50 (FIG. 8), and has a value of about 5 Hz, for example.
Note that the data a1 to a5 and b1 to b5 are average values of instrumental error dispersion, and even if the flow rate is calculated using this data as it is, a highly accurate measurement result cannot be expected. Therefore, also in the present invention, primary inclination data A1 to A5 and primary intercept data B1 to B5 (hereinafter collectively referred to as “correction coefficient”) corrected for each unit in the adjustment inspection process described later. The flow rate is calculated using this correction coefficient as shown in the equation (3). Thereby, it is possible to perform very accurate measurement.
[0075]
FIG. 13C shows an example of a memory map of the EEPROM 17. As shown in this figure, the EEPROM 17 includes an inspection end flag, the corrected primary equation inclination data A1 to A5, the corrected primary equation intercept data B1 to B5, integrated flow data, integrated batch flow value data, model Setting code determination data, integration display method determination data, batch flow value setting data, upper limit flow value setting data, lower limit flow value setting data, and switch output cycle determination data are stored. Note that details of these data will be described in corresponding portions in a flowchart described later.
[0076]
Next, the operation of this flow meter (instantaneous flow meter) will be described in detail. As described above, this flow meter can operate as both an instantaneous flow meter and an integrated batch flow meter. Here, a case where the flow meter is operated as an instantaneous flow meter will be described.
This flow meter is generally operated by three types of interrupt processing: a main routine as a flow meter, frequency measurement interrupt processing, 1 msec clock counting interrupt processing, and power supply voltage check interrupt processing. .
Here, by the frequency measurement interrupt process and the 1 msec clock count interrupt process, Flow meter The processing related to the measurement of the integer part of the frequency of the signal under measurement by the main counter and the measurement of the fractional part by the sub-counter according to the frequency measurement method is executed, and the above-described equation (4) or (5) is executed by the main routine. Various processes such as calculation of the frequency using, calculation and display of the instantaneous flow rate value based on the frequency, output to an external device, and output of a switch output signal are executed.
[0077]
FIG. 14 is a diagram showing a processing flow of the main routine. As shown in this figure, the main routine has two start positions, a first start (start 1) and a second start (start 2). Here, when a reset signal is input from the power-on reset circuit 14, the operation starts from the start 1, and when an interrupt is input from the watchdog timer 15, the operation starts from the start 2. .
[0078]
When the supply of power from the DC stabilized power supply circuit 78 is started by connecting the external device EXCT and the flow meter, the power-on reset circuit 14 detects this, and the microcomputer 20 A power-on reset pulse is applied to. Thereby, the process is started from start 1, and first, the first initialization process of step S41 is executed. In the first initialization process based on the power-on reset, a predetermined initialization process of the instantaneous flowmeter is executed and all the contents of the RAM 85 are reset. In step S42, the timer operation of each timer in the timer group 83 is started. However, the operation of the timer that generates the second period timer (0.2 second timer) and the 1 msec reference clock is not started here. Therefore, the signal from the first period timer is not output as described above.
Subsequently, the inspection end flag, integrated flow rate data, integrated batch flow rate value data, and the like are read from the EEPROM 17 and stored in a predetermined area of the RAM 85 (step S43). In the initial state, that is, in the state where the adjustment inspection device is connected as the external device EXCT before shipment from the factory, both the inspection end flag and the two accumulated data are set to the initial value 0. Next, the first output OUT1 (OUT) is turned on for 2 seconds (step S44). As a result, the external device EXCT (adjustment inspection device) can be notified of the start (start 1) of the instantaneous flowmeter by power-on reset. At the same time, the OUT1 LED 33 is also lit for 2 seconds.
[0079]
On the other hand, an interrupt signal is input from the watchdog timer 15 when a fixed time signal is not output to the watchdog timer 15 within a predetermined period due to some reason such as a runaway control program. At this time, the process starts from the start 2, and the second initialization process of step S45 is executed. In the second initialization process, a predetermined initialization process of the instantaneous flowmeter is executed. Unlike the first initialization process, a correction coefficient and an integrated flow value stored in the RAM 85 are used. Data and accumulated batch data are not cleared. Then, in the same manner as in step S42, the timer operation of each timer excluding the second period timer (0.2 second timer) and the 1 msec reference clock is started (step S46).
[0080]
After step S44 or step S46 is executed, the process proceeds to step S47, where it is determined whether or not the 4 to 20 mA transmission system is set by the jumper pin J2 in the function selection unit 12. If the result of this determination is YES, the process proceeds to step S48, where the D / A converter 73, V / I converter 74 and 4-20 mA transmission signal output unit 75 of the signal output unit 40 can be operated, and the external The output is set to 4 to 20 mA transmission system. If the determination result in step S47 is NO, the process proceeds to step S49, the PWM output function unit built in the microcomputer 20 is set to be operable, and measurement data is output to the outside by the PWM method. Set to.
[0081]
Next, it progresses to step S50 and it is determined whether the said jumper pin J1 is set to the instantaneous flow meter mode. When the jumper pin J1 is short-circuited and the instantaneous flow meter mode is set, the determination result is YES and the instantaneous flow meter processing program in step S51 is executed. On the other hand, when the jumper pin J1 is opened, the integrated batch flow meter processing program in step S52 is executed. In this specification, since the instantaneous flow meter is targeted, the instantaneous flow meter processing program (step S51) when the determination result in step S50 is YES will be described in detail below.
[0082]
FIG. 15 is a flowchart for explaining the operation of the instantaneous flow meter processing program in step S51.
When this instantaneous flow meter processing program is started, first, in step S60, the second output OUT2 is validated and the input IN is invalidated.
Next, it progresses to step S61 and it is determined whether the test | inspection completion flag is set. This inspection end flag is a flag that is set when this instantaneous flowmeter inspection and coefficient data correction processing are performed in the adjustment inspection process described later. In the initial state, this inspection end flag is set. The determination result in step S61 is NO. At this time, the process proceeds to step S62, and the model setting code of the instantaneous flowmeter is set using the manual operation unit 13, that is, the setting key 41, the up key 42, and the down key 43. Thereby, the diameter and material of the flow path in which this instantaneous flow meter is used are set. As described above, this step S62 is executed when the inspection end flag is not set, and is actually executed by the manufacturer.
[0083]
On the other hand, when the examination end flag is set, the process proceeds to step S63, and various data (such as the corrected primary slope data A1 to A5 and the primary intercept data B1 to B5) stored in the EEPROM 17 are read. And stored in a predetermined area of the RAM 85.
When the adjustment inspection process is not performed, standard primary slope data a1 to a5 and primary intercept data b1 to b5 stored in the ROM 84 are used for the above-described flow rate calculation. Become.
[0084]
After step S62 or step S63 is executed, the process proceeds to step S64, and based on the setting code and information read from the EEPROM 17, the diameter and material of the flow path and version information of the control program are displayed on the display unit. 30 are sequentially displayed for a predetermined time.
FIG. 16 shows an example of the display form of the display unit 30 in step S64. In FIG. 16, (a) shows an example of a caliber display form, (b) shows an example of a material display form, (c) shows an example of a software version display, and (a) → (b) Display is sequentially repeated for a predetermined time (for example, 1 second) in the order of (c) → (a).
[0085]
Here, as the diameter, there are a display in millimeters (mm) (A is added after the number) and an indication in inches (B is added after the number). Therefore, these apertures are displayed using the 3-digit data display 31 in the form shown on the right side of FIG. In the example shown in FIG. 16A, “10A” is displayed. Note that small, medium, and large described on the left of each aperture in FIG. 16 (a) indicate the classification to which each aperture belongs when each aperture is classified into three types: large, medium, and small. ing.
Examples of the material include L-PPS, PPS (polyphenylene sulfide), PVC (polyvinyl chloride), PFA, SUS (stainless steel), and the like, in the form shown in FIG. It is displayed on the display 31. In the illustrated example, the material is PVC.
Further, FIG. 16C shows a display example of the version of the control program. In this example, it is shown that the version of the control program is V3.8.
As described above, in the instantaneous flow meter of the present invention, the version of the control program is displayed on the display 31 that displays the measurement data at the start of operation, which is very convenient when performing maintenance or the like. ing.
[0086]
Now, after displaying the caliber, material, and program version (step S64), the process proceeds to step S65, and the time measurement process of the 0.2 second timer and the 1 msec clock is started. The counting process of the sub counters is started. Then, 0 is set in a register j that stores a value j indicating where in the second the 0.2 second interrupt is located. The contents of this register j indicate the position of the second signal having a period of 0.2 seconds in the 1-second period of the first signal, and the first signal (1-second timer) ) At the same timing, j = 1, and then sequentially counted as 2, 3, and 4. When j = 5, j = 0 is converted, and j = 1, 2, 3,. Is done.
As described above, in this embodiment, the output of the first cycle timer is generated from the output of the second cycle timer (0.2 second timer), but the first cycle timer (1 second timer) ) And a second period timer (0.2 second timer) may be provided separately to generate the first signal and the second signal.
[0087]
In step S66, it is determined whether or not the inspection mode is set. This determination is performed by inputting a signal from the input port to which the inspection mode setting pin 18 is connected and determining whether or not the inspection mode setting pin 18 is short-circuited. When the inspection mode setting pin 18 is short-circuited and set to the inspection mode, the process proceeds to step S67 to determine whether or not the inspection end flag is set. When the inspection end flag is not set, an inspection process in step S68 described later is executed, and thereafter a flow rate calculation process in step S69 is executed.
On the other hand, when the inspection mode is not set, or when the determination result of step S67 is YES, the flow proceeds to the flow rate calculation process of step S69. Thereafter, the display process in step S70, the external output process in step S71, the switch output process in step S72, and the key input process in step S73 are sequentially executed. Then, after the key input process in step S73 is executed, the process returns to step S66 again, and the processes in steps S66 to S73 are repeatedly executed. The details of each processing in steps S69 to S73 will be described later.
The above is the outline of the instantaneous flow meter processing program.
[0088]
FIG. 17 is a flowchart for explaining the operation of the power supply voltage check interrupt process. The voltage detector 16 determines whether or not the power supply voltage Vcc is equal to or higher than a predetermined voltage, and when detecting that the power supply voltage Vcc is lower than the first predetermined voltage, the voltage detector 16 supplies power to the microcomputer 20. Generate a voltage check interrupt. Thereby, the power supply voltage check interrupt process is started. When the power supply voltage check interrupt process is started, first, in step S81, the accumulated data in the RAM 85, the diameter and material data, the data specifying the accumulated display method, the upper limit flow value setting data, the lower limit flow rate Value setting data and selected predetermined data such as the switch output cycle determination data are stored in the EEPROM 17. Thereby, loss of these data can be prevented.
[0089]
After the necessary data is saved in the EEPROM 17 in the step S81, the microcomputer 20 is put into a wait state (step S82). When the power supply voltage Vcc returns to the first predetermined voltage or higher again without reaching the second predetermined voltage lower than the first predetermined voltage, the wait state is canceled (step S83), and again Return to main routine processing. In this case, since the power supply voltage Vcc has not dropped below the second predetermined voltage, it is considered that the data in the RAM 85 has not been lost, and the processing returns to the main routine.
On the other hand, when the power supply voltage Vcc drops below the second predetermined voltage, it is considered that the data in the RAM 85 has been lost. Therefore, when the power supply voltage Vcc returns, the power-on reset circuit 14 operates. Then, the process is started again from the first start position (main routine in FIG. 14).
[0090]
Next, the adjustment inspection process in step S68 (FIG. 15) will be described with reference to the connection diagram in the adjustment inspection process shown in FIG. 18 and the flowchart of FIG.
As shown in FIG. 18, this adjustment inspection process is executed in a state where the adjustment inspection apparatus is connected as the external apparatus EXCT. As shown in FIG. 11 and FIG. 12, the signal output unit 40 / power supply unit 45 is connected to the adjustment inspection apparatus EXCT which is an external device in this case. The offset adjustment and span adjustment of the signal corresponding to the instantaneous flow rate of the ˜20 mA transmission signal or the PWM signal are omitted in FIG.
[0091]
In FIG. 18, a high-precision reference flow meter 101 serving as a reference, a metering unit main body 50 of the instantaneous flow meter of the present invention, a pump 102, and a flow control valve 103 are attached to a pipe 100. Then, as described above, the OUT1 output of the output transistor 70 in the signal output unit 40, the 10-bit measurement data output, and the output of the sensor unit 11 via the output transistor 77 are input to the adjustment inspection device via a connector. Has been. Further, the output of the high-accuracy reference flow meter 101 is also input to the adjustment inspection apparatus. And the control signal with respect to the said flow control valve 103 is output from the said adjustment test | inspection apparatus, and it controls so that a predetermined | prescribed flow volume may be sent through the said piping 100 according to the predetermined test | inspection step shown in FIG.
As shown in FIG. 11, a power supply line, an input signal line, and an output signal line are actually connected, but the description is omitted in FIG.
[0092]
The adjustment inspection step S68 is performed in such a connected state. As shown in the flowchart of FIG. 19, first, in step S91, each part of the flowmeter is inspected according to a predetermined procedure. Next, proceeding to step S92, the output OUT1 is turned on for a predetermined time (for example, 0.1 second) and then turned off, and the first step of the adjustment inspection process is started for the adjustment inspection apparatus. Is notified. In response to this, the adjustment inspection apparatus uses the high-accuracy reference flowmeters to obtain the reference flow rates Q1 to Q6 corresponding to the six frequencies f1 to f6 stored in the ROM 84 corresponding to the selected model (model). While measuring at 101, the flow control valve 103 is controlled to flow through the pipe. Here, first, the flow rate control valve 103 is controlled such that the first reference flow rate Q1 flows through the pipe 100. The flow meter calculates and stores the frequency by the above-described method based on the input signal from the sensor unit 11 at this time (step S93). The frequency at this time is F1. And while displaying this frequency F1 and the flow volume Q1 at that time on the said indicator 31, this frequency value F1 is output to the said adjustment inspection apparatus via the said signal output part 40 (step S94).
[0093]
Next, the process proceeds to step S95, where the output OUT1 is turned on again for a predetermined time to notify the adjustment inspection apparatus of the progress of the step. As a result, the adjustment inspection device controls the second reference flow rate Q2 to flow through the pipe 100. And the said control part 20 calculates and memorize | stores the frequency F2 based on the input from the sensor part 11 at that time (step S96), while displaying the measured frequency value F2 and the reference | standard flow volume Q2, and also to the said adjustment inspection apparatus. Output (step S97). Then, the process proceeds to step S98, and the corrected primary slope data A1 and intercept data corrected based on the measured frequency F1 at the reference flow rate Q1 stored in step S93 and the measured frequency F2 at the reference flow rate Q2 stored in step S96. B1 is calculated. The correction coefficients A1 and B1 are calculated based on the following expressions (6) and (7).
A1 = (Q2-Q1) / (F2-F1) (6)
B1 = (Q1 * F2-Q2 * F1) / (F2-F1) (7)
The calculated correction coefficients A1 and B1 are stored in a predetermined area of the RAM 85. In step S99, the output OUT1 is turned on for a predetermined period to notify the adjustment inspection apparatus that the process in this step has been completed.
[0094]
Thereafter, in the same manner as described above, the reference flow rates Q3 to Q6 are sequentially flowed, and the correction coefficients A2 to A5 and B2 to B5 are similarly calculated using the measured frequency values F3 to F6 at that time and stored in the RAM 85. To do. In step S101, the display unit 31 displays the end of the inspection process. In step S102, the coefficients A1 to A5 and B1 to B5 stored in the RAM 85 are stored in the EEPROM 17. In step S103, the inspection end flag is set. The inspection process is completed after setting.
In steps S94, S97, etc., the frequency data F1 to F6 output to the adjustment inspection apparatus are stored as inspection records in the adjustment inspection apparatus. In steps S94, S97, etc., the measured frequency value Fi and the reference flow rate Qi are alternately blinked and displayed on the display 31 every predetermined period (for example, 0.5 seconds).
[0095]
Next, the frequency measurement interrupt process and the 1 msec clock count interrupt process will be described with reference to the flowcharts of FIGS. 20 and 21 and the time chart of FIG.
FIG. 20 is a flowchart of the frequency measurement interrupt process. This frequency measurement interrupt process is started by the output of the second period timer (0.2 second timer) generated every 0.2 seconds. When this process is started, first, in step S111, the 0.2 second timer is restarted. This ensures an accurate interrupt every 0.2 seconds each time. Further, as described above, in this embodiment, since the first period timer output is generated based on the output of the 0.2 second timer, the accuracy of the first period timer (1 second timer) output is increased. Is also guaranteed.
[0096]
In step S112, the switch output cycle determination data is referenced to determine whether the switch output is set at high speed. As described above, depending on the mode of use of this instantaneous flow meter, when the measured flow rate value exceeds a preset lower limit flow rate value or upper limit flow rate value, a high-speed (for example, within 1 second) switch output May be required. In order to cope with this, in the present invention, it is possible to select whether or not to make the switch output high-speed by the switch output cycle determination data. The switch output cycle determination data can be set by the user using the key switches 41 to 43 of the manual operation unit 13 in the key input processing routine (step S73) described in detail later. ing.
If the result of determination in step S112 is that high speed output has been made, a switch output flag is set in step S113, and the flow proceeds to step S114. On the other hand, when the high-speed output is not set, the process directly proceeds to step S114.
[0097]
In step S114, it is determined whether the content of the register j is 0-4. If j = 0 and j = 4, the process proceeds to step S119 as it is. When j = 1, the count content f0 of the main counter 81 is stored in the register in step S115, the count content of the main counter 81 is reset to 0 in step S116, and the count of the input pulse signal by the main counter 81 is performed again. Is resumed, and the process proceeds to step S119.
Thereby, as shown in FIG. 22, when j = 1, that is, at the measurement start (end) point of the first period timer, the count value f0 of the main counter is stored in the register. Therefore, the register stores the number f0 of input signal pulses input per second, that is, the integer part of the frequency of the input signal pulse.
When j = 2, the calculation permission flag 1 is set in step S117, and the process proceeds to step S119. Further, when j = 3, in step S118, an external output permission flag is set, and the process proceeds to step S119.
[0098]
As described above, when j = 0 or 4 in step S114, or after step S116, S117 or S118 is executed, step S119 is executed, and the contents of the register j are incremented. In step S120, it is determined whether or not the content of the register j is 2. When j = 2, the process proceeds to step S121. As will be described later, the sub-counter 82 counts the 1 msec reference clock from the rising edge to the falling edge of the input pulse from the sensor unit 11, and in this step S121, the count value n1 of the sub-counter 82 at this time point Is stored in a register. Then, the calculation permission flag 2 is set (step S122), and the current frequency measurement interrupt process is terminated.
That is, as shown in FIG. 22, in step S121, the time n1 counted by the 1 msec reference clock from the rising edge of the input pulse signal immediately before the measurement start (end) point to the measurement start point is obtained in the register. It is done.
On the other hand, if the decision result in the step S120 is NO, the process advances to a step S123 to judge whether j = 5. When j = 5, the contents of the register j are set to 0. When j ≠ 5, the frequency measurement interrupt process is terminated as it is.
[0099]
FIG. 21 is a flowchart for explaining the 1 msec clock counting interrupt process.
When the rising edge of the input pulse signal is detected, the 1 msec clock counting interrupt process is started (step S131), and the counting of 1 msec clock is started (step S132). Actually, this counting process is executed in the sub-counter 82. Then, it is determined whether or not the count value N1 is 200 or more (that is, 1 msec × 200 = 0.2 sec or more) (step S133), and when it is 200 or more, the second counter is reset. Then, detection of the rising edge of the next input pulse signal is awaited (step S139). As described above, in this example, the measurement lower limit frequency is set to 5 Hz, and when the cycle of the input pulse is 0.2 sec or more, the measurement lower limit frequency is equal to or lower than the measurement lower limit frequency. I'm waiting. In other words, if the frequency with flow is 5 Hz, there is no flow to be measured, so no pulse is input, and there is also a realistic aspect that there is no need to measure this input pulse.
[0100]
On the other hand, when the determination result of step S133 is NO, the process proceeds to step S134, and the above counting is repeated until the next rising edge is detected (NO in step S134). When the next rising edge is detected, the count value N1 of the sub-counter 82 so far is stored in a predetermined area of the RAM 85 (step S135). That is, as shown in FIG. 22, the period of the input pulse is sequentially measured by a 1 msec clock, and the measured value is sequentially stored in the RAM 85. At this time, the current count value is stored in an area of the RAM 85 different from the previous count value. That is, as an area for storing the count value N1 of the sub-counter 82 of the RAM 85, for example, an area for storing at least three count values is prepared, and the immediately preceding three count values N1 are sequentially stored.
[0101]
In step S136, it is determined whether the count value N1 stored in the RAM 85 is 20 or 16 in succession. This is to prevent erroneous measurement due to an induced voltage of the AC power supply (50 Hz or 60 Hz) mixed in the measurement signal as noise. If the decision result in the step S136 is YES, the process advances to a step S140 so as to reset the count value f0 of the main counter to 0 and the main counter 81 until the next count start time, that is, when j = 0. The counting operation is stopped.
In general, the flow value fluctuates finely, and usually the same frequency is not continuously detected. Therefore, it is possible to prevent the induction noise from the commercial AC power source from being detected by such a method.
[0102]
On the other hand, if the decision result in the step S136 is NO, the process advances to a step S137 to determine whether or not the calculation permission flag 2 is set. If the result of this determination is NO, the process returns to step S132, and the above-described measurement of the period of the input pulse signal is continued. On the other hand, if the calculation permission flag 2 is set and the determination result in step S137 is YES, the process proceeds to step S137, and the count value N1 at this time is read from the RAM 85 and stored in the register. Then, the processing after step S132 is repeated again. That is, as described above, the calculation permission flag 2 is set at a timing corresponding to j = 1 (step S122 in the frequency measurement interrupt process), and as shown in FIG. When the input pulse rises, the count value N1 is stored in the register. As a result, the cycle N1 of the input pulse signal straddling the time point j = 1 can be obtained in the register by the 1 msec clock counting interrupt process.
[0103]
As described above, the count contents f0 of the main counter 81 and the count contents n1 and N1 of the sub-counter 82 are written in the register by the frequency measurement interrupt process and the 1 msec clock count interrupt process. In the processing after the flow rate calculation processing step S69 (FIG. 15), a flow rate value is calculated using these count values, displayed, output to the outside, and further a switch output to the outside is performed.
Hereinafter, these processes will be described in detail.
[0104]
FIG. 23 is a flowchart showing the flow rate calculation processing in step S69. When this process is started, first, it is determined whether or not both the calculation permission flag 1 and the calculation permission flag 2 are set (step S141). Here, when the calculation permission flags 1 and 2 are not set, the count value f0 of the main counter and the count values N1 and n1 of the sub-counter are not prepared in the register, and the instantaneous flow rate value and the integrated flow rate value are not prepared. Since it is not the timing to execute this calculation, the flow rate calculation process is terminated as it is.
[0105]
On the other hand, when both the calculation permission flag 1 and the calculation permission flag 2 are set (when j = 2 or later as shown in FIG. 22), the process proceeds to step S142, and the register The number f0 of input pulse signals per second counted by the main counter 81 is stored in the register f. Next, it progresses to step S143 and subtraction of the fraction part in a measurement start point is performed. That is, as described above, using the values of N1 and n1 counted by the sub-counter 82 and stored in the register, f−n1 / N1 in the first half of the equation (4) is calculated and stored in the register f. Store. Then, it progresses to step S144 and the decimal part is added in the said measurement end point. That is, using the values of N2 and n2 counted by the sub-counter 82 and stored in the register, f + n2 / N2 in the latter half of the equation (4) is calculated and stored in the register f. That is, in steps S142, S143, and S144, the calculation of the above-described equation (4) is executed to calculate the frequency f of the input pulse signal for one second with high accuracy.
[0106]
Next, the process proceeds to step S145, and it is determined whether or not the value of the frequency f calculated in this way is equal to or higher than the flow frequency F1. When this result is NO, it is below the measurement lower limit frequency, so the process proceeds to step S148, and 0 is stored in the register Q for storing the instantaneous value. On the other hand, when the frequency f is equal to or higher than the flow frequency F1, the process proceeds to step S146, and an instantaneous flow rate value Q (= Ai × f + Bi) is calculated based on the equation (3). The correction coefficients Ai and Bi used here are the correction coefficients read from the EEPROM 17 in the step S63 (FIG. 15). Here, the instantaneous flow rate value Q is a value in units of “L / min”.
Subsequently, the process proceeds to step S147, and using the instantaneous flow rate value Q calculated in step S146, Q / 60 is added to the integrated flow rate value Qt to update the integrated flow rate value Qt. Here, Q is divided by 60 in order to convert the flow rate into 1 second. After the process of step S148 or step S147 is completed, both the calculation permission flags 1 and 2 are reset (step S149), and the flow rate calculation process is terminated.
[0107]
FIG. 24 is a flowchart for explaining the display processing in step S70 (FIG. 15). When this display process is started, first, in step S151, the set display mode is determined. Here, when the display mode is the instantaneous flow rate, the process proceeds to step S152, and the instantaneous flow rate value Q calculated in the flow rate calculation process is displayed on the display unit 31. This display mode is set in a key input process described later.
If the integrated flow rate display is selected, the process proceeds to step S153 to determine whether or not the fixed digit display is set. Here, when the fixed digit display (fixed decimal point type display) is set, the process proceeds to step S154, where the symbol “ud” indicating the upper digit display and the integrated flow rate are displayed on the display 31. Value of m Three Are displayed alternately for a predetermined period (for example, 5 seconds every 0.5 seconds). Subsequently, the process proceeds to step S155, where the symbol “Ld” indicating that the lower digit is displayed on the display 31 and the lower digit data in units of L of the integrated flow rate value are displayed in the same manner as in step S154. Display alternately for a predetermined period.
[0108]
On the other hand, when the display of the floating point system is set, the determination result of step S153 is NO, and the process proceeds to step S156. In step S156, the display unit 31 alternately displays a symbol “ud” indicating that the upper digit is displayed and data of three digits from the most significant digit of the integrated flow rate value for a predetermined period. When the unit display unit 32 is provided, the “m” is displayed together with the display. Three The unit display LED 35 is turned on. Then, the process proceeds to step S157 where the symbol “Ld” indicating that the lower digit is displayed on the display 31 and the fourth to sixth digits of data from the most significant digit of the integrated flow rate value are alternately displayed for a predetermined period. indicate. When the unit display section 32 is provided, the corresponding unit display LED 35 or 36 is turned on at the same time. That is, when the unit of the displayed fourth to sixth digit data is cubic meters, “m Three The unit display LED 35 is turned on. When the unit is liter, the “L” unit display LED 36 is turned on.
[0109]
FIG. 25 is a flowchart of the external output process S71 (FIG. 15). When the external output process is started, first, in step S161, it is determined whether or not the external output permission flag is set. This external output permission flag is a flag that is set at the timing of j = 3 in step S118 in the frequency measurement interrupt process (FIG. 20) (see FIG. 22). When the external output permission flag is not set, it is not the external output timing, and the external output process is terminated as it is.
As described above, in the present invention, since the timing of the external output is set to a predetermined timing, the deviation of data acquired by the external device is reduced, and high-accuracy monitoring is possible.
On the other hand, when the external output permission flag is set, the set signal system of the external output is determined in step S162. As described above, the selection of the output method is set by the jumper pin J2 in the function selection unit 12 (FIG. 11).
[0110]
Here, when the 4 to 20 mA transmission method is selected as the signal method, it is determined in step S163 whether or not the frequency f calculated in step S144 (FIG. 23) is equal to or higher than the flow frequency F1. If it is not equal to or higher than the flow frequency F1, the process proceeds to step S164, and all "0" are output to the 10-bit output latch. Further, when the frequency f is equal to or higher than the flow frequency F1, the process proceeds to step S165, and it is determined whether or not the instantaneous flow rate value Q calculated in step S144 (FIG. 23) is 110% or more of the rated flow rate value. . When the determination result is YES, the process proceeds to step S167 to output “1” to all the 10-bit latch outputs. On the other hand, if the decision result in the step S165 is NO, the process advances to a step S166 to output a 10-bit output corresponding to the calculated instantaneous flow rate value Q to the 10-bit latch. As a result, the 10-bit D / A converter 73 in the signal output unit 40 (FIG. 12) converts the 10-bit latch output into an analog signal, and the V / I converter 74 converts it into a corresponding current signal. A 4 to 20 mA transmission signal corresponding to the external device EXCT is output from the ~ 20 mA transmission signal output unit 75.
[0111]
On the other hand, when the jumper pin J2 in the function selection unit 12 is opened and the PWM signal method is selected as the output method, the process proceeds to step S168. Then, as in the case described above, it is determined whether or not the measured frequency f is equal to or higher than the flow frequency F1. If the result is NO, a pulse signal having a duty equivalent to 10 bits of “0” is output from the PWM output function unit built in the microcomputer 20 to the gate of the output transistor 76 (step S169). Further, when the measured frequency f is equal to or higher than the frequency with flow F1, the process proceeds to step S170, and it is determined whether or not the calculated instantaneous flow rate value Q is equal to or higher than 110% of the rating. If the determination result is NO, the process proceeds to step S171, and a pulse signal having a duty corresponding to the calculated instantaneous flow rate value Q (this is assumed to be 10-bit data) is output to the gate of the output transistor 76. Output to. When the instantaneous flow rate value Q is 110% or more of the rated value, the process proceeds to step S172, and a pulse signal having a duty equivalent to 10 bits of all 1 is output to the gate of the output transistor 76. Thus, a PWM signal having a 10-bit resolution corresponding to the instantaneous flow rate measured by the external device EXCT can be output via the output transistor 76.
[0112]
After outputting a signal based on the signal system set in step S167, S166 or S164 or step S172, S171 or S169 to the external device EXCT, the external output permission flag is reset in step S173. Ends the external output process.
As described above, in the present invention, since the measurement result having a resolution of 10 bits is used, it is possible to prevent propagation of errors and obtain a highly accurate measurement result.
[0113]
FIG. 26 is a flowchart for explaining the operation of the switch output process S72 (FIG. 15). When the switch output process is started, first, in step S181, it is determined whether or not the switch output flag is set. This switch output flag is a flag that is set in step S113 in the frequency measurement interrupt process (FIG. 20). When the high-speed switch output mode is set, every 0.2 seconds in step S113 (FIG. 20). This flag will be set. Here, in the normal switch output mode in which the switch output flag is not set, the process proceeds to step S185, and the measurement frequency f is written in the register f ′. On the other hand, in the high-speed output mode in which the switch output flag is set, the process proceeds to step S182, the count value f0 of the main counter 81 is read, and the count value f0 of the main counter read in the previous switch output process. A difference Δf from (old) is obtained, and 5 × Δf is written in the register f ′ (step S183). In step S184, the switch output flag is reset. The switch output flag is described as the SW output flag in the flowchart.
[0114]
That is, in the high-speed switch output mode in which the switch output flag is set, a value obtained by multiplying the difference Δf of the count value of the main counter 81 read in this switch output process executed every 0.2 seconds by 5 is obtained. As the frequency value f ′ for the switch output, in the normal switch output mode, the frequency value f calculated in step S144 (FIG. 23) (this value is calculated approximately every second) is used as the switch output. Is used as a frequency value f ′.
After determining the frequency value f ′ for the switch output in this way, the process proceeds to step S186, and the instantaneous flow rate value Q ′ (= Ai ×) corresponding to the frequency value f ′ based on the above-described equation (3). f ′ + Bi) is calculated.
[0115]
In step S187, the instantaneous flow rate value Q 'calculated in step S186 is compared with a preset lower limit flow rate value QL. As a result, when Q ′ ≦ QL, the process proceeds to step S188, where a high level is output to the gate of the output transistor 70, and an “L” level signal is output from the first output OUT1. At the same time, the first output LED 33 is turned on.
On the other hand, when Q ′> QL, the process proceeds to step S189 to determine whether or not the output OUT1 is at the “L” level. When the result is YES, the process further proceeds to step S190, where the instantaneous flow rate value Q ′ is QL + qL. more than It is determined whether or not. If the result of this determination is NO, the process proceeds to step S188.
Thus, in steps S189 and S190, the output OUT1 has a hysteresis characteristic. As a result, as shown in FIG. 26, the output OUT1 becomes “L” level when the instantaneous flow rate value Q ′ becomes less than the lower limit flow rate value QL, and becomes QL + qL or more when the instantaneous flow rate increases. It has a hysteresis characteristic so that it becomes “H” level when
On the other hand, when the determination result of step S189 is NO and when the determination result of step S190 is YES, the process proceeds to step S191, where a low level is output to the gate of the output transistor 70, and the first output OUT1 To output an “H” level signal. At the same time, the OUT1 LED 33 is turned off.
[0116]
After performing the process of step S188 or step S191 on the first output OUT1, the process proceeds to step S192, where the instantaneous flow rate value Q ′ is compared with the upper limit flow rate value QU. As a result, when QU ≦ Q ′, the process proceeds to step S193, a high level signal is output to the gate of the output transistor 71 (FIG. 12), and an “L” level is output to the second output OUT2. The second output LED 34 is turned on.
On the other hand, when Q ′ <QU, the process proceeds to step S194 to determine whether or not the second output OUT2 is at a low level. As a result, when it is at the low level, the process proceeds to step S195, and it is determined whether or not the instantaneous flow rate value Q ′ is equal to or less than QU−qU. Here, qU is a value that determines the hysteresis characteristic of the second switch output, and this second switch output OUT2 is changed from the high level to the low level when the instantaneous flow rate value Q ′ becomes equal to or higher than the upper limit flow rate value QU. When the instantaneous flow rate value Q ′ becomes QU−qU or less, the low level is inverted to the high level. Accordingly, when the determination result in step S195 is NO, the flow does not yet reverse the OUT2 output from the low level to the high level, and thus the process proceeds to step S193.
If the determination result in step S194 is NO or if the determination result in step S195 is YES, the process proceeds to step S196, and a low level signal is output to the gate of the output transistor 71 (FIG. 12). In addition, an “H” level is output to the second output OUT2, and the second output LED 34 is turned off.
[0117]
Thus, in the switch output processing of the present invention, the count value f0 of the main counter is checked every 0.2 seconds, and the difference Δf from the count value in the previous time (0.2 seconds before) is obtained. An approximate flow rate is calculated with Δf as a frequency for 1 second. Then, the approximate flow rate value calculated every 0.2 seconds is used for comparison with the upper limit / lower limit flow rate value. Therefore, it is possible to quickly detect the occurrence of an accident and send a signal as compared with the case where comparison is performed every measurement cycle (for example, 1 second) as in the past. In the case of an application example to be monitored, it is possible to prevent the equipment from being burned out.
[0118]
In the above description, the approximate frequency value is calculated based on the difference Δf in the count value of the main counter 81 every 0.2 seconds. However, other methods can be employed. That is, every 0.2 seconds, an approximate 1 is obtained by multiplying the count value f0 of the main counter 81 at that time by a different coefficient depending on which time of the first cycle the time is. This is a method of calculating an approximate flow rate by obtaining a frequency per second. Specifically, when the time is 0.2 seconds later, the count value f0 × 5 of the main counter is set to a frequency value for 1 second, and after 0.4 seconds, f0 × 2.5 is set to 0.6. Approximate flow rate is calculated by setting f0 × 1.667 for the second time and f0 × 1.25 for the frequency value for one second after 0.8 second, and the approximate flow rate and the upper / lower limit flow rate values. And compare. According to this method, it is possible to obtain an approximate flow rate with higher accuracy than in the case described above, but the control program becomes complicated because different coefficients are used.
[0119]
FIG. 27 is a process flowchart of the key input process S73 (FIG. 15). When this key input process is started, first, in step S201, any of the setting key (ENT key) 41, the up key (△ key) 42 or the down key (▽ key) 43 of the manual operation unit 13 is operated. It is determined whether or not it has been done. If no key operation is detected, the process proceeds to step S202, where the instantaneous flow rate value Q is displayed, and the key input process is terminated.
[0120]
When any operation of the operation keys 41 to 43 is detected, the process proceeds to step S203, and it is determined whether or not the operated key is the ENT key 41. When the operated key is the ENT key 41, the process proceeds to step S204, and the integrated flow rate value Qt display flag is set in a set state for a predetermined period (here, 10 seconds). Thereby, in step S151 of the display process (FIG. 24), the display mode is set to the integrated flow rate mode, and the integrated flow rate value Qt is displayed on the display unit 30. In step S205, it is determined whether the ENT key 41 has been operated again. If the ENT key 41 is not operated, the key input process is terminated as it is.
Thus, when the operator operates the ENT key 41 once, the integrated flow rate value Qt can be displayed on the display unit 30 for a predetermined period.
[0121]
On the other hand, when the ENT key 41 is operated again and the determination result in step S205 is YES, the process proceeds to step S206, and the L level point (lower limit flow rate value QL) of the output OUT1 is displayed on the display 31. The OUT1 LED 33 blinks. In this state, the operator can change the QL value using the △ key 42 or the ▽ key 43 and set it using the ENT key 41. When the ENT key 41 is operated and the setting of this QL is completed, the process proceeds to step S207, and similarly, the hysteresis value qL is displayed, and this qL is changed and set. Thereafter, the operation of the ENT key 41 causes the upper flow rate value QU to be displayed, changed and set in step S208, and the hysteresis value qU to be displayed, changed and set in step S209. The ENT key 41 is operated in step S209. Then, this key input process is terminated.
Thus, when the operator presses the ENT key 41 twice, the lower limit flow value QL, hysteresis value qL, upper limit flow value QU, and hysteresis value qU can be changed and set.
[0122]
On the other hand, when it is determined NO in step S203, that is, when the operated key is the △ key 42 or the ▽ key 43, the process proceeds to step S210, where the △ key 42 and the ▽ key 43 are pressed simultaneously. It is determined whether or not. When the determination result is YES, it is further determined whether or not the Δ key 42 and the ▽ key 43 are simultaneously pressed for a first predetermined time (for example, 5 seconds) (step S211). When the determination result of step S210 is NO, or when the determination result of step S211 is NO, that is, the Δ key 42 and the ▽ key 43 have not been pressed simultaneously for the first predetermined time (5 seconds) or more. At this time, the key input process is terminated as it is.
[0123]
On the other hand, if the △ key 42 and the ▽ key 43 are simultaneously pressed for the first predetermined time or longer and the determination result in step S211 is YES, the process proceeds to step S212, and the △ key 42 and the ▽ key 43 are simultaneously pressed. It is determined whether or not the second predetermined time (for example, 10 seconds) has been continued. When the determination result is YES, that is, when the Δ key 42 and the ▽ key 43 are continuously pressed for, for example, 10 seconds or more, the process proceeds to step S216, and the integrated flow rate value Qt stored in the RAM 85 and the EEPROM 17 is reached. Is cleared and the key input process is terminated.
As a result, the integrated flow value Qt can be cleared and integration from 0 can be started again.
[0124]
If the determination result in step S212 is NO, that is, if the △ key 42 and the ▽ key 43 are pressed simultaneously, for example, for 5 seconds or more and less than 10 seconds, the process proceeds to step S213, and the setting code is read out and handled accordingly. The aperture, material, and software version information are sequentially displayed for a predetermined period. This is the same as the display in step S64 (FIG. 15).
In step S214, the set display mode is displayed on the display 31. For example, when the display mode is set to fixed digit display, all three decimal points in the display 31 are lit, and when the display mode is set to floating digit display, the three decimal points in the display 31 are set. This is done by turning on and off one by one. At this time, the operator can change the display mode by operating the Δ key 42 or the ▽ key 43, and can set the display mode by operating the ENT key 41.
[0125]
When the operator operates the ENT key 41, the process proceeds to step S215, and the set switch output cycle is displayed on the display 31. This is performed, for example, by displaying “0.2” on the display 31 when the switch output cycle is set to a high speed and displaying “1.0” when the switch output period is set to a low speed. The operator can change the setting of the switch output cycle by operating the Δ key 42 or the ▽ key 43, and can set the switch output cycle by operating the ENT key 41. . Then, when the ENT key 41 is operated, this key input process is ended.
As described above, in this key input process, each of the parameters can be easily set and changed by using the △ key 42 and the ▽ key 43 mainly for changing the setting and using the ENT key 41 for confirmation. .
[0126]
In the above-described embodiment, the input pulse is counted and its period is measured by the rising edge of the input pulse. However, the time point of the falling edge of the input pulse may be used as a reference.
Further, the first period, the second period, and the period of the reference clock do not have to be the values used in the above-described embodiments, and may be optimal values according to individual cases. . For example, by making the reference clock faster, measurement with higher resolution can be performed.
Furthermore, in the above-described embodiment, the display 31 is an LED having a three-digit display unit. However, the display 31 is not limited to this, and may have any number of digits such as four digits or eight digits. it can. Furthermore, the display is not limited to the LED display, and other display elements such as an LCD can be used.
[0127]
【The invention's effect】
As described in detail above, the present invention Flowmeter Therefore, it is possible to perform highly accurate frequency measurement in a short time.
Moreover, when measuring continuously, the count value (n2, N2) used for the last measurement can be used also for the next measurement, and can be measured with high processing efficiency.
Flow rate of the present invention In total According to this, the instantaneous flow rate value can be measured with high accuracy for each first period.
In addition, the integrated flow rate can be displayed in multiple digits, and an easy-to-use flow meter can be provided.
Furthermore, based on the high-resolution measurement result, the measurement flow rate can be transmitted to the external device at a predetermined timing, and there is little data deviation and high-precision monitoring is possible.
Furthermore, the flow rate that allows the user to select whether or not to perform external switch output at high speed according to the application. Total Can be provided.
Furthermore, the flow rate that allows the setting value of the switch output to be easily changed Total Can be provided.
[Brief description of the drawings]
FIG. 1 of the present invention Flow meter Frequency measurement with frequency measurement method applied Part It is a figure which shows the example of a structure.
FIG. 2 of the present invention Flow meter It is a figure for demonstrating the frequency measurement method.
FIG. 3 shows frequency measurement shown in FIG. Part Is a flowchart of a main routine in FIG.
FIG. 4 shows frequency measurement shown in FIG. Part Is a flowchart of a first timer interrupt processing routine in FIG.
FIG. 5 shows frequency measurement shown in FIG. Part It is a flowchart of the count processing routine of the 2nd counter in.
FIG. 6 shows frequency measurement shown in FIG. Part It is a timing chart for demonstrating operation | movement.
[Fig. 7] of the present invention. Flow meter Frequency measurement method The Apply Shi It is a block diagram which shows an example of the basic composition of the flowmeter.
FIG. 8 is a diagram showing the structure of an embodiment of a flow meter of the present invention.
FIG. 9 is a diagram showing another embodiment of the display unit of the flowmeter of the present invention.
FIG. 10 is a diagram showing an example of the layout of printed circuit boards and the layout of components on the printed circuit board in the flowmeter of the present invention.
FIG. 11 is a block diagram showing a circuit configuration of a flow meter of the present invention.
FIG. 12 is a block diagram showing a configuration of a power supply unit and a signal output unit of the flowmeter of the present invention.
FIG. 13 is a diagram showing an example of a memory map of ROM, RAM, and EEPROM in the flowmeter of the present invention.
FIG. 14 is a flowchart of a main routine of the flow meter of the present invention.
FIG. 15 is a flowchart of an instantaneous flow meter processing program of the flow meter of the present invention.
FIG. 16 is a diagram for explaining a display form in step S64 in FIG.
FIG. 17 is a flowchart of a power supply voltage check interrupt process of the flowmeter of the present invention.
FIG. 18 is a diagram showing a connection state during the adjustment inspection process of the flowmeter of the present invention.
FIG. 19 is a flowchart of a flow meter adjustment inspection process according to the present invention.
FIG. 20 is a flowchart of frequency measurement interrupt processing of the flowmeter of the present invention.
FIG. 21 is a flowchart of a 1 msec clock counting process of the flow meter of the present invention.
FIG. 22 is a diagram for explaining the frequency measurement interrupt process and the 1 msec clock counting process;
FIG. 23 is a flowchart of flow rate calculation processing of the flowmeter of the present invention.
FIG. 24 is a flowchart of the display process of the flowmeter of the present invention.
FIG. 25 is a flowchart of external output processing of the flowmeter of the present invention.
FIG. 26 is a flowchart of switch output processing of the flowmeter of the present invention.
FIG. 27 is a flowchart of key input processing of the flowmeter of the present invention.
[Explanation of symbols]
1 Frequency detector
2 First counter
3 Second counter
4 First timer
5 Reference clock generator
6 arithmetic processing part
7 Control unit
8 Display section
9 Output section
11 Sensor part
12 Function selection section
13 Manual operation part (key input part)
14 Reset signal output unit (power-on reset circuit)
15 Watchdog timer section
16 Voltage drop detector
17 Nonvolatile memory (EEPROM)
20 Control unit (microcomputer)
30 Display section
31 Display (data display unit)
33 Output 1 display unit (OUT1LED)
34 Output 2 display unit (OUT2LED)
35, 36 Unit display LED
40 Signal output section
41 Setting key (ENT key)
42 Up key (△ key)
43 Down key (▽ key)
45 Power supply
50 Weighing unit body
61-63 Printed circuit board
70, 71, 76, 77 Output transistor
73 Digital-analog converter (D / A converter)
74 Voltage-current converter (V / I converter)
75 4-20mA transmission signal output section
78 DC stabilized power supply circuit
81 First counter (main counter)
82 Second counter (sub-counter)
83 Timer registers
84 ROM
85 RAM

Claims (3)

被測定流量に対応する周波数を有するパルス信号を出力するセンサ部と、
第1の周期を有する第1の信号を発生する第1の信号発生部と、
前記第1の信号に応じて、前記第1の周期の期間に前記センサ部から出力されるパルスの数を計数する第1の測定部と、
前記第1の信号をその周期中に含むパルスにおける前記第1の信号の位置を測定する第2の測定部と、
前記第1の測定部による計数値と前記第2の測定部による測定結果とに基づいて、前記第1の周期毎に前記パルス信号の周波数を算出する第1の演算部と、
該算出されたパルス信号の周波数に基づいて瞬時流量を算出する第2の演算部とを有する流量計であって、
前記第1の信号と同期し、かつ、前記第1の周期を測定下限周波数で除算した第2の周期を有する第2の信号を発生する第2の信号発生部と、
前記パルス信号中のパルスの周期が、商用交流電源周波数に対応する周期と等しい状態が所定回数連続したときは、当該測定結果を無効とする手段とを有し、
前記第2の信号発生部の出力に基づいて前記各演算部の演算動作のタイミングが制御されることを特徴とする流量計。
A sensor unit that outputs a pulse signal having a frequency corresponding to the flow rate to be measured;
A first signal generator for generating a first signal having a first period;
A first measurement unit that counts the number of pulses output from the sensor unit during the period of the first cycle in response to the first signal;
A second measuring unit for measuring a position of the first signal in a pulse including the first signal in its cycle;
A first calculation unit that calculates a frequency of the pulse signal for each first period based on a count value by the first measurement unit and a measurement result by the second measurement unit;
A flow meter having a second calculation unit for calculating an instantaneous flow rate based on the calculated frequency of the pulse signal,
Synchronized with the first signal and a second signal generator for generating a second signal having a second period divided by the constant lower limit frequency measuring said first period,
When the state in which the pulse period in the pulse signal is equal to the period corresponding to the commercial AC power frequency continues for a predetermined number of times, the measurement result is invalidated, and
Flowmeter, characterized in that the timing of the computation operation of each operation unit based on an output of said second signal generator is controlled.
被測定流量に対応する周波数を有するパルス信号を出力するセンサ部と、
第1の周期を有する第1の信号を発生する第1の信号発生部と、
前記第1の信号に応じて、前記第1の周期の期間に前記センサ部から出力されるパルスの数を計数する第1の測定部と、
前記第1の信号をその周期中に含むパルスにおける前記第1の信号の位置を測定する第2の測定部と、
前記第1の測定部による計数値と前記第2の測定部による測定結果とに基づいて、前記第1の周期毎に前記パルス信号の周波数を算出する第1の演算部と、
該算出されたパルス信号の周波数に基づいて瞬時流量を算出する第2の演算部とを有する流量計であって、
予め設定された設定流量値と前記第2の演算部により算出された瞬時流量値とを比較する比較部と、
該比較結果をディジタル信号として出力するスイッチ出力部とを有し、
前記比較部は、前記第1の周期毎に前記第1の演算部の出力に基づいて算出された瞬時流量値と前記設定流量値とを比較する通常モードと、前記第1の周期を測定下限周波数で除算した第2の周期毎に前記第1の測定部の測定値に基づいて算出された瞬時流量値と前記設定流量値とを比較する高速モードの2つの動作モードを有することを特徴とする流量計。
A sensor unit that outputs a pulse signal having a frequency corresponding to the flow rate to be measured;
A first signal generator for generating a first signal having a first period;
A first measurement unit that counts the number of pulses output from the sensor unit during the period of the first cycle in response to the first signal;
A second measuring unit for measuring a position of the first signal in a pulse including the first signal in its cycle;
A first calculation unit that calculates a frequency of the pulse signal for each first period based on a count value by the first measurement unit and a measurement result by the second measurement unit;
A flow meter having a second calculation unit for calculating an instantaneous flow rate based on the calculated frequency of the pulse signal,
A comparison unit that compares a preset flow rate value set in advance with the instantaneous flow rate value calculated by the second calculation unit;
A switch output unit that outputs the comparison result as a digital signal;
The comparison unit includes a normal mode for comparing the instantaneous flow rate value calculated based on the output of the first calculation unit for each of the first period and said set flow rate value, measure the first cycle It has two operation modes of a high speed mode for comparing the instantaneous flow rate value calculated based on the measurement value of the first measurement unit and the set flow rate value every second period divided by the lower limit frequency. A flow meter.
前記設定流量値として複数の値が設定可能とされており、前記スイッチ出力部は、該複数の設定流量値に対する比較結果の論理和により制御されるようになされていることを特徴とする前記請求項記載の流量計。A plurality of values can be set as the set flow rate value, and the switch output unit is controlled by a logical sum of comparison results for the plurality of set flow rate values. Item 3. The flow meter according to Item 2 .
JP25980798A 1998-09-14 1998-09-14 Flowmeter Expired - Fee Related JP4126117B2 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP25980798A JP4126117B2 (en) 1998-09-14 1998-09-14 Flowmeter
US09/787,134 US6611785B1 (en) 1998-09-14 1999-09-13 Flowmeter, flow detecting switch, control method of flowmeter, control method of flow detecting switch, and recording medium having recorded a control program
PCT/JP1999/004979 WO2004074856A1 (en) 1998-09-14 1999-09-13 Frequency measuring method, frequency measuring device, physical quantity measuring device, flowmeter, flow rate sensing switch, method for control flowmeter, method for controlling flow rate sensing switch, and recorded medium on which control program is recorded

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP25980798A JP4126117B2 (en) 1998-09-14 1998-09-14 Flowmeter

Publications (2)

Publication Number Publication Date
JP2000088899A JP2000088899A (en) 2000-03-31
JP4126117B2 true JP4126117B2 (en) 2008-07-30

Family

ID=17339282

Family Applications (1)

Application Number Title Priority Date Filing Date
JP25980798A Expired - Fee Related JP4126117B2 (en) 1998-09-14 1998-09-14 Flowmeter

Country Status (1)

Country Link
JP (1) JP4126117B2 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
IT1397119B1 (en) * 2009-12-24 2012-12-28 Elbi Int Spa FLOW MEASUREMENT DEVICE FOR FLUIDS, IN PARTICULAR FOR LIQUIDS.
CN104483544B (en) * 2014-12-01 2017-11-10 陕西海泰电子有限责任公司 Single channel counter high accuracy frequency/period measuring method
CN104849549B (en) * 2015-04-21 2018-03-06 深圳市海浦蒙特科技有限公司 Measure the method and system of pulse frequency
JP7468186B2 (en) 2020-06-24 2024-04-16 セイコーエプソン株式会社 Frequency measuring devices, microcontrollers and electronic devices
CN115560809B (en) * 2022-11-22 2023-02-28 河北讯辉科技股份有限公司 Automatic industrial metering system
CN116360369B (en) * 2023-03-29 2024-04-19 山东农业工程学院 Intelligent batching control method and system for ceramic blade

Also Published As

Publication number Publication date
JP2000088899A (en) 2000-03-31

Similar Documents

Publication Publication Date Title
US4432232A (en) Device and method for measuring the coefficient of performance of a heat pump
US20170248535A1 (en) Conductivity sensor
US4399510A (en) System for monitoring utility usage
US7099785B2 (en) Electric plug having display means to indicate consumed power and electric energy
US7963173B2 (en) Magnetic flowmeter for measuring flow
EP0763718A1 (en) Flowmeter
US5586045A (en) Method of calibrating a high resolution flowmeter and measuring volume flow
US6269701B1 (en) Electromagnetic flowmeter deriving power from signalling loop current
RU2337320C1 (en) Water meter
JP4126117B2 (en) Flowmeter
JP3615921B2 (en) Flowmeter
US6611785B1 (en) Flowmeter, flow detecting switch, control method of flowmeter, control method of flow detecting switch, and recording medium having recorded a control program
JP3792878B2 (en) 2-wire measurement quantity transmitter and 2-wire flow rate transmitter
JP3964554B2 (en) Flow meter, control method thereof, and recording medium recording control program
US5270684A (en) Oil consumption counter
CN216050077U (en) Hall flowmeter with current output function
JP2001188983A (en) Method and device for transmitting physical quantity data, and system and instrument for flow rate measurement
CN216361634U (en) Gas flow standard part calibrating device
Komarenko et al. PSOC4 Based Intelligent Water Consumption Meter
JP3494743B2 (en) Flowmeter
JPS5917770B2 (en) electronic thermometer
JP3206211B2 (en) Flowmeter
RU2687506C1 (en) Electronic unit of vane water meter
JP3387673B2 (en) Flow meter with temperature display
JPH08271307A (en) Gas flow meter

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040401

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070703

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070903

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080205

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080401

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: 20080507

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080512

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110516

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110516

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120516

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120516

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130516

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140516

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees