JP5534486B1 - Bar code reader, control method of bar code reader, and program - Google Patents

Bar code reader, control method of bar code reader, and program Download PDF

Info

Publication number
JP5534486B1
JP5534486B1 JP2013067893A JP2013067893A JP5534486B1 JP 5534486 B1 JP5534486 B1 JP 5534486B1 JP 2013067893 A JP2013067893 A JP 2013067893A JP 2013067893 A JP2013067893 A JP 2013067893A JP 5534486 B1 JP5534486 B1 JP 5534486B1
Authority
JP
Japan
Prior art keywords
voltage
integral value
value
signal
reference voltage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2013067893A
Other languages
Japanese (ja)
Other versions
JP2014191679A (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.)
NEC Platforms Ltd
Original Assignee
NEC Platforms Ltd
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 NEC Platforms Ltd filed Critical NEC Platforms Ltd
Priority to JP2013067893A priority Critical patent/JP5534486B1/en
Application granted granted Critical
Publication of JP5534486B1 publication Critical patent/JP5534486B1/en
Publication of JP2014191679A publication Critical patent/JP2014191679A/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

【課題】バーコードの読み取り精度を向上させることができるバーコード読取装置、バーコード読取装置の制御方法、及びプログラムを提供すること。
【解決手段】本発明にかかるバーコード読取装置1は、CCD13と、積分値算出部151と、調整部152と、を備える。CCD13は、バーコードからの反射光を受光し、受光信号を生成する。積分値算出部151は、受光信号と予め設定された基準電圧と比較し、基準電圧以上の受光信号の波形を積分することにより第1の積分値を算出する。また、積分値算出部151は、基準電圧未満の受光信号の波形を積分することにより第2の積分値を算出する。調整部152は、第1の積分値と第2の積分値との和に基づいて、受光信号のゲインを調整する。
【選択図】図1
A barcode reader capable of improving the accuracy of barcode reading, a method for controlling the barcode reader, and a program are provided.
A barcode reader 1 according to the present invention includes a CCD 13, an integral value calculation unit 151, and an adjustment unit 152. The CCD 13 receives the reflected light from the barcode and generates a light reception signal. The integral value calculation unit 151 compares the light reception signal with a preset reference voltage, and calculates the first integral value by integrating the waveform of the light reception signal equal to or higher than the reference voltage. Further, the integral value calculation unit 151 calculates the second integral value by integrating the waveform of the received light signal that is less than the reference voltage. The adjustment unit 152 adjusts the gain of the received light signal based on the sum of the first integral value and the second integral value.
[Selection] Figure 1

Description

本発明はバーコード読取装置、バーコード読取装置の制御方法、及びプログラムに関する。   The present invention relates to a barcode reader, a method for controlling the barcode reader, and a program.

商品コードの識別などにバーコードが用いられている。バーコード読取装置は、光源から出射した光をバーコード上に投光し、受光素子を用いてバーコードからの反射光を受光する。そして、バーコード読取装置は、受光した反射光を電気信号に変換し、当該電気信号に基づいてバーコードシンボルの配置を読み取る。これにより、バーコード読取装置は、バーコードで表示されている情報を読み取る。   Bar codes are used to identify product codes. The bar code reader projects light emitted from a light source onto a bar code and receives reflected light from the bar code using a light receiving element. Then, the barcode reader converts the received reflected light into an electrical signal, and reads the arrangement of barcode symbols based on the electrical signal. Thereby, the barcode reader reads the information displayed by the barcode.

バーコード読取装置には読取速度や読取精度の向上が要求されており、様々な提案がなされている。例えば、特許文献1には、バーコード読取装置を構成するアナログ素子のばらつきによらず、正確にバーコードを読み取ることができる利得制御方法が開示されている。また、特許文献2には、バーコードの背景環境に影響されることなくバーコードを正確に読み取ることができるバーコード読取装置が開示されている。   Bar code readers are required to improve reading speed and reading accuracy, and various proposals have been made. For example, Patent Document 1 discloses a gain control method that can accurately read a barcode regardless of variations in analog elements constituting the barcode reader. Patent Document 2 discloses a barcode reader that can accurately read a barcode without being affected by the background environment of the barcode.

特開2002−232245号公報JP 2002-232245 A 特開2009−259059号公報JP 2009-259059 A

しかしながら、バーコードの欠陥や、読取時におけるバーコード読取装置の不適切な姿勢等の影響によって、バーコードからの反射光が電気信号に変換された時に、電気信号の振幅が小さくなってしまう場合がある。このため、バーコード読取装置は、バーコードを正しく読み取ることが出来ず、読み取り失敗となってしまうという問題があった。   However, when the reflected light from the barcode is converted into an electrical signal due to the effect of a barcode defect or an inappropriate posture of the barcode reader at the time of reading, the amplitude of the electrical signal becomes small There is. For this reason, the barcode reader has a problem that the barcode cannot be read correctly and reading fails.

本発明は、このような問題を解決するためになされたものであり、バーコードの読み取り精度を向上させることができるバーコード読取装置、バーコード読取装置の制御方法、及びプログラムを提供することを目的とする。   The present invention has been made to solve such problems, and provides a barcode reader, a barcode reader control method, and a program capable of improving barcode reading accuracy. Objective.

本発明にかかるバーコード読取装置は、バーコードからの反射光を受光し、受光信号を生成する受光手段と、前記受光信号と予め設定された基準電圧と比較し、前記基準電圧以上の前記受光信号の波形を積分することにより第1の積分値を算出し、前記基準電圧未満の前記受光信号の波形を積分することにより第2の積分値を算出する積分値算出手段と、前記第1の積分値と前記第2の積分値との和に基づいて、前記受光信号のゲインを調整するゲイン調整手段と、を備えるものである。   The bar code reader according to the present invention receives reflected light from a bar code, generates a light reception signal, and compares the light reception signal with a preset reference voltage, and receives the light received above the reference voltage. An integral value calculating means for calculating a first integrated value by integrating a waveform of the signal, and calculating a second integrated value by integrating a waveform of the received light signal less than the reference voltage; Gain adjusting means for adjusting the gain of the received light signal based on the sum of the integral value and the second integral value.

本発明にかかるバーコード読取装置の制御方法は、バーコードからの反射光を受光し、受光信号を生成するステップと、前記受光信号と予め設定された基準電圧と比較し、前記基準電圧以上の前記受光信号の波形を積分することにより第1の積分値を算出するステップと、前記基準電圧未満の前記受光信号の波形を積分することにより第2の積分値を算出するステップと、前記第1の積分値と前記第2の積分値との和に基づいて、前記受光信号のゲインを調整するステップと、を備えるものである。   The control method of the barcode reader according to the present invention includes a step of receiving reflected light from a barcode and generating a light reception signal, and comparing the light reception signal with a preset reference voltage, Calculating a first integrated value by integrating the waveform of the received light signal, calculating a second integrated value by integrating the waveform of the received light signal less than the reference voltage, and the first Adjusting the gain of the received light signal based on the sum of the integral value of the second and the second integral value.

本発明にかかるプログラムは、コンピュータに、受光部にバーコードからの反射光を受光させ、受光信号を生成させるステップと、前記受光信号と予め設定された基準電圧と比較させ、前記基準電圧以上の前記受光信号の波形を積分することにより第1の積分値を算出させるステップと、前記基準電圧未満の前記受光信号の波形を積分することにより第2の積分値を算出させるステップと、前記第1の積分値と前記第2の積分値との和に基づいて、前記受光信号のゲインを調整させるステップと、を実行させるものである。   A program according to the present invention causes a computer to receive a reflected light from a barcode on a light receiving unit and generate a light reception signal, and to compare the light reception signal with a preset reference voltage, Integrating a waveform of the received light signal to calculate a first integrated value; integrating a waveform of the received light signal less than the reference voltage to calculate a second integrated value; Adjusting the gain of the received light signal based on the sum of the integral value of the second and the second integral value.

本発明により、バーコードの読み取り精度を向上させることができるバーコード読取装置、バーコード読取装置の制御方法、及びプログラムを提供することができる。   According to the present invention, it is possible to provide a barcode reading apparatus, a method for controlling the barcode reading apparatus, and a program capable of improving the barcode reading accuracy.

実施の形態にかかるバーコード読取装置のブロック図である。It is a block diagram of the barcode reader concerning an embodiment. 実施の形態にかかる積分値算出部のブロック図である。It is a block diagram of the integral value calculation part concerning embodiment. 実施の形態にかかる調整部のブロック図である。It is a block diagram of the adjustment part concerning an embodiment. 実施の形態にかかるバーコード読取装置の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the barcode reader concerning Embodiment. 実施の形態にかかるバーコード読取装置の動作を説明するための図である。It is a figure for demonstrating operation | movement of the barcode reader concerning Embodiment. 実施の形態にかかるバーコード読取装置の動作を説明するための図である。It is a figure for demonstrating operation | movement of the barcode reader concerning Embodiment. 比較例にかかるバーコード読取装置の図である。It is a figure of the barcode reader concerning a comparative example. 実施の形態にかかるバーコード読取装置のブロック図である。It is a block diagram of the barcode reader concerning an embodiment.

以下、図面を参照して本発明の実施の形態について説明する。
図1に、本実施の形態にかかるバーコード読取装置1のブロック図を示す。バーコード読取装置1は、バーコードラベル90に記載されたバーコードの情報を読み取る。ここで、バーコードとは、縞模様状の線の太さによって数値や文字などを示す識別子である。
Embodiments of the present invention will be described below with reference to the drawings.
FIG. 1 shows a block diagram of a barcode reader 1 according to the present embodiment. The barcode reader 1 reads barcode information written on the barcode label 90. Here, the bar code is an identifier indicating a numerical value, a character, or the like depending on the thickness of a striped line.

<バーコード読取装置1の構成>
バーコード読取装置1は、投光用LED(Light Emitting Diode)11と、受光レンズ12と、CCD(Charge Coupled Device)13と、アンプ14と、調整回路15と、CPU(Central Processing Unit)16と、を備える。
<Configuration of Barcode Reader 1>
The barcode reader 1 includes a light emitting diode (LED) 11, a light receiving lens 12, a CCD (Charge Coupled Device) 13, an amplifier 14, an adjustment circuit 15, and a CPU (Central Processing Unit) 16. .

投光用LED11は、発光素子であり、バーコードラベル90に対して光を照射する。受光レンズ12は、バーコードラベル90からの反射光を集光する。CCD13は、受光レンズ12によって集光された反射光を受光し、電気信号(受光信号)を生成する受光素子である。CCD13は、受光した光を受光信号に変換し、アンプ14に出力する。アンプ14は、受光信号を増幅し、調整回路15に出力する。   The light projecting LED 11 is a light emitting element, and irradiates the bar code label 90 with light. The light receiving lens 12 condenses the reflected light from the barcode label 90. The CCD 13 is a light receiving element that receives the reflected light collected by the light receiving lens 12 and generates an electrical signal (light reception signal). The CCD 13 converts the received light into a light reception signal and outputs it to the amplifier 14. The amplifier 14 amplifies the received light signal and outputs it to the adjustment circuit 15.

調整回路15は、積分値算出部151と、調整部152と、を備える。積分値算出部151は、増幅された受光信号に基づいて、受光信号の振幅の大きさや、受光信号の振幅の中心と基準電圧との差を検出する。ここで、基準電圧とは、バーコード読取装置1の動作電圧の中間電圧である。つまり、基準電圧とは、最小動作電圧を0Vとすると、最大動作電圧の1/2(50%)の電圧を意味する。また、調整部152は、検出した振幅の大きさや振幅の中心と基準電圧との差に基づいて、受光信号のゲインとオフセット電圧とを調整する。なお、調整回路15の詳細な構成及び動作については後述する。   The adjustment circuit 15 includes an integral value calculation unit 151 and an adjustment unit 152. Based on the amplified light reception signal, the integral value calculation unit 151 detects the amplitude of the light reception signal and the difference between the center of the light reception signal amplitude and the reference voltage. Here, the reference voltage is an intermediate voltage of the operating voltage of the barcode reader 1. That is, the reference voltage means a voltage that is 1/2 (50%) of the maximum operating voltage when the minimum operating voltage is 0V. The adjustment unit 152 adjusts the gain and offset voltage of the received light signal based on the detected amplitude and the difference between the amplitude center and the reference voltage. The detailed configuration and operation of the adjustment circuit 15 will be described later.

CPU16は、バーコード読取装置1の各部の制御を行う中央制御装置である。CPU16は、A/Dコンバータ161と、メモリ162と、GPIO(General Purpose Input/Output)163と、を備える。   The CPU 16 is a central control device that controls each part of the barcode reader 1. The CPU 16 includes an A / D converter 161, a memory 162, and a GPIO (General Purpose Input / Output) 163.

A/Dコンバータ161は、調整回路15から出力されたアナログ信号(ゲイン及びオフセットの調整後の受光信号)をデジタル信号に変換する。なお、デコード処理については、バーコード読取技術においては公知の技術であるため、詳細な説明は省略する。A/Dコンバータ161は、デジタル化したデータをメモリ162に格納する。メモリ162は、例えば、RAM(Random Access Memory)やROM(Read Only Memory)等の記憶装置である。GPIO163は、汎用入出力部である。CPU16は、GPIO163を介してCLK信号や制御信号を調整回路15に出力する。また、CPU16は、GPIO163を介して投光用LED11を発光させるための制御信号を出力する。   The A / D converter 161 converts the analog signal output from the adjustment circuit 15 (the light reception signal after adjusting the gain and offset) into a digital signal. Since the decoding process is a known technique in the barcode reading technique, detailed description thereof is omitted. The A / D converter 161 stores the digitized data in the memory 162. The memory 162 is a storage device such as a RAM (Random Access Memory) or a ROM (Read Only Memory). The GPIO 163 is a general-purpose input / output unit. The CPU 16 outputs a CLK signal and a control signal to the adjustment circuit 15 via the GPIO 163. Further, the CPU 16 outputs a control signal for causing the light projecting LED 11 to emit light via the GPIO 163.

<調整回路15の詳細構成>
ここで、調整回路15の詳細な構成について説明する。図2及び図3は、調整回路15のブロック図である。図2は、積分値算出部151のブロック図である。図3は、調整部152のブロック図である。
<Detailed Configuration of Adjustment Circuit 15>
Here, a detailed configuration of the adjustment circuit 15 will be described. 2 and 3 are block diagrams of the adjustment circuit 15. FIG. 2 is a block diagram of the integral value calculation unit 151. FIG. 3 is a block diagram of the adjustment unit 152.

まず、図2を参照して積分値算出部151の構成について説明する。積分値算出部151は、A/Dコンバータ201と、コンパレータ202と、加算回路203〜205と、減算回路206と、AND回路207、208と、NOT回路209と、を備える。なお、図2に記載された「アナログ信号」とは、図1に示したアンプ14の出力信号(つまり、アンプ14において増幅された受光信号)である。   First, the configuration of the integral value calculation unit 151 will be described with reference to FIG. The integrated value calculation unit 151 includes an A / D converter 201, a comparator 202, addition circuits 203 to 205, a subtraction circuit 206, AND circuits 207 and 208, and a NOT circuit 209. 2 is an output signal of the amplifier 14 shown in FIG. 1 (that is, a light reception signal amplified by the amplifier 14).

A/Dコンバータ201には、アナログ信号が入力される。A/Dコンバータ201は、CPU16から出力されるCLK信号のタイミングに同期して、入力されたアナログ信号をデジタル変換し、デジタルデータとしてバスに出力する。つまり、A/Dコンバータ201は、デジタルデータを加算回路203、204に出力する。なお、図2及び図3において、データバスを8、11、12ビットデータバスとしているが、ビット数は、これらに限られるものではない。   An analog signal is input to the A / D converter 201. The A / D converter 201 digitally converts the input analog signal in synchronization with the timing of the CLK signal output from the CPU 16 and outputs it as digital data to the bus. That is, the A / D converter 201 outputs digital data to the addition circuits 203 and 204. 2 and 3, the data bus is an 8, 11, 12-bit data bus, but the number of bits is not limited to these.

コンパレータ202のプラス端子には、アナログ信号が入力される。一方、コンパレータ202のマイナス端子側には、基準電圧が入力される。基準電圧とは、上記の通り、最大動作電圧の50%の値とする。本実施の形態においては、最大動作電圧を3.0V、基準電圧を1.5Vとする。コンパレータ202は、入力されたアナログ信号と基準電圧とを比較し、比較結果に応じた出力信号をAND回路207及びNOT回路209に出力する。例えば、コンパレータ202は、基準電圧よりもアナログ信号が大きい場合、H(High)レベルの信号を出力し、基準電圧よりもアナログ信号が小さい場合、L(Low)レベルの信号を出力する。   An analog signal is input to the plus terminal of the comparator 202. On the other hand, a reference voltage is input to the negative terminal side of the comparator 202. As described above, the reference voltage is 50% of the maximum operating voltage. In the present embodiment, the maximum operating voltage is 3.0V and the reference voltage is 1.5V. The comparator 202 compares the input analog signal with the reference voltage, and outputs an output signal corresponding to the comparison result to the AND circuit 207 and the NOT circuit 209. For example, the comparator 202 outputs an H (High) level signal when the analog signal is larger than the reference voltage, and outputs an L (Low) level signal when the analog signal is smaller than the reference voltage.

加算回路203、204は、入力されたデジタルデータ(アナログ信号が離散化されたデータ)の値を加算する。なお、加算回路は公知の回路であるので、詳細な説明は省略する。加算回路203、204を動作させるための加算タイミング信号は、A/Dコンバータ201を動作させるためのCLK信号とコンパレータ202の出力信号の論理積で生成される。   The adder circuits 203 and 204 add values of input digital data (data obtained by discretizing an analog signal). Since the adder circuit is a known circuit, detailed description thereof is omitted. An addition timing signal for operating the adder circuits 203 and 204 is generated by a logical product of the CLK signal for operating the A / D converter 201 and the output signal of the comparator 202.

加算回路203は、コンパレータ202の出力がHレベルで、CLK信号が立ち上がったときに加算動作を行う。このとき、コンパレータ202の出力がHレベルの場合とは、コンパレータ202のプラス端子に入力されたアナログ信号の電圧値が、コンパレータ202のマイナス端子に入力された基準電圧より高い場合である。言い換えると、加算回路203は、基準電圧である1.5Vよりも高い電圧(1.5V〜3.0V)の波形がアナログ信号としてコンパレータ202に出力されている間のみ、A/Dコンバータ201からの値を加算する。このため、加算回路203に格納されている値は、アナログ信号が基準電圧より高い電圧である場合において、A/D変換されたデータの和となる。つまり、加算回路203は、基準電圧よりも高い電圧のアナログ信号波形の積分値(面積)を算出する。加算回路203により算出された積分値は第1の積分値である。   The adding circuit 203 performs an adding operation when the output of the comparator 202 is at the H level and the CLK signal rises. At this time, the case where the output of the comparator 202 is at the H level is a case where the voltage value of the analog signal input to the plus terminal of the comparator 202 is higher than the reference voltage input to the minus terminal of the comparator 202. In other words, the adder circuit 203 outputs from the A / D converter 201 only while the waveform of a voltage (1.5 V to 3.0 V) higher than the reference voltage of 1.5 V is output to the comparator 202 as an analog signal. Add the value of. For this reason, the value stored in the adder circuit 203 is the sum of A / D converted data when the analog signal is higher than the reference voltage. That is, the adding circuit 203 calculates an integrated value (area) of an analog signal waveform having a voltage higher than the reference voltage. The integral value calculated by the adder circuit 203 is the first integral value.

加算回路204は、コンパレータ202の出力がLレベルで、CLK信号が立ち上がったときに加算動作を行う。このとき、コンパレータ202の出力がLレベルの場合とは、コンパレータ202のプラス端子に入力されたアナログ信号の電圧値が、コンパレータ202のマイナス端子に入力された基準電圧より低い場合である。言い換えると、加算回路204は、基準電圧である1.5Vよりも低い電圧(0V〜1.5V)の波形がアナログ信号としてコンパレータ202に出力されている間のみ、A/Dコンバータ201からの値を加算する。このため、加算回路204に格納される値は、アナログ信号が基準電圧より低い電圧である場合において、A/D変換されたデータの和となる。つまり、加算回路204は、基準電圧よりも低い電圧のアナログ信号波形の積分値(面積)を算出する。加算回路204により算出された積分値は第2の積分値である。   The adding circuit 204 performs an adding operation when the output of the comparator 202 is at the L level and the CLK signal rises. At this time, the case where the output of the comparator 202 is at the L level is a case where the voltage value of the analog signal input to the plus terminal of the comparator 202 is lower than the reference voltage input to the minus terminal of the comparator 202. In other words, the adder circuit 204 outputs the value from the A / D converter 201 only while the waveform of a voltage (0V to 1.5V) lower than the reference voltage 1.5V is output to the comparator 202 as an analog signal. Is added. For this reason, the value stored in the adder circuit 204 is the sum of the A / D converted data when the analog signal is lower than the reference voltage. That is, the adding circuit 204 calculates an integrated value (area) of an analog signal waveform having a voltage lower than the reference voltage. The integral value calculated by the adder circuit 204 is a second integral value.

加算回路203、204は、加算したデータを加算回路205及び減算回路206に出力する。加算回路203、204は、CCD13によるスキャン前、もしくは、スキャン後(調整回路15の演算終了後)に、CPU16から出力されるクリア信号によってクリアされる。これにより、加算回路203、204に格納された値(積分値)が0にリセットされる。   The addition circuits 203 and 204 output the added data to the addition circuit 205 and the subtraction circuit 206. The adder circuits 203 and 204 are cleared by a clear signal output from the CPU 16 before the scan by the CCD 13 or after the scan (after completion of the calculation of the adjustment circuit 15). As a result, the values (integrated values) stored in the addition circuits 203 and 204 are reset to zero.

加算回路205は、加算回路203の加算結果と加算回路204の加算結果とを加算する。このとき、加算回路203の加算結果は、基準電圧よりも電圧が大きいアナログ信号の振幅の総和(第1の積分値)である。加算回路204の加算結果は、基準電圧よりも電圧が小さいアナログ電圧の振幅の総和(第2の積分値)である。つまり、加算回路205の加算結果は、アナログ信号の振幅(基準電圧に対する振幅)の総和である。   The adder circuit 205 adds the addition result of the adder circuit 203 and the addition result of the adder circuit 204. At this time, the addition result of the addition circuit 203 is the sum of the amplitudes of the analog signals having a voltage higher than the reference voltage (first integrated value). The addition result of the adder circuit 204 is a sum of amplitudes (second integrated values) of analog voltages whose voltage is smaller than the reference voltage. That is, the addition result of the adder circuit 205 is the sum of the amplitudes of the analog signals (amplitude relative to the reference voltage).

加算回路205の出力は、CPU16から出力されるラッチ信号によってラッチされて出力される。加算回路205の出力である加算データ出力は、読み取ったバーコード信号波形(アナログ信号波形)の大きさを示す信号である。加算データ出力は、バーコード信号波形の大きさが大であれば大きくなり、小であれば小さくなる。   The output of the adder circuit 205 is latched and output by a latch signal output from the CPU 16. The added data output as the output of the adder circuit 205 is a signal indicating the magnitude of the read barcode signal waveform (analog signal waveform). The added data output increases when the barcode signal waveform is large, and decreases when it is small.

また、減算回路206は、加算回路203の加算結果から加算回路204の加算結果を減算して出力する。減算回路206の出力は、CPU16から出力されるラッチ信号によってラッチされて出力される。減算回路206の出力である減算データ出力は、読み取ったバーコード信号波形の中心が、どの程度ずれているかを示す信号である。減算データ出力は、ずれが大であれば大きくなり、ずれが小であれば小さくなり、上にずれていれば正の値となり、下にずれていれば負の値となる。   The subtraction circuit 206 subtracts the addition result of the addition circuit 204 from the addition result of the addition circuit 203 and outputs the result. The output of the subtraction circuit 206 is latched and output by a latch signal output from the CPU 16. The subtraction data output which is the output of the subtraction circuit 206 is a signal indicating how much the center of the read barcode signal waveform is deviated. The subtraction data output becomes large when the deviation is large, becomes small when the deviation is small, becomes a positive value when it is shifted upward, and becomes a negative value when it is shifted downward.

AND回路207には、コンパレータ202の出力信号とCLK信号とが入力される。AND回路207は、コンパレータ202の出力信号及びCLK信号のレベルに応じたレベル(HレベルまたはLレベル)の信号を加算回路203に出力する。AND回路208には、NOT回路209を介してコンパレータ202の出力信号が入力される。また、AND回路208には、CLK信号が入力される。AND回路208は、NOT回路209の出力信号及びCLK信号に応じたレベル(HレベルまたはLレベル)の信号を加算回路204に出力する。   The AND circuit 207 receives the output signal of the comparator 202 and the CLK signal. The AND circuit 207 outputs a signal (H level or L level) corresponding to the output signal of the comparator 202 and the level of the CLK signal to the adder circuit 203. The output signal of the comparator 202 is input to the AND circuit 208 via the NOT circuit 209. The CLK signal is input to the AND circuit 208. The AND circuit 208 outputs a signal (H level or L level) corresponding to the output signal of the NOT circuit 209 and the CLK signal to the adder circuit 204.

次に、図3を参照して調整部152の構成について説明する。調整部152は、比較回路303、304と、電圧・抵抗変換回路305、306と、アンプ307と、抵抗308、309と、コンデンサ310と、カップリングコンデンサ311と、を備える。   Next, the configuration of the adjustment unit 152 will be described with reference to FIG. The adjustment unit 152 includes comparison circuits 303 and 304, voltage / resistance conversion circuits 305 and 306, an amplifier 307, resistors 308 and 309, a capacitor 310, and a coupling capacitor 311.

CPU16から出力されるラッチ信号によって、加算回路205と減算回路206の出力がラッチされた後、比較回路303、304は、例えば、演算可能な素子を用いて構成されており、CPU16から出力されるコンペア信号を受け、以下のように動作する。
比較回路303は、加算回路205の出力(電圧値)に対応する、ゲインを制御する電圧・抵抗変換回路305(第1の電圧・抵抗変換回路)への出力(電圧値)を予め定めた対応表を有し、加算回路205の出力(電圧値)に応じて、電圧・抵抗変換回路305(第1の電圧・抵抗変換回路)へ電圧値を出力する。加算回路205の出力(電圧値)が大きすぎる場合、電圧・抵抗変換回路305の抵抗値を小さくする電圧値が出力され、加算回路205の出力(電圧値)が小さすぎる場合、電圧・抵抗変換回路305の抵抗値を大きくする電圧値が出力される。
After the outputs of the adder circuit 205 and the subtractor circuit 206 are latched by the latch signal output from the CPU 16, the comparison circuits 303 and 304 are configured using, for example, elements that can be calculated and output from the CPU 16. In response to the compare signal, it operates as follows.
The comparison circuit 303 corresponds to an output (voltage value) corresponding to the output (voltage value) of the adder circuit 205, and outputs a predetermined value (voltage value) to the voltage / resistance conversion circuit 305 (first voltage / resistance conversion circuit) for controlling the gain. A voltage value is output to the voltage / resistance conversion circuit 305 (first voltage / resistance conversion circuit) according to the output (voltage value) of the addition circuit 205. When the output (voltage value) of the adder circuit 205 is too large, a voltage value that decreases the resistance value of the voltage / resistance conversion circuit 305 is output. When the output (voltage value) of the adder circuit 205 is too small, voltage / resistance conversion is performed. A voltage value for increasing the resistance value of the circuit 305 is output.

比較回路304は、減算回路206の出力(電圧値)に対応する、オフセット電圧を制御する電圧・抵抗変換回路306(第2の電圧・抵抗変換回路)への出力(電圧値)を予め定めた対応表を有し、電圧・抵抗変換回路306(第2の電圧・抵抗変換回路)へ電圧値を出力する。減算回路206の出力(電圧値)が正の値の場合は、電圧・抵抗変換回路306の抵抗値を正の値に応じて小さくする電圧値が出力され、減算回路206の出力(電圧値)が負の値の場合は、電圧・抵抗変換回路306の抵抗値を負の値に応じて大きくする電圧値が出力される。減算回路206の出力(電圧値)が正の値の場合でも、また、負の値の場合でも、減算回路206の出力(電圧値)が"0"に近くなるように、電圧・抵抗変換回路306の抵抗値が調整される。
なお、バーコードには、前後にクワイエットゾーンが存在するので、オフセット電圧については、その分を考慮して調整を行うように、電圧・抵抗変換回路306を設定する必要がある。なお、クワイエットゾーンとは、バーパターンの前後の空白部分である。
The comparison circuit 304 predetermined an output (voltage value) to the voltage / resistance conversion circuit 306 (second voltage / resistance conversion circuit) that controls the offset voltage corresponding to the output (voltage value) of the subtraction circuit 206. A correspondence table is provided, and a voltage value is output to the voltage / resistance conversion circuit 306 (second voltage / resistance conversion circuit). When the output (voltage value) of the subtraction circuit 206 is a positive value, a voltage value that decreases the resistance value of the voltage / resistance conversion circuit 306 according to the positive value is output, and the output (voltage value) of the subtraction circuit 206 Is a negative value, a voltage value for increasing the resistance value of the voltage / resistance conversion circuit 306 in accordance with the negative value is output. Even if the output (voltage value) of the subtraction circuit 206 is a positive value or a negative value, the voltage / resistance conversion circuit so that the output (voltage value) of the subtraction circuit 206 is close to “0”. The resistance value of 306 is adjusted.
Since the bar code has a quiet zone before and after, it is necessary to set the voltage / resistance conversion circuit 306 so that the offset voltage is adjusted in consideration of that. The quiet zone is a blank portion before and after the bar pattern.

電圧・抵抗変換回路305、306は、入力された電圧値に応じた抵抗値を有する抵抗として動作する。つまり、電圧・抵抗変換回路305、306の抵抗値は、入力電圧に比例する。電圧・抵抗変換回路305、306は、例えばポテンショメータ(可変抵抗器)である。電圧・抵抗変換回路305の一端は、抵抗308を介してグランドに接続される。また、電圧・抵抗変換回路305の一端は、アンプ307のマイナス側端子に接続される。電圧・抵抗変換回路305の他端は、アンプ307の出力端子に接続される。抵抗308の一端は、電圧・抵抗変換回路305及びアンプ307のマイナス側端子に共通接続される。抵抗308の他端は、コンデンサ310を介して、グランドに接続される。すなわち、電圧・抵抗変換回路305、アンプ307、及び抵抗308は、非反転増幅回路を構成し、ゲイン調整手段として機能する。電圧・抵抗変換回路305は、アンプ307の帰還抵抗である。したがって、アンプ307のゲインは、電圧・抵抗変換回路305の抵抗値と抵抗308の抵抗値との比に応じて変化する。なお、抵抗308の抵抗値は固定値である。   The voltage / resistance conversion circuits 305 and 306 operate as resistors having a resistance value corresponding to the input voltage value. That is, the resistance values of the voltage / resistance conversion circuits 305 and 306 are proportional to the input voltage. The voltage / resistance conversion circuits 305 and 306 are, for example, potentiometers (variable resistors). One end of the voltage / resistance conversion circuit 305 is connected to the ground via a resistor 308. One end of the voltage / resistance conversion circuit 305 is connected to the negative terminal of the amplifier 307. The other end of the voltage / resistance conversion circuit 305 is connected to the output terminal of the amplifier 307. One end of the resistor 308 is commonly connected to the voltage / resistance conversion circuit 305 and the negative terminal of the amplifier 307. The other end of the resistor 308 is connected to the ground via the capacitor 310. That is, the voltage / resistance conversion circuit 305, the amplifier 307, and the resistor 308 constitute a non-inverting amplifier circuit and function as a gain adjusting unit. The voltage / resistance conversion circuit 305 is a feedback resistor of the amplifier 307. Therefore, the gain of the amplifier 307 changes according to the ratio between the resistance value of the voltage / resistance conversion circuit 305 and the resistance value of the resistor 308. Note that the resistance value of the resistor 308 is a fixed value.

電圧・抵抗変換回路306の一端は、アンプ307のプラス側端子に接続される。また、電圧・抵抗変換回路306の一端は、カップリングコンデンサ311に接続される。電圧・抵抗変換回路306の他端は、グランドに接続される。抵抗309の一端は、電源電圧Vccに接続される。抵抗309の他端は、電圧・抵抗変換回路306のプラス側端子に接続される。また、抵抗309の他端は、カップリングコンデンサ311に接続される。つまり、電圧・抵抗変換回路306及び抵抗309は、バイアス回路を構成し、オフセット調整手段として機能する。バイアス回路は、カップリングコンデンサ311からの入力信号に対してバイアスをかけて、アンプ307に出力する。なお、図3において、Vccは動作電圧の上限値(第1の電源電圧。3.0V)であり、グランドは動作電圧の下限値(第2の電源電圧。0V)である。   One end of the voltage / resistance conversion circuit 306 is connected to the positive terminal of the amplifier 307. One end of the voltage / resistance conversion circuit 306 is connected to the coupling capacitor 311. The other end of the voltage / resistance conversion circuit 306 is connected to the ground. One end of the resistor 309 is connected to the power supply voltage Vcc. The other end of the resistor 309 is connected to the plus side terminal of the voltage / resistance conversion circuit 306. The other end of the resistor 309 is connected to the coupling capacitor 311. That is, the voltage / resistance conversion circuit 306 and the resistor 309 constitute a bias circuit and function as an offset adjustment unit. The bias circuit biases the input signal from the coupling capacitor 311 and outputs it to the amplifier 307. In FIG. 3, Vcc is the upper limit value of the operating voltage (first power supply voltage, 3.0 V), and ground is the lower limit value of the operating voltage (second power supply voltage, 0 V).

<調整回路15の動作>
続いて、調整回路15の動作について、図4に示すフローチャートを参照して説明する。まず、積分値算出部151は、前回の計算結果をクリアする(ステップS101)。つまり、CPU16は、クリア信号を出力することにより、加算回路203、204に格納されている加算結果を0にする。
<Operation of Adjustment Circuit 15>
Next, the operation of the adjustment circuit 15 will be described with reference to the flowchart shown in FIG. First, the integral value calculation unit 151 clears the previous calculation result (step S101). In other words, the CPU 16 outputs the clear signal to set the addition result stored in the addition circuits 203 and 204 to zero.

次に、コンパレータ202は、アナログ信号(増幅された受光信号)の電圧値を確認する(ステップS102)。具体的には、コンパレータ202は、アナログ信号の電圧値と基準電圧とを比較する。アナログ信号の電圧値が基準電圧以上である場合(ステップS103:Yes)、加算回路203は、基準電圧以上のデータを加算する(ステップS104)。一方、アナログ信号の電圧値が基準電圧未満である場合(ステップS103:No)、加算回路204は、基準電圧未満のデータを加算する(ステップS105)。   Next, the comparator 202 confirms the voltage value of the analog signal (amplified light reception signal) (step S102). Specifically, the comparator 202 compares the voltage value of the analog signal with a reference voltage. When the voltage value of the analog signal is equal to or higher than the reference voltage (step S103: Yes), the adding circuit 203 adds data equal to or higher than the reference voltage (step S104). On the other hand, when the voltage value of the analog signal is less than the reference voltage (step S103: No), the adding circuit 204 adds data less than the reference voltage (step S105).

CPU16は、全データを処理したか否かを判定する(ステップS106)。全データが処理されている場合(ステップS106:Yes)、ステップ107以降の処理へ進む。一方、全データが処理されていない場合(ステップS106:No)、ステップS102の処理に戻る。   The CPU 16 determines whether all data has been processed (step S106). When all the data has been processed (step S106: Yes), the process proceeds to step 107 and subsequent steps. On the other hand, when all the data has not been processed (step S106: No), the processing returns to step S102.

このとき、全データとは、バーコード読取装置1が1回スキャンを行い、それに伴ってCCD13から出力された信号をA/Dコンバータ201がA/D変換したデータの全てを意味する。また、全データが処理されているか否かの判断は、A/Dコンバータ201に入力されたCLK信号の値に基づいて判断される。例えば、バーコード読取装置1の1回分のスキャンにおいて生成された出力データに対して、CLK=1のCLK信号を用いてA/D変換が行われた場合、CPU16は、1回の加算処理が行われたときに全データが処理されたと判断する。また、CLK=100のCLK信号を用いてA/D変換が行われた場合、CPU16は、100回の加算処理が行われたときに全データが処理されたと判断する。   At this time, the total data means all data obtained by A / D converter 201 performing A / D conversion on the signal output from CCD 13 along with scanning performed once by barcode reader 1. Whether or not all data has been processed is determined based on the value of the CLK signal input to the A / D converter 201. For example, when A / D conversion is performed on the output data generated in one scan of the barcode reader 1 using the CLK signal of CLK = 1, the CPU 16 performs one addition process. When done, determine that all data has been processed. When A / D conversion is performed using the CLK signal of CLK = 100, the CPU 16 determines that all data has been processed when the addition processing is performed 100 times.

次に、加算回路205は、基準電圧以上のデータの和と基準電圧未満のデータの和を加算する(ステップS107)。つまり、加算回路205は、加算回路203、204の出力の合計を算出する。加算回路205は、加算結果を加算データ出力として、比較回路303に出力する。   Next, the adder circuit 205 adds the sum of data greater than or equal to the reference voltage and the sum of data less than the reference voltage (step S107). That is, the adder circuit 205 calculates the sum of the outputs of the adder circuits 203 and 204. The addition circuit 205 outputs the addition result to the comparison circuit 303 as an addition data output.

ここで、図5を用いて加算回路205の動作を説明する。図5は、アナログ信号の波形である。具体的には、図5は、バーコードリーダが正しく読み取ることが出来ない信号の波形を示す。図5は、信号の振幅が小さすぎるため、ノイズ等の影響が大となり、正しくデコードすることができない状態の波形を示す。横軸は時間を示す。つまり、横軸は、CCD13がバーコードを走査した時間を示す。縦軸は信号レベル(V)を示す。このとき、バーコードの黒い領域は照射された光を吸収するため、反射光の強度が弱くなり、黒い領域に対応する信号レベルは低くなる。一方、バーコードの白い部分は照射した光を反射するため、反射光の強度が強くなり、白い領域に対応する信号レベルは高くなる。また、上記したように、本実施の形態においては、動作電圧の範囲は0V〜3.0Vであるものとする。基準電圧は、最大動作電圧の50%である1.5Vとする。   Here, the operation of the adder circuit 205 will be described with reference to FIG. FIG. 5 is a waveform of an analog signal. Specifically, FIG. 5 shows a waveform of a signal that cannot be read correctly by the barcode reader. FIG. 5 shows a waveform in a state where the amplitude of the signal is too small so that the influence of noise or the like becomes large and cannot be correctly decoded. The horizontal axis indicates time. That is, the horizontal axis indicates the time when the CCD 13 scans the barcode. The vertical axis represents the signal level (V). At this time, since the black area of the barcode absorbs the irradiated light, the intensity of the reflected light becomes weak and the signal level corresponding to the black area becomes low. On the other hand, since the white portion of the barcode reflects the irradiated light, the intensity of the reflected light is increased and the signal level corresponding to the white area is increased. In addition, as described above, in this embodiment, the operating voltage range is 0V to 3.0V. The reference voltage is 1.5 V, which is 50% of the maximum operating voltage.

図5において、波形の基準電圧(1.5V)以上の領域は、加算回路203により加算されるデータであり、基準電圧未満の領域は、加算回路204により加算されるデータである。加算回路205は、基準電圧以上のデータと基準電圧未満のデータ(図5の斜線領域)の総和を算出する。つまり、加算回路205は、基準電圧以上の電圧のアナログ信号波形の積分値と、基準電圧よりも低い電圧のアナログ信号波形の積分値と、の合計(図5の斜線領域の面積)を算出する。このため、バーコードの波形の振幅が大きい程、加算回路205の加算結果は大きくなり、バーコードの波形の振幅が小さい程、加算回路205の加算結果は小さくなる。   In FIG. 5, the region of the waveform having a reference voltage (1.5 V) or higher is data added by the adder circuit 203, and the region less than the reference voltage is data added by the adder circuit 204. The adder circuit 205 calculates the sum of data that is equal to or higher than the reference voltage and data that is lower than the reference voltage (shaded area in FIG. 5). That is, the adder circuit 205 calculates the sum (the area of the hatched area in FIG. 5) of the integrated value of the analog signal waveform having a voltage equal to or higher than the reference voltage and the integrated value of the analog signal waveform having a voltage lower than the reference voltage. . For this reason, the larger the amplitude of the barcode waveform, the larger the addition result of the adding circuit 205, and the smaller the amplitude of the barcode waveform, the smaller the addition result of the adding circuit 205.

比較回路303は、加算回路205の出力(電圧値)に応じた電圧値を、電圧・抵抗変換回路305に出力する。電圧・抵抗変換回路305の抵抗値は、入力された電圧値に応じた抵抗値に変化する。例えば、調整回路15に入力されたアナログ信号の振幅量が少ない場合(加算データ出力の値が小さい場合)は、アナログ変換後の加算データも小さくなる。電圧・抵抗変換回路305は、その加算データに応じて比較回路303から出力された電圧を、電圧抵抗変換して、アンプ307の帰還抵抗として利用している。より詳細には、電圧・抵抗変換回路305の抵抗値をR1、抵抗308の抵抗値をR2とすると、電圧利得は(R1+R2)/R2となる。アンプ307は、R1、R2に応じた電圧利得を用いてアナログ信号を増幅する。これにより、アンプ307のゲインが調整される(ステップS109)。そして、次回のスキャン時のゲインとして使用される。なお、抵抗308の抵抗値は、電圧・抵抗変換回路306の可変範囲や必要とする電圧利得の値に応じて予め設定される。   The comparison circuit 303 outputs a voltage value corresponding to the output (voltage value) of the addition circuit 205 to the voltage / resistance conversion circuit 305. The resistance value of the voltage / resistance conversion circuit 305 changes to a resistance value corresponding to the input voltage value. For example, when the amplitude amount of the analog signal input to the adjustment circuit 15 is small (when the value of the addition data output is small), the addition data after analog conversion is also small. The voltage / resistance conversion circuit 305 performs voltage resistance conversion on the voltage output from the comparison circuit 303 according to the added data, and uses the voltage as a feedback resistance of the amplifier 307. More specifically, when the resistance value of the voltage / resistance conversion circuit 305 is R1, and the resistance value of the resistor 308 is R2, the voltage gain is (R1 + R2) / R2. The amplifier 307 amplifies the analog signal using a voltage gain corresponding to R1 and R2. Thereby, the gain of the amplifier 307 is adjusted (step S109). Then, it is used as a gain at the next scan. The resistance value of the resistor 308 is set in advance according to the variable range of the voltage / resistance conversion circuit 306 and the required voltage gain value.

また、減算回路206は、基準電圧以上のデータの和から基準電圧未満のデータの和を減算する(ステップS108)。つまり、減算回路206は、加算回路203の出力から加算回路204の出力を減算する。減算回路206は、減算結果を減算データ出力として比較回路304に出力する。   Further, the subtraction circuit 206 subtracts the sum of data less than the reference voltage from the sum of data greater than or equal to the reference voltage (step S108). That is, the subtracting circuit 206 subtracts the output of the adding circuit 204 from the output of the adding circuit 203. The subtraction circuit 206 outputs the subtraction result to the comparison circuit 304 as a subtraction data output.

ここで、図6を用いて減算回路206の動作を説明する。図6は、アナログ信号の波形である。具体的には、図6は、バーコードリーダが正しく読み取ることが出来ない信号の波形を示す。より詳細には、図6は、波形の振幅の中心(一点鎖線)が動作電圧範囲の中心(基準電圧1.5V)から上限側に電圧Vgだけずれている状態の波形を示す。この場合、信号がサチュレーションしてしまい、正しいバー幅データを取得することができない。より詳細には、波形の振幅の中心が基準電圧と一致していれば、バー幅drが実際のバーコードの白い領域の幅となる。しかし、図6の状態のままデコードしてしまうと、A/Dコンバータ161は、基準電圧(1.5V)に基づいて二値化するため、バー幅dsをバーコードの白い領域の幅として認識してしまう。このため、バーコードの読み取りができなかったり、誤読してしまったりして、正しくデコードすることができない。図5と同様に、縦軸は信号レベル(V)を示し、横軸は時間を示す。また、上記したように、本実施の形態においては、動作電圧の範囲は0V〜3.0Vであるものとする。基準電圧は、最大動作電圧の50%である1.5Vとする。   Here, the operation of the subtraction circuit 206 will be described with reference to FIG. FIG. 6 is a waveform of an analog signal. Specifically, FIG. 6 shows a waveform of a signal that cannot be read correctly by the barcode reader. More specifically, FIG. 6 shows a waveform in a state where the center of the waveform amplitude (one-dot chain line) is shifted from the center of the operating voltage range (reference voltage 1.5 V) to the upper limit side by the voltage Vg. In this case, the signal is saturated and correct bar width data cannot be obtained. More specifically, if the center of the amplitude of the waveform matches the reference voltage, the bar width dr becomes the width of the white area of the actual barcode. However, if decoding is performed in the state of FIG. 6, the A / D converter 161 binarizes based on the reference voltage (1.5 V), and thus recognizes the bar width ds as the width of the white area of the barcode. Resulting in. For this reason, the barcode cannot be read or misread and cannot be decoded correctly. As in FIG. 5, the vertical axis indicates the signal level (V), and the horizontal axis indicates time. In addition, as described above, in this embodiment, the operating voltage range is 0V to 3.0V. The reference voltage is 1.5 V, which is 50% of the maximum operating voltage.

図6において、波形の基準電圧(1.5V)以上の領域は、加算回路203により加算されるデータであり、基準電圧未満の領域は、加算回路204により加算されるデータである。減算回路206は、基準電圧以上のデータの和(図6の斜線領域)から基準電圧未満のデータの和(図6のドット領域)を減算した値を算出する。つまり、バーコードの波形の振幅の中心の基準電圧に対するずれが大きい程、減算回路206の減算結果は大きくなり、バーコードの波形の振幅の中心の基準電圧に対するずれが小さい程、減算回路206の減算結果は小さくなる。   In FIG. 6, the region of the waveform having a reference voltage (1.5 V) or higher is data added by the adder circuit 203, and the region below the reference voltage is data added by the adder circuit 204. The subtracting circuit 206 calculates a value obtained by subtracting the sum of data less than the reference voltage (dot region in FIG. 6) from the sum of data above the reference voltage (shaded region in FIG. 6). That is, the greater the deviation of the barcode waveform amplitude from the center reference voltage, the greater the subtraction result of the subtraction circuit 206. The smaller the deviation of the barcode waveform amplitude from the center reference voltage, the smaller the deviation of the subtraction circuit 206. The subtraction result becomes smaller.

比較回路304は、減算回路206の出力(電圧値)に応じた電圧値を、電圧・抵抗変換回路306に出力する。電圧・抵抗変換回路306の抵抗値は、入力された電圧値に応じた抵抗値に変化する。アナログ信号は、カップリングコンデンサ311において直流成分が除去される。直流成分が除去された信号には、電圧・抵抗変換回路306の抵抗値及び抵抗309の抵抗値に応じた電圧だけバイアスがかかる。   The comparison circuit 304 outputs a voltage value corresponding to the output (voltage value) of the subtraction circuit 206 to the voltage / resistance conversion circuit 306. The resistance value of the voltage / resistance conversion circuit 306 changes to a resistance value corresponding to the input voltage value. A direct current component is removed from the analog signal by the coupling capacitor 311. The signal from which the DC component is removed is biased by a voltage corresponding to the resistance value of the voltage / resistance conversion circuit 306 and the resistance value of the resistor 309.

電圧・抵抗変換回路306及び抵抗309がバイアス回路を構成する。より詳細には、電圧・抵抗変換回路306の抵抗値をR3、抵抗309の抵抗値をR4、バイアス回路の入力電圧をViとすると、バイアス回路の出力(バイアス電圧)はR3/(R3+R4)×Viとなる。つまり、入力電圧が電圧・抵抗変換回路306と抵抗309によって分圧される。そして、バイアスがかかったアナログ信号がアンプ307に入力される。   The voltage / resistance conversion circuit 306 and the resistor 309 constitute a bias circuit. More specifically, when the resistance value of the voltage / resistance conversion circuit 306 is R3, the resistance value of the resistor 309 is R4, and the input voltage of the bias circuit is Vi, the output (bias voltage) of the bias circuit is R3 / (R3 + R4) × Vi. That is, the input voltage is divided by the voltage / resistance conversion circuit 306 and the resistor 309. Then, the biased analog signal is input to the amplifier 307.

例えば、アナログ信号の波形が動作電圧の上限側にずれている場合、電圧・抵抗変換回路306の抵抗値は大きくなる。そのため、R3はR4よりも大きい値となり、R3/(R3+R4)の値は1/2より小さくなる。その結果、アナログ信号の波形の中心を下限側に調整することができる。同様に、アナログ信号の波形が動作電圧の下限側にずれている場合、電圧・抵抗変換回路306の抵抗値は小さくなる。そのため、R3はR4よりも小さい値となり、R3/(R3+R4)の値は1/2より大きくなる。その結果、アナログ信号の波形の中心を上限側に調整することができる。これにより、アンプ307のオフセット電圧が調整される(ステップS110)。そして、次回のスキャン時のオフセット電圧として使用される。   For example, when the waveform of the analog signal is shifted to the upper limit side of the operating voltage, the resistance value of the voltage / resistance conversion circuit 306 increases. Therefore, R3 is larger than R4, and the value of R3 / (R3 + R4) is smaller than 1/2. As a result, the center of the analog signal waveform can be adjusted to the lower limit side. Similarly, when the waveform of the analog signal is shifted to the lower limit side of the operating voltage, the resistance value of the voltage / resistance conversion circuit 306 becomes small. Therefore, R3 is smaller than R4, and the value of R3 / (R3 + R4) is larger than 1/2. As a result, the center of the analog signal waveform can be adjusted to the upper limit side. Thereby, the offset voltage of the amplifier 307 is adjusted (step S110). Then, it is used as an offset voltage at the next scan.

このように、調整部152は、受光信号のゲイン及びオフセット電圧を調整する。そして、調整後の受光信号をCPU16のA/Dコンバータ161に出力する。このため、A/Dコンバータ161は、適切な振幅及び振幅中心を有する波形の受光信号を用いてデコード処理を行うことができる。   As described above, the adjustment unit 152 adjusts the gain and offset voltage of the light reception signal. Then, the adjusted light reception signal is output to the A / D converter 161 of the CPU 16. For this reason, the A / D converter 161 can perform decoding processing using a light reception signal having a waveform having an appropriate amplitude and amplitude center.

<比較例>
ここで、比較例にかかるバーコード読取装置9の構成について説明する。比較例にかかるバーコード読取装置9は、図1に示したバーコード読取装置9の構成に比べて、調整回路15を有していない点で異なる。なお、その他の構成については、バーコード読取装置1と同様の構成であるため、適宜説明を省略する。
<Comparative example>
Here, the configuration of the barcode reader 9 according to the comparative example will be described. The barcode reader 9 according to the comparative example is different from the configuration of the barcode reader 9 shown in FIG. 1 in that the adjustment circuit 15 is not provided. Other configurations are the same as those of the barcode reading apparatus 1, and thus description thereof will be omitted as appropriate.

バーコード読取装置9の構成によれば、CCD13がアンプ14に受光信号を出力する。そして、アンプ14が、受光信号を増幅し、A/Dコンバータ161に出力する。A/Dコンバータ161は、入力された受光信号をデジタル信号に変換(二値化)して、デコードする。つまり、受光信号は補正されることなくデジタル信号に変換される。このため、受光信号の波形の振幅が小さかったり、振幅の中心が動作電圧の上限側または下限側にずれてしまったりする場合、A/Dコンバータ161は正確にデコードすることができない。   According to the configuration of the barcode reader 9, the CCD 13 outputs a light reception signal to the amplifier 14. Then, the amplifier 14 amplifies the received light signal and outputs it to the A / D converter 161. The A / D converter 161 converts (binarizes) the received light reception signal into a digital signal and decodes it. That is, the received light signal is converted into a digital signal without being corrected. For this reason, when the amplitude of the waveform of the received light signal is small or the center of the amplitude is shifted to the upper limit side or the lower limit side of the operating voltage, the A / D converter 161 cannot accurately decode.

これに対して、本実施の形態にかかるバーコード読取装置1においては、積分値算出部151が、基準電圧以上の受光信号の波形を積分することにより第1の積分値を算出し、基準電圧未満の受光信号の波形を積分することにより第2の積分値を算出する。そして、調整部152が、当該第1の積分値及び第2の積分値に基づいて、受光信号のゲイン及び中心電圧を調整する。このため、受光信号の波形を適切な波形に修正することができる。したがって、バーコード読取装置の読み取り精度を向上させることができる。   On the other hand, in the barcode reader 1 according to the present embodiment, the integral value calculation unit 151 calculates the first integral value by integrating the waveform of the received light signal equal to or higher than the reference voltage, and the reference voltage The second integrated value is calculated by integrating the waveform of the received light signal of less than. Then, the adjustment unit 152 adjusts the gain and center voltage of the light reception signal based on the first integration value and the second integration value. For this reason, the waveform of the received light signal can be corrected to an appropriate waveform. Therefore, the reading accuracy of the barcode reader can be improved.

なお、本発明は上記実施の形態に限られたものではなく、趣旨を逸脱しない範囲で適宜変更することが可能である。例えば、バーコード読取装置1の構成は、図1に示した構成に限られない。本発明にかかるバーコード読取装置1は、図8に示すように、少なくともバーコードからの反射光を受光し、受光信号を生成する受光部13、積分値算出部151、及び調整部152を備えていればよい。   Note that the present invention is not limited to the above-described embodiment, and can be changed as appropriate without departing from the spirit of the present invention. For example, the configuration of the barcode reader 1 is not limited to the configuration shown in FIG. As shown in FIG. 8, the barcode reading apparatus 1 according to the present invention includes at least a light receiving unit 13 that receives reflected light from a barcode and generates a light reception signal, an integral value calculation unit 151, and an adjustment unit 152. It only has to be.

また、上述のバーコード読取装置1の任意の処理は、CPU(Central Processing Unit)にコンピュータプログラムを実行させることにより実現することも可能である。この場合、コンピュータプログラムは、様々なタイプの非一時的なコンピュータ可読媒体(non-transitory computer readable medium)を用いて格納され、コンピュータに供給することができる。非一時的なコンピュータ可読媒体は、様々なタイプの実体のある記録媒体(tangible storage medium)を含む。非一時的なコンピュータ可読媒体の例は、磁気記録媒体(例えばフレキシブルディスク、磁気テープ、ハードディスクドライブ)、光磁気記録媒体(例えば光磁気ディスク)、CD−ROM(Read Only Memory)、CD−R、CD−R/W、半導体メモリ(例えば、マスクROM、PROM(Programmable ROM)、EPROM(Erasable PROM)、フラッシュメモリ、RAM(random access memory))を含む。また、プログラムは、様々なタイプの一時的なコンピュータ可読媒体(transitory computer readable medium)によってコンピュータに供給されてもよい。一時的なコンピュータ可読媒体の例は、電気信号、光信号、及び電磁波を含む。一時的なコンピュータ可読媒体は、電線及び光ファイバ等の有線通信路、又は無線通信路を介して、プログラムをコンピュータに供給できる。   Further, the arbitrary processing of the above-described barcode reader 1 can be realized by causing a CPU (Central Processing Unit) to execute a computer program. In this case, the computer program can be stored using various types of non-transitory computer readable media and supplied to the computer. Non-transitory computer readable media include various types of tangible storage media. Examples of non-transitory computer-readable media include magnetic recording media (for example, flexible disks, magnetic tapes, hard disk drives), magneto-optical recording media (for example, magneto-optical disks), CD-ROMs (Read Only Memory), CD-Rs, CD-R / W, semiconductor memory (for example, mask ROM, PROM (Programmable ROM), EPROM (Erasable PROM), flash memory, RAM (random access memory)) are included. The program may also be supplied to the computer by various types of transitory computer readable media. Examples of transitory computer readable media include electrical signals, optical signals, and electromagnetic waves. The temporary computer-readable medium can supply the program to the computer via a wired communication path such as an electric wire and an optical fiber, or a wireless communication path.

また、コンピュータが上述の実施の形態の機能を実現するプログラムを実行することにより、上述の実施の形態の機能が実現される場合だけでなく、このプログラムが、コンピュータ上で稼動しているOS(Operating System)もしくはアプリケーションソフトウェアと共同して、上述の実施の形態の機能を実現する場合も、本発明の実施の形態に含まれる。さらに、このプログラムの処理の全てもしくは一部がコンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットによって行われて、上述の実施の形態の機能が実現される場合も、本発明の実施の形態に含まれる。   In addition to the case where the function of the above-described embodiment is realized by the computer executing the program that realizes the function of the above-described embodiment, this program is not limited to the OS ( A case where the functions of the above-described embodiment are realized in cooperation with an operating system or application software is also included in the embodiment of the present invention. Furthermore, the present invention is also applicable to the case where the functions of the above-described embodiment are realized by performing all or part of the processing of the program by a function expansion board inserted into the computer or a function expansion unit connected to the computer. It is included in the embodiment.

例えば、調整回路15においてハードウエア(A/Dコンバータ、加算回路、減算回路等)を用いて実現していた処理を、ソフトウエア(CPU)を用いて実現してもよい。   For example, the processing realized in the adjustment circuit 15 using hardware (A / D converter, addition circuit, subtraction circuit, etc.) may be realized using software (CPU).

1 バーコード読取装置
11 投光用LED
12 受光レンズ
13 CCD
14 アンプ
15 調整回路
16 CPU
151 積分値算出部
152 調整部
161 A/Dコンバータ
162 メモリ
163 GPIO
1 Barcode reader 11 LED for light projection
12 Light receiving lens 13 CCD
14 Amplifier 15 Adjustment circuit 16 CPU
151 Integral Value Calculation Unit 152 Adjustment Unit 161 A / D Converter 162 Memory 163 GPIO

Claims (5)

バーコード読取装置であって、
バーコードからの反射光を受光し、受光信号を生成する受光手段と、
前記受光信号と、前記バーコード読取装置の動作電圧の上限値及び下限値の中間電圧である基準電圧と、を比較し、前記基準電圧以上の前記受光信号の波形を積分することにより第1の積分値を算出し、前記基準電圧未満の前記受光信号の波形を積分することにより第2の積分値を算出する積分値算出手段と、
前記第1の積分値と前記第2の積分値との和に基づいて、前記受光信号のゲインを調整するゲイン調整手段と、
前記第1の積分値と前記第2の積分値との差に基づいて、前記受光信号のオフセット電圧を調整するオフセット調整手段と、
を備えるバーコード読取装置。
A bar code reader,
A light receiving means for receiving reflected light from the barcode and generating a light reception signal;
The light reception signal is compared with a reference voltage that is an intermediate voltage between the upper limit value and the lower limit value of the operating voltage of the barcode reader, and the waveform of the light reception signal equal to or higher than the reference voltage is integrated. An integral value calculating means for calculating a second integral value by calculating an integral value and integrating the waveform of the received light signal less than the reference voltage;
Gain adjusting means for adjusting the gain of the received light signal based on the sum of the first integral value and the second integral value;
An offset adjusting means for adjusting an offset voltage of the light reception signal based on a difference between the first integral value and the second integral value;
A barcode reader.
前記ゲイン調整手段は、アンプと帰還抵抗とを有する負帰還回路を含み、
前記帰還抵抗は、前記第1の積分値及び前記第2の積分値の和に基づく電圧が入力され、入力される電圧に応じて抵抗値が変化する第1の電圧抵抗変換回路であり、
前記アンプのゲインは、前記第1の電圧抵抗変換回路の抵抗値に基づいて変化する請求項1に記載のバーコード読取装置。
The gain adjusting means includes a negative feedback circuit having an amplifier and a feedback resistor,
The feedback resistor is a first voltage resistance conversion circuit that receives a voltage based on a sum of the first integral value and the second integral value, and changes a resistance value according to the inputted voltage.
The bar code reader according to claim 1, wherein the gain of the amplifier changes based on a resistance value of the first voltage resistance conversion circuit.
前記オフセット調整手段は、
一端が第1の電源電圧に接続された抵抗素子と、
一端が第2の電源電圧に接続され、他端が前記抵抗素子の他端に接続され、前記第1の積分値と前記第2の積分値との差に基づく電圧が入力され、入力される電圧に応じて抵抗値が変化する第2の電圧抵抗変換回路と、を有し、
前記オフセット調整手段は、前記第1の積分値と前記第2の積分値との差に基づくバイアス電圧を生成し、前記バイアス電圧を用いて前記受光信号のオフセット電圧を変化させる請求項1または2に記載のバーコード読取装置。
The offset adjusting means includes
A resistance element having one end connected to the first power supply voltage;
One end is connected to the second power supply voltage, the other end is connected to the other end of the resistance element, and a voltage based on the difference between the first integral value and the second integral value is inputted and inputted. A second voltage resistance conversion circuit whose resistance value changes according to the voltage,
Said offset adjusting means, the first bias voltage generated based on the difference between the integrated value and said second integral value, claim 1 or 2, the bias voltage with changing the offset voltage of the light receiving signal The barcode reader described in 1.
バーコード読取装置の制御方法であって、
バーコードからの反射光を受光し、受光信号を生成するステップと、
前記受光信号と、前記バーコード読取装置の動作電圧の上限値及び下限値の中間電圧である基準電圧と、を比較し、前記基準電圧以上の前記受光信号の波形を積分することにより第1の積分値を算出するステップと、
前記基準電圧未満の前記受光信号の波形を積分することにより第2の積分値を算出するステップと、
前記第1の積分値と前記第2の積分値との和に基づいて、前記受光信号のゲインを調整するステップと、
前記第1の積分値と前記第2の積分値との差に基づいて、前記受光信号のオフセット電圧を調整するステップと、
を備えるバーコード読取装置の制御方法。
A control method for a barcode reader,
Receiving reflected light from the barcode and generating a received light signal;
The light reception signal is compared with a reference voltage that is an intermediate voltage between the upper limit value and the lower limit value of the operating voltage of the barcode reader, and the waveform of the light reception signal equal to or higher than the reference voltage is integrated. Calculating an integral value;
Calculating a second integral value by integrating the waveform of the received light signal less than the reference voltage;
Adjusting the gain of the received light signal based on the sum of the first integral value and the second integral value;
Adjusting an offset voltage of the received light signal based on a difference between the first integral value and the second integral value;
A method for controlling a bar code reader comprising:
バーコード読取装置を制御するためのプログラムであって、
コンピュータに、
受光部にバーコードからの反射光を受光させ、受光信号を生成させるステップと、
前記受光信号と、前記バーコード読取装置の動作電圧の上限値及び下限値の中間電圧である基準電圧と、を比較させ、前記基準電圧以上の前記受光信号の波形を積分することにより第1の積分値を算出させるステップと、
前記基準電圧未満の前記受光信号の波形を積分することにより第2の積分値を算出させるステップと、
前記第1の積分値と前記第2の積分値との和に基づいて、前記受光信号のゲインを調整させるステップと、
前記第1の積分値と前記第2の積分値との差に基づいて、前記受光信号のオフセット電圧を調整させるステップと、
を実行させるプログラム。
A program for controlling a barcode reader,
On the computer,
Receiving light reflected from the barcode in the light receiving unit and generating a light reception signal;
The light reception signal is compared with a reference voltage that is an intermediate voltage between the upper limit value and the lower limit value of the operation voltage of the barcode reader, and the waveform of the light reception signal equal to or higher than the reference voltage is integrated. Calculating an integral value;
Calculating a second integrated value by integrating the waveform of the received light signal less than the reference voltage;
Adjusting the gain of the received light signal based on the sum of the first integral value and the second integral value;
Adjusting the offset voltage of the received light signal based on the difference between the first integral value and the second integral value;
A program that executes
JP2013067893A 2013-03-28 2013-03-28 Bar code reader, control method of bar code reader, and program Active JP5534486B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013067893A JP5534486B1 (en) 2013-03-28 2013-03-28 Bar code reader, control method of bar code reader, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013067893A JP5534486B1 (en) 2013-03-28 2013-03-28 Bar code reader, control method of bar code reader, and program

Publications (2)

Publication Number Publication Date
JP5534486B1 true JP5534486B1 (en) 2014-07-02
JP2014191679A JP2014191679A (en) 2014-10-06

Family

ID=51409357

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013067893A Active JP5534486B1 (en) 2013-03-28 2013-03-28 Bar code reader, control method of bar code reader, and program

Country Status (1)

Country Link
JP (1) JP5534486B1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07129709A (en) * 1993-11-05 1995-05-19 Nippondenso Co Ltd Bar code reader
JPH0934978A (en) * 1995-07-18 1997-02-07 Denso Corp Bar code reader
JP2004015671A (en) * 2002-06-10 2004-01-15 Optoelectronics Co Ltd Signal detection processing circuit
JP2012208824A (en) * 2011-03-30 2012-10-25 Denso Wave Inc Optical information reading apparatus

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07129709A (en) * 1993-11-05 1995-05-19 Nippondenso Co Ltd Bar code reader
JPH0934978A (en) * 1995-07-18 1997-02-07 Denso Corp Bar code reader
JP2004015671A (en) * 2002-06-10 2004-01-15 Optoelectronics Co Ltd Signal detection processing circuit
JP2012208824A (en) * 2011-03-30 2012-10-25 Denso Wave Inc Optical information reading apparatus

Also Published As

Publication number Publication date
JP2014191679A (en) 2014-10-06

Similar Documents

Publication Publication Date Title
US9524410B2 (en) Method and system for optimizing system settings of a laser scanner control system
JP2008507760A (en) Electro-optic reader with improved performance in high intensity ambient light
US10288731B2 (en) Distance detection method and distance detection device using the same
JP5534486B1 (en) Bar code reader, control method of bar code reader, and program
CN109084814B (en) Encoder having function of adjusting threshold of comparator and encoder control method
US7093763B1 (en) Laser scanner having analog digitizer with increased noise immunity
US9235745B2 (en) Signal processing device for reader targeted to codes, signal processing method, and signal processing program
US8967478B2 (en) Apparatus for and method of electro-optically reading a target in the presence of ambient light by rejecting the ambient light
JP2013069200A (en) Bar code reading device and method
JP5902859B1 (en) Control circuit for optical information reader
JPH04223583A (en) Bar code reader
JP2010182262A (en) Information reading apparatus
CN101877046A (en) Image sensor device and method for identifying visible mark
JP5892625B2 (en) Code reading apparatus, code reading method, and code reading program
JP5424369B1 (en) Bar code reader, bar code reading method and bar code reading program
JP4132144B2 (en) Bar code reader
JP5218316B2 (en) Optical information reader
WO2011034107A1 (en) Optical information reader and control method therefor
JP4107237B2 (en) Method for identifying boundary position of optical information reader
CN102831374B (en) Bar-code scanner and photoelectric signal processing circuit thereof
JP2019046330A (en) Optical type information reading device
JP2002232245A (en) Method and device for controlling gain
JP5284115B2 (en) Bar code reader
JP2009295113A (en) Barcode reading device and its reading data processing method
JP2015176425A (en) Bar code reading device, bar code reading method, and bar code reading program

Legal Events

Date Code Title Description
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: 20140325

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140417

R150 Certificate of patent (=grant) or registration of utility model

Ref document number: 5534486

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350