A control system and method based on machine vision detection and diversion robot
By using a machine vision inspection and shunt robot control system, efficient inspection and shunt of automotive wiring harness connectors have been achieved, solving the problem of non-integration of inspection and shunt in existing technologies and improving production efficiency and system stability.
Patent Information
- Application Number
- CN202211020100.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-24
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-08-24
AI Technical Summary
The current automotive wiring harness connector production lacks an integrated testing and distribution system, resulting in large factory footprints, wasted resources, low efficiency, and high costs.
A machine vision-based detection and diversion robot control system is adopted, including a robotic arm control system and a diversion device control system. It utilizes an STM32 microcontroller, a CMOS sensing module, and a motor control module to achieve accurate detection and diversion of wire harness connectors.
It improves detection accuracy and efficiency, reduces system coupling, enhances stability, reduces errors through multiple tests and mathematical statistical analysis, and improves work efficiency.
Smart Images

Figure CN115401890B
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of automobile wiring harness manufacturing and processing, and in particular relates to a control system and method based on machine vision detection and a shunting robot. Background Art
[0002] As one of the important components of a car, the wiring harness is equivalent to the transmission nerve of the car, which directly affects the quality and performance of a car. Therefore, in addition to meeting the basic performance requirements of the car, the wiring harness design also has extremely high quality requirements for the wiring harness itself. The automotive wiring harness connector is an important part of the wiring harness and acts as a relay station for the automotive wiring harness. Therefore, the quality of the wiring harness connector cannot be ignored; furthermore, there are many types of automotive wiring harnesses, which require a variety of connectors, which will increase the quality risk of the wiring harness connector and the difficulty of quality inspection. In the production of wiring harness connectors, the wiring harness connectors are injection molded by an injection molding machine, then cooled and transported to the inspection area by a transport device. In the injection molding process, a specific connector model is required for injection molding. For a wide variety of connectors, the same injection molding machine will replace different models.
[0003] In production, there are many injection molding machines under complex working conditions. If different types of connectors are equipped with a set of transportation and detection equipment, the factory will be extremely large and waste resources. There is no intelligent detection and control system that can realize integrated detection and diversion, which will result in low work efficiency and high cost. Summary of the invention
[0004] Therefore, the technical problem to be solved by the present invention is to provide a method that can solve the problem that the existing production process is to assemble a set of transportation and detection equipment, which makes the factory extremely large and wastes resources, and there is no intelligent detection and control system that can realize integrated detection and diversion, thereby causing low work efficiency and high cost.
[0005] In order to solve the above problems, the present invention provides a control system based on machine vision detection and diversion robot, the control system includes a mechanical arm control system and a diversion device control system, the mechanical arm control system and the diversion device control system are communicatively connected, so that the mechanical arm control system controls the diversion device control system to perform diversion action according to the visual detection result;
[0006] The robot control system and the shunt device control system both include an STM32 single-chip microcomputer minimum system control unit, a reset circuit, a switch circuit, a PWM oscillator module and a motor control module. The STM32 single-chip microcomputer minimum system control unit is connected to the PWM oscillator module, and each motor control module is respectively connected to the IO pin of the STM32 single-chip microcomputer minimum system control unit, and the reset port of the reset circuit is connected to the reset receiving port of the STM32 single-chip microcomputer minimum system control unit; the switch circuit is connected to the switch pin of the STM32 single-chip microcomputer minimum system control unit;
[0007] The robot control system further includes a CMOS sensor module, which is connected to a stm32 single-chip minimum system control unit in the robot control system;
[0008] The stm32 single-chip microcomputer minimum system control unit in the robotic arm control system and the stm32 single-chip microcomputer minimum system control unit in the shunt device control system are connected through three pins for communication.
[0009] Optionally, the motor control module includes an optocoupler isolation module, a Schmidt inverter module and a motor interface module, the stm32 single-chip microcomputer minimum system control unit is connected to the optocoupler isolation module, the optocoupler isolation module is connected to the Schmidt inverter module, and the Schmidt inverter module is connected to the motor interface module.
[0010] Optionally, the Schmitt inverter adopts the CD40106 Schmitt inverter.
[0011] Optionally, the motor uses TBS2701 servo.
[0012] A control method based on machine vision detection and shunting robot, used to control the above control system, the control system includes a mechanical arm control system and a shunting device control system. The mechanical arm control system and the shunting device control system both include an STM32 single-chip minimum system control unit, a reset circuit, a switch circuit, a PWM oscillator module and a motor control module. The mechanical arm control system also includes a CMOS sensor module, and the motor control module includes an optocoupler isolation module, a Schmidt inverter module and a motor interface module.
[0013] The control method comprises the following steps:
[0014] In the first step, the wiring harness connector is produced from the injection molding machine and placed on the transport device;
[0015] In the second step, the harness connector passes through the transmission device to the diversion device area;
[0016] In the third step, the visual detector detects the position of the wiring harness connector and controls the robotic arm to accurately grasp it;
[0017] In the fourth step, the robot arm places the wiring harness connector in the optimal visual inspection area and controls the robot arm to adjust the inspection position of the wiring harness connector within a reasonable range, thereby completing multiple sampling of the target area;
[0018] The fifth step is to perform mathematical statistical analysis on the multiple test results of each target area to reduce the test error and complete the quality test of the wiring harness connector;
[0019] Step 6: After the quality inspection of the wiring harness connector is completed, the single chip microcomputer controls the shunt turntable to perform shunt action on the wiring harness connector according to the inspection result;
[0020] In the seventh step, the single chip microcomputer counts the wiring harness connectors in the feeding device corresponding to each type, and when the number reaches 10, the control motor releases the wiring harness connectors in the feeding device into the corresponding product storage box;
[0021] The above steps are completed by the robot control system and the diversion device control system. The robot control system also includes a robot control step, a camera image acquisition program step, and a wiring harness connector surface defect detection program step. The diversion device control system includes a diversion program step and a steering gear driver step.
[0022] Optionally, the robotic arm control step is that first the robotic arm control system detects through a CMOS sensor module that the wiring harness connector transported on the transport device arrives at the diversion device area, then detects and calculates the spatial coordinates of the wiring harness connector, and controls the operation of the motors of various parts of the robotic arm through the coordinates, thereby clamping the target connector; after clamping the target connector, the connector is placed in the visual inspection area, and the inspection position is adjusted at the same time to obtain multiple inspection samples of the target area.
[0023] Optionally, the camera image acquisition program steps in the visual detection area are first to initialize the camera. The OV7670 camera configures the registers through OV_SCL and OV_SDA, and then configures the corresponding IO port status. First, set OV_PWDN = 0 to exit the power-down mode and reset OV7670. Then set OV_RESET to 1 to end the reset, and then configure the registers of OV7670 to configure it for UXGA output; after OV7670 is configured, enable the IO and DCMI clocks, and then set the relevant IO ports to the multiplexing function mode; then configure the DCMI related settings, and One parameter is set to capture mode, the second parameter selects synchronization mode, the third parameter sets pixel clock polarity, the fourth parameter sets vertical synchronization polarity VSYNC, the fifth parameter sets horizontal synchronization polarity, the sixth parameter sets frame capture rate, and the seventh parameter sets extended data mode; then configure DMA; then set the image output size of OV7670 and enable DCMI capture; capture the harness connector template image, then adjust the camera brightness to find the target area, fit the area where the target appears, find the target area and extract the edge of the target, then calculate the coordinates of the target and feedback.
[0024] Optionally, the wiring harness connector surface defect detection program steps are first to initialize the OV7670 camera, enable IO and DCMI clocks, set the capture mode, select the synchronization mode, set the pixel clock polarity, set the vertical synchronization polarity VSYNC, set the horizontal synchronization polarity, set the frame capture rate, set the extended data mode, configure DMA, set the image output size of OV7670, enable DCMI capture, obtain the wiring harness surface image, grayscale the image, and then perform median filtering on the image, perform polar coordinate transformation to transform the acquired surface into a plane, and then perform mean filtering on the image, and then binarize, open operation, and expansion operation to determine whether there are defects, and at the same time classify qualified products, mark unqualified products and different types of qualified products and feed them back to the shunt device control system, and the shunt device control system controls the shunt disk to receive the corresponding wiring harness connector according to these marking information.
[0025] Optionally, the diverter device control step is that the diverter device control system obtains the classification marking data of the wire harness connector transmitted from the robotic arm control system, and controls the diverter turntable to rotate the designated type receiving port to the position of the target wire harness connector according to the marking data, and the robotic arm releases the mechanical claw to place the wire harness connector in the corresponding type of feeding device; according to the number of wire harness connectors accommodated in each feeding device, the diverter device counts the wire harness connectors in each feeding device, and when the number of connectors reaches the capacity number, controls the diverter turntable to rotate the feeding device to the corresponding product storage box position, and starts the feeding device motor to complete the feeding action.
[0026] Optionally, the servo motor driving steps are to first give the servo a signal to make it work, then turn on the TIM13 clock, set the values of the two registers ARR and PSC to control the output PWM cycle, then set TIM13_CH1 to PWM mode, enable TIM13, and modify TIM13_CCR1 to control the duty cycle to control the steering and speed of the servo.
[0027] Beneficial Effects
[0028] A control system and method based on machine vision inspection and diversion robot is provided in an embodiment of the present invention, that is, in a robotic arm control system, the spatial coordinates of the wiring harness connector reaching the diversion device area are collected and calculated through a CMOS sensor module, and the robotic arm is controlled to accurately clamp the target connector according to the spatial coordinates; the robotic arm clamps the target connector to the visual inspection area, and the CMOS sensor module performs surface defect detection on the surface of the target connector, and communicates the detection result to the diversion device control system, and the diversion device control system controls the diversion device to rotate accurately according to the detection result, aligns the corresponding type of receiving port with the robotic arm workstation, and then the robotic arm releases the mechanical claw and places the target connector into the corresponding type of feeding device. When the number of connectors in the feeding device reaches the maximum capacity value, the diversion device control system controls the rotation of the diversion disc and the operation of the servo of the feeding device, and places the wiring harness connector in the feeding device into the corresponding type of product storage box to complete the diversion action.
[0029] The control system can well solve the problems that are easy to occur in the control of detection and diversion robots. In addition, under multi-channel control, the components are automatically coordinated to reduce the coupling degree and improve the overall stability and robustness of the system; the detection efficiency and accuracy are improved by performing mathematical statistical analysis on multiple detection results of each target area; and the feeding device acts as a buffer device of the system to improve the working efficiency of the overall system. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 Schematic diagram of the overall control system of the detection and diversion robot based on machine vision according to an embodiment of the present invention;
[0031] Figure 2 Schematic diagram of the overall mechanical structure of the detection and diversion robot based on machine vision according to an embodiment of the present invention;
[0032] Figure 3 A schematic diagram of the structure of a robot mechanical arm device according to an embodiment of the present invention;
[0033] Figure 4 This is a schematic structural diagram of a robot feeding device according to an embodiment of the present invention;
[0034] Figure 5 The robot overall program flowchart of the embodiment of the present invention;
[0035] Figure 6 A flowchart of a program for obtaining the coordinates of a harness connector for a robotic arm control system according to an embodiment of the present invention;
[0036] Figure 7 A flowchart of a wiring harness connector quality inspection program according to an embodiment of the present invention;
[0037] Figure 8 A classification and marking program flowchart of a robotic arm control system according to an embodiment of the present invention;
[0038] Fig. 9 A flow diversion program flowchart of a flow diversion device control system according to an embodiment of the present invention;
[0039] Fig.10 This is a block diagram of a steering engine driver according to an embodiment of the present invention.
[0040] The reference numerals are:
[0041] 1. Visual detector; 2. Diversion turntable; 3. Transport device; 4. Feeding device; 5. Product storage box; 6. Robotic arm device. DETAILED DESCRIPTION
[0042] See also Figures 1 to 10 As shown, according to an embodiment of the present invention, the present invention provides a control system for a machine vision detection and diversion robot, the mechanical structure of the robot is as follows Figure 2 The robot is composed of a visual detector 1, a diversion turntable 2, a transport device 3, a feeding device 4, a product storage box 5, a mechanical arm device 6, etc. It has 4 independent visual inspection stations and transmits data to the diversion control system in the middle.
[0043] like Figure 1 As shown, a detection and diversion robot overall control system based on machine vision, the control system includes a robotic arm control system and a diversion device control system.
[0044] The robot control system includes the stm32 single-chip minimum system control unit, CMOS sensor module, reset circuit, switch circuit, optocoupler isolation module, PWM oscillator module, Schmidt inverter module, and motor interface module; the 8 pins of the CMOS sensor module are respectively connected to the 8 io pins of the stm32 single-chip minimum system control unit, so as to ensure that the image information collected by the industrial camera can be transmitted to the single-chip microcomputer on time; the stm32 single-chip microcomputer analyzes and processes the image data through DMA, and controls the operation of each motor according to the analysis results; the PWM oscillator module provides a standard PWM signal for the stm32 single-chip microcomputer minimum system control unit, so as to ensure the single-chip The motor control signal sent by the machine can be effectively received by the motor; each motor control module is respectively connected to the io pin of the stm32 microcontroller minimum system control unit, so as to ensure that the microcontroller controls the operation of each motor according to the analysis results; specifically, the D0~D7 pins of the CMOS module are successively connected to the PA0~PA7 pins of the robotic arm control microcontroller; the 7 motors on the robotic arm require corresponding 7 motor interfaces, each motor interface is connected in series with a CD40106 Schmidt inverter, and then in series with an optocoupler isolation module, and finally connected to a single pin of the robotic arm control microcontroller, and correspondingly, the 7 motor interfaces are connected to the PB8~PB14 pins of the robotic arm control microcontroller.
[0045] The motor control module includes an optocoupler isolation module, a Schmidt inverter module, and a motor interface module; the motor control signal sent by the microcontroller needs to pass through the optocoupler isolation module to ensure the safety and stability of the circuit. After the motor control signal is transmitted through the optocoupler isolation module, the leading and trailing edges will be distorted. Therefore, a CD40106 Schmidt inverter is used to shape the signal transmitted from the optocoupler isolation module to generate a standard PWM square wave signal; the reset port of the reset circuit is connected to the reset receiving port of the stm32 microcontroller minimum system control unit; the switch circuit is connected to the switch pin of the stm32 microcontroller minimum system control unit.
[0046] The shunt device control system lacks a CMOS sensor module compared to the robotic arm control system, and the other components are consistent with the robotic arm control system. The robotic arm control system communicates with the shunt device control system through three pins to ensure that the robotic arm control system controls the shunt device shunt action according to the visual detection results. Specifically, the PA1~PA3 pins of the shunt device control microcontroller are successively connected to the PA13~PA11 pins of the robotic arm control microcontroller; the 13 motors on the shunt device require corresponding 13 motor interfaces, each motor interface is connected in series with a CD40106 Schmidt inverter, and then connected in series with an optocoupler isolation module, and finally connected to a single pin of the shunt device control microcontroller. Correspondingly, the 13 motor interfaces are connected to the PA8~PA13 pins and PB8~PB14 of the shunt device control microcontroller.
[0047] like Figure 5 As shown, a control method based on machine vision detection and diversion robot, the overall process of robot operation is divided into 7 steps, the control method steps are as follows:
[0048] In the first step, the wiring harness connector is produced from the injection molding machine and placed on the transport device;
[0049] In the second step, the harness connector passes through the transmission device to the diversion device area;
[0050] In the third step, the visual detector detects the position of the wiring harness connector and controls the robotic arm to accurately grasp it;
[0051] In the fourth step, the robot arm places the wiring harness connector in the optimal visual inspection area and controls the robot arm to adjust the inspection position of the wiring harness connector within a reasonable range, thereby completing multiple sampling of the target area;
[0052] The fifth step is to perform mathematical statistical analysis on the multiple test results of each target area to reduce the test error and complete the quality test of the wiring harness connector;
[0053] Step 6: After the quality inspection of the wiring harness connector is completed, the single chip microcomputer controls the shunt turntable to perform shunt action on the wiring harness connector according to the inspection result;
[0054] In the seventh step, the single chip microcomputer counts the wiring harness connectors in the feeding device corresponding to each type. When the number reaches 10, the control motor releases the wiring harness connectors in the feeding device into the corresponding product storage box.
[0055] The above steps are completed jointly by the robot arm control system and the diversion device control system.
[0056] The robot arm control steps are as follows: first, the robot arm control system detects through the CMOS sensor module that the wiring harness connector transported on the transport device arrives at the diversion device area, and then detects and calculates the spatial coordinates of the wiring harness connector, and controls the precise operation of the motors of various parts of the robot arm through the coordinates, so as to accurately clamp the target connector; after clamping the target connector, place the connector in the optimal visual inspection area, and adjust the inspection position within an appropriate range to obtain multiple inspection samples of the target area.
[0057] like Figure 6 As shown in the figure, the robot control system obtains the wiring harness connector coordinate program consists of 18 steps:
[0058] The first step is to initialize the camera. The OV7670 camera configures the registers through OV_SCL and OV_SDA, and then configures the corresponding IO port status. First, set OV_PWDN = 0 to exit the power-down mode, then pull down OV_RESET to reset OV7670, and then set OV_RESET to 1 to end the reset. Then configure the registers of OV7670 to UXGA output;
[0059] The second step is to enable the IO and DCMI clocks, and then set the relevant IO ports to multiplexing function mode;
[0060] From step 3 to step 11, configure DCMI related settings, set the first parameter to capture mode, select synchronization mode through the second parameter, set pixel clock polarity through the third parameter, set vertical synchronization polarity VSYNC through the fourth parameter, set horizontal synchronization polarity through the fifth parameter, set frame capture rate through the sixth parameter, and set extended data mode through the seventh parameter; then configure DMA; then set the image output size of OV7670 and enable DCMI capture;
[0061] In steps 12 to 18, the image of the wiring harness connector template is captured, and then the camera brightness is adjusted to find the target area, fit the area where the target may appear, find the best target area and extract the edge of the target, and then calculate the coordinates of the target.
[0062] like Figure 7 As shown in the figure, the wiring harness connector surface defect detection procedure is the wiring harness connector quality detection procedure, which consists of 24 steps:
[0063] The first step is to initialize the camera. The OV7670 camera configures the registers through OV_SCL and OV_SDA, and then configures the corresponding IO port status. First, set OV_PWDN = 0 to exit the power-down mode, then pull down OV_RESET to reset OV7670, and then set OV_RESET to 1 to end the reset. Then configure the registers of OV7670 to UXGA output;
[0064] The second step is to enable the IO and DCMI clocks, and then set the relevant IO ports to multiplexing function mode;
[0065] From step 3 to step 11, configure DCMI related settings, set the first parameter to capture mode, select synchronization mode through the second parameter, set pixel clock polarity through the third parameter, set vertical synchronization polarity VSYNC through the fourth parameter, set horizontal synchronization polarity through the fifth parameter, set frame capture rate through the sixth parameter, and set extended data mode through the seventh parameter; then configure DMA; then set the image output size of OV7670 and enable DCMI capture;
[0066] Step 12: Set how many frames to collect a picture;
[0067] Steps 13 to 21 are image processing. Grayscale is used to reduce image noise for preprocessing. Median and mean filters are used to remove noise caused by uneven illumination. Polar coordinates are used to transform the curved surface of the harness connector into a plane to improve detection accuracy. Binarization uses the set RGB threshold to display smooth surfaces in black and defects in white. Opening and dilation operations are used to further process the binary images to reduce external interference. Finally, the connected domain is calculated to extract edges and find defects.
[0068] Step 15: extract the edge of the wiring harness connector port to obtain the port size and port count;
[0069] Step 22: Determine whether there is a defect. If yes, mark it as unqualified and proceed to the next step. If no, mark it as qualified products in the next step.
[0070] Step 23: classify and mark qualified products using the port size and port count data obtained by port edge extraction in the previous step;
[0071] In the twenty-fourth step, the data of the unqualified product mark or the qualified product classification mark is transmitted to the control system of the diversion device, and the diversion device performs the diversion action.
[0072] Among them, the classification standard is based on the actual manufacturer's wire harness type sample input. For example, if the classification is based on the size and number of the wire harness connector ports, it is necessary to count the ports of the wire harness connector, extract the edges, and calculate the sizes, and complete the classification based on different results.
[0073] like Figure 8 As shown, the classification and marking procedure for qualified products consists of 4 steps:
[0074] The first step is to input edge extraction data;
[0075] The second step is to calculate the size of the wiring harness connector port;
[0076] Step 3: Count the harness connector ports;
[0077] The fourth step is to classify and mark qualified products according to port size and port quantity.
[0078] like Fig. 9 As shown, the diversion procedure of the diversion device control system consists of three steps:
[0079] The first step is to input the classified labeled data;
[0080] In the second step, the diversion turntable is controlled according to the marking data to rotate the designated type of receiving port to the position of the target harness connector, and the robotic arm releases the mechanical claw to place the harness connector on the corresponding type of feeding device;
[0081] In the third step, the diversion device will count the harness connectors in each feeding device, and proceed to the next step when the number of connectors reaches the maximum number that can be accommodated;
[0082] The fourth step is to control the diversion turntable to rotate the corresponding type of feeding device to the position of the corresponding type of product storage box, and start the feeding device motor to complete the feeding action.
[0083] The control system of the diverter device obtains the classification labeling data of the harness connector transmitted by the robotic arm control system, and controls the diverter turntable to rotate the designated type receiving port to the position of the target harness connector according to the labeling data. The robotic arm releases the mechanical claw and places the harness connector in the corresponding type of feeding device. Each feeding device can accommodate up to 10 harness connectors. The diverter device counts the harness connectors in each feeding device. When the number of connectors reaches the maximum number that can be accommodated, the diverter turntable is controlled to rotate the feeding device to the corresponding product storage box position, and the feeding device motor is started to complete the feeding action.
[0084] Furthermore, the detection and diversion robot is designed with multiple robotic arms and visual detection devices, and therefore requires multiple robotic arm control systems. These control systems are independent of each other and transmit data to the middle diversion device control system, which processes the data in sequence according to the time sequence of the data provided by each robotic arm control system; considering that the diversion device consumes a long time and will affect the work efficiency of the overall system, the maximum number of wiring harness connectors that can be accommodated by the feeding device is designed to provide the system with buffering capacity, thereby improving the work efficiency of the overall system.
[0085] like Fig.10 As shown, the servo driver consists of 9 steps:
[0086] In the first step, the servo driver first gives the servo a signal to make it work;
[0087] The second step is to turn on the TIM13 clock and GPIO clock;
[0088] The third step is to turn on the corresponding pin as a PWM output pin;
[0089] Steps 4 to 6: Initialize TIM13; set the auto-reload value; set the prescaler value;
[0090] From step 7 to step 9, set the values of the two registers ARR and PSC to control the output PWM cycle; then set TIM13_CH1 to PWM mode; enable TIM14; modify TIM13_CCR1 to control the duty cycle to control the servo speed and direction.
[0091] The machine vision-based inspection and diversion robot provides an optimal control method and hardware control system to solve the problem of fully automated unified transportation, unified inspection and diversion of a wide variety of automotive wiring harness connectors.
[0092] It is easy for those skilled in the art to understand that the above-mentioned advantageous methods can be freely combined and superimposed without conflict.
Claims
1. A control method based on machine vision detection and diversion robot, characterized in that: The control system used in the method includes a mechanical arm control system and a diversion device control system, and the mechanical arm control system and the diversion device control system are communicatively connected so that the mechanical arm control system controls the diversion device control system to perform diversion action according to the visual detection result; The robot control system and the shunt device control system both include an STM32 single-chip microcomputer minimum system control unit, a reset circuit, a switch circuit, a PWM oscillator module and a motor control module. The STM32 single-chip microcomputer minimum system control unit is connected to the PWM oscillator module, and each motor control module is respectively connected to the IO pin of the STM32 single-chip microcomputer minimum system control unit, and the reset port of the reset circuit is connected to the reset receiving port of the STM32 single-chip microcomputer minimum system control unit; the switch circuit is connected to the switch pin of the STM32 single-chip microcomputer minimum system control unit; The robot control system further includes a CMOS sensor module, which is connected to a stm32 single-chip minimum system control unit in the robot control system; The stm32 single-chip microcomputer minimum system control unit in the robotic arm control system and the stm32 single-chip microcomputer minimum system control unit in the shunt device control system are connected by three pins for communication; The control method comprises the following steps: In the first step, the wiring harness connector is produced from the injection molding machine and placed on the transport device; In the second step, the harness connector passes through the transmission device to the diversion device area; In the third step, the visual detector detects the position of the wiring harness connector and controls the robotic arm to accurately grasp it; In the fourth step, the robot arm places the wiring harness connector in the optimal visual inspection area and controls the robot arm to adjust the inspection position of the wiring harness connector within a reasonable range, thereby completing multiple sampling of the target area; The fifth step is to perform mathematical statistical analysis on the multiple test results of each target area to reduce the test error and complete the quality test of the wiring harness connector; Step 6: After the quality inspection of the wiring harness connector is completed, the single chip microcomputer controls the shunt turntable to perform shunt action on the wiring harness connector according to the inspection result; In the seventh step, the single chip microcomputer counts the wiring harness connectors in the feeding device corresponding to each type, and when the number reaches 10, the control motor releases the wiring harness connectors in the feeding device into the corresponding product storage box; The above steps are completed by the robot control system and the shunt device control system, wherein the robot control system also includes a robot control step, a camera image acquisition program step, and a wiring harness connector surface defect detection program step, and the shunt device control system includes a shunt program step and a steering gear driver step; The robot arm control steps are: first, the robot arm control system detects through the CMOS sensor module that the wiring harness connector transported on the transport device arrives at the diversion device area, and then the CMOS sensor module detects and calculates the spatial coordinates of the wiring harness connector, and controls the operation of the motors of various parts of the robot arm through the coordinates, so as to clamp the target connector; after clamping the target connector, the target connector is placed in the visual inspection area, and the inspection position is adjusted at the same time to obtain multiple inspection samples of the target area; The procedure steps for detecting defects on the surface of harness connectors are as follows: first, the OV7670 camera is initialized, IO and DCMI clocks are enabled, the capture mode is set, the synchronization mode is selected, the pixel clock polarity is set, the vertical synchronization polarity VSYNC is set, the horizontal synchronization polarity is set, the frame capture rate is set, the extended data mode is set, DMA is configured, the image output size of OV7670 is set, DCMI capture is enabled, the harness surface image is obtained, the image is grayed, and then the image is median filtered, polar coordinates are transformed to transform the obtained surface into a plane, and then the image is mean filtered, and then binarized, open and dilate to determine whether there are defects, and at the same time, qualified products are classified, unqualified products and different types of qualified products are marked and fed back to the shunt device control system, and the shunt device control system controls the shunt disc to receive the corresponding harness connector according to these marking information; The control step of the diverter device is that the diverter device control system obtains the classification marking data of the wiring harness connector transmitted by the robotic arm control system, and controls the diverter turntable to rotate the designated type receiving port to the position of the target wiring harness connector according to the marking data, and the robotic arm releases the mechanical claw to place the wiring harness connector in the corresponding type of feeding device; according to the number of wiring harness connectors accommodated in each feeding device, the diverter device will count the wiring harness connectors in each feeding device, and when the number of connectors reaches the capacity number, the diverter turntable is controlled to rotate the feeding device to the corresponding product storage box position, and the feeding device motor is started to complete the feeding action.
2. The control method based on machine vision detection and diversion robot according to claim 1 is characterized in that: The camera image acquisition program steps in the visual detection area are as follows: First, the camera is initialized. The OV7670 camera configures the registers through OV_SCL and OV_SDA, and then configures the corresponding IO port status. First, set OV_PWDN = 0 to exit the power-down mode and reset OV7670. Then set OV_RESET to 1 to end the reset, and then configure the registers of OV7670 to UXGA output; After OV7670 is configured, enable the IO and DCMI clocks, and then set the relevant IO ports to multiplexing mode; then configure the DCMI related settings and set the first The parameter is set to capture mode, the second parameter selects the synchronization mode, the third parameter sets the pixel clock polarity, the fourth parameter sets the vertical synchronization polarity VSYNC, the fifth parameter sets the horizontal synchronization polarity, the sixth parameter sets the frame capture rate, and the seventh parameter sets the extended data mode; then configure DMA; then set the image output size of OV7670 and enable DCMI capture; capture the harness connector template image, then adjust the camera brightness to find the target area, fit the area where the target appears, find the target area and extract the edge of the target, then calculate the coordinates of the target and feedback.
3. The control method based on machine vision detection and diversion robot according to claim 1 is characterized in that: The steps of driving the servo motor are to first give the servo a signal to make it work, then turn on the TIM13 clock, set the values of the two registers ARR and PSC to control the output PWM cycle, then set TIM13_CH1 to PWM mode, enable TIM13, and modify TIM13_CCR1 to control the duty cycle to control the steering and speed of the servo.
