Design of measuring light curtain for object classification equipment based on C51 series single chip microcomputer

Publisher:泉地水无痕Latest update time:2012-05-10 Source: 21ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Introduction

Light curtain is a kind of equipment that is widely used in electronic measurement system. It can measure a series of data such as height, length or width of objects on constant speed conveyor belt, so as to provide corresponding parameters for the subsequent electronic system. This paper presents a light curtain measurement method for measuring the height of objects using single chip microcomputer.

2 Basic principle of light curtain measuring the height of objects

Figure 1 shows a schematic diagram of the test principle structure of measuring the height of an object using an ordinary light curtain. In the figure, multiple infrared transmitting tubes are installed at equal intervals on one side of the light curtain, and the same number of infrared receiving tubes are arranged in the same manner on the other side. Each infrared transmitting tube corresponds to a corresponding infrared receiving tube, and they are installed on the same straight line. When there is no obstacle between the infrared transmitting tube and the infrared receiving tube on the same straight line, the modulated signal (light signal) emitted by the infrared transmitting tube can smoothly reach the infrared receiving tube. After the infrared receiving tube receives the modulated signal, the corresponding circuit outputs a low level. In the case of obstacles, the modulated signal (light signal) emitted by the infrared transmitting tube cannot smoothly reach the infrared receiving tube. At this time, the infrared receiving tube cannot receive the modulated signal, and the corresponding circuit outputs a high level. When no object passes through the light curtain, the modulated signals (light signals) emitted by all infrared transmitting tubes can smoothly reach the corresponding infrared receiving tube on the other side, so that all internal circuits output low levels. In this way, the height information of the object can be obtained by analyzing the internal circuit state. Since the upper and lower adjacent optical paths may interfere with each other, the emission angle of the selected infrared light-emitting tube should be less than 15°. In addition, considering that the light curtain must have a certain width, the signal emitted by the infrared emitting tube should also be modulated. However, in actual production, there is always interference between the upper and lower paths, making it difficult to improve the measurement accuracy. In order to completely and fundamentally solve the interference problem between the two adjacent paths, this paper presents a method of using C51 microcontrollers and related chips to achieve height measurement.

3 Structure and working process of the height measurement light curtain system

The system structure of the height measurement light curtain is shown in Figure 2. The maximum number of infrared transmission and receiving channels of the device can be 215 in theory. Considering the actual height of the light curtain and the spacing between the upper and lower channels, it will generally not exceed 64. For the convenience of introduction, this article takes 16 channels as an example, and marks them as 1 channel, 2 channels, and 3 channels in descending order according to the installation height. ... 16 channels. The multiplexer of the transmitting and receiving parts uses a common multiplexer (such as the 7LS15 series). The A0~A3 of the multiplexer at the transmitting end is connected to P1.0~P1.3 of the microcontroller, and the A0~A3 of the multiplexer at the receiving end is connected to P1.4~P1.7 of the microcontroller. The parallel-in serial-out module and the serial-in parallel-out module use 8-bit shift registers (such as 741LS165 and 74HC595). The loading signal Ld of the parallel-in serial-out module = P1.4·WR? The data read signal E of the serial-in parallel-out module = P1.5·RD. The shift control signal is connected to the TE synchronization signal. RAM is used to store data and can be connected to the P0 and P2 ports of the microcontroller. Its capacity depends on the amount of data to be processed. This article chooses 1kB. The synchronization signal TE and the shift clock CP can be generated by the timer of the microcontroller, or the CP clock divided by 8 can be used as the TE signal. The reading of the serial input and parallel output module and the writing of the parallel input and serial output module can be completed through the interrupt method. At the same time, the processed height data can be sent out through the serial port of the microcontroller. In the linear scanning mode, the working process of the device is as follows: First, after the falling edge of TE arrives, the microcontroller writes the data to be sent to the serial input and parallel output module (such as 01H), and sends the same path selection signal (that is, the first address signal) to the sending end and the receiving end at the same time. When the rising edge of TE arrives, under the control of the shift clock, data 01H begins to be sent to the infrared transmitting circuit of the first channel through the multi-way switch, and then is sent out in the form of optical signal after modulation. At the same time, the infrared receiving circuit starts receiving when the rising edge of TE arrives. Since the multi-way switch selection signals for sending and receiving are the same, in fact, only the one corresponding to the transmitting end (i.e. the first channel) is received. The demodulated data can generally be shifted into the serial input and output module under the action of the shift clock, and the reception is completed when the falling edge of TE arrives, and the interrupt processing program of the microcontroller is triggered at the same time, so that the data is read by the microcontroller. The microcontroller then compares the sent data with the received data. If they are different (Note: Here, only when there is an object blocking the path, the sending signal cannot be received, resulting in different data for sending and receiving), it indicates that an object has passed through the path. If they are the same, it means that there is no object blocking the path or the height of the object is lower than the installation height of the infrared transmitting tube of the path. Then scan the second channel. At the same time, after the falling edge of TE arrives, the single-chip microcomputer sends out the selection address of the second channel and sends out the data to be sent (02H is used in this article, but it can be different). Similarly, it starts to shift out when the rising edge of TE arrives, and passes through the second channel sending and receiving channel, and then is sent out in the form of optical signal after modulation. At the same time, the rising edge of TE starts the second channel receiving. After receiving, the single-chip microcomputer performs relevant processing. Then it is the third channel, the fourth channel, ... the fifteenth channel, and the sixteenth channel, thus completing a scan from the first channel to the sixteenth channel. If it is required to scan at a speed of 100 times/s, the frequency of TE should be 1.6kHz, and the frequency of the shift clock CP should be 12.8kHz. The timing of sending and receiving is shown in Figure 3. In the figure, RN is the serial data received, and TN is the data shifted out by the sending end. The waveform of the modulation and demodulation part is omitted in the figure.

In the linear scanning mode, the MCU sends the same path selection signal to the transmitter and receiver each time, that is, the first path sends and the first path receives, the second path sends and the second path receives, ... the fifteenth path sends and the fifteenth path receives, the sixteenth path sends and the sixteenth path receives. In the cross scanning mode, the MCU sends different path selection signals to the transmitter and receiver each time. That is, the first path sends and the second path receives, the second path sends and the first path receives, ... the fifteenth path sends and the sixteenth path receives, the sixteenth path sends and the fifteenth path receives. In comparison, the cross scanning mode is more accurate in measuring the height of objects, and the detection accuracy is highest at the center 1/3 of the detection area. The minimum detection height can be reduced to 2/3 of that in the linear scanning mode.

4 Analysis mode of height detection

There are many settings for the light curtain detection mode. From the above light curtain working process, it can be seen that the first and last light blocking mode and the first and last light transmission mode can be used. In the first and last light blocking mode, when the object enters the light curtain area, the light is blocked, and the single-chip microcomputer will identify the number of the first beam of light that is blocked. Then the total number of blocked light rays is calculated from bottom to top until the last blocked light, and finally the data is accumulated to obtain the size of the object in the measured direction. In the first and last light projection mode, when the object enters the light curtain area, the single-chip microcomputer will control the identification of the transmitted light, and calculate from the first beam of transmitted light, and then accumulate the values ​​in sequence until the last transmitted light, and finally calculate the total number of transmitted light to obtain the size of the object in the measured direction.

5. Performance and results of height measurement light curtain devices

When making a light curtain, it is important to select high-brightness infrared emitting diodes and high-sensitivity infrared receiving tubes. In order to prevent the infrared receiving tube from saturation, an additional filter can be added to make it work in a micro-conduction state. In the linear scanning mode, when the optical axis spacing is 2.5 cm and the light curtain width is 5 m, the maximum resolution can reach 2.5 cm. When the belt speed (object movement speed) is 5 m/s, the scanning spacing is 1 cm. In fact, this method is also suitable for making high-precision measurement light curtains for use in grading equipment such as fruit and packages.

Reference address:Design of measuring light curtain for object classification equipment based on C51 series single chip microcomputer

Previous article:Data acquisition and storage circuit based on C8051F320 USB interface
Next article:Design of digital inclination sensor based on SCA100t and C8051F microcontroller

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号