Industrial control circuit for image edge detection
By integrating image acquisition and processing modules on the plastic welding machine, accurate identification and noise filtering of the edges of plastic films are achieved, and the problems of high manual detection costs and safety hazards in the prior art are solved, and the safety and reliability of the system are improved.
Patent Information
- Application Number
- CN202510214375.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-13
- Publication Date
- 2025-05-23
Smart Images

Figure CN120034714A_ABST
Abstract
Description
[0001] This case is a divisional application based on the invention patent with application date of September 13, 2022, application number CN202211118778.3, and name of an industrial control system with image edge detection as the parent case. Technical Field
[0002] The invention relates to the technical field of industrial control systems with image edge detection, and in particular to an industrial control circuit for image edge detection. Background Art
[0003] At present, the plastic welding machines on the market generally use manual detection to align the edge of the plastic film, and manually operate the welding machine for welding. This solution requires a lot of labor costs. In some complex environments, such as tunnels or coal mine waterproofing, manual edge detection and welding of plastics are dangerous. Therefore, it is of great practical significance to study a plastic welding machine based on image edge detection. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide an industrial control circuit for image edge detection, which can accurately identify the edge of the image and filter out the noise when there is interference or image jitter during the image acquisition process, so that the edge acquired by the system is more consistent with the actual edge trajectory.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0006] An industrial control system with image edge detection comprises a camera image acquisition module, an image processing module and a single-chip embedded module arranged on a plastic welding machine, the single-chip embedded module comprising a motor drive module, a temperature heating module, a human-computer interaction detection protection module and a single-chip main control module, the image processing module is electrically connected to the camera image acquisition module and the single-chip main control module respectively, and the single-chip main control module is electrically connected to the motor drive module, the temperature heating module and the human-computer interaction detection protection module respectively.
[0007] The beneficial effects of the present invention are:
[0008] The camera image acquisition module is set to perform image data acquisition and image format conversion, so as to obtain the original image of the edge of the plastic film; the image acquisition processing module performs filtering processing on the original image data collected by the camera image acquisition module, on the one hand, to improve the resolution of the original image, which is helpful for better edge detection processing in the future, and on the other hand, to reduce the data capacity of the image, reduce the loss of system resources, and help to improve the detection speed of subsequent edge processing; after the single-chip main control module communicates with the FPGA through IIC, the motor drive module obtains the difference data obtained after edge detection post-processing, so as to control the steering of the servo to achieve the effect of edge tracking; A temperature heating module is set up to achieve the purpose of controlling the heating speed of the system; a human-computer interaction detection and protection module is set up, which can shut down the heating and motor rotation when an abnormal situation occurs, and remind the user to turn off the input power, thereby realizing the protection function of the system; the industrial control system with image edge detection designed in this scheme can accurately identify the edge of the image through the cooperation between the camera image acquisition module, image processing module, motor drive module, temperature heating module, human-computer interaction detection and protection module and single-chip main control module, and when there is interference or image jitter in the system during the image acquisition process, this part of the noise can be filtered out, so that the edge acquired by the system is more in line with the actual edge trajectory. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 A module connection block diagram of an industrial control system with image edge detection according to the present invention;
[0010] Figure 2 A circuit schematic diagram of a camera image acquisition module of an industrial control system with image edge detection according to the present invention;
[0011] Figure 3 A circuit schematic diagram of an image processing module of an industrial control system with image edge detection according to the present invention;
[0012] Figure 4 A circuit schematic diagram of a temperature heating module of an industrial control system with image edge detection according to the present invention;
[0013] Figure 5 A circuit schematic diagram of a motor drive module of an industrial control system with image edge detection according to the present invention;
[0014] Figure 6 A circuit schematic diagram of a single-chip main control module of an industrial control system with image edge detection according to the present invention;
[0015] Figure 7A circuit schematic diagram of a human-machine interaction detection and protection module of an industrial control system with image edge detection according to the present invention;
[0016] Figure 8 A flow chart of an edge detector module of an industrial control system with image edge detection according to the present invention;
[0017] Description of labels:
[0018] 1. Camera image acquisition module; 2. Image processing module; 3. Single-chip embedded module; 301. Motor drive module; 302. Temperature heating module; 303. Human-computer interaction detection and protection module; 304. Single-chip main control module. DETAILED DESCRIPTION
[0019] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.
[0020] Please refer to Figure 1 , the technical solution provided by the present invention:
[0021] An industrial control system with image edge detection comprises a camera image acquisition module, an image processing module and a single-chip embedded module arranged on a plastic welding machine, the single-chip embedded module comprising a motor drive module, a temperature heating module, a human-computer interaction detection protection module and a single-chip main control module, the image processing module is electrically connected to the camera image acquisition module and the single-chip main control module respectively, and the single-chip main control module is electrically connected to the motor drive module, the temperature heating module and the human-computer interaction detection protection module respectively.
[0022] From the above description, it can be seen that the beneficial effects of the present invention are:
[0023] The camera image acquisition module is set to perform image data acquisition and image format conversion, so as to obtain the original image of the edge of the plastic film; the image acquisition processing module performs filtering processing on the original image data collected by the camera image acquisition module, on the one hand, to improve the resolution of the original image, which is helpful for better edge detection processing in the future, and on the other hand, to reduce the data capacity of the image, reduce the loss of system resources, and help to improve the detection speed of subsequent edge processing; after the single-chip main control module communicates with the FPGA through IIC, the motor drive module obtains the difference data obtained after edge detection post-processing, so as to control the steering of the servo to achieve the effect of edge tracking; A temperature heating module is set up to achieve the purpose of controlling the heating speed of the system; a human-computer interaction detection and protection module is set up, which can shut down the heating and motor rotation when an abnormal situation occurs, and remind the user to turn off the input power, thereby realizing the protection function of the system; the industrial control system with image edge detection designed in this scheme can accurately identify the edge of the image through the cooperation between the camera image acquisition module, image processing module, motor drive module, temperature heating module, human-computer interaction detection and protection module and single-chip main control module, and when there is interference or image jitter in the system during the image acquisition process, this part of the noise can be filtered out, so that the edge acquired by the system is more in line with the actual edge trajectory.
[0024] Further, the camera image acquisition module includes an image sensor U3, a resistor R9, a resistor R12, a resistor R10, a resistor R6, a resistor R7, a capacitor C3 and a capacitor C4, the model of the image sensor U3 is OV5640, and the fifth pin, the sixth pin, the seventh pin, the thirteenth pin, the fortieth pin, the forty-first pin, the forty-sixth pin, the forty-eighth pin, the forty-ninth pin, the sixtieth pin, the sixty-second pin, the sixty-third pin, the sixty-fourth pin, the sixty-fifth pin, the sixty-eighth pin and the sixty-ninth pin of the image sensor U3 are respectively electrically connected to the image processing module;
[0025] The eleventh pin of the image sensor U3 is grounded through a resistor R9, the fourteenth pin of the image sensor U3 is grounded through a resistor R12, the second pin of the image sensor U3 is electrically connected to the third pin of the image sensor U3, the fifteenth pin of the image sensor U3 and the sixteenth pin of the image sensor U3 respectively, the forty-eighth pin of the image sensor U3 is electrically connected to one end of the resistor R6, the other end of the resistor R6 is electrically connected to one end of the resistor R7, the other end of the resistor R7 is electrically connected to the forty-ninth pin of the image sensor U3, the fiftieth pin of the image sensor U3 is grounded through a resistor R10, and the thirty-third pin of the image sensor U3 is grounded through a capacitor C3 The thirty-fourth pin of the image sensor U3 is grounded through the capacitor C4, the twenty-sixth pin of the image sensor U3 is electrically connected to the thirty-second pin of the image sensor U3, the twenty-eighth pin of the image sensor U3 is electrically connected to the thirtieth pin of the image sensor U3, the 20th pin of the image sensor U3 is electrically connected to the twenty-first pin of the image sensor U3 and both are grounded, the twenty-fourth pin of the image sensor U3 is electrically connected to the twenty-fifth pin of the image sensor U3 and both are grounded, and the fifty-sixth pin of the image sensor U3 is electrically connected to the fifty-seventh pin of the image sensor U3, the fifty-eighth pin of the image sensor U3 and the fifty-ninth pin of the image sensor U3 respectively.
[0026] From the above description, it can be seen that the image sensor model OV5640 is a 1 / 4 inch 5 million pixel high-performance image sensor that supports DVP and MIPI interfaces. The PWND pin (i.e., the fourteenth pin) is grounded through the resistor R12, so that the image sensor U3 exits the power saving mode. The RESETB pin (i.e. the 13th pin) is valid when the low point is set, and the image sensor U3 is reset when it is set low; the AVDD pin (i.e. the 32nd pin) is the sensor analog power pin, and a 2.8V voltage is connected in actual use; in the OTP write state, AVDD must be connected to 2.5V+-5%, but there is no such requirement in the OPT read state; the DVDD pin (i.e. the second and third pins) is the sensor digital power pin, and the voltage is 1.5V±5% (small ripple); the DOVDD pin (i.e. the 56th to 59th pins) is the sensor digital IO power pin, and the actual use voltage is 1.8V; the AGND (analog ground) and DGND (digital ground) pins should be separated in the module and connected at a single point on the PCB outside the module, and should not be connected in the module; capacitors C3 and C4 play a filtering role; resistors R6 and R7 provide pull-up current for the IIC bus; resistors R9 and R10 connect the corresponding pins to the digital ground and analog ground.
[0027] Furthermore, the image processing module includes a chip U7, the model of the chip U7 is Zynq7020, and the first pin, the third pin, the fourth pin, the fifth pin, the sixth pin, the seventh pin, the eighth pin, the ninth pin, the tenth pin, the eleventh pin, the twelfth pin, the thirteenth pin, the fourteenth pin, the fifteenth pin, the sixteenth pin and the eighteenth pin of the chip U7 are respectively electrically connected to the camera image acquisition module.
[0028] Furthermore, the motor drive module includes a resistor R4, a resistor R8, a resistor R11, a resistor R13, a diode D1, a motor M1, a switch tube U5, a chip U2, a steering servo interface CN2 and a Hall sensor interface CN4. The model of the chip U2 is TLP251. The second pin of the chip U2 is electrically connected to one end of the resistor R4, and the other end of the resistor R4 is electrically connected to the single-chip microcomputer main control module. The third pin of the chip U2 is connected to the digital ground, the fifth pin of the chip U2 is connected to the high-voltage ground, the sixth pin of the chip U2 is electrically connected to one end of the resistor R8, and the other end of the resistor R8 is electrically connected to one end of the resistor R11 and the gate of the switch tube U5 respectively. The other end of the resistor R11 is connected to the high-voltage ground, and the source of the switch tube U5 is connected to the high-voltage ground. The drain of the gate U5 is electrically connected to one end of the motor M1 and the anode of the diode D1 respectively, the cathode of the diode D1 is electrically connected to the other end of the motor M1, and the cathode of the diode D1 and the other end of the motor M1 are both connected to a 310V power supply, the eighth pin of the chip U2 is connected to a 12V power supply, the first pin of the steering servo interface CN2 is connected to a 3.3V power supply, the second pin of the steering servo interface CN2 is electrically connected to the single-chip microcomputer main control module, the third pin of the steering servo interface CN2 is connected to a digital ground, the first pin of the Hall sensor interface CN4 is electrically connected to one end of a resistor R13, the other end of the resistor R13 is connected to a 3.3V power supply, the second pin of the Hall sensor interface CN4 is connected to a digital ground, and the third pin of the Hall sensor interface CN4 is connected to a 3.3V power supply.
[0029] From the above description, it can be seen that the single-chip microcomputer main control module provides the motor control signal, and indirectly controls the switch of the switch tube U5 through the chip U2, thereby realizing the speed control of the motor M1. Among them, the resistor R4 and the resistor R8 play the role of current limiting, the resistor R11 enables the switch tube U5 to be stably maintained in the closed state when there is no motor control signal, and the diode D1 plays the role of freewheeling. The steering angle of the steering servo interface CN2 is provided by the single-chip microcomputer main control module, and the Hall sensor interface CN4 is used to test the speed of the motor in order to adjust the welding speed of the plastic welding machine; the resistor R13 provides a pull-up current for the output signal of the Hall sensor.
[0030] Further, the temperature heating module includes a resistor R1, a resistor R2, a resistor R3, a resistor R5, a capacitor C1, a thyristor U4, a heating plate RS1, a connector CN1, an isolation optocoupler U1, a thermocouple sensor interface CN3 and a thermocouple digital converter U6, the model of the thermocouple digital converter U6 is MAX6676, the first pin of the thermocouple digital converter U6 is respectively electrically connected to the first pin of the thermocouple sensor interface CN3 and the second pin of the thermocouple digital converter U6 and both are grounded, the third pin of the thermocouple digital converter U6 is electrically connected to the second pin of the thermocouple sensor interface CN3, the fourth pin of the thermocouple digital converter U6 is connected to a 3.3V power supply, and the fifth pin, the sixth pin and the seventh pin of the thermocouple digital converter U6 are respectively electrically connected to the single-chip main control module;
[0031] The model of the isolation optocoupler U1 is MOC3061. The first pin of the isolation optocoupler U1 is electrically connected to one end of the resistor R1, and the other end of the resistor R1 is electrically connected to the single-chip microcomputer main control module. The second pin of the isolation optocoupler U1 is grounded. The fourth pin of the isolation optocoupler U1 is electrically connected to one end of the resistor R5 and the first end of the thyristor U4 respectively. The other end of the resistor R5 is electrically connected to the second end of the thyristor U4, one end of the capacitor C1 and the first pin of the connector CN1 respectively. The third end of the thyristor U4 is electrically connected to one end of the resistor R2, one end of the resistor R3 and one end of the heating plate RS1 respectively. The other end of the resistor R2 is electrically connected to the sixth pin of the isolation optocoupler U1, and the other end of the heating plate RS1 is electrically connected to the second pin of the connector CN1. The connector CN1 is connected to 220V AC mains.
[0032] From the above description, it can be seen that the single-chip microcomputer main control module outputs a PWM signal, which controls the isolation optocoupler U1 through the resistor R1, thereby indirectly controlling the thyristor U4 to modulate the AC power to achieve the purpose of controlling the heating speed of the system; the resistors R2 and R5 play a current limiting role, and the resistor R3 and the capacitor C1 are used to eliminate voltage spikes. The heating plate RS1 is a 500W-1500W AC heating plate. The connector CN1 is the AC mains input interface; the temperature reading is the analog signal transmitted by the thermocouple digital converter U6 sampling the thermocouple sensor (through the thermocouple sensor interface CN3), and then converted into a digital signal through the built-in conversion module of the converter, and then communicated with the single-chip microcomputer main control module, so that the single-chip microcomputer main control module can obtain the current actual temperature.
[0033] Furthermore, the human-computer interaction detection protection module includes a resistor R17, a resistor R18, a resistor R19, a resistor R20, a potentiometer R21, a potentiometer R22, a capacitor C5, a capacitor C6, a common cathode digital tube LED1 and a driver chip U9, the model of the driver chip U9 is FD612, the first pin to the twelfth pin of the driver chip U9 are respectively electrically connected to the twelve pins of the common cathode digital tube LED1, the thirteenth pin of the driver chip U9 is connected to a 3.3V power supply, the fourteenth pin of the driver chip U9 is respectively electrically connected to one end of the resistor R18 and the single-chip microcomputer main control module, the fifteenth pin of the driver chip U9 is respectively electrically connected to one end of the resistor R17 and the single-chip microcomputer main control module The main control module is electrically connected, the other end of the resistor R18 is electrically connected to the other end of the resistor R17, and the other end of the resistor R18 and the other end of the resistor R17 are both connected to a 3.3V power supply, one end of the potentiometer R21 is electrically connected to one end of the resistor R19, one end of the capacitor C5 and the single-chip microcomputer main control module, the other end of the potentiometer R21 is grounded, the other end of the capacitor C5 is grounded, the other end of the resistor R19 is connected to a 3.3V power supply, one end of the potentiometer R22 is electrically connected to one end of the resistor R20, one end of the capacitor C6 and the single-chip microcomputer main control module, the other end of the potentiometer R22 is grounded, the other end of the capacitor C6 is grounded, and the other end of the resistor R20 is connected to a 3.3V power supply.
[0034] From the above description, it can be seen that the human-machine interaction detection protection module mainly includes speed and temperature regulator, display interface, heating temperature abnormality and other protection functions, as well as motor abnormality protection and other functions. This module can realize motor debugging, the welding temperature of the plastic welding machine, and possible abnormal conditions. When these abnormal conditions occur, the heating and motor rotation can be turned off, and the user is reminded to turn off the input power, thereby realizing the protection function of the system. The human-computer interaction detection protection module is a single-chip microcomputer main control module that reads the voltage at both ends of the potentiometer and obtains the actual setting value through the built-in ADC module. The potentiometer R21 and the resistor R19 form a voltage divider circuit for adjusting the temperature of the heating plate, and the capacitor C5 plays a filtering role; the potentiometer R22 and the resistor R20 form a voltage divider circuit for adjusting the speed of the motor, and the capacitor C6 plays a filtering role; the display interface is composed of the common cathode digital tube LED1 and the driver chip U9; the module communicates with the single-chip microcomputer main control module through the IIC bus; resistors R17 and R18 serve to improve the IIC driving capability; when the motor speed is abnormal or the heating temperature is abnormal, the system stops heating and motor rotation, and displays the fault code through the digital tube to prompt the user to troubleshoot the problem and turn off the power.
[0035] Furthermore, the single-chip microcomputer main control module includes a chip U8, the model of the chip U8 is YTX51FCOAE, the first pin, the second pin, the third pin and the nineteenth pin of the chip U8 are respectively electrically connected to the temperature heating module, the thirteenth pin, the fourteenth pin and the seventeenth pin of the chip U8 are respectively electrically connected to the motor drive module, the eighth pin and the eighteenth pin of the chip U8 are respectively electrically connected to the image processing module, and the eleventh pin and the twelfth pin of the chip U8 are respectively electrically connected to the human-computer interaction detection and protection module.
[0036] Please refer to Figures 1 to 8 , Embodiment 1 of the present invention is:
[0037] Please refer to Figure 1 An industrial control system with image edge detection includes a camera image acquisition module 1, an image processing module 2 and a single-chip embedded module 3 arranged on a plastic welding machine, the single-chip embedded module 3 includes a motor drive module 301, a temperature heating module 302, a human-computer interaction detection and protection module 303 and a single-chip main control module 304, the image processing module 2 is electrically connected to the camera image acquisition module 1 and the single-chip main control module 304, and the single-chip main control module 304 is electrically connected to the motor drive module 301, the temperature heating module 302 and the human-computer interaction detection and protection module 303.
[0038] Please refer to Figure 2 , the camera image acquisition module 1 includes an image sensor U3, a resistor R9 (resistance value is 0Ω), a resistor R12 (resistance value is 4.7kΩ), a resistor R10 (resistance value is 0Ω), a resistor R6 (resistance value is 4.7kΩ), a resistor R7 (resistance value is 4.7kΩ), a capacitor C3 (capacitance value is 0.1μF) and a capacitor C4 (capacitance value is 0.1μF), the model of the image sensor U3 is OV5640, and the fifth pin, the sixth pin, the seventh pin, the thirteenth pin, the fortieth pin, the forty-first pin, the forty-sixth pin, the forty-eighth pin, the forty-ninth pin, the sixtieth pin, the sixty-second pin, the sixty-third pin, the sixty-fourth pin, the sixty-fifth pin, the sixty-eighth pin and the sixty-ninth pin of the image sensor U3 are electrically connected to the image processing module 2 respectively;
[0039] Please refer to Figure 2The eleventh pin of the image sensor U3 is grounded through a resistor R9, the fourteenth pin of the image sensor U3 is grounded through a resistor R12, the second pin of the image sensor U3 is electrically connected to the third pin of the image sensor U3, the fifteenth pin of the image sensor U3 and the sixteenth pin of the image sensor U3 respectively, the forty-eighth pin of the image sensor U3 is electrically connected to one end of the resistor R6, the other end of the resistor R6 is electrically connected to one end of the resistor R7, the other end of the resistor R7 is electrically connected to the forty-ninth pin of the image sensor U3, the fiftieth pin of the image sensor U3 is grounded through a resistor R10, and the thirty-third pin of the image sensor U3 is grounded through a capacitor C3 The thirty-fourth pin of the image sensor U3 is grounded through the capacitor C4, the twenty-sixth pin of the image sensor U3 is electrically connected to the thirty-second pin of the image sensor U3, the twenty-eighth pin of the image sensor U3 is electrically connected to the thirtieth pin of the image sensor U3, the 20th pin of the image sensor U3 is electrically connected to the twenty-first pin of the image sensor U3 and both are grounded, the twenty-fourth pin of the image sensor U3 is electrically connected to the twenty-fifth pin of the image sensor U3 and both are grounded, and the fifty-sixth pin of the image sensor U3 is electrically connected to the fifty-seventh pin of the image sensor U3, the fifty-eighth pin of the image sensor U3 and the fifty-ninth pin of the image sensor U3 respectively.
[0040] Please refer to Figure 3 The image processing module 2 includes a chip U7, the model of the chip U7 is Zynq7020, and the first pin, the third pin, the fourth pin, the fifth pin, the sixth pin, the seventh pin, the eighth pin, the ninth pin, the tenth pin, the eleventh pin, the twelfth pin, the thirteenth pin, the fourteenth pin, the fifteenth pin, the sixteenth pin and the eighteenth pin of the chip U7 are respectively electrically connected to the camera image acquisition module 1.
[0041] Please refer to Figure 5The motor drive module 301 includes a resistor R4 (resistance value is 510Ω), a resistor R8 (resistance value is 51Ω), a resistor R11 (resistance value is 10kΩ), a resistor R13 (resistance value is 10kΩ), a diode D1 (model FR307), a motor M1 (model MOTOR), a switch tube U5 (model FGA25N120), a chip U2, a steering servo interface CN2 and a Hall sensor interface CN4. The model of the chip U2 is TLP251. The second pin of the chip U2 is electrically connected to one end of the resistor R4, and the other end of the resistor R4 is electrically connected to the single-chip microcomputer main control module 304. The third pin of the chip U2 is connected to the digital ground, the fifth pin of the chip U2 is connected to the high-voltage ground, the sixth pin of the chip U2 is electrically connected to one end of the resistor R8, and the other end of the resistor R8 is electrically connected to one end of the resistor R11 and the gate of the switch tube U5 respectively. The other end of the resistor R11 is connected to the high voltage ground, the source of the switch tube U5 is connected to the high voltage ground, the drain of the switch tube U5 is electrically connected to one end of the motor M1 and the anode of the diode D1 respectively, the cathode of the diode D1 is electrically connected to the other end of the motor M1 and the cathode of the diode D1 and the other end of the motor M1 are both connected to a 310V power supply, the eighth pin of the chip U2 is connected to a 12V power supply, the first pin of the steering servo interface CN2 is connected to a 3.3V power supply, the second pin of the steering servo interface CN2 is electrically connected to the single-chip microcomputer main control module 304, the third pin of the steering servo interface CN2 is connected to the digital ground, the first pin of the Hall sensor interface CN4 is electrically connected to one end of the resistor R13, the other end of the resistor R13 is connected to the 3.3V power supply, the second pin of the Hall sensor interface CN4 is connected to the digital ground, and the third pin of the Hall sensor interface CN4 is connected to the 3.3V power supply.
[0042] Please refer to Figure 4The temperature heating module 302 includes a resistor R1 (resistance value is 300Ω), a resistor R2 (resistance value is 300Ω), a resistor R3 (resistance value is 39Ω), a resistor R5 (resistance value is 300Ω), a capacitor C1 (capacitance value is 0.01μF), a thyristor U4 (model BAT41600B), a heating plate RS1, a connector CN1, an isolation optical coupler U1 (model MOC3061), a thermocouple sensor interface CN3 and a thermocouple digital converter U6. The thermocouple digital converter U6 has The model is MAX6676, the first pin of the thermocouple digital converter U6 is electrically connected to the first pin of the thermocouple sensor interface CN3 and the second pin of the thermocouple digital converter U6 respectively and both are grounded, the third pin of the thermocouple digital converter U6 is electrically connected to the second pin of the thermocouple sensor interface CN3, the fourth pin of the thermocouple digital converter U6 is connected to a 3.3V power supply, and the fifth pin, the sixth pin and the seventh pin of the thermocouple digital converter U6 are electrically connected to the single-chip microcomputer main control module 304 respectively;
[0043] Please refer to Figure 4 The model of the isolation optocoupler U1 is MOC3061. The first pin of the isolation optocoupler U1 is electrically connected to one end of the resistor R1, and the other end of the resistor R1 is electrically connected to the single-chip main control module 304. The second pin of the isolation optocoupler U1 is grounded. The fourth pin of the isolation optocoupler U1 is electrically connected to one end of the resistor R5 and the first end of the thyristor U4 respectively. The other end of the resistor R5 is electrically connected to the second end of the thyristor U4, one end of the capacitor C1 and the first pin of the connector CN1 respectively. The third end of the thyristor U4 is electrically connected to one end of the resistor R2, one end of the resistor R3 and one end of the heating plate RS1 respectively. The other end of the resistor R2 is electrically connected to the sixth pin of the isolation optocoupler U1, and the other end of the heating plate RS1 is electrically connected to the second pin of the connector CN1. The connector CN1 is connected to 220V AC mains.
[0044] Please refer to Figure 7The human-computer interaction detection protection module 303 includes a resistor R17 (resistance value is 4.7kΩ), a resistor R18 (resistance value is 4.7kΩ), a resistor R19 (resistance value is 10kΩ), a resistor R20 (resistance value is 10kΩ), a potentiometer R21 (resistance value is 10kΩ), a potentiometer R22 (resistance value is 10kΩ), a capacitor C5 (capacitance value is 100nF), a capacitor C6 (capacitance value is 100nF), a common cathode digital tube LED1 and a driver chip U9, the model of the driver chip U9 is FD612, the first pin to the twelfth pin of the driver chip U9 are respectively electrically connected to the twelve pins of the common cathode digital tube LED1 in a one-to-one correspondence, the thirteenth pin of the driver chip U9 is connected to a 3.3V power supply, and the fourteenth pin of the driver chip U9 is respectively connected to one end of the resistor R18 and the single-chip main control module The fifteenth pin of the driving chip U9 is electrically connected to one end of the resistor R17 and the single-chip main control module 304 respectively, the other end of the resistor R18 is electrically connected to the other end of the resistor R17, and the other end of the resistor R18 and the other end of the resistor R17 are both connected to a 3.3V power supply, one end of the potentiometer R21 is electrically connected to one end of the resistor R19, one end of the capacitor C5 and the single-chip main control module 304 respectively, the other end of the potentiometer R21 is grounded, the other end of the capacitor C5 is grounded, and the other end of the resistor R19 is connected to a 3.3V power supply, one end of the potentiometer R22 is electrically connected to one end of the resistor R20, one end of the capacitor C6 and the single-chip main control module 304 respectively, the other end of the potentiometer R22 is grounded, the other end of the capacitor C6 is grounded, and the other end of the resistor R20 is connected to a 3.3V power supply.
[0045] Please refer to Figure 6 The single-chip microcomputer main control module 304 includes a chip U8, the model of the chip U8 is YTX51FCOAE, the first pin, the second pin, the third pin and the nineteenth pin of the chip U8 are respectively electrically connected to the temperature heating module 302, the thirteenth pin, the fourteenth pin and the seventeenth pin of the chip U8 are respectively electrically connected to the motor driving module 301, the eighth pin and the eighteenth pin of the chip U8 are respectively electrically connected to the image processing module 2, and the eleventh pin and the twelfth pin of the chip U8 are respectively electrically connected to the human-computer interaction detection protection module 303.
[0046] The working principle of the above industrial control system with image edge detection is:
[0047] The image sensor with the model number OV5640 is a high-performance 1 / 4-inch 5-megapixel image sensor that supports DVP and MIPI interfaces. The PWND pin (i.e., the fourteenth pin) is grounded through the resistor R12 to make the image sensor U3 exit the power-saving mode. The RESETB pin (i.e., the thirteenth pin) is active low, and when set low, it resets the image sensor U3; the AVDD pin (i.e., the thirty-second pin) is the sensor analog power supply pin, and a 2.8V voltage is connected in actual use; in the OTP writing state, AVDD must be connected to 2.5V ± 5%, but there is no such requirement in the OPT reading state; the DVDD pins (i.e., the second and third pins) are the sensor digital power supply pins, with a voltage of 1.5V ± 5% (small ripple); the DOVDD pins (i.e., the fifty-sixth to fifty-ninth pins) are the sensor digital IO power supply pins, and the actual operating voltage is 1.8V; the AGND (analog ground) and DGND (digital ground) pins should be separated inside the module and connected at a single point on the PCB outside the module, and should not be connected inside the module; the capacitors C3 and C4 play a filtering role; the resistors R6 and R7 provide pull-up current for the IIC bus; the resistors R9 and R10 connect the corresponding pins to the digital ground and the analog ground.
[0048] The image processing module 2 is composed of a PLL clock module, an IIC configuration, an image acquisition preprocessing module, an edge detection module, an SDRAM controller, and a trace algorithm module. These modules are internally hardware-connected inside the FPGA chip (i.e., chip U7).
[0049] The PLL clock module generates the system clock required for each sub-module in the FPGA image processing module 2 to operate.
[0050] The IIC configuration is mainly used to communicate with the camera image acquisition module 1 to facilitate the acquisition of the original film edge image.
[0051] The image acquisition preprocessing module filters the original image data collected by the camera image acquisition module 1. On the one hand, it improves the resolution of the original image, which helps to better perform edge detection processing subsequently. On the other hand, it reduces the data capacity of the image, reduces the consumption of system resources, and is conducive to improving the detection speed of subsequent edge processing.
[0052] The core of the whole system is the edge detector module, which can be divided into eight parts, as shown in the figure below. First, the color image is gray-scaled to obtain a gray-scale image, and then the required pixel 3X3 processing matrix needs to be calculated, and then the pixel array is subjected to a mean filter operation to filter out noise, and then the denoised pixel array is subjected to edge detection operator calculation and straight line fitting to obtain edge information that matches the edge of the original image, and by calculating the width of the film edge and the left and right sides of the image edge, the two networks Tracking instruction1 and Tracking instruction2 are connected to the microcontroller main control module 304, thereby adjusting the rotation direction of the servo of the plastic welding machine to achieve the effect of welding the plastic while tracking.
[0053] The main flow chart of the edge detector module is as follows Figure 8 As shown, it mainly includes the following steps:
[0054] 1. The plastic film image data is collected in real time through the camera image acquisition module 1. The collected image contains a lot of background noise, which may introduce interference in edge detection and cause false detection. Therefore, it is necessary to filter out the noise;
[0055] 2. Perform grayscale processing on the collected digital image to obtain a grayscale image. The grayscale process is to unify the RGB value of each pixel into the same value. The grayscaled image will change from three channels to a single channel, and the single-channel data processing will be much simpler. Color images have three components, R, G, and B, which are the three basic colors of red, green, and blue. Grayscale is the process of making the R, G, and B components of the color equal. Pixels with large grayscale values are brighter, and vice versa. This process is called grayscale. By setting the grayscale threshold, most of the background or environmental noise can be segmented and filtered out, reducing the amount of image data, facilitating subsequent processing to save system resources.
[0056] 3. Calculate the required pixel processing array according to the grayscale image obtained through grayscale processing;
[0057] 4. Perform mean filtering on the pixel matrix to filter out noise; in a specific area, the average of all pixels is the final result, and the weight of each pixel is the same, which is the inverse of the total number of pixels. Mean smoothing is linear and will not change due to different positions and pixel distributions. For example, for a 3*3 convolution kernel, the current pixel to be processed is multiplied by the corresponding weight coefficient matrix template.
[0058] 5. Perform edge detection calculation on the filtered numbers.
[0059] 6. Binarize the numbers after edge detection, multiply the image data with the value of the operator at the corresponding position and then add them to get Gx in the x direction and Gy in the y direction. Square these two values, add them and take the square root to get Gxy. Compare the calculated Gxy with the set threshold. If Gxy is greater than this threshold, it means that the point is a boundary point and is displayed in black, otherwise it is displayed as a white point.
[0060] 7. Perform centerline fitting based on the least squares method on the binarized data and determine the centerline to obtain the final target edge. The data after binarization are some discrete points, not a smooth curve. By straight line fitting, when using the centerline for deviation processing, the slope deviation obtained by fitting the centerline will be more accurate, so the least squares method can be used for line filling processing.
[0061] 8. The image data after straight line fitting is processed by the SDRAM controller and stored in the SDRAM.
[0062] The SDRAM controller is used to cache the image data processed by the edge detection module into the SDRAM controller. Since the amount of processed image data is large and the amount of data that needs to be comprehensively processed in real-time processing is far greater than the FPGA on-chip storage resources, an external SDRAM controller is required to cache the image data.
[0063] The tracking algorithm module calculates the width of the film edge and the left and right sides of the image edge, and transmits the calculated difference to the single-chip microcomputer main control module 304, so that the single-chip microcomputer adjusts the rotation direction of the servo of the plastic welding machine to achieve the tracking effect.
[0064] The single-chip microcomputer main control module 304 provides the motor control signal, and indirectly controls the switch of the switch tube U5 through the chip U2, thereby realizing the speed control of the motor M1. The resistors R4 and R8 play the role of current limiting, the resistor R11 enables the switch tube U5 to be stably maintained in the off state when there is no motor control signal, and the diode D1 plays the role of freewheeling. The steering angle of the steering servo interface CN2 is provided by the single-chip microcomputer main control module 304, and the Hall sensor interface CN4 is used to test the speed of the motor in order to adjust the welding speed of the plastic welding machine; the resistor R13 provides a pull-up current for the output signal of the Hall sensor.
[0065] The single-chip microcomputer main control module 304 outputs a PWM signal, which controls the isolation optocoupler U1 through the resistor R1, thereby indirectly controlling the thyristor U4 to modulate the AC power to achieve the purpose of controlling the heating speed of the system; the resistors R2 and R5 play a current limiting role, and the resistor R3 and the capacitor C1 are used to eliminate voltage spikes. The heating plate RS1 is a 500W-1500W AC heating plate. The connector CN1 is the AC mains input interface; the temperature reading is the analog signal transmitted by the thermocouple digital converter U6 sampling the thermocouple sensor (through the thermocouple sensor interface CN3), and then converted into a digital signal through the built-in conversion module of the converter, and then communicated with the single-chip microcomputer main control module 304, so that the single-chip microcomputer main control module 304 can obtain the current actual temperature.
[0066] The human-machine interaction detection protection module 303 mainly includes speed and temperature regulator, display interface, heating temperature abnormality and other protection functions, as well as motor abnormality protection and other functions. This module can realize motor debugging, the welding temperature of the plastic welding machine, and possible abnormal conditions. When these abnormal conditions occur, the heating and motor rotation can be turned off, and the user is reminded to turn off the input power, thereby realizing the protection function of the system. The human-computer interaction detection protection module 303 is a single-chip microcomputer main control module 304 that reads the voltage across the potentiometer and obtains the actual setting value through the built-in ADC module. The potentiometer R21 and the resistor R19 form a voltage divider circuit for adjusting the temperature of the heating plate, and the capacitor C5 plays a filtering role; the potentiometer R22 and the resistor R20 form a voltage divider circuit for adjusting the speed of the motor, and the capacitor C6 plays a filtering role; the display interface is composed of a common cathode digital tube LED1 and a driver chip U9; the module communicates with the single-chip microcomputer main control module 304 through the IIC bus; resistors R17 and R18 serve to improve the IIC driving capability; when the motor speed is abnormal or the heating temperature is abnormal, the system stops heating and motor rotation, and displays a fault code through the digital tube to prompt the user to troubleshoot the problem and turn off the power.
[0067] In summary, the present invention provides an industrial control circuit for image edge detection, which acquires the original image of the edge of the plastic film by setting a camera image acquisition module for image data acquisition and image format conversion; the image acquisition processing module performs filtering processing on the original image data acquired by the camera image acquisition module, which improves the resolution of the original image on the one hand, and helps to better perform edge detection processing later, and reduces the data capacity of the image, reduces the loss of system resources, and is conducive to improving the detection speed of subsequent edge processing; the motor drive module acquires the difference data obtained after edge detection post-processing after the single-chip main control module communicates with the FPGA through IIC, so as to control The steering of the servo achieves the effect of edge tracking; a temperature heating module is set to achieve the purpose of controlling the heating speed of the system; a human-computer interaction detection and protection module is set to turn off the heating and motor rotation when an abnormal situation occurs, and remind the user to turn off the input power, thereby realizing the protection function of the system; the industrial control system with image edge detection designed in this scheme can accurately identify the edge of the image through the cooperation between the camera image acquisition module, image processing module, motor drive module, temperature heating module, human-computer interaction detection and protection module and single-chip main control module, and when there is interference or image jitter in the system during the image acquisition process, this part of the noise can be filtered out, so that the edge acquired by the system is more in line with the actual edge trajectory.
[0068] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. An industrial control circuit for image edge detection, It is characterized in that It includes a camera image acquisition module, an image processing module and a single-chip embedded module arranged on the plastic welding machine, the single-chip embedded module includes a motor drive module, a temperature heating module, a human-computer interaction detection and protection module and a single-chip main control module, the image processing module is electrically connected to the camera image acquisition module and the single-chip main control module respectively, and the single-chip main control module is electrically connected to the motor drive module, the temperature heating module and the human-computer interaction detection and protection module respectively; The camera image acquisition module is used to collect image data and convert image formats to obtain the original image of the edge of the plastic film; The image acquisition processing module is used to filter the original image data collected by the camera image acquisition module; The motor drive module obtains the difference data obtained after edge detection and post-processing after the single-chip main control module communicates with the FPGA through IIC; The temperature heating module is used to control the heating speed of the system; The human-machine interaction detection protection module is used to shut down the heating and motor rotation when an abnormal situation occurs, and remind the user to turn off the input power.
2. The industrial control circuit for image edge detection according to claim 1, It is characterized in that The camera image acquisition module includes an image sensor U3, a resistor R9, a resistor R12, a resistor R10, a resistor R6, a resistor R7, a capacitor C3 and a capacitor C4, the model of the image sensor U3 is OV5640, and the fifth pin, the sixth pin, the seventh pin, the thirteenth pin, the fortieth pin, the forty-first pin, the forty-sixth pin, the forty-eighth pin, the forty-ninth pin, the sixtieth pin, the sixty-second pin, the sixty-third pin, the sixty-fourth pin, the sixty-fifth pin, the sixty-eighth pin and the sixty-ninth pin of the image sensor U3 are electrically connected to the image processing module respectively; The eleventh pin of the image sensor U3 is grounded through a resistor R9, the fourteenth pin of the image sensor U3 is grounded through a resistor R12, the second pin of the image sensor U3 is electrically connected to the third pin of the image sensor U3, the fifteenth pin of the image sensor U3 and the sixteenth pin of the image sensor U3 respectively, the forty-eighth pin of the image sensor U3 is electrically connected to one end of the resistor R6, the other end of the resistor R6 is electrically connected to one end of the resistor R7, the other end of the resistor R7 is electrically connected to the forty-ninth pin of the image sensor U3, the fiftieth pin of the image sensor U3 is grounded through a resistor R10, and the thirty-third pin of the image sensor U3 is grounded through a capacitor C3 The thirty-fourth pin of the image sensor U3 is grounded through the capacitor C4, the twenty-sixth pin of the image sensor U3 is electrically connected to the thirty-second pin of the image sensor U3, the twenty-eighth pin of the image sensor U3 is electrically connected to the thirtieth pin of the image sensor U3, the 20th pin of the image sensor U3 is electrically connected to the twenty-first pin of the image sensor U3 and both are grounded, the twenty-fourth pin of the image sensor U3 is electrically connected to the twenty-fifth pin of the image sensor U3 and both are grounded, and the fifty-sixth pin of the image sensor U3 is electrically connected to the fifty-seventh pin of the image sensor U3, the fifty-eighth pin of the image sensor U3 and the fifty-ninth pin of the image sensor U3 respectively.
3. The industrial control circuit for image edge detection according to claim 1, It is characterized in that The image processing module includes a chip U7, the model of the chip U7 is Zynq7020, and the first pin, the third pin, the fourth pin, the fifth pin, the sixth pin, the seventh pin, the eighth pin, the ninth pin, the tenth pin, the eleventh pin, the twelfth pin, the thirteenth pin, the fourteenth pin, the fifteenth pin, the sixteenth pin and the eighteenth pin of the chip U7 are respectively electrically connected to the camera image acquisition module.
4. The industrial control circuit for image edge detection according to claim 1, It is characterized in that The motor drive module includes a resistor R4, a resistor R8, a resistor R11, a resistor R13, a diode D1, a motor M1, a switch tube U5, a chip U2, a steering gear interface CN2 and a Hall sensor interface CN4. The model of the chip U2 is TLP251. The second pin of the chip U2 is electrically connected to one end of the resistor R4, and the other end of the resistor R4 is electrically connected to the single-chip microcomputer main control module. The third pin of the chip U2 is connected to the digital ground, the fifth pin of the chip U2 is connected to the high-voltage ground, the sixth pin of the chip U2 is electrically connected to one end of the resistor R8, and the other end of the resistor R8 is electrically connected to one end of the resistor R11 and the gate of the switch tube U5 respectively. The other end of the resistor R11 is connected to the high-voltage ground, and the source of the switch tube U5 is connected to the high-voltage ground. The drain of 5 is electrically connected to one end of the motor M1 and the anode of the diode D1 respectively, the cathode of the diode D1 is electrically connected to the other end of the motor M1, and the cathode of the diode D1 and the other end of the motor M1 are both connected to a 310V power supply, the eighth pin of the chip U2 is connected to a 12V power supply, the first pin of the steering servo interface CN2 is connected to a 3.3V power supply, the second pin of the steering servo interface CN2 is electrically connected to the single-chip microcomputer main control module, the third pin of the steering servo interface CN2 is connected to a digital ground, the first pin of the Hall sensor interface CN4 is electrically connected to one end of a resistor R13, the other end of the resistor R13 is connected to a 3.3V power supply, the second pin of the Hall sensor interface CN4 is connected to a digital ground, and the third pin of the Hall sensor interface CN4 is connected to a 3.3V power supply.
5. The industrial control circuit for image edge detection according to claim 1, It is characterized in that The temperature heating module includes a resistor R1, a resistor R2, a resistor R3, a resistor R5, a capacitor C1, a thyristor U4, a heating plate RS1, a connector CN1, an isolation optical coupler U1, a thermocouple sensor interface CN3 and a thermocouple digital converter U6, the model of the thermocouple digital converter U6 is MAX6676, a first pin of the thermocouple digital converter U6 is electrically connected to a first pin of the thermocouple sensor interface CN3 and a second pin of the thermocouple digital converter U6, and both are grounded, a third pin of the thermocouple digital converter U6 is electrically connected to a second pin of the thermocouple sensor interface CN3, a fourth pin of the thermocouple digital converter U6 is connected to a 3.3V power supply, and a fifth pin, a sixth pin and a seventh pin of the thermocouple digital converter U6 are electrically connected to a single-chip microcomputer main control module respectively; The model of the isolation optocoupler U1 is MOC3061. The first pin of the isolation optocoupler U1 is electrically connected to one end of the resistor R1, and the other end of the resistor R1 is electrically connected to the single-chip microcomputer main control module. The second pin of the isolation optocoupler U1 is grounded. The fourth pin of the isolation optocoupler U1 is electrically connected to one end of the resistor R5 and the first end of the thyristor U4 respectively. The other end of the resistor R5 is electrically connected to the second end of the thyristor U4, one end of the capacitor C1 and the first pin of the connector CN1 respectively. The third end of the thyristor U4 is electrically connected to one end of the resistor R2, one end of the resistor R3 and one end of the heating plate RS1 respectively. The other end of the resistor R2 is electrically connected to the sixth pin of the isolation optocoupler U1, and the other end of the heating plate RS1 is electrically connected to the second pin of the connector CN1. The connector CN1 is connected to 220V AC mains.
6. The industrial control circuit for image edge detection according to claim 1, It is characterized in that The human-computer interaction detection protection module includes a resistor R17, a resistor R18, a resistor R19, a resistor R20, a potentiometer R21, a potentiometer R22, a capacitor C5, a capacitor C6, a common cathode digital tube LED1 and a driver chip U9. The model of the driver chip U9 is FD612. The first pin to the twelfth pin of the driver chip U9 are electrically connected to the twelve pins of the common cathode digital tube LED1 one by one. The thirteenth pin of the driver chip U9 is connected to a 3.3V power supply. The fourteenth pin of the driver chip U9 is electrically connected to one end of the resistor R18 and the single-chip main control module. The fifteenth pin of the driver chip U9 is electrically connected to one end of the resistor R17 and the single-chip main control module. The resistor R18 is electrically connected to the other end of the resistor R17, and the other end of the resistor R18 and the other end of the resistor R17 are both connected to a 3.3V power supply. One end of the potentiometer R21 is electrically connected to one end of the resistor R19, one end of the capacitor C5 and the single-chip microcomputer main control module, respectively. The other end of the potentiometer R21 is grounded, the other end of the capacitor C5 is grounded, and the other end of the resistor R19 is connected to a 3.3V power supply. One end of the potentiometer R22 is electrically connected to one end of the resistor R20, one end of the capacitor C6 and the single-chip microcomputer main control module, respectively. The other end of the potentiometer R22 is grounded, the other end of the capacitor C6 is grounded, and the other end of the resistor R20 is connected to a 3.3V power supply.
7. The industrial control circuit for image edge detection according to claim 1, It is characterized in that The single-chip microcomputer main control module includes a chip U8, the model of the chip U8 is YTX51FCOAE, the first pin, the second pin, the third pin and the nineteenth pin of the chip U8 are respectively electrically connected to the temperature heating module, the thirteenth pin, the fourteenth pin and the seventeenth pin of the chip U8 are respectively electrically connected to the motor drive module, the eighth pin and the eighteenth pin of the chip U8 are respectively electrically connected to the image processing module, and the eleventh pin and the twelfth pin of the chip U8 are respectively electrically connected to the human-computer interaction detection and protection module.