One of the production processes of printed matter is to bind and shape the single-page printed sheets printed by the printing machine, and the key to its success or failure is the collating process.
In order to avoid manual collation, such as duplicate posts, fewer posts, messy posts, etc., two main solutions are currently used: First, the principle of photoelectric diffusion and reflection is used, and the red LED is used as a light source to illuminate the signature, according to Discriminate the intensity of the reflected light. This solution is sensitive to the surrounding light and has a greater dependence on the finish of the signature paper, reflective performance and printing density. Especially for signatures with large color changes, the inspection accuracy is very low and the ideal effect cannot be achieved; the second is to use Optical image recognition technology, for image recognition of part of the content in the signature. However, due to the placement offset, or the relative position movement or twisting that occurs during the work, the signature discrimination rate is not high.
Currently, bar codes have been widely used as a timely, accurate, reliable, and economical data input method. Therefore, using barcode recognition technology and applying it to the production site of printed product binding is a simple and effective signature detection system. The starting point of the design of this scheme is based on this.
Figure 1 System composition
System structure and working principle
A signature detection system based on barcode recognition consists of the following parts: (1) items to be inspected with barcodes, (2) barcode readers, (3) embedded control systems, and (4) computers in the enterprise LAN.
Its composition structure is shown in Figure 1.
First, a bar code is printed on the edge of the layout of the signature, as a basis for the system's subsequent detection device identification. Then use an embedded control system with a bar code reader to compare the read bar code information with the set reference bar code information. For the read bar code information, according to the set control logic, combined with external electrical machinery Institutions to complete the operation of this type of signatures.
The computer can communicate with the embedded control system through the communication interface, read the barcode content, so as to obtain the signature information, and then write the information into the database through counting and other operations. The computer is in the company's local area network, and any computer in any other office area can also access the database in the computer in real time to understand the production process and production situation in a timely manner.
System design and implementation
In the implementation of the specific system, we choose an existing barcode reader, cooperate with the single-chip system to form an embedded control unit, and write the control information of the control unit to the computer database through the RS485 serial communication port.
1 Selection and modification of bar code reader
Here, the 1000-type handheld bar code reader of CIPHER is selected. The reader has the following advantages:
â— Can recognize many common barcode systems.
â— Equipped with keyboards (PS / 2), RS232, USB and other digital interfaces.
â— Fast reading speed.
â— It has multiple reading methods and power saving methods.
We changed the part of the manual contact switch on the reader used to start reading barcodes from manual start to automatic control start by the embedded system, that is, by closing and releasing the relay contacts controlled by the embedded system to simulate the control of the human hand .
2 Embedded control system
â— Hardware design
The part of the embedded control system includes the digital interface circuit part of the reader and a single chip microcomputer system and its peripheral interface circuit.
The hardware block diagram is shown in Figure 2.
Figure 2 hardware block diagram of the detection part
The reset and watchdog chip selected MAX813, which monitors the operation of the software to prevent the program from flying or crashing; in order to control the communication rate more accurately, a crystal oscillator of 11.592MHz was selected; the single chip chose AT89C51 of ATMEL.
â— Embedded software
Use C51 to write software, the function that the software system machine should realize is shown as in Fig. 3.
Figure 3 Software functional block diagram of the detection part
The software is responsible for capturing the paper feed signal, and then simulating the manual button, starting the sensor work, and judging after reading the bar code information, according to the judgment results, different output, and also can communicate with the host computer.
In the process of software work, in order to capture the input of the request signal in real time, the reading of the signal input is interrupted. After receiving the signal, the corresponding request event flag is set, and the processing of the request signal is performed outside the interrupt, which can effectively capture the request input signal and avoid the interrupt program from occupying CPU resources for too long.
After the main program is initialized after power-on, check each event flag in turn. If it is found that there is a request for the event, the event is immediately processed, and the request flag is cleared after the processing is completed. The events to be processed include: capturing paper feed beats, receiving data from the computer, comparison judgment after the barcode is read, and post-judgment processing. The entire system flow is shown in Figure 4.
Figure 4 main program flow chart
The paper feed cycle is triggered by an external paper feed mechanism, and an external interrupt method is used in the software. Communication events are triggered by the software's serial receive interrupt, and barcode processing events are triggered by the high-priority interrupts that receive digital barcode signals.
Set the CIPHER interface board to send the barcode content in the manner of PS / 2 keyboard, and the interface signal timing is shown in Figure 5.
Figure 5 Barcode reader digital interface timing
The other two events, wrong signatures and white paper events, come from the comparison results of barcode information.
â‘ Processing paper feed beat signal processing
After detecting the barcode reading request-paper feed signal event, the barcode reader should be activated to read the barcode information. The original manual button on the reader was transformed to simulate the electric shock of the relay. Closing the relay can completely achieve the purpose of opening the reader.
â‘¡ Handle the events of barcode judgment
After the MCU receives the complete barcode information, it sets the barcode to determine the event. When dealing with judgment events, first of all, you must compare the read barcode with the set reference information. Because the barcode uses the keyboard interface to transmit data, the encoding rule of each number or character is "pass and break code", that is, each character to be transmitted includes three bytes: "encoding + 0x4F + encoding". Therefore, when comparing, pay attention to the movement of the reference bar code pointer and the bar code pointer to be determined: the reference pointer moves 1 byte at a time, and the pointer to be determined moves 3 bytes.
Figure 6 shows the state transition after reading the barcode.
Figure 6 Barcode judgment status diagram
In the error state of the signature, the MCU will output an alarm indication signal according to the set software, and output a drive control signal to the signature removal device to remove the erroneous signature; if only one signature removal device is installed at the end of the pipeline, the microcontroller Counting the paper-feeding beats will start, and when the erroneous signature is passed, the single-chip microcomputer sends a signal to the signature rejection device, and the rejection device will reject the signature set that includes the incorrect signature.
3 Computer communication
On the paging machine assembly line, each paging station with a signature installed must be equipped with a reader and an embedded control system, and all the signature detection devices can also be connected to the computer via the bus to further complete the signature. Statistics, query and other functions.
In the design of the physical layer, the mature RS485 serial communication bus is used to connect to different detection devices and computers; in the design of the link layer, in order to ensure the reliable transmission and reception of data frames, in addition to the checksum, there are data frames Special frame header bytes and frame tail bytes, etc., to avoid interference on the link.
4 Database section
Use VC ++ 6.0 to write a humanized operation interface on the computer, and use ADO (ActiveX Data Object) to manage the database. Run the SQL command to obtain the result record set to be obtained during operation.
to sum up
The system can be used in any article detection system with barcodes. For different application requirements, as long as different electrical mechanical mechanisms are connected to the output terminals of the system according to the site conditions, it can be carried out according to the required control logic. automatic detection.
Coffee Table,Modern Coffee Table,Folding Coffee Table,Adjustable Coffee Table
DUOBUY TECHNOLOGY SHANDONG CO., LTD. , https://www.doubuytech.com