Design and implementation of a barcode precision measurement system

Publisher:脑力激荡Latest update time:2011-07-07 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Barcode technology was first developed in the turbulent 1920s in the laboratory of Westinghouse. At that time, every idea about the application of electronic technology was very novel. His idea was to put a barcode mark on the envelope. The information in the barcode was the address of the recipient, just like today's postal code. For this reason, Kermode invented the earliest barcode logo. The design was very simple, that is, one "bar" represented the number "1", two "bars" represented the number "2", and so on. Then, he invented a barcode reading device composed of basic components: a scanner (capable of emitting light and receiving reflected light); a method for measuring the reflected signal bars and spaces, that is, the edge positioning coil; and a method for using the measurement results, that is, the decoder.

The barcode positioning technology based on ARM single chip has the advantages of objective reading, fast measurement speed and high accuracy. It can overcome the shortcomings of traditional visual reading, such as cumbersome reading process, long reading time, large human error and low automation. This technology has a wide range of applications. It is suitable for various photoelectric absolute displacement encoders with short-distance and high-precision positioning requirements; it is also suitable for geodetic height measurement with large-range measurement distance and large-range requirements, dam subsidence observation, road surface flatness measurement, etc. This paper proposes a measurement system solution based on ST Semiconductor's 32-bit high-performance processor STR912FW44X6.

System Structure

The system consists of the following parts: barcode ruler, optical system, CMOS image acquisition module, STR912 main control board, keyboard and LCD display module, power supply module and computer test system. The hardware structure diagram is shown in Figure 1.

The working principle of the system is as follows: the barcode image with precise position information passes through the optical system and is imaged on the photosensitive surface of the CMOS image sensor. After the STR912FW44X6 processor performs automatic exposure control on the SVI company's LIS-1024 image sensor, it collects image information and obtains the position information of the barcode through algorithm processing.

When the system performs high-speed image acquisition, the STR912FW44X6 processor sends the acquired signal to the computer measurement system through the Ethernet interface for final data processing.

Hardware Design

Image acquisition module

The image acquisition module is mainly composed of a linear array CMOS image sensor (LIS-1024) and an operational amplifier (TLV2221IDBVR). The video signal is amplified by the operational amplifier and then transmitted to the STR912FW44X6 main processor for A/D conversion and converted into a digital image signal.

The STR912FW44X6 main processor directly controls the image acquisition timing. The image acquisition module itself does not have an automatic exposure function. The main chip needs to analyze the acquired image signal for changes in ambient light intensity, and then control the image sensor to achieve the function of adaptive ambient light intensity. [page]

Motherboard Module

The main chip of the system is a high-performance embedded chip STR912FW44X6 based on the ARM966E-S core, with a computing speed of 96MIPS and supports single-cycle DSP instructions. The system periphery of the chip includes clock, reset, power management, vector interrupt controller (VIC), internal PLL, RTC, timer, 9 programmable DMA channels and up to 80 GPIOs. There are also 8-channel 10-bit ADC, 3-phase motor controller, PWM output and multiple communication interfaces.

The chip has built-in dual-group Flash, and can use any communication port on the chip to realize in-system programming. The main chip is connected to a 64MB memory (chip ST-M25P64) to expand the storage space.

Motherboard peripheral interface

The main interfaces include CMOS image sensor interface, RS-232 interface, I2C interface and 10/100M Ethernet interface.

The interface of the CMOS image sensor mainly realizes the automatic exposure control and image acquisition of the image sensor; the RS-232 interface (chip SP3222) realizes program download, communication with the host computer, and accepts the host computer command control; the I2C interface realizes the communication between the main chip and the keyboard and LCD display module; the 10/100M Ethernet interface (chip STE100P) cooperates with computer software to realize high-speed image acquisition. ARM Development Forum

Keyboard and LCD display module

The keyboard module uses the ATMega48 chip to realize keyboard control and I2C communication, as well as the LCD screen module I2C communication.

Software Design

The system software flow is shown in Figure 2.


Software Features

The main function of the software is the barcode positioning algorithm of the image, including the following:

Barcode detection: Extract various characteristic parameters from the barcode signal, usually including the detection of the edge position, center, width of each barcode, and codeword division.

Determine the object-image ratio based on the known parameters of the ruler, and at the same time find the viewing distance, calculate the relative distance between the reference position and the target code position, and enlarge it to the actual size d2 (accuracy result) according to the object-image ratio.

. Decoding: It is equivalent to the inverse process of source coding, and calculates the codeword position d1 (rough reading result) of the target codeword. The final scale reading ds is the sum of the rough reading and the intensive reading results: ds=d1+d2. [page]

This system uses an equally spaced periodic displacement barcode, and uses the barcode's equally spaced structure to calculate the object-image ratio by extracting the characteristic spectral lines corresponding to the barcode's equally spaced spacing, and then obtains the barcode's equivalent width sequence, and finally achieves decoding based on the barcode's periodicity.

Software Architecture

The entire software uses the embedded operating system mCOS-II as the main carrier. The software is mainly divided into five threads. After the system is powered on, the five threads work in parallel. The five threads are: serial port control, I2C interface control, Ethernet interface control, system menu control, data acquisition and decoding.

Test Results

In order to examine the performance of the system, a comparison experiment with a screw micrometer with an accuracy of 0.004mm was designed. The screw micrometer was used to measure the actual movement of the barcode ruler. Each time the barcode ruler moved 0.500mm, a total of 11 data were measured, and the barcode values ​​at 11 different positions were obtained. The difference was calculated for comparison. The measurement results are shown in Table 1.

From the measurement data, we can see that the deviation of the system measurement data is within ±0.0185mm, which means that the system measurement has achieved a certain accuracy.

A preliminary test of the system resolution was conducted. The relative position of the barcode and the measurement system was kept unchanged, and the data were measured 10 times in succession, as shown in Table 2.

The average value of the measured data is 130.5049mm, and the system measurement arithmetic deviation is within ±0.3mm, that is, the resolution of the existing system is about 0.3mm. After adopting measures such as system error calibration and software algorithm improvement, it is expected that the measurement accuracy of the system will be further improved.

Conclusion

This system is an ARM-based precision visual measurement platform that realizes the precision measurement function of barcodes. Further development on this platform can form a system that can be applied to the precision measurement of one-dimensional and two-dimensional lengths, and has a relatively broad application prospect.

Reference address:Design and implementation of a barcode precision measurement system

Previous article:Application of Ethernet in Surge Test
Next article:Virtual Remote Temperature Control System Based on Common Data Acquisition Card

Latest Test Measurement Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号