A fast and high-precision appearance quality inspection system and inspection method for reflective curved surfaces
By adopting a high-speed multi-angle light source control system and a line scan image acquisition system in the reflective curved surface detection system, the efficiency and accuracy problems of small defect detection of reflective curved surfaces are solved, and the detection effect of high sensitivity and high efficiency is achieved.
Patent Information
- Application Number
- CN202210129041.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-11
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2042-02-11
AI Technical Summary
The prior art is difficult to efficiently detect tiny defects of reflective curved surfaces, especially in scenarios where large curvature surfaces and industrial detection efficiency and accuracy are required.
A high-speed multi-angle light source control system, motion control system, line scan image acquisition system and real-time controller surrounding the sample to be inspected is adopted to realize the detection of small defects of the reflective surface through light source layout and light-tuning methods, which can generate high-precision scanned images and complete the surface detection of 60-degree inclination angle.
It realizes the detection of small defects of the reflective surface with high sensitivity, improves detection accuracy and efficiency, and can complete the detection of 1m×1m samples in 3 seconds, and generates defect reports to realize the online detection function.
Smart Images

Figure CN114527073B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field related to industrial quality inspection, and more specifically, relates to a fast and high-precision appearance quality inspection system and inspection method for reflective curved surfaces. Background Art
[0002] In recent years, the shells of many products have been painted, electroplated and other processes to make the surface smooth and bright. The back cover of the mobile phone has also changed from the original frosted plastic to 3D tempered glass. The appearance of these products has become more beautiful. The problem that comes with it is that machine vision equipment often faces strong reflections when performing automated inspections, which affects the accuracy of the inspection results. Compared with ordinary objects, the defects of reflective surface objects are very different from normal surfaces, and the contrast is very low. For example, some concave and convex points, this type of defect is just that the surface is no longer flat, but the color is consistent with the normal surface, and it is difficult to detect by ordinary methods. Commonly used three-dimensional detection methods such as binocular vision, triangular laser, structured light and other methods cannot be applied to mirror-reflective objects.
[0003] PMD is a highly reflective surface inspection technology that can accurately measure subtle angular changes on reflective surfaces, construct a three-dimensional topography, and distinguish whether the defect is a convex point or a concave point. However, this method is applied to area array cameras and cannot be used on line scanning systems, so the inspection accuracy is limited. In addition, more than 10 images need to be taken at a time to decode the correct topography information, which cannot be widely used in the demand for high industrial efficiency.
[0004] In curved surface detection, due to angle reasons, the detection angle cannot be too large. A single shot with conventional lighting can detect an inclination of about 30 degrees. The PMD method is limited by the projection screen, and the detection angle is generally not greater than 15 degrees.
[0005] Therefore, the development of equipment that can detect large-curvature reflective surfaces and meet the requirements of industrial inspection efficiency and industrial inspection accuracy has broad application prospects in the field of appearance quality inspection of various products. Summary of the invention
[0006] In order to overcome the deficiencies of the above-mentioned prior art, the purpose of the present invention is to provide a fast and high-precision appearance quality inspection system and inspection method for reflective curved surfaces. The light source layout and lighting method provided realize high-sensitivity detection of tiny defects on reflective surfaces. The light source control system can generate high-precision scanning images in combination with the linear array camera. After reasonable layout and software control, surface inspection at an angle of 60 degrees can be completed. The acquisition speed is one-third of the scanning speed of a single line scan camera, that is, the length and width of the sample to be tested are 1m each. It only takes 3s to complete the shooting with a line scan acquisition with a resolution accuracy of 0.01mm at a line frequency of 100KHz. The constructed image background is almost completely black, which is relatively ideal. Defects can be identified with simple processing. Therefore, a defect report can be generated while the image is being acquired, realizing the online detection function.
[0007] In order to achieve the above object, the technical solution adopted by the present invention is:
[0008] A fast and high-precision appearance quality inspection system for reflective curved surfaces, comprising a high-speed multi-angle light source control system, a motion control system, a line scanning image acquisition system and a real-time controller placed around the sample to be inspected, characterized in that:
[0009] The motion control system comprises a linear servo motion platform (2) and a rotary correction platform (1), wherein the rotary correction platform (1) is located in front of the linear servo motion platform (2), and a line scanning detection station (3) is located in the middle of the linear servo motion platform (2);
[0010] The high-speed multi-angle light source control system comprises a first light source (4) and a second light source (8), wherein the first light source (4) and the second light source (8) are located above and in front of a line scanning detection station (3) at different angles; the first light source (4) and the second light source (8) are controlled by a light source main controller (7), the light source main controller (7) controls a regional controller (6) located on the back of the first light source (4) and the second light source (8), and the regional controller (6) controls an LED driver (5) located on the back of the first light source (4) and the second light source (8);
[0011] The line scanning image acquisition system is composed of a line scanning industrial camera (9), an image acquisition card and an industrial control computer;
[0012] The high-speed multi-angle light source control and line scanning image acquisition system is installed on a detection system mounting frame (10), and the detection system mounting frame (10) is assembled and used with a motion control system.
[0013] The real-time controller is a Cyclone V Soc FPGA, which is responsible for the real-time control of the high-speed multi-angle light source control system, the motion control system and the line scanning image acquisition system. The internal ARM processor is mainly responsible for the non-real-time control of the system. The application program on the Linux system sends the LED control sequence information to the light source control system through the CAN bus. In addition, the TCP protocol is used to communicate with the image acquisition system. The internal FPGA core and the ARM core use the high-speed interconnection bus AXI for data transmission. The FPGA core is responsible for real-time control, sends pulse instructions to the motion control system and receives the encoder information on the motion platform. After decoding, the light source and the camera are synchronously triggered in real time to complete image acquisition.
[0014] The motion control system includes a linear motion table and a rotary correction table. The linear motion table is responsible for transporting the sample to be tested through the line scanning detection station at a constant speed. The motion table encoder coaxially connected to it transmits the real-time position information to the real-time controller. The rotary correction table is equipped with a certain layout of photoelectric detection switches, which can identify the posture information of the sample to be tested, and adjust the sample to be tested to the required posture through the servo rotary table and servo push rod.
[0015] The rotating correction table (1) is composed of a rotating table, a push rod, a photoelectric sensor, a servo motor and a controller, and its function is to correct the posture of the sample to be tested and rotate it to the required angle. The working process is that the loading robot first places the sample to be tested on the rotating table, and a plurality of photoelectric sensors are placed on the top to detect whether the sample to be tested is under the photoelectric sensors. At least two of the photoelectric sensors are located in a direction perpendicular to the assembly line, so that the servo motor drives the turntable to rotate and the push rod to try multiple times until the two photoelectric sensors detect signals at the same time, and the posture is basically correct. If the sample to be tested is a circle or other type of outer contour that is not composed of straight line segments, other photoelectric sensors are added to assist in correction.
[0016] The light source is composed of multiple light panels, which are distributed around the workpiece to be tested. Each light panel is equipped with several LEDs, and the back of the light panel is equipped with a heat sink and an onboard controller. A three-level controller is provided in the light source control system. The master controller is responsible for receiving the configuration information and storing it in the local Flash. When a real-time trigger signal is received, the corresponding lighting information is written to the local controller via SPI. The local controller outputs PWM to control the corresponding LED driver to output a predetermined brightness. Furthermore, the high-speed multi-angle light source control system is composed of two LED light-emitting panels and an on-board drive control circuit. The size of the light-emitting panel depends on the size of the sample to be tested. It is generally designed to be three times the length of the sample to be tested. For cost considerations, a better hemispherical cover shape can also be used to obtain more angles of illumination, which will have better imaging results for some defects and also make detection of larger inclination angles possible.
[0017] The lamp beads used in the lamp board are surface-mount light-emitting diodes, which are suitable for selecting a small package type with a large light-emitting surface and small pins, so as to improve the accuracy of the subsequent light-emitting angle control; at the same time, the larger the proportion of the light-emitting surface, the higher the uniformity of the light projection at a single point.
[0018] The image acquisition system includes a line scan camera, an image acquisition card and an industrial computer. The line scan camera is installed at a 30-degree tilt and connected to the image acquisition card via a high-speed CoaXPress coaxial cable. The image acquisition card is plugged into the PCI_E slot of the industrial computer. The industrial computer is connected to the real-time controller using a network cable and uses the TCP protocol to transmit data.
[0019] A fast and high-precision appearance quality detection technology for a reflective curved surface, wherein the detection method comprises the following steps:
[0020] Before testing, a reflection model is established for the reflective surface. If a CAD model of the sample to be tested is available, it can be automatically generated by the software; if not provided, a standard sample is used for self-modeling. The specific process is as follows:
[0021] First, transport the sample to be tested to the first scanning position, and then control the light source to turn on one row of LEDs each time and collect an image, traversing from the first row to the last row to complete the vertical collection. Compare the numerical values at the same pixel point of each collected image, and find the position of the peak after smoothing, that is, the corresponding LED row number a. Similarly, complete another horizontal collection to find the corresponding LED column number b. In this way, after two orthogonal light source controls, the specific position (a, b) of an LED can be obtained according to the LED row number and column number, that is, the light emitted from this LED will be reflected to the camera by a point on the surface of the sample to be tested. According to this method, the reflection information of the pixel point at this scanning position at other scanning positions is obtained, which is recorded as
[0022] F(x,y)=(a,b)
[0023] x is the number of scan lines, y is the column coordinate of each scanned image, and (a, b) is the position of the LED on the light board.
[0024] Then, the light source is made to generate a black and white stripe pattern distributed horizontally, and the width d of the edge blur band is obtained, which represents the size of the mirror reflection lobe. Finally, a full-bright pattern is generated, and the brightness of each LED is gradually adjusted to make the image grayscale value distributed around 245. The LED brightness value l at this time is recorded;
[0025] During the inspection, the posture of the sample to be tested is first corrected on the rotating correction table, and then the sample to be tested passes through the line scanning inspection station at a uniform speed. At the same time, the light source and the camera start working. After collecting a frame of image, the sample to be tested returns to the rotating correction table and rotates 120 degrees clockwise. The above actions are repeated twice, and finally three images are obtained, which is equivalent to collecting three images from three directions around the sample to be tested.
[0026] When capturing images, the position x output by the encoder is used to retrieve the reflection model F(x,y), generate a corresponding light signal, and adjust the brightness to l. The camera starts a synchronous capture called the mirror reflection image. Then the LED that is lit at this time and the LEDs within a width of d / 2 around it are disabled, and all other LED lights are lit at full power. The camera starts another synchronous capture called the diffuse reflection image. The difference between the two images is the final generated image.
[0027] The beneficial effects of the present invention are:
[0028] The light source layout and lighting method provided by the present invention realize high-sensitivity detection of tiny defects on reflective surfaces. The light source control system can generate high-precision scanned images in combination with a linear array camera, and can complete curved surface detection at a 60-degree inclination angle through reasonable layout and software control. The acquisition speed is one-third of the scanning speed of a single line scan camera, that is, the length and width of the sample to be tested are 1m respectively, and it only takes 3s to complete the shooting with a line scan acquisition with a resolution accuracy of 0.01mm at a line frequency of 100KHz. The constructed image background is almost completely black, which is relatively ideal, and defects can be identified with simple processing. Therefore, a defect report can be generated while the image is being acquired, realizing the online detection function. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a schematic diagram of the device of the present invention;
[0030] Figure 2 It is a schematic diagram of the hardware composition of the present invention;
[0031] Figure 3 It is a software flow chart of the present invention;
[0032] Among them: 1 is a rotary correction table; 2 is a linear servo motion table; 3 is a line scan detection station; 4 is a first light source; 5 is an LED driver; 6 is a zone controller; 7 is a light source main controller; 8 is a second light source; 9 is a line scan industrial camera; 10 is a detection system mounting bracket. DETAILED DESCRIPTION
[0033] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0034] like Figure 1 , 2As shown in , 3, a fast and high-precision appearance quality inspection system for reflective curved surfaces, including a high-speed multi-angle light source control system, a motion control system, a line scanning image acquisition system and a real-time controller placed around the sample to be inspected, characterized in that:
[0035] The motion control system comprises a linear servo motion platform (2) and a rotary correction platform (1), wherein the rotary correction platform (1) is located in front of the linear servo motion platform (2), and a line scanning detection station (3) is located in the middle of the linear servo motion platform (2);
[0036] The high-speed multi-angle light source control system comprises a first light source (4) and a second light source (8), wherein the first light source (4) and the second light source (8) are located above and in front of a line scanning detection station (3) at different angles; the first light source (4) and the second light source (8) are controlled by a light source main controller (7), the light source main controller (7) controls a regional controller (6) located on the back of the first light source (4) and the second light source (8), and the regional controller (6) controls an LED driver (5) located on the back of the first light source (4) and the second light source (8);
[0037] The line scanning image acquisition system is composed of a line scanning industrial camera (9), an image acquisition card and an industrial control computer;
[0038] The high-speed multi-angle light source control and line scanning image acquisition system is installed on a detection system mounting frame (10), and the detection system mounting frame (10) is assembled and used with a motion control system.
[0039] The real-time controller is a Cyclone V Soc FPGA, which is responsible for the real-time control of the high-speed multi-angle light source control system, the motion control system and the line scanning image acquisition system. The internal ARM processor is mainly responsible for the non-real-time control of the system. The application program on the Linux system sends the LED control sequence information to the light source control system through the CAN bus. In addition, the TCP protocol is used to communicate with the image acquisition system. The internal FPGA core and the ARM core use the high-speed interconnection bus AXI for data transmission. The FPGA core is responsible for real-time control, sends pulse instructions to the motion control system and receives the encoder information on the motion platform. After decoding, the light source and the camera are synchronously triggered in real time to complete image acquisition.
[0040] The motion control system includes a linear motion table and a rotary correction table. The linear motion table is responsible for transporting the sample to be tested through the line scanning detection station at a constant speed. The motion table encoder coaxially connected to it transmits the real-time position information to the real-time controller. The rotary correction table is equipped with a certain layout of photoelectric detection switches, which can identify the posture information of the sample to be tested, and adjust the sample to be tested to the required posture through the servo rotary table and servo push rod.
[0041] The rotary correction table is composed of a rotating table, a push rod, a photoelectric sensor, a servo motor and a controller, and its function is to correct the posture of the sample to be tested and rotate it to the required angle. The working process is that the loading robot first places the sample to be tested on the rotating table, and multiple photoelectric sensors are placed on the top to detect whether the sample to be tested is under the photoelectric sensor. At least two of the photoelectric sensors are located in a direction perpendicular to the assembly line, so that the servo motor drives the turntable to rotate and the push rod to try many times until the two photoelectric sensors detect the signal at the same time, and the posture is basically correct. If the sample to be tested is a circle or other type of outer contour that is not composed of straight line segments, other photoelectric sensors are added to assist in correction.
[0042] The high-speed multi-angle light source control system consists of two LED light panels and an on-board drive control circuit. The size of the light panel depends on the size of the sample to be tested, and is generally designed to be three times the length of the sample to be tested. This patent uses a flat light panel for cost considerations, and a better hemispherical cover shape can also be used to obtain more angles of illumination, which will have better imaging results for some defects and also make it possible to detect larger angles.
[0043] Furthermore, the lamp beads used in the lamp board are surface-mount light-emitting diodes, which are suitable for a small package type with a large light-emitting surface and small pins, so as to improve the accuracy of the subsequent light-emitting angle control; at the same time, the larger the proportion of the light-emitting surface, the higher the uniformity of the light projection at a single point.
[0044] The difference between the light board and the ordinary light board is that a high-speed drive control circuit is added, and each lamp can be independently controlled in time. First, each lamp bead is driven by a constant current source IC to control its switch or freely adjust the light on and off. Then the 16 drive ICs are driven by a local control IC through a PWM signal, and finally each local control IC is connected to a light board master control IC through an SPI line. Compared with the general master controller directly driving the LED, this embedded control solution has the advantages of more control quantity, strong anti-interference ability, and high strobe frequency.
[0045] For a single LED, its off time is uncertain. In order to make it light up instantly no matter how long the off time is, it is necessary to trickle charge the capacitors and other components in the circuit to compensate for the leakage current.
[0046] For the convenience of description, the running direction of the assembly line is defined as the X-axis direction, the direction perpendicular to the horizontal plane is defined as the Y-axis direction, and the vertical direction is defined as the Z-axis direction.
[0047] The overall working process of the device is that the sample to be tested first passes through the rotary correction table to correct the posture so that its position is centered and fixed. Then it passes through the inspection station at a certain speed, while controlling the light source and the line scan camera to continuously collect images. After one scan is completed, the roller is reversed and the sample to be tested is sent back to the rotary correction table. After rotating 120 degrees, the above inspection steps are repeated again. After three inspections, the sample is retained on the unloading table, waiting for the industrial control computer to calculate the inspection results and then sorting. The qualified ones will enter the next process normally, and the unqualified ones will be sorted to different NG product areas according to the defect type, defect size and other parameters.
[0048] An important problem that this patent intends to solve is the detection of curved surfaces. A single camera can only shoot the object to be inspected from one angle, which is easy to cause occlusion. When the inclination angle of the surface of the object to be inspected is approximately parallel to the shooting direction, the strong side view angle will seriously affect the detection accuracy. This patent uses a three-rotation method, with the camera tilted 30 degrees, and then rotating the object to be inspected 120 degrees each time, which is equivalent to three cameras shooting images from three directions, effectively solving the surface inclination problem and improving the imaging quality.
[0049] The principle of detecting reflective surfaces is to use the law of mirror reflection satisfied by the reflective surface to construct its reflection model, and determine its defect type by checking the intensity of the light reflected from the surface of the sample to be tested and the angle of the reflection petal. Generally speaking, defects can be divided into two categories. One category is scratches, dirt, orange peel and other defects that increase the proportion of diffusely reflected light petals, and the other category is defects such as concave and convex points, broken edges, and acne that cause the mirror reflection peak to deflect. The above defects are all types of defects that are difficult to detect with ordinary light sources. Common defects such as discoloration, logo printing problems, and size deviations can be detected by conventional solutions. The non-reflective images synthesized by this patent can also be well detected. Such defects are not protected by this patent.
[0050] Before testing this patent, it is necessary to run the new product introduction software and put the samples that have passed the manual inspection into the testing device. At this time, turn on the first row of LED lights and start collecting a row of images. Then collect the second row and collect the second row of images until all rows of the LED light board are lit once and the vertical movement is completed. At this time, compare the numerical values of the same pixel on each collected image. Due to the presence of noise, pre-smoothing is required. Finally, calculate the image serial number at the peak, which corresponds to the LED row number that is lit at this time. Then turn on the first column of LEDs and start moving in the horizontal direction. Similarly, the LED column number corresponding to each pixel can be obtained. Finally, after two orthogonal movements, the LED position of the mirror reflection peak corresponding to each pixel can be obtained. The analysis here uses the principle of reversible light path. In other words, the light emitted by this LED can be reflected by the sample to be tested and collected by the machine. Finally, save the position corresponding to the motor encoder and the position of all LEDs and record them as
[0051] F(x,y)=(a,b)
[0052] X is the encoder position, y is the column coordinate of each scan image, and (a, b) is the position of the LED on the light board.
[0053] In this way, the sample to be tested has completed the acquisition of a row of reflection models. At this time, the motion stage will slightly move the sample to be tested one step, that is, the distance corresponding to one pixel in a captured image, and then start to acquire the next row of models until the entire sample to be tested is scanned. The scanning time depends on the number of LEDs on the light board. The total scanning time is (number of rows + number of columns of LED light board) * normal detection time. Since this is only the introduction step of new products, each new product only needs to be executed once, which is not related to the normal detection time, so there is no need to optimize within an acceptable time range.
[0054] Finally, the light source generates a horizontally distributed black and white stripe pattern, and the width d of the edge blur band is obtained, which represents the size of the mirror reflection lobe. Finally, a full-bright pattern is generated, and the brightness of each LED is gradually adjusted so that the image grayscale value is distributed around 245, and the LED brightness value l is recorded at this time.
[0055] This method of obtaining the reflection model of the sample to be tested by actual measurement can also be obtained directly by calculation using the CAD model. The CAD model information of the sample to be tested is analyzed by computer to obtain the three-dimensional morphology information, and the curvature and other information are derived, so the LED position corresponding to each pixel can be directly analyzed. The method of using the CAD model here can reduce the time of introducing new products and is simpler, but it requires higher equipment installation accuracy; the method of using the sample to be tested for actual measurement can be used under the limited condition that the user does not provide the CAD model, and the application scenario is wider. Therefore, both methods have a certain scope of application, and which one should be used should be analyzed specifically in specific scenarios.
[0056] In the normal testing process, two images need to be taken for each step of the sample to be tested, and the speed of the motion stage should be set to half of the normal speed. First, the posture of the sample to be tested is corrected on the rotating correction stage, and then the sample to be tested passes through the line scan detection station at a uniform speed. At the same time, the light source and camera start working. After collecting a frame of images, the sample to be tested returns to the rotating correction stage, rotates 120 degrees clockwise, and repeats the above actions twice. Finally, three images are obtained, which is equivalent to collecting three images from three directions around the sample to be tested.
[0057] Specifically, when capturing images, the reflection model F(x,y) is retrieved through the position x output by the encoder to generate a corresponding lighting signal, the brightness is adjusted to l, and the camera starts a synchronous capture. Then, the LED that is lit at this time and the surrounding LEDs within a width of d / 2 are disabled, and all other LED lights are lit at full power. The camera then starts another synchronous capture.
[0058] The output of the line scan camera is a sequence of images stitched together from each line collected, with alternating light and dark images. The image is split into two images according to the odd and even lines. The bright image is called the specular reflection image, and the darker image is called the diffuse reflection image. The specular reflection image is subtracted from the diffuse reflection image to obtain the differential image, which is the final output image and enters the next step of the defect recognition and classification process.
[0059] Example
[0060] The inspection station consists of a line scan camera, an FPGA control board, an industrial computer, two light boards, and a servo motion table. The servo motion table is equipped with a fixture that can limit the sample to be tested and prevent it from moving. The control signal of the servo motion table is output by the FPGA control board, so that it moves a certain distance at the desired speed. At this time, the line scan camera starts to work and collect image information. In order to ensure the accuracy of sampling and the speed of detection, the FPGA control board will read the encoder signal on the servo motion table, and at the same time, it will be output to the light source controller and the line trigger end of the line scan camera through the electronic gear, electronic cam and other operators. In this way, even if there is a slight disturbance in the movement speed of the motion table, it will not affect the exposure time, scanning time and other parameters, avoiding the occurrence of problems such as uneven exposure and image deformation.
[0061] The FPGA control board uses Intel's Cyclone V Soc FPGA as the main control chip. This chip is a hybrid structure with an FPGA of 110K programmable logic gates and an ARM Cortex-A9 dual-core processor. The board is designed with 1GB (2*256M*16) DDR3SDRAM and 8G FLASH, a Gigabit Ethernet port, an SPI to CAN interface and a 24V power supply interface. The FPGA mainly runs the real-time control program, and the ARM processor handles the interactive program with the industrial control computer. The communication between the FPGA and the ARM can use the high-speed bus on the chip to achieve high-bandwidth real-time data interaction through memory mapping. The workflow of the FPGA control board is as follows: the first step is that the industrial computer sends a start signal, and the ARM processor accesses the LED stroboscopic sequence information and configuration parameters such as scanning speed and LED brightness stored in the database through the network, and sends the relevant stroboscopic sequence information to all LED control board core chips through the CAN bus to correct the brightness parameters; the second step is to run the SPTA algorithm to make the servo motor start to accelerate according to the specified acceleration until the maximum operating speed is reached; the third step is to read the encoder information, quadruple the encoder's orthogonal signal, and then pass through the electronic gear to send a trigger signal to each LED control board and industrial camera with a differential signal; the fourth step is to stop outputting the trigger signal when the motion stroke is reached, and stop the servo motor at a fixed deceleration. Then drive the servo motor to quickly retreat to the rotating table in the reverse direction, rotate 120 degrees clockwise, and then repeat step one.
[0062] The light board is divided into four levels from top to bottom: master controller, local controller, multi-channel LED driver, and LED lamp beads. The master controller is implemented using the STM32F1 series microcontroller. The controller receives configuration information from the FPGA control board through the CAN bus and saves it in the local Flash. The stroboscopic sequence information is large, and it is necessary to obtain the information of the LED on and off each time the shooting is performed. It needs to be saved on the light board before detection. During normal detection, only high-frequency trigger signals are used, which avoids the cost increase caused by the use of high-speed buses. During CAN communication, due to the need to transmit large data packets, on the one hand, it is necessary to ensure a high transmission rate, and on the other hand, to ensure the correctness of the transmitted data. Here, the data is packaged into JSON format. The key name is the trigger ID number, and the key value is the LED coordinates and CRC check value that need to be lit for this trigger. If the transmission is wrong, the light control board requests resending in the form of a remote frame, and finally checks the total number again to ensure that there are no duplicate frames or missing frames.
[0063] The master controller uses the SPI protocol to communicate with the corresponding local controller. When the trigger signal is received, the lighting information of the corresponding row saved in the flash is retrieved according to the number of corresponding trigger signals, and then each LED is traversed in turn. Specifically, the LED position information is used to determine which local controller the LED belongs to, and then the corresponding local controller is pulled down through the chip select signal line in the SPI protocol to write two bytes of position coordinates. The first byte transmits the X coordinate and the second byte transmits the Y coordinate. When the write is successful, the slave responds with a byte of status flag, indicating the current LED status of this coordinate to ensure that it is consistent with the status recorded by the master controller.
[0064] The local controller is also implemented using an STM32 microcontroller. The SPI slave is simulated through the general GPIO port on the local controller, and the main controller communicates with the corresponding slave through the chip select signal line. When the host receives the light-on signal, it reads the LED number that needs to be turned on, finds the LED driver number in the area, enables the corresponding driver, and then controls its brightness through the PWM signal.
[0065] The industrial computer is responsible for image processing and establishes a TCP server locally. The FPGA controller will automatically connect to this server after power-on to establish a communication channel. When the system starts running, the line scan camera is configured to line trigger mode, the acquisition speed is configured, the exposure time is set to fixed, and the industrial computer sends a start signal to the FPGA control board. Then wait for the line scan camera to output a frame of image, split it into two images according to the odd and even lines of the image sequence, and subtract the diffuse reflection image from the mirror reflection image to obtain the final image.
Claims
1. A fast and high-precision appearance quality inspection method for reflective curved surfaces, characterized in that: High-speed multi-angle light source control system, motion control system, line scan image acquisition system and real-time controller placed around the sample to be inspected: The motion control system comprises a linear servo motion table (2) and a rotary correction table (1), wherein the rotary correction table (1) is located in front of the linear servo motion table (2), and a line scanning detection station (3) is located in the middle of the linear servo motion table (2); The high-speed multi-angle light source control system comprises a first light source (4) and a second light source (8), wherein the first light source (4) and the second light source (8) are located above and in front of a line scanning detection station (3) at different angles; the first light source (4) and the second light source (8) are controlled by a light source main controller (7), the light source main controller (7) controls a regional controller (6) located behind the first light source (4) and the second light source (8), and the regional controller (6) controls an LED driver (5) located behind the first light source (4) and the second light source (8); The line scanning image acquisition system is composed of a line scanning industrial camera (9), an image acquisition card and an industrial control computer; The high-speed multi-angle light source control and line scanning image acquisition system is installed on the detection system mounting frame (10), and the detection system mounting frame (10) is assembled and used with the motion control system; The real-time controller is a Cyclone V Soc FPGA, which is responsible for the real-time control of the high-speed multi-angle light source control system, motion control system and line scan image acquisition system. The internal ARM processor is mainly responsible for the non-real-time control of the system. The application program on the Linux system sends the LED control sequence information to the light source control system through the CAN bus. In addition, it uses the TCP protocol to communicate with the image acquisition system. The internal FPGA core and ARM core use the high-speed interconnect bus AXI for data transmission. The FPGA core is responsible for real-time control, sending pulse instructions to the motion control system and receiving the encoder information on the motion stage. After decoding, it synchronously triggers the light source and camera in real time to complete image acquisition. The detection method includes the following steps: Before testing, a reflection model is established for the reflective surface. If a CAD model of the sample to be tested is available, it can be automatically generated by the software; if not provided, a standard sample is used for self-modeling. The specific process is as follows: First, the sample to be tested is transported to the first scanning position, and then the light source is controlled to turn on one row of LEDs each time and collect an image, traversing from the first row to the last row to complete the vertical collection; compare the values of the same pixel point in each collected image, and find the position of the peak after smoothing, that is, the corresponding LED row number a, and similarly complete another horizontal collection to find the corresponding LED column number b; in this way, after two orthogonal light source controls, the specific position (a, b) of an LED can be obtained according to the LED row number and column number, that is, the light emitted from this LED will be reflected to the camera by a point on the surface of the sample to be tested; according to this method, the reflection information of the pixel point at this scanning position at other scanning positions is obtained, which is recorded as F(x,y)= (a,b) x is the number of scan lines, y is the column coordinate of each scanned image, and (a, b) is the position of the LED on the light board; Then, the light source is made to generate a black and white stripe pattern distributed horizontally, and the width d of the edge blur band is obtained, which represents the size of the mirror reflection lobe. Finally, a full-bright pattern is generated, and the brightness of each LED is gradually adjusted to make the image grayscale value distributed around 245. The LED brightness value l at this time is recorded; During the inspection, the posture of the sample to be tested is first corrected on the rotating correction table, and then the sample to be tested passes through the line scanning inspection station at a uniform speed. At the same time, the light source and the camera start working. After collecting a frame of image, the sample to be tested returns to the rotating correction table and rotates 120 degrees clockwise. The above actions are repeated twice, and finally three images are obtained, which is equivalent to collecting three images from three directions around the sample to be tested. When collecting images, the position x output by the encoder is used to call the reflection model F(x,y), generate the corresponding light signal, and adjust the brightness to l. The camera starts a synchronous acquisition called the mirror reflection image. Then the LED that is lit at this time and the LEDs within a width of d / 2 around it are disabled, and all other LED lights are lit at full power. The camera starts another synchronous acquisition called the diffuse reflection image. The difference between the two images is the final generated image. The light source layout and lighting method enable highly sensitive detection of tiny defects on reflective surfaces; The light source control system can be combined with the linear array camera to generate high-precision scanning images. After reasonable layout and software control, it can complete the surface detection of 60-degree inclination angle; the acquisition speed is one-third of the scanning speed of a single line scan camera, that is, the length and width of the sample to be tested are 1m respectively, and the line scan acquisition with a resolution accuracy of 0.01mm at a line frequency of 100KHz only takes 3s to complete the shooting.
2. The method for rapid and high-precision appearance quality inspection of a reflective curved surface according to claim 1, characterized in that: The linear motion table is responsible for transporting the sample to be tested through the line scanning detection station at a constant speed. The motion table encoder coaxially connected to it transmits the real-time position information to the real-time controller. The photoelectric detection switches with a certain layout on the rotary correction table can identify the posture information of the sample to be tested, and the sample to be tested can be adjusted to the required posture through the servo rotary table and servo push rod.
3. The method for rapid and high-precision appearance quality inspection of a reflective curved surface according to claim 1, characterized in that: The rotating correction table (1) is composed of a rotating table, a push rod, a photoelectric sensor, a servo motor and a controller, and its function is to correct the posture of the sample to be tested and rotate it to a required angle. A plurality of photoelectric sensors are placed above the rotating table, wherein at least two photoelectric sensors are located in a direction perpendicular to the assembly line. If the sample to be tested is circular or has an outer contour other than straight line segments, other photoelectric sensors are added to assist in the correction.
4. The method for rapid and high-precision appearance quality inspection of a reflective curved surface according to claim 1, characterized in that: The light source is composed of multiple light boards, which are distributed around the workpiece to be tested. Each light board is equipped with several LEDs. The back of the light board is equipped with a heat sink and an onboard controller. The light source control system is equipped with a three-level controller. The main controller is responsible for receiving configuration information and storing it in the local Flash. When a real-time trigger signal is received, the corresponding lighting information is written to the local controller through SPI. The local controller outputs PWM to control the corresponding LED driver to output a predetermined brightness. The size of the light-emitting board depends on the size of the sample to be tested.
5. The method for rapid and high-precision appearance quality inspection of a reflective curved surface according to claim 4, characterized in that: The lamp beads used in the lamp board are surface-mount light-emitting diodes, which are suitable for selecting a small package type with a large light-emitting surface and small pins.
6. The method for rapid and high-precision appearance quality inspection of a reflective curved surface according to claim 1, characterized in that: The image acquisition system includes a line scan camera, an image acquisition card and an industrial control computer. The line scan camera is installed at an angle of 30 degrees and is connected to the image acquisition card via a high-speed CoaXPress coaxial cable. The image acquisition card is inserted into the PCI_E slot of the industrial control computer. The industrial control computer and the real-time controller are connected using a network cable and data is transmitted using the TCP protocol.
Citation Information
Patent Citations
Light source structure for detection of high-reflection curved metal
CN109323164A
Online detection device for typical defects of mobile phone curved glass
CN210604434U