Home » knowledge » Analysis of the basic structure and working principle of PCB online testing equipment

Analysis of the basic structure and working principle of PCB online testing equipment

The printed circuit board appearance inspection machine is an important quality inspection equipment on the PCB product production line. It is based on the principle of optical image processing and computer vision recognition technology. Its main function is to detect the appearance defects encountered in the production process of PCB components. China is a big country in PCB production in the world, but not a strong country. An important link in the PCB production chain – PCB equipment and equipment is not strong is one of the important reasons for this situation. In order to promote the development and progress of China’s PCB industry, a more automatic The visual inspection machine is a manual PCB visual inspection machine with simple operation, more compact system and higher cost performance.Manual PCB visual inspection machine by manual board placement

The printed circuit board appearance inspection machine is an important quality inspection equipment on the PCB product production line. It is based on the principle of optical image processing and computer vision recognition technology. Its main function is to detect the appearance defects encountered in the production process of PCB components. China is a big country in PCB production in the world, but not a strong country. An important link in the PCB production chain – PCB equipment and equipment is not strong is one of the important reasons for this situation. In order to promote the development and progress of China’s PCB industry, a more automatic The visual inspection machine is a manual PCB visual inspection machine with simple operation, more compact system and higher cost performance. The manual PCB appearance inspection machine automatically transmits the PCB through the conveyor after the manual board placement, and the linear CCD camera scans the PCB board evenly to obtain accurate images. Control signal automatic sorting PCB (OK/NG). It can accurately detect appearance defects such as foreign objects, exposed copper, oil replenishment, scratches, poor gold plating, wrong characters, uneven green oil, uneven pads, residual copper, missing printing, and developing. Since the speed and effect of image acquisition and processing will directly affect the accuracy and effectiveness of PCB board detection, the image acquisition system is studied in detail according to the characteristics of manual visual inspection machines, and C# is used. Net framework is used for secondary development of ActiveMil and the development of image acquisition software system is realized with GDI+graphics interface library.

1 The overall structure of the PCB visual inspection machine system

The PCB online inspection system has a complex structure, and its transmission control equipment, electrical control system and camera must be under the precise control of the computer to coordinate processing work and complete complex inspection and sorting tasks. The structure of the PCB online inspection equipment based on machine vision is shown in Figure 1.

Analysis of the basic structure and working principle of PCB online testing equipment

Figure 1 Structure of PCB online inspection equipment based on machine vision

The system is mainly divided into motion control, image acquisition and image processing. The image acquisition part is an important part of the whole system. Cameras and lenses are equivalent to human eyes in machine vision, and are responsible for capturing images of objects. The image acquisition part is an important part of the PCB inspection system and the basis of the inspection process. The PCB inspection system emphasizes the speed and accuracy of inspection, so the image acquisition part needs to provide clear images in a timely and accurate manner.

2 The hardware structure of the image acquisition system

1) The working principle of the image acquisition system

When the system is powered on, the MCU automatically detects whether the PCB stage is reset to the starting point. This process is mainly completed by two fiber optic sensors and servo motors. Two sensors are installed at the starting point of the motor track, namely the reset point and the track endpoint. It has the functions of reset, stop and motor reversal. After power-on, the MCU detects that the sesorl (reset point or starting point) is invalid, and calls the motor reversing program to make the PCB stage return to the starting position, and at the same time, the serial port sends a color image invalid signal to the PC. Then the MCU continues to judge whether a button is pressed. If a button is pressed, the motor starts to rotate forward, and the serial port sends a color image valid signal to the PC. This process is also the PCB line scanning process to complete the image acquisition. In this process, the motor goes through three stages: acceleration stage, constant speed stage and deceleration stop stage. During the forward rotation of the motor, starting from seven o’clock, the MCU counts the pulses fed back by the servo motor encoder through the unique capture and comparison unit (CCU6), but when the count value reaches the effective value of the image acquisition, the serial port sends the acquired image to the PC. Start signal, at this time the line array CCD starts to image the PCB. When the motor decelerates forward to the sensor 2 at the end of the track, the motor stops and immediately reverses back to the starting point. In this process, the serial port sends an invalid signal to the PC. So far, a complete detection process is complete. The MCU continues to detect whether a button is pressed for the next detection. Among them, the acquisition valid and start signals sent by the serial port can effectively avoid false triggering. The image signal collected by the CCD is sent to the image acquisition card by the CamreLink interface, and then further image processing is performed by the PC.

Analysis of the basic structure and working principle of PCB online testing equipment

Figure 2 The working principle of the image acquisition system of the PCB visual inspection machine

2) Reception and detection of sensors and buttons

Using optocoupler isolation technology, photoelectric isolation between circuits can be achieved, even if the input signal can pass through without resistance, and the output signal can be prevented from being fed back to the input terminal, which is beneficial to suppress the interference of spikes and various noises, stable operation, no contact, use Long life and high transmission efficiency. In order to detect the feedback speed signal of the rotating mirror in real time, the high-speed optocoupler ACPL-072L is used in this design, the transmission rate can be as high as 25 MBd, and the peripheral circuit is simple, as shown in Figure 3.

Analysis of the basic structure and working principle of PCB online testing equipment

Figure 3 ACPL-072L circuit schematic

This design uses the CC25 port of the capture/compare unit in the XC164CS peripheral, and uses the optocoupler transmission signal as an external interrupt signal to trigger the XC164 to achieve high-speed and accurate sensor positioning and button detection.

3) CCD camera system

The image acquisition system of this manual PCB appearance inspection machine adopts the 3CCD color line scan camera NUCLi7300 of NED rainbow series. The camera has a wide range of applications and can perform color difference detection that was previously impossible with black and white cameras. The external interface is a high-speed serial interface (Camera Link), which can be easily connected to the capture card, and can also easily set the gain and offset, and has the function of correcting the RGB line delay. The number of pixels is 7 300×3 Line, the pixel size is 10×10 μm, the data rate is 60MHz, and the shortest scan rate is 7.6kHz. FIG. 4 is a timing diagram of the continuous line scan rate model used in this system.

Analysis of the basic structure and working principle of PCB online testing equipment

Figure 4 Sequence diagram of CCD continuous line scan rate model

The frame acquisition card in the system is Matrox’s SoliosXCL-SU74, which has its own processor to handle two independent base modes or one mid-mode Camera Link configuration, 66 MHz acquisition rate, 64 MB buffer, and can acquire area arrays. and line scan cameras with multiple acquisition modes.

At present, most of the image inspection systems on the market use area scanning (Areascan) cameras to collect and analyze images. However, due to the large size range of PCB products inspected by this PCB appearance inspection machine – 50 mmx50mm ~ 330mmx250 mm, the accuracy requirements are as high as At the sub-pixel level, the resolution and image acquisition speed of the area scan camera cannot meet these requirements, so the system selects the line scan CCD. However, the line scan detection system must use the motion speed to obtain the area shadow image, that is, when the PCB under test moves to the camera’s field of view, the hardware sends a trigger signal to the camera to start the acquisition, so the acquisition mode of the acquisition card is set to hardware-triggered synchronous acquisition. , and allocate a maximum memory of 64 M. The schematic diagram of the connection between the CCD and the acquisition card is shown in Figure 5.

Analysis of the basic structure and working principle of PCB online testing equipment

Figure 5 Schematic diagram of connection between CCD and capture card

3 Software system composition

The development language adopted by the software of the image acquisition system is C#, and the software development kit is the AeTIveMil9.0 component.

Matrox has a rich package – Image Processing and Pattern Recognition Library (MIL) and MIL’s sub-library MIL-LITE (Basic Image Processing). MIL is a hardware-independent 32-bit image processing library, which utilizes Intel’s MMX multimedia graphics acceleration function to optimize the image processing library, which can process binary, grayscale or color images. It is independent of hardware platform. And for rapid Windows application development, MIL bundles AcTIveMIL. AeTIveMIL is a* dynamic control for managing image acquisition, processing, analysis, Display and archiving. AeTI-veMIL is fully integrated into Microsoft Visual Basic, Visual C++ and . net rapid application development environment. The image acquisition system selects the AetiveMil control library, which can realize all the functions of all MILs, and because of the use of ActiveX controls, it greatly reduces the difficulty of program design, shortens the software development cycle, and improves the application system stability.

3.1 Image acquisition program based on AclivrMil

The basic idea of ​​the image acquisition program is:

1) Open the communication channel, that is, determine an application object (Application), and create one or more system objects (System) for each application object.

2) Initialize hardware resources, that is, allocate data buffer (Data Buffer), data collector (Digitizer) and data Display (Display) objects for each system object.

3) Start the acquisition process, that is, read the image into the data cache, and assign the cache to the array, and realize the processing of the image by processing the array. After the image data is associated with the data display, the preprocessing can be displayed through the display control or form. the result after.

AetiveMIL allows developers to quickly and easily combine a graphics application with a Windows user interface. Application development includes drag and scroll tool placement as well as punctuation and click configuration, substantially reducing the amount of code. exist. Net framework 3.0 card hair environment, after installing the MIL development package and configuring it correctly, the components such as Application, System, Image, ImageProcess, and Display will be automatically added to the toolbar.

The developer drags the required controls onto the image acquisition form, an Application, corresponding to the single-lens manual appearance machine, a System, a single form display – a Disp-laly, in order to improve the CPU usage, dual Buffered asynchronous acquisition – two ImageBuffers, and one ImageProcess.

3.2 The idea of ​​double-buffer asynchronous acquisition

Matrox MeteorII frame grabber supports two acquisition methods, synchronous and asynchronous.

The synchronous acquisition mode is suitable for continuous acquisition and display of images without performing arithmetic processing. This is because in the synchronous acquisition mode, before each image acquisition, the CPU sends an acquisition synchronization signal to the acquisition card, and then waits for the acquisition to end. During the process, the CPU can only be in a waiting state because the image data cannot be obtained. Since it takes about 40 ms for the CCD to collect only one frame of image, which is roughly equivalent to the human visual retention, it cannot guarantee that the acquisition and processing are completed within 40 ms in the synchronous mode, and it cannot meet the requirements of real-time processing.

In the asynchronous acquisition mode, the acquisition work and the computer’s image processing work can be carried out at the same time, that is, when the CPU processes the image of the current frame, the CCD camera can perform the image acquisition of the next frame. Therefore, when programming, a buffer mechanism is needed to buffer the currently collected images and the images to be collected or being collected by the CCD camera, so as to realize the parallel work of image collection and processing. Obviously, using this double-buffer acquisition method can not only reduce the requirements for the hardware system, but also greatly improve the processing speed of the system to meet the requirements of real-time processing.

The results show that the image acquisition speed of the double-buffer asynchronous acquisition system is significantly improved, and the development cycle is shortened and the development labor cost is reduced due to the use of ActiveX components. And improve the quality of image acquisition. It only takes 1.3 s to collect a 7300×10000 image and stitch it in real time, without frame drop, and without loss of stitching. The formula for calculating the size of the image buffer is MemSize=ImageWidthxlmageHeightxFrames. The experiment also shows that 7 300 × 1 000 images are collected by synchronous acquisition, and 1 frame of 8 bits per pixel requires approximately 6Gb of buffer space; the same is the same as the asynchronous double-buffer acquisition method. Resolution images require less than 32 mb of cache to keep images continuously. It can be seen that using the asynchronous double-buffer acquisition method can not only save system resources, but also obtain more efficient and better acquisition results.

5 Conclusion

Double-buffering technology has been widely used in the field of image display in recent years. This design combines double-buffering technology with asynchronous acquisition in the image acquisition system of PCB manual visual inspection machine for the first time. Using Matrox’s SoliosXCL-SU74, the asynchronous double-buffer acquisition method can realize the real-time continuous acquisition of the PCB appearance machine (this experiment is set to acquire 10 frames of images per second, and the width of each frame is 7 300 and the height is 1 000). , and use the GDI+ library to achieve real-time lossless image stitching. This solution is more efficient than traditional image acquisition, has lower hardware requirements, and is more suitable for large data image acquisition systems such as PCB appearance machines.

The Links:   MG50Q6ES40 LM150X08-A4N7