Workpiece rotation detection and sorting method and rotation detection and sorting system
By adopting a control method with friction links and a drive system of anisotropic stepper motors in the workpiece detection and sorting machine, precise rotation and detection of workpieces are achieved, solving the problems of inaccurate detection and high misjudgment rate in traditional technology. Improved accuracy and efficiency of detection and sorting.
Patent Information
- Application Number
- CN202211181140.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-27
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-09-27
AI Technical Summary
The turntable control of traditional workpiece detection and sorting machines is not precise enough, resulting in inaccurate workpiece detection, high misjudgment rate, and inability to effectively sort qualified and unqualified products.
A control method with a friction link is used to control the main turntable servo motor, combined with an anisotropic stepper motor, to guide the workpiece to the corresponding detection position through precise angular rotation, a photoelectric switch is used to record the rotation angle, and the first and second detection components are combined Visual image processing is used to judge the detection results to ensure accurate sorting of workpieces.
It improves the accuracy of workpiece detection and sorting, reduces the misjudgment rate, ensures that workpieces correctly enter the corresponding temporary storage container, and improves detection and sorting efficiency.
Smart Images

Figure CN115430612B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of detection and sorting technology, and more specifically, to a workpiece rotation detection and sorting method and a rotation detection and sorting system. Background Art
[0002] In the production process of screws, nuts, studs and other workpieces, appearance inspection and product identification are becoming more and more important. For different types of workpieces, their length, thread and identification need to be inspected, and only qualified workpieces can be used normally by users. Traditional manual inspection is costly, slow, and inefficient, and workers are prone to fatigue, which makes the subjectivity of sorting personnel restrict the accuracy of sorting, resulting in a high error rate, which does not meet current production requirements.
[0003] In the relevant field, there are corresponding detection and sorting settings to replace manual sorting. For example, the Chinese patent document with publication number CN106391511A discloses a screw omnidirectional detector, which includes a frame, a vibration disk arranged on one side of the frame, a transparent turntable arranged on the surface of the frame, a CCD station, a beam optical fiber, and a material receiving mechanism, wherein the transparent turntable is driven to rotate by a servo motor; the vibration disk is connected to a feeding guide rail, and the feeding guide rail is arranged on the outer edge of the turntable; the CDD station includes a tooth damage detection station, a height detection station, a top detection station, and a bottom detection station, and the beam optical fiber, the tooth damage detection station and the material receiving mechanism are arranged in sequence along the rotation direction of the transparent turntable. The height detection station, the top detection station, and the bottom detection station are arranged between the four tooth damage detection stations.
[0004] For another example, a Chinese patent document with publication number CN109277315A discloses a screw sorting machine, which includes a workbench with a rotating chuck provided on the workbench, a feeding device, a first detection device, a second detection device, a third detection device, a first waste discharge device, a second waste discharge device, a third waste discharge device and a discharging device are provided in sequence along the rotation direction of the rotating chuck in the circumference of the rotating chuck, and a rotating detection device is provided on the workbench corresponding to the second detection device, a plurality of U-shaped grooves arranged at equal intervals for clamping screws are provided on the outer peripheral wall of the rotating chuck, and a baffle is provided in the circumference of the rotating chuck to prevent the screws from falling off.
[0005] Although the above-mentioned inspection and sorting machine uses multiple inspection components to inspect various parts of the workpiece, the control of its turntable is not precise enough, so that the workpiece sometimes cannot accurately reach the inspection station corresponding to the inspection component, resulting in the inspection component being unable to correctly detect the length, thread, marking and other indicators of the workpiece, thereby increasing the error rate of the inspection and sorting machine. Summary of the invention
[0006] The invention provides a workpiece rotation detection and sorting method and a rotation detection and sorting system, aiming to improve the accuracy of workpiece detection and sorting.
[0007] In order to achieve the above object, the technical solution provided by the present invention is:
[0008] A workpiece rotation detection and sorting method of the present invention comprises the following steps:
[0009] Step 1: The workpiece is transported from the loading port to the main turntable, and the main turntable is driven by the driving system to rotate with the workpiece;
[0010] Step 2: The workpiece rotates to the photoelectric switch and starts recording the rotation angle of the main turntable;
[0011] Step 3: After the main turntable rotates by a first angle, the workpiece stays at a first detection position, and the first detection component detects the workpiece;
[0012] Step 4: After the first detection component completes the detection, the main turntable continues to rotate; after the main turntable rotates by a second angle, the workpiece stays at the second detection position, and the second detection component detects the workpiece;
[0013] Step 5: After the second inspection component has finished the inspection, determine whether the workpiece is qualified and whether re-inspection is required according to the inspection results of the first inspection component and the second inspection component;
[0014] If the workpiece is judged to be qualified, after the main turntable rotates by a third angle, the workpiece stays at the qualified workstation, and the first blowing port starts blowing air to blow the workpiece into a qualified product temporary storage container;
[0015] If the workpiece is judged to be unqualified, after the main turntable rotates to a fourth angle, the workpiece stays at the unqualified position, and the second blowing port starts blowing air to blow the workpiece into a temporary storage container for unqualified products;
[0016] If it is determined that the workpiece needs to be re-inspected, after the main turntable rotates to the fifth angle, the workpiece stays at the re-inspection station, and the third blowing port starts blowing air to blow the workpiece into the re-inspection product temporary storage container;
[0017] Among them, in the steps 1 to 5, the driving system includes a main turntable servo motor and a counter-rotating stepper motor, and the main turntable servo motor is controlled by a control method with a friction link, and the dynamic equation of the main turntable servo motor is:
[0018]
[0019] Where: is the first-order derivative of the main turntable servo motor's rotation angle with respect to time; K is the second-order derivative of the main turntable servo motor angle with respect to time; m is the motor torque coefficient; C e is the voltage feedback coefficient; J is the moment of inertia; R is the armature resistance; K u is the power amplifier gain factor; u(t) is the control input, i.e., the driving force; F f (t) is the friction force as a function of time.
[0020] Furthermore, in the steps 1 to 5,
[0021] when hour,
[0022]
[0023] when hour,
[0024]
[0025] Where F(t) is the driving force; F m is the maximum static friction; F c is the Coulomb friction force; k v is the proportional coefficient of the viscous friction torque; α and α1 are very small, positive constants.
[0026] Furthermore, in step 3 and step 4, F c 15N·m, F m 20N·m, k v is 2Nms / rad, α is 0.01, and α1 is 1.
[0027] Furthermore, in the steps 1 to 5, the transfer function of the non-rotating stepping motor is:
[0028]
[0029] Furthermore, in steps three to five, a first task is configured for the first detection component, and the first task includes completing the setting of the first detection component, collecting the workpiece image, visual image processing and judgment, and entering the result queue; a second task is configured for the second detection component, and the second task includes completing the setting of the second detection component, collecting the workpiece image, visual image processing and judgment, and entering the result queue, counting the total time consumed by the current task, and counting the total time consumed by the current task.
[0030] Furthermore, the processing flow of the first task includes the following steps:
[0031] S11, setting parameters of the first detection component;
[0032] S12, defining the visual image processing and judgment result CAM1_RESULT of the first detection component; defining the image parameter variables; then, the first detection component starts to collect the image information of the workpiece;
[0033] S13, determining whether the image information of the workpiece is collected in step S12; if the image information of the workpiece is collected, executing step S14; if the image information of the workpiece is not collected, ending the first task;
[0034] S14, perform visual image processing and judgment on the collected image information, and return the result to CAM1_RESULT; enter the result queue of the visual image processing and judgment of the first detection component into a queue with an index number of 0.
[0035] Furthermore, the processing flow of the second task includes the following steps:
[0036] S21, setting parameters of the second detection component;
[0037] S22, define the visual image processing and judgment result CAM2_RESULT of the second detection component; define image parameter variables; define the total time-consuming time variable of the current task;
[0038] S23, initializing a timer for counting the total time consumed by the current task;
[0039] S24, the second detection component starts to collect image information of the workpiece;
[0040] S25, determining whether the image information of the workpiece is collected in step S24; if the image information of the workpiece is collected, executing step S26; if the image information of the workpiece is not collected, terminating the second task;
[0041] S26, perform visual image processing and judgment on the collected image information, and return the result to CAM2_RESULT; enter the result queue of the visual image processing and judgment of the second detection component into the queue, with the index number being 1;
[0042] S27, the timer for counting the total time consumed by the current task ends, and the total time consumed by the current task is obtained;
[0043] S28. The total time taken for the current task is queued.
[0044] Further, after the first task and the second task are completed, a third task is configured to count the detection results, and the third task includes the following steps:
[0045] S31, configure Ethernet;
[0046] S32, the result queues of the visual image processing and judgment of the first detection component and the second detection component are dequeued;
[0047] S33, the total time-consuming time data of the current task is dequeued. If the total time-consuming time data of the current task is dequeued successfully, the total time-consuming time of the current task is accumulated;
[0048] S34, if the result queue of visual image processing and judgment is successfully dequeued, the result of visual image processing and judgment is subjected to comprehensive judgment processing, the result is generated into ASCII text, and the communication task flow is carried out through Ethernet, and the ASCII text is sent to the controller; at the same time, the current task is subjected to statistics on the number of detections, conversion of detection efficiency, and initialization of the accumulated time;
[0049] S35, setting the statistical results of the number of detections and the conversion results of the detection efficiency on a display interface electrically connected to the controller, and adding a control button;
[0050] S36. In the communication task process, multiple branch node processes are added, corresponding to the control buttons in the interface, and the control buttons include: initializing the inspection queue, starting, emergency pause, clearing the workpieces to be inspected on the table, and stopping loading.
[0051] Furthermore, between step S31 and step S32, a user variable definition step is also included, and the user variable definition step includes: defining a total number count TOTAL_No of workpieces, defining a result queue sequence number count variable QUEUE_No, defining a result of visual image processing and judgment of the first detection component that is out of the queue QUE_RESULT1, defining a result of visual image processing and judgment of the second detection component that is out of the queue QUE_RESULT2, defining a temporary processing result data TEMP_RESULT, defining a first defect count NG1_COUNT, defining a second defect count NG2_COUNT, defining a yield rate OK_RATE of workpiece detection, defining a count value CNT100_LOOP for loop counting to 100 workpieces, when the count reaches 100, set it to zero, defining a cumulative variable TIME_SUM of the total time consumed by the current task, and defining a speed STAT_VEL for statistically detecting workpieces;
[0052] The step S32 comprises the following steps:
[0053] S321, set variable, QUE_RESULT1 = data out of queue.CCD1_R;
[0054] S322, set variable, QUE_RESULT2 = data out of queue.CCD2_R;
[0055] S323, combining the results of visual image processing and judgment of the first detection component and the second detection component into one result;
[0056] S324, generate the final result text: in the system tool, use the text generation tool, the text content is: M%d=%d, the connected numbers are the queue numbers QUEUE_No and TEMP_RESULT;
[0057] S325: Send the final result text to the controller.
[0058] A rotating detection and sorting system for implementing the above-mentioned workpiece rotating detection and sorting method of the present invention comprises a main turntable, a loading port, a photoelectric switch, a first detection component, a second detection component, a first air port, a second air port and a third air port arranged along the circumference of the main turntable, as well as a temporary storage container for qualified products, a temporary storage container for unqualified products, and a temporary storage container for re-tested products; the temporary storage container for qualified products is located in front of the blowing direction of the first air port, the temporary storage container for unqualified products is located in front of the blowing direction of the second air port, and the temporary storage container for re-tested products is located in front of the blowing direction of the third air port.
[0059] Compared with the prior art, the technical solution provided by the present invention has the following beneficial effects:
[0060] (1) The workpiece rotation detection and sorting method of the present invention controls the main turntable servo motor of the drive system through a control method with a friction link. On the one hand, it can improve the success rate of the workpiece correctly rotating to the first detection position and the second detection position, thereby improving the accuracy of the first detection component and the second detection component in detecting the workpiece; on the other hand, it can enable the workpiece to be correctly rotated to the qualified position, the unqualified position and the re-inspection position, thereby ensuring that the workpiece can be accurately blown into the corresponding temporary storage container, preventing the workpiece from falling off or falling into the wrong temporary storage container, thereby improving the accuracy of workpiece sorting.
[0061] (2) The workpiece rotation detection and sorting system of the present invention comprises a main turntable, a loading port, a photoelectric switch, a first detection component, a second detection component, a first air blow port, a second air blow port and a third air blow port, and is used to implement the workpiece rotation detection and sorting method of the present invention, which has high workpiece detection accuracy and workpiece sorting accuracy, and high workpiece detection and sorting efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 It is a structural schematic diagram of the workpiece rotation detection and sorting system of the present invention;
[0063] Figure 2 A control architecture diagram of the drive system in the present invention;
[0064] Figure 3 The friction force of the drive system of the present invention varies with angular velocity;
[0065] Figure 4 Schematic diagram of position tracking and speed tracking in the present invention. DETAILED DESCRIPTION
[0066] In order to further understand the content of the present invention, the present invention is described in detail in conjunction with the accompanying drawings and embodiments.
[0067] The structures, proportions, sizes, etc. illustrated in the drawings of this specification are only used to match the contents disclosed in the specification for people familiar with this technology to understand and read, and are not used to limit the limiting conditions for the implementation of the present invention, so they have no substantial technical significance. Any modification of the structure, change of the proportion relationship or adjustment of the size, without affecting the effects and purposes that can be achieved by the present invention, should still fall within the scope of the technical content disclosed by the present invention. At the same time, the terms such as "upper", "lower", "left", "right", "middle" and so on quoted in this specification are only for the convenience of description, and are not used to limit the scope of implementation. The change or adjustment of their relative relationship should also be regarded as the scope of implementation of the present invention without substantially changing the technical content.
[0068] This embodiment provides a rotation detection and sorting system for inspecting the length, thread, and mark of a workpiece, and sorting the workpiece according to the detection results. Figure 1 The rotary detection and sorting system includes a main turntable 100, a loading port 210, a first air blowing port 220, a second air blowing port 230, a third air blowing port 240, a photoelectric switch 310, a first detection component 320 and a second detection component 330. The loading port 210, the photoelectric switch 310, the first detection component 320, the second detection component 330, the first air blowing port 220, the second air blowing port 230 and the third air blowing port 240 are arranged along the circumferential direction of the main turntable 100.
[0069] The workpiece enters the main turntable 100 from the loading port 210, and the main turntable 100 rotates with the workpiece. When the workpiece rotates to the photoelectric switch 310, the photoelectric switch 310 is triggered and starts to record the rotation angle of the main turntable 100, that is, the rotation angle of the workpiece. Figure 1, the straight line connected between the center point of the photoelectric switch 310 and the center point of the main turntable 100 is the reference line, the angle between the straight line connected between the first side of the first detection component 320 and the center point of the main turntable 100 and the reference line is θ1, the angle between the straight line connected between the second side of the first detection component 320 and the center point of the main turntable 100 and the reference line is θ2, the angle between the straight line connected between the first side of the second detection component 330 and the center point of the main turntable 100 and the reference line is θ3, the angle between the straight line connected between the second side of the second detection component 330 and the center point of the main turntable 100 and the reference line is θ4, the first side of the first blowing port 220 and the center point of the main turntable 100 are connected to the first side of the first blowing port 220 and the center point of the main turntable 100. The angle between the straight line connected to the center point of the first blow port 220 and the reference line is θ5, the angle between the straight line connected to the center point of the main turntable 100 and the reference line is θ6, the angle between the straight line connected to the first side of the second blow port 230 and the center point of the main turntable 100 and the reference line is θ7, the angle between the straight line connected to the second side of the second blow port 230 and the center point of the main turntable 100 and the reference line is θ8, the angle between the straight line connected to the first side of the third blow port 240 and the center point of the main turntable 100 and the reference line is θ9, the angle between the straight line connected to the second side of the third blow port 240 and the center point of the main turntable 100 and the reference line is θ10, and the angle between the straight line connected to the center point of the main turntable 100 and the reference line is θ11. 10 .
[0070] When the workpiece passes through the photoelectric switch 310 and rotates the first angle, the workpiece stays at the first detection position, and the first detection component 320 completes the detection of the workpiece, and the first angle is θ1+(θ2-θ1) / 2; after the first detection component 320 completes the detection, the workpiece rotates the second angle, and stays at the second detection position, and the second detection component 330 completes the detection of the workpiece, and the second angle is (θ3-θ2)+(θ4-θ3) / 2.
[0071] After the second detection component 330 completes the detection, it is determined whether the workpiece is qualified and whether re-inspection is required based on the detection results of the first detection component 320 and the second detection component 330. If the workpiece is determined to be qualified,
[0072] Specifically, after the main turntable 100 rotates the third angle, the workpiece stays at the qualified station, the first air outlet 220 starts blowing, and blows the workpiece into the qualified product temporary storage container, and the third angle is (θ5-θ4)+(θ6-θ5) / 2; if the workpiece is judged to be unqualified, after the main turntable 100 rotates the fourth angle, the workpiece stays at the unqualified station, the second air outlet 230 starts blowing, and blows the workpiece into the unqualified product temporary storage container, and the second angle is (θ7-θ6)+(θ8-θ7) / 2; if it is judged that the workpiece needs to be re-inspected, after the main turntable 100 rotates the fifth angle, the workpiece stays at the re-inspection station, the third air outlet 240 starts blowing, and blows the workpiece into the re-inspection product temporary storage container, and the second angle is (θ9-θ8)+(θ9-θ10) / 2. 10-θ9) / 2.
[0073] In this embodiment, the main turntable 100 can be powered by a driving system to rotate. Specifically, the driving system includes a main turntable servo motor 130 and an opposite direction stepping motor 140, and the main turntable servo motor 130 and the opposite direction stepping motor 140 are connected to the main turntable 100 in a transmission manner. A guide wheel 110 is also provided on the main turntable 100 to limit the rotation direction of the main turntable 100. Both the first detection component 320 and the second detection component 330 can be CCD cameras.
[0074] In addition, this embodiment also provides a workpiece rotation detection and sorting method. The rotation detection and sorting method of this embodiment can be implemented using the workpiece rotation detection and sorting system of this embodiment, or can be implemented using equipment such as screw omnidirectional detectors and screw sorting machines in related fields.
[0075] The workpiece rotation detection and sorting method of this embodiment specifically includes the following steps:
[0076] Step 1: The workpiece is transported from the loading port to the main turntable, and the main turntable rotates with the workpiece under the drive of the drive system.
[0077] Step 2: The workpiece rotates to the photoelectric switch and starts recording the rotation angle of the main turntable.
[0078] Step 3: After the main turntable rotates to a first angle, the workpiece stays at a first detection position, and the first detection component detects the workpiece.
[0079] The first detection component detects the workpiece by configuring the first task for the first detection component. The first task includes completing the setting of the first detection component, collecting the workpiece image, visual image processing and judgment, and entering the result queue. The first task specifically includes the following steps:
[0080] S11, setting parameters of the first detection component;
[0081] S12, defining the visual image processing and judgment result CAM1_RESULT of the first detection component; defining the image parameter variables; then, the first detection component starts to collect the image information of the workpiece;
[0082] S13, determining whether the image information of the workpiece is collected in step S12; if the image information of the workpiece is collected, executing step S14; if the image information of the workpiece is not collected, ending the first task;
[0083] S14, perform visual image processing and judgment on the collected image information, and return the result to CAM1_RESULT; enter the result queue of the visual image processing and judgment of the first detection component into a queue with an index number of 0.
[0084] Step 4: After the first detection component completes the detection, the main turntable continues to rotate; after the main turntable rotates to a second angle, the workpiece stays at the second detection position, and the second detection component detects the workpiece.
[0085] The second detection component detects the workpiece by configuring the second task for the second detection component. The second task includes completing the setting of the second detection component, collecting the workpiece image, visual image processing and judgment, entering the result queue, counting the total time consumed by the current task, and entering the total time consumed by the current task into the queue. The second task specifically includes the following steps:
[0086] S21, setting parameters of the second detection component;
[0087] S22, define the visual image processing and judgment result CAM2_RESULT of the second detection component; define image parameter variables; define the total time-consuming time variable of the current task;
[0088] S23, initializing a timer for counting the total time consumed by the current task;
[0089] S24, the second detection component starts to collect image information of the workpiece;
[0090] S25, determining whether the image information of the workpiece is collected in step S24; if the image information of the workpiece is collected, executing step S26; if the image information of the workpiece is not collected, terminating the second task;
[0091] S26, perform visual image processing and judgment on the collected image information, and return the result to CAM2_RESULT; enter the result queue of the visual image processing and judgment of the second detection component into the queue, with the index number being 1;
[0092] S27, the timer for counting the total time consumed by the current task ends, and the total time consumed by the current task is obtained;
[0093] S28. The total time taken for the current task is queued.
[0094] Step 5: After the second inspection component is inspected, determine whether the workpiece is qualified and whether re-inspection is required based on the inspection results of the first inspection component and the second inspection component.
[0095] If the workpiece is judged to be qualified, the main turntable rotates to the third angle, the workpiece stays at the qualified position, the first blowing port starts to blow air, and the workpiece is blown into the qualified product temporary storage container;
[0096] If the workpiece is judged to be unqualified, the main turntable rotates to the fourth angle, the workpiece stays at the unqualified position, the second blowing port starts to blow air, and blows the workpiece into the unqualified temporary storage container;
[0097] If it is determined that the workpiece needs to be re-inspected, after the main turntable rotates to the fifth angle, the workpiece stays at the re-inspection station, the third blowing port starts blowing, and blows the workpiece into the re-inspection product temporary storage container.
[0098] The third task is configured to complete the statistics, processing and judgment of the detection results of the first detection component and the second detection component. The third task specifically includes the following steps:
[0099] S31, configure Ethernet;
[0100] S32, the result queues of the visual image processing and judgment of the first detection component and the second detection component are dequeued;
[0101] S33, the total time-consuming time data of the current task is dequeued. If the total time-consuming time data of the current task is dequeued successfully, the total time-consuming time of the current task is accumulated;
[0102] S34, if the result queue of visual image processing and judgment is successfully dequeued, the result of visual image processing and judgment is subjected to comprehensive judgment processing, the result is generated into ASCII text, and the communication task flow is carried out through Ethernet, and the ASCII text is sent to the controller; at the same time, the current task is subjected to statistics on the number of detections, conversion of detection efficiency, and initialization of the accumulated time;
[0103] S35, setting the statistical results of the number of detections and the conversion results of the detection efficiency on a display interface electrically connected to the controller, and adding a control button;
[0104] S36. In the communication task process, multiple branch node processes are added, corresponding to the control buttons in the interface, and the control buttons include: initializing the inspection queue, starting, emergency pause, clearing the workpieces to be inspected on the table, and stopping loading.
[0105] In addition, between the step S31 and the step S32, a user variable definition step is also included, and the user variable definition step includes: defining a total number count TOTAL_No of workpieces, defining a result queue sequence number count variable QUEUE_No, defining a result of visual image processing and judgment of the first detection component that is out of the queue QUE_RESULT1, defining a result of visual image processing and judgment of the second detection component that is out of the queue QUE_RESULT2, defining a temporary processing result data TEMP_RESULT, defining a first defect count NG1_COUNT, defining a second defect count NG2_COUNT, defining a good count OK_COUNT of workpiece detection, defining a defect count NG_COUNT of workpiece detection, defining a yield rate OK_RATE of workpiece detection, defining a count value CNT100_LOOP for loop counting to 100 workpieces, when the count reaches 100, set it to zero, defining an accumulation variable TIME_SUM of the total time-consuming time of the current task, and defining a speed STAT_VEL for statistically detecting workpieces;
[0106] The step S32 comprises the following steps:
[0107] S321, set variable, QUE_RESULT1 = data out of queue.CCD1_R;
[0108] S322, set variable, QUE_RESULT2 = data out of queue.CCD2_R;
[0109] S323, combining the results of visual image processing and judgment of the first detection component and the second detection component into one result;
[0110] S324, generate the final result text: in the system tool, use the text generation tool, the text content is: M%d=%d, the connected numbers are the queue numbers QUEUE_No and TEMP_RESULT;
[0111] S325: Send the final result text to the controller.
[0112] More specifically, in step S323, the process of combining the results of visual image processing and judgment of the first detection component and the second detection component into one result is:
[0113] Let QUEUE_No be TOTAL_No & 1023; if QUE_RESULT1 is 0, then NG1_COUNT is incremented by 1; if QUE_RESULT2 is 0, then NG2_COUNT is incremented by 1; if QUE_RESULT1 and QUE_RESULT2 are both 1, then TEMP_RESULT is 48 and OK_COUNT is incremented by 1; otherwise, EMP_RESULT is 192 and NG_COUNT is incremented by 1. The value of UNT is accumulated by 1; then, the value of TOTAL_No is accumulated by 1, OK_RATE is 100*OK_COUNT / TOTAL_No, and the value of CNT100_LOOP is accumulated by 1; if the value of CNT100_LOOP is greater than or equal to 100, set the value of CNT100_LOOP to 0; set the value of STAT_VEL to 6000000 / TIME_SUM, and set TIME_SUM=0; when the value of TIME_SUM is greater than 6000000, set the value of STAT_VEL to 0.
[0114] In the workpiece rotation detection and sorting method of this embodiment, in steps 1 to 5, the driving system includes a main turntable servo motor and a counter-rotating stepper motor. The main turntable servo motor is controlled by a control method with a friction link, and a sinusoidal signal is provided by a signal generator 120. The dynamic equation of the main turntable servo motor is:
[0115]
[0116] Where: is the first-order derivative of the main turntable servo motor's rotation angle with respect to time; K is the second-order derivative of the main turntable servo motor angle with respect to time; m is the motor torque coefficient; C e is the voltage feedback coefficient; J is the moment of inertia; R is the armature resistance; K u is the power amplifier gain factor; u(t) is the control input, i.e., the driving force; F f (t) is the friction force as a function of time.
[0117] Among them, the function of friction force on time is F f (t),
[0118] when hour,
[0119]
[0120] when hour,
[0121]
[0122] Where F(t) is the driving force; F m is the maximum static friction; F c is the Coulomb friction force; k v is the proportional coefficient of the viscous friction torque; α and α1 are very small, positive constants.
[0123] Figure 2 The drive system control architecture of the workpiece rotation detection and sorting method of this embodiment is shown. Specifically, the secondary loop PID control rate of the main turntable servo motor is:
[0124]
[0125] The PID control rate of the main loop that controls the stepper motor and the auxiliary loop is:
[0126]
[0127] The transfer function of the counter-rotating stepper motor is,
[0128]
[0129] As a specific example of this implementation, in step 3 and step 4, F c 15N·m, F m 20N·m, k v is 2Nms / rad, α is 0.01, and α1 is 1. In this embodiment, R is 8.33Ω, K m 4N·m / A, C e is 1.2V / (rad / s), J is 0.5kg·m 2 , K u It is 11V / V; P1 value is 13.6666550010431, I1 value is 7.6202118844652, D1 value is 5.44600939946391, N1 value is 10922.5627369282, P2 value is 22.1086429945789, I2 value is 92.0335499067832, D2 value is 1.32285001458007, and N2 value is 4962.25028927777.
[0130] Substituting the values of the above parameters into equations (1) to (6), we can obtain the position tracking and velocity tracking result graphs, as well as the friction force versus angular velocity graph. Figure 3 and Figure 4In the presence of friction, the cascade PID control scheme of the present application achieves good trajectory tracking and speed maintenance effects for the hybrid complex system composed of the main rotating disk servo motor and the guide stepper motor.
[0131] The present invention and its embodiments are described schematically above, and the description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. Therefore, if a person skilled in the art is inspired by it and designs a structural method and an embodiment similar to the technical solution without creativity without departing from the purpose of the invention, they shall all fall within the protection scope of the present invention.
Claims
1. A workpiece rotation detection and sorting method, characterized in that: The following steps are included: Step 1: The workpiece is transported from the loading port to the main turntable, and the main turntable is driven by the driving system to rotate with the workpiece; Step 2: The workpiece rotates to the photoelectric switch and starts recording the rotation angle of the main turntable; Step 3: After the main turntable rotates by a first angle, the workpiece stays at a first detection position, and the first detection component detects the workpiece; Step 4: After the first detection component completes the detection, the main turntable continues to rotate; after the main turntable rotates by a second angle, the workpiece stays at the second detection position, and the second detection component detects the workpiece; Step 5: After the second inspection component has finished the inspection, determine whether the workpiece is qualified and whether re-inspection is required according to the inspection results of the first inspection component and the second inspection component; If the workpiece is judged to be qualified, after the main turntable rotates by a third angle, the workpiece stays at the qualified workstation, and the first blowing port starts blowing air to blow the workpiece into a qualified product temporary storage container; If the workpiece is judged to be unqualified, after the main turntable rotates by a fourth angle, the workpiece stays at the unqualified position, and the second blowing port starts blowing air to blow the workpiece into a temporary storage container for unqualified products; If it is determined that the workpiece needs to be re-inspected, after the main turntable rotates to the fifth angle, the workpiece stays at the re-inspection station, and the third blowing port starts blowing air to blow the workpiece into the re-inspection product temporary storage container; Among them, in the steps 1 to 5, the driving system includes a main turntable servo motor and a counter-rotating stepper motor, and the main turntable servo motor is controlled by a control method with a friction link, and the dynamic equation of the main turntable servo motor is: Where: is the first-order derivative of the main turntable servo motor's rotation angle with respect to time; K is the second-order derivative of the main turntable servo motor angle with respect to time; m is the motor torque coefficient; C e is the voltage feedback coefficient; J is the moment of inertia; R is the armature resistance; K u is the power amplifier gain factor; u(t) is the control input, i.e., the driving force; F f (t) is the friction force as a function of time.
2. A workpiece rotation detection and sorting method according to claim 1, characterized in that: In the steps 1 to 5, when hour, when hour, Where F(t) is the driving force; F m is the maximum static friction; F c is the Coulomb friction force; k v is the proportional coefficient of the viscous friction torque; α and α1 are very small, positive constants.
3. A workpiece rotation detection and sorting method according to claim 2, characterized in that: In the steps 3 and 4, F c 15N·m, F m 20N·m, k v is 2Nms / rad, α is 0.01, and α1 is 1.
4. A workpiece rotation detection and sorting method according to claim 1, characterized in that: In the steps 1 to 5, the transfer function of the counter-rotating stepping motor is: 。 5. A workpiece rotation detection and sorting method according to claim 1, characterized in that: In steps three to five, a first task is configured for the first detection component, and the first task includes completing the setting of the first detection component, collecting the workpiece image, visual image processing and judgment, and entering the result queue; a second task is configured for the second detection component, and the second task includes completing the setting of the second detection component, collecting the workpiece image, visual image processing and judgment, and entering the result queue, counting the total time consumed by the current task, and counting the total time consumed by the current task.
6. A workpiece rotation detection and sorting method according to claim 5, characterized in that: The processing flow of the first task includes the following steps: S11, setting parameters of the first detection component; S12, defining the visual image processing and judgment result CAM1_RESULT of the first detection component; defining the image parameter variables; then, the first detection component starts to collect the image information of the workpiece; S13, determining whether the image information of the workpiece is collected in step S12; if the image information of the workpiece is collected, executing step S14; if the image information of the workpiece is not collected, ending the first task; S14, perform visual image processing and judgment on the collected image information, and return the result to CAM1_RESULT; enter the result queue of the visual image processing and judgment of the first detection component into a queue with an index number of 0.
7. A workpiece rotation detection and sorting method according to claim 6, characterized in that: The processing flow of the second task includes the following steps: S21, setting parameters of the second detection component; S22, define the visual image processing and judgment result CAM2_RESULT of the second detection component; define image parameter variables; define the total time-consuming time variable of the current task; S23, initializing a timer for counting the total time consumed by the current task; S24, the second detection component starts to collect image information of the workpiece; S25, determining whether the image information of the workpiece is collected in step S24; if the image information of the workpiece is collected, executing step S26; if the image information of the workpiece is not collected, terminating the second task; S26, perform visual image processing and judgment on the collected image information, and return the result to CAM2_RESULT; enter the result queue of the visual image processing and judgment of the second detection component into the queue, with the index number being 1; S27, the timer for counting the total time consumed by the current task ends, and the total time consumed by the current task is obtained; S28. The total time taken for the current task is queued.
8. A workpiece rotation detection and sorting method according to claim 7, characterized in that: After the first and second tasks are completed, a third task is configured to collect statistics on the detection results. The third task includes the following steps: S31, configure Ethernet; S32, the result queues of the visual image processing and judgment of the first detection component and the second detection component are dequeued; S33, the total time-consuming time data of the current task is dequeued, and if the total time-consuming time data of the current task is dequeued successfully, the total time-consuming time of the current task is accumulated; S34, if the result queue of visual image processing and judgment is successfully dequeued, the result of visual image processing and judgment is subjected to comprehensive judgment processing, the result is generated into ASCII text, and the communication task flow is carried out through Ethernet, and the ASCII text is sent to the controller; at the same time, the current task is subjected to statistics on the number of detections, conversion of detection efficiency, and initialization of the accumulated time; S35, setting the statistical results of the number of detections and the conversion results of the detection efficiency on a display interface electrically connected to the controller, and adding a control button; S36. In the communication task process, multiple branch node processes are added, corresponding to the control buttons in the interface, and the control buttons include: initializing the inspection queue, starting, emergency pause, clearing the workpieces to be inspected on the table, and stopping loading.
9. A workpiece rotation detection and sorting method according to claim 8, characterized in that: Between step S31 and step S32, a user variable definition step is also included, and the user variable definition step includes: defining a total number count TOTAL_No of workpieces, defining a result queue sequence number count variable QUEUE_No, defining a result of visual image processing and judgment of the first detection component out of the queue QUE_RESULT1, defining a result of visual image processing and judgment of the second detection component out of the queue QUE_RESULT2, defining a temporary processing result data TEMP_RESULT, defining a first defect count NG1_COUNT, defining a second defect count NG2_COUNT, defining a yield rate OK_RATE of workpiece detection, defining a count value CNT100_LOOP for loop counting to 100 workpieces, when the count reaches 100, set it to zero, defining a cumulative variable TIME_SUM of the total time-consuming time of the current task, and defining a speed STAT_VEL for statistically detecting workpieces; The step S32 comprises the following steps: S321, set variable, QUE_RESULT1 = data out of queue.CCD1_R; S322, set variable, QUE_RESULT2 = data out of queue.CCD2_R; S323, combining the results of visual image processing and judgment of the first detection component and the second detection component into one result; S324, generate the final result text: in the system tool, use the text generation tool, the text content is: M%d=%d, the connected numbers are the queue numbers QUEUE_No and TEMP_RESULT; S325: Send the final result text to the controller.
10. A rotation detection and sorting system for implementing the workpiece rotation detection and sorting method according to any one of claims 1 to 9, characterized in that: The invention comprises a main turntable, a feeding port, a photoelectric switch, a first detection component, a second detection component, a first air port, a second air port and a third air port arranged along the circumference of the main turntable, as well as a temporary storage container for qualified products, a temporary storage container for unqualified products and a temporary storage container for retested products; the temporary storage container for qualified products is located in front of the blowing direction of the first air port, the temporary storage container for unqualified products is located in front of the blowing direction of the second air port, and the temporary storage container for retested products is located in front of the blowing direction of the third air port.
