A dual-vision fusion spin bottle deviation correction control method and system
Patent Information
- Application Number
- CN202610818854.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-08
- Publication Date
- 2026-09-25
AI Technical Summary
[0005]本申请实施例通过提供一种双视觉融合的旋瓶纠偏控制方法及系统,解决了现有旋瓶定位方法受限于算法精度和皮带控制策略,导致定位偏差大、适配性差的技术问题
[0020]本申请实施例通过提供一种双视觉融合的旋瓶纠偏控制方法及系统,首先,采用顶拍模式和侧拍双模式同步采集容器瓶身图像并加权融合角度信息,相较于传统单一视觉模式,能够有效规避瓶身反光、印刷色差、产线抖动带来的识别误差。其次,根据容器瓶径参数、产线基础线速度、旋转区长度计算双夹持皮带的初始转速差,还结合融合历史识别误差做前馈补偿,并基于连续执行偏差预测旋转趋势做动态修正,适配不同规格瓶型与产线速度波动,满足柔性生产需求。最后,增加二次视觉验证环节,实时统计定位结果,及时剔除不合格产品并更新融合历史识别误差,持续优化定位精度,有效提升了旋瓶定位的合格率与整条产线的生产稳定性。
Smart Images

Figure CN122809149A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of industrial vision technology, specifically to a dual-vision fusion method and system for controlling the rotation of bottles. Background Technology
[0002] In the bottling production line, after the bottles of wine and beverages are filled and capped, the positioning marks on the bottles need to be precisely rotated to a specified angle to meet the positional requirements of subsequent labeling, packing or visual inspection. Therefore, the bottle rotation positioning process is an indispensable and important step in the bottling production process. The accuracy of the bottle rotation correction directly affects the processing quality and production efficiency of subsequent processes.
[0003] However, most existing bottle rotation correction technologies use monocular vision to acquire positioning information and rely on a single viewpoint to extract angle values. When there is deformation of the container body, printing offset, or surface reflection interference, recognition errors are easily generated. At the same time, most control methods only use belt differential control with fixed parameters, without combining historical detection errors for feedforward compensation, and without secondary verification and error iteration update after rotation. This results in poor adaptability to different container sizes, and long-term operation can easily accumulate positioning deviations, making it difficult to meet the high-precision positioning requirements of high-speed production lines.
[0004] In addition, existing bottle rotation correction control methods are mostly open-loop control with fixed parameters, which cannot automatically adjust the bottle rotation action parameters according to the differences in specifications of different bottle types and the fluctuations in the conveying speed of the production line. They have poor adaptability and are difficult to meet the flexible production needs of multiple specifications and small batches. Summary of the Invention
[0005] This application provides a dual-vision fusion-based bottle rotation correction control method and system, which solves the technical problems of existing bottle rotation positioning methods being limited by algorithm accuracy and belt control strategies, resulting in large positioning deviations and poor adaptability.
[0006] The technical solution to the above-mentioned technical problems in this application is as follows:
[0007] In a first aspect, this application provides a dual-vision fusion method for controlling the rotation of a bottle, the method comprising:
[0008] Simultaneously acquire container bottle images, perform visual inspection and image preprocessing on the bottle images, and extract the current angle value of the current positioning mark relative to the reference point. The visual inspection includes top-shot mode and side-shot mode.
[0009] Read the target angle value from the recipe parameters, calculate the shortest path angle difference between the current angle value and the target angle value, and determine the rotation direction based on the shortest path angle difference;
[0010] Obtain the container's bottle diameter parameters, the production line's basic linear velocity, and the length of the rotating zone. Calculate the required initial speed difference of the double-clamping belts based on the shortest path angle difference.
[0011] The fusion history recognition error in the current visual detection mode is obtained, and the initial speed difference is compensated by the fusion history recognition error. An optimized control command is generated and sent to the lower-level controller through the serial communication protocol to drive the dual clamping belt actuator to run with the compensated speed difference, so that the container rotates to the target angle value during the movement.
[0012] After the rotation is completed, the camera is triggered again to capture images of the bottle for secondary visual verification, obtain the verification angle value after the actual rotation, calculate the execution deviation, and predict the rotation excess trend value of the next container based on the execution deviation. The rotation excess trend value is compared with the preset excess threshold, the positioning result is recorded, and the fusion history recognition error is updated based on the execution deviation.
[0013] Secondly, this application provides a dual-vision fusion bottle-spinning correction control system, comprising:
[0014] The visual inspection module is used to synchronously acquire images of the container body, perform visual inspection and image preprocessing on the bottle body images, and extract the current angle value of the current positioning mark relative to the reference point. The visual inspection includes top shooting mode and side shooting mode.
[0015] The shortest path angle difference acquisition module is used to read the target angle value in the recipe parameters, calculate the shortest path angle difference between the current angle value and the target angle value, and determine the rotation direction based on the shortest path angle difference.
[0016] The initial speed difference calculation module is used to obtain the container diameter parameters, the basic linear velocity of the production line and the length of the rotating area, and calculate the required initial speed difference of the double clamping belts based on the shortest path angle difference value.
[0017] The control command optimization module is used to obtain the historical recognition error under the current visual detection mode, perform feedforward compensation on the initial speed difference based on the historical recognition error, generate optimized control commands, and send the optimized control commands to the lower-level controller through the serial communication protocol to drive the dual-clamping belt actuator to run with the compensated speed difference, so that the container rotates to the target angle value during the movement.
[0018] The positioning result recording module is used to trigger the camera to capture images of the bottle again after the rotation action is completed for secondary visual verification, obtain the verification angle value after the actual rotation, calculate the current execution deviation, predict the rotation excess trend value of the next container based on the current execution deviation, compare the rotation excess trend value with the preset excess threshold, record the positioning result, and update the historical recognition error based on the current execution deviation.
[0019] This application provides one or more technical solutions, which have at least the following technical effects or advantages:
[0020] This application provides a dual-vision fusion-based bottle rotation correction control method and system. First, it employs both top-view and side-view modes to simultaneously acquire images of the bottle body and weightedly fuse angle information. Compared to traditional single-vision modes, this effectively avoids recognition errors caused by bottle reflection, printing color differences, and production line vibration. Second, it calculates the initial speed difference of the dual-clamping belts based on bottle diameter parameters, the basic production line speed, and the length of the rotating zone. It also incorporates feedforward compensation based on historical recognition errors and dynamically corrects the rotation trend based on continuous execution deviation prediction, adapting to different bottle sizes and production line speed fluctuations to meet flexible production requirements. Finally, a secondary vision verification step is added to statistically analyze positioning results in real time, promptly eliminating unqualified products and updating historical recognition errors, continuously optimizing positioning accuracy, and effectively improving the pass rate of bottle rotation positioning and the overall production line stability.
[0021] Through the above technical solution, this application can be adapted to different bottle types and production line conditions. The bottle rotation positioning accuracy and correction accuracy are significantly better than the traditional single vision open-loop control scheme, which can effectively reduce the defect rate of subsequent processes and improve the overall production efficiency of the filling production line. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a flowchart illustrating a dual-vision fusion-based bottle-rotation correction control method provided in an embodiment of this application.
[0024] Figure 2 This is a flowchart illustrating the calculation of the current angle value after fusion in a dual-vision fusion-based bottle correction control method provided in an embodiment of this application.
[0025] Figure 3This is a schematic diagram of a dual-vision fusion bottle-spinning correction control system provided in an embodiment of this application.
[0026] The components represented by each number in the attached diagram are explained below:
[0027] The system includes a visual inspection module 11, a shortest path angle difference acquisition module 12, an initial speed difference calculation module 13, a control command optimization module 14, and a positioning result recording module 15. Detailed Implementation
[0028] This application provides a dual-vision fusion bottle-spinning correction control method and system to address the technical problems of existing bottle-spinning positioning methods being limited by algorithm accuracy and belt control strategies, resulting in large positioning deviations and poor adaptability.
[0029] Example 1, as Figure 1 As shown, this application provides a dual-vision fusion-based bottle rotation correction control method, including:
[0030] S10: Synchronously acquire container bottle images, perform visual inspection and image preprocessing on the bottle images, and extract the current angle value of the current positioning mark relative to the reference point. The visual inspection includes top shooting mode and side shooting mode.
[0031] In this embodiment, images of the container bottle are acquired simultaneously using top-view and side-view modes, and the current angle value of the current positioning mark relative to the reference point is extracted. In the top-view mode, an industrial camera positioned directly above the top of the container takes a vertical downward shot to directly identify the positioning mark at the bottle mouth or cap. In the side-view mode, an industrial camera positioned on the side of the container takes a horizontal shot to identify the label positioning mark printed on the side wall of the bottle. The simultaneous acquisition of images in both modes can adapt to the positioning mark position settings of different bottle types, while reducing the interference of reflection and occlusion on the recognition results from a single viewing angle.
[0032] The acquired container bottle images are preprocessed, including grayscale conversion, filtering and noise reduction, contrast enhancement, and image cropping. After these processes, the effective area of the positioning markers can be segmented, reducing the impact of production line environmental interference on feature extraction.
[0033] The visual inspection of the bottle image includes:
[0034] The steps for visual inspection using top-down shooting mode include:
[0035] The Hough circle detection algorithm is used to detect the circular outline of the bottle mouth in the bottle body image and obtain the coordinates of the center of the bottle mouth.
[0036] A circular region of interest is defined with the center of the bottle mouth as the center, and a location marker is searched within the circular region of interest;
[0037] Extract the center point of the positioning mark, calculate the polar angle of the center point relative to the center of the bottle mouth, and use the polar angle as the first current angle value;
[0038] Visual inspection is performed using a side-view shooting mode, and the steps include:
[0039] A template matching algorithm is used to match a preset positioning mark template in the bottle image to obtain the coordinates of the center point of the matching area;
[0040] The arc length is calculated based on the pixel offset between the center point coordinates and the image reference point, combined with the bottle diameter parameter of the container, and then the second current angle value is calculated from the arc length.
[0041] The first current angle value and the second current angle value are weighted and fused according to the first confidence weight and the second confidence weight to obtain the fused current angle value;
[0042] The first confidence weight and the second confidence weight are calculated based on the historical recognition error of the top-shot mode and the historical recognition error of the side-shot mode.
[0043] In this embodiment, the steps of the top-shot mode are as follows: First, Hough circle detection is performed on the circular outline of the bottle mouth. By setting a range of circular radii, bottle mouth outlines that conform to the current bottle type specifications are filtered out, and other circular interferences in the production line background are eliminated to obtain the coordinates of the bottle mouth center. The Hough circle detection algorithm is an existing shape detection algorithm that can filter out circular outlines that meet the parameter conditions in the image space through a voting mechanism, and the detection accuracy meets the positioning requirements of the industrial site. After obtaining the coordinates of the bottle mouth center, a circular region of interest with a fixed radius is delineated with the center as the center, based on the bottle cap diameter of the current bottle type. The positioning marker is searched only within this region, which can reduce invalid calculations and improve the recognition speed. After the positioning marker is found, its center point coordinates are extracted. The polar angle of this point relative to the bottle mouth center is the first current angle value output by the top-shot mode.
[0044] The specific steps of the side-shot mode are as follows: The side-shot mode uses a template matching algorithm for feature matching based on the positioning marks on the side wall of the bottle. That is, the standard positioning marks are saved as templates in advance. The template matching algorithm is an existing feature matching algorithm in industrial images. By calculating the normalized cross-correlation coefficient between the image to be detected and the template, the matching region with the highest similarity is found. After determining the center point coordinates of the matching region, the pixel offset between the center point and the preset vertical baseline of the image is combined with the bottle diameter parameter of the current container. The actual rotation arc length is obtained using the arc length formula. Then, the second current angle value output by the side-shot mode is calculated by the ratio of the actual rotation arc length to the bottle radius. That is, the second current angle value = actual rotation arc length / bottle radius. The actual rotation arc length = pixel offset × actual length corresponding to a unit pixel. After obtaining the actual rotation arc length, the second current angle value output by the side-shot mode can be obtained.
[0045] like Figure 2 As shown, after both detection modes have completed angle extraction, the first confidence weight and the second confidence weight are calculated by combining the historical recognition error of each mode. The smaller the historical recognition error, the higher the corresponding confidence weight. Then, the current angle value is obtained by weighted fusion, which not only retains the information advantages of the two modes, but also dynamically adapts to more reliable recognition results under the current working conditions.
[0046] Furthermore, based on the historical recognition error of the top-shot mode and the side-shot mode, the calculation can be performed, for example, by using the first confidence weight = 1 - the normalized value of the historical recognition error of the top-shot mode, and the second confidence weight = 1 - the normalized value of the historical recognition error of the side-shot mode. The smaller the historical recognition error, the larger the corresponding weight. The normalization of the historical recognition error can be completed by (historical recognition error - minimum historical recognition error) / (maximum historical recognition error - minimum historical recognition error).
[0047] Specifically, image preprocessing includes:
[0048] The acquired bottle images are converted to grayscale, transforming the three-channel image into a single-channel grayscale image;
[0049] Gaussian filtering is used to reduce noise in the grayscale image;
[0050] A contrast-limited adaptive histogram equalization algorithm is used to enhance the contrast of the denoised image;
[0051] The enhanced image is cropped according to the preset region of interest parameters to extract the effective region containing the bottle opening and positioning marks.
[0052] In this embodiment, grayscale processing refers to the process of converting the three RGB channel components of a color image into a single grayscale luminance channel. The grayscale value is obtained by weighting the pixel values of the red, green, and blue channels according to different weights. While preserving the image contour and feature information, the computational load of subsequent image processing is reduced. For example, the pixel weight can adopt the classic 0.299R+0.587G+0.114B calculation method, which is compatible with the image acquisition format of most industrial cameras.
[0053] Gaussian filtering removes Gaussian noise from images collected in industrial settings by performing a weighted average of the pixel values in the image neighborhood according to a normal distribution. This smooths the image while preserving the overall grayscale distribution characteristics, preventing noise from interfering with subsequent contour detection and feature matching.
[0054] The contrast-limited adaptive histogram equalization algorithm differs from global histogram equalization. It divides the image into multiple continuous sub-regions and performs histogram equalization on each sub-region separately. At the same time, it limits the amplification of contrast. This can improve the contrast between the localization marker and the background under low light conditions without excessively amplifying local noise, thereby improving the stability of feature extraction under different lighting conditions.
[0055] Finally, the image is cropped according to the preset region of interest parameters for the current bottle shape, retaining only the valid area containing the bottle mouth and bottle body positioning marks, reducing the computational overhead of invalid areas and improving the processing speed of the entire visual inspection process.
[0056] Based on the above step S10, the current angle value of the fused dual-mode recognition information can be obtained, avoiding the positioning deviation caused by the failure of single-view recognition.
[0057] S20: Read the target angle value in the formula parameters, calculate the shortest path angle difference between the current angle value and the target angle value, and determine the rotation direction based on the shortest path angle difference;
[0058] In this embodiment, the target angle value is preset by the production formula according to the current production variety and is used to mark the target position that the bottle positioning mark needs to be rotated to reach.
[0059] There are multiple combinations of angle differences between the current angle value and the target angle value. If the rotation is driven by directly calculating the difference between the two, the rotation path may be too long and exceed the available travel range of the rotation area. Therefore, this application calculates the shortest path angle difference, which is in the range of [-180°, 180°]. If the difference is positive, the rotation direction is clockwise; if the difference is negative, the rotation is counterclockwise. If the absolute value of the angle difference is greater than 180°, the shortest path angle difference is obtained by subtracting the absolute value of 360° from the positive or negative angle difference. The clockwise or counterclockwise rotation direction is then determined based on the sign of the shortest path angle difference, ensuring that the container reaches the target position with the minimum rotation amplitude, reducing invalid rotation actions, and shortening the positioning time.
[0060] Based on the shortest path planning completed in step S20 above, it can be ensured that the container completes the angle adjustment within the limited length of the rotation area, avoiding positioning failure caused by insufficient rotation stroke.
[0061] S30: Obtain the container's bottle diameter parameters, the production line's basic linear velocity, and the length of the rotating area; calculate the required initial speed difference of the double-clamping belts based on the shortest path angle difference.
[0062] In this embodiment, the dual clamping belts are respectively arranged on the left and right sides of the container conveying channel. When they move in opposite directions at different speeds, they rely on the friction with the bottle body to drive the container to move and rotate at the same time. The travel time of the container in the rotation zone is equal to the length of the rotation zone divided by the basic linear velocity of the production line. This travel time is the total time available for angle adjustment. The total rotation angle to be completed is the absolute value of the shortest path angle difference. Therefore, the average rotational angular velocity required by the container can be calculated. Combined with the container diameter parameters, the initial speed difference that the dual clamping belts need to meet can be obtained to ensure that the container rotates to the target angle just as it leaves the rotation zone.
[0063] Specifically, step S30 in the method includes:
[0064] Based on the basic linear velocity of the production line and the length of the rotating zone, calculate the dwell time of the container in the rotating zone;
[0065] The angular velocity is calculated by the difference between the container's dwell time in the rotation zone and the shortest path angle.
[0066] Based on the bottle diameter parameters, calculate the initial linear velocity difference of the dual clamping belts;
[0067] Obtain the pulley diameter and transmission ratio of the double clamping belts, and convert the initial linear velocity difference into the target rotational speed values of the first belt and the second belt, respectively. The rotational speed difference between the first belt and the second belt is the initial linear velocity difference, and the resultant force of the rotational speeds of the two belts drives the container to rotate at an angular velocity.
[0068] In this embodiment of the application, firstly, based on the basic linear velocity of the production line and the length of the rotating zone, the residence time of the container in the rotating zone is calculated. The formula for calculating the residence time is as follows: Where L is the length of the rotating zone and v0 is the basic linear velocity of the production line.
[0069] Secondly, according to the formula The required average rotational angular velocity is calculated, where Δθ is the shortest path angular difference. Combined with the bottle diameter parameter r, the required initial linear velocity difference for the dual-clamping belts is obtained. Because the two belts rotate in opposite directions at different speeds, the difference in linear velocity is directly converted into the rotational linear velocity of the bottle, which in turn drives the container to rotate. After obtaining the initial difference in linear velocity, the linear velocity is converted into the target speed of the first belt and the second belt by combining the pulley diameter and transmission ratio of the two belts. The basic conveying speed of the two belts is matched with the basic linear velocity of the production line. The speed difference is then superimposed and distributed to obtain the target speed values of the first belt and the second belt.
[0070] Specifically, obtaining the pulley diameter and transmission ratio of the dual-clamping belts, and converting the initial linear velocity difference into target rotational speed values for the first belt and the second belt, respectively, includes:
[0071] Based on the basic linear velocity of the production line, the target linear velocity of the first belt and the target linear velocity of the second belt are calculated. The difference between the target linear velocity of the first belt and the target linear velocity of the second belt is equal to the initial linear velocity difference, and the sign of the difference is determined by the rotation direction.
[0072] Based on the target linear velocity of the first belt and the target linear velocity of the second belt, obtain the target rotational speed of the first belt and the target rotational speed of the second belt;
[0073] The pulleys of the first belt and the second belt have the same diameter and transmission ratio.
[0074] In this embodiment, firstly, the basic conveying line speeds of the two belts are obtained based on the basic line speed of the production line. Then, the speed difference increments are allocated to the two belts according to the rotation direction: if the left belt causes the container to rotate clockwise, when the container needs to rotate clockwise, the linear speed of the left belt is increased and the linear speed of the right belt is decreased, so that the target linear speed of the left belt minus the target linear speed of the right belt equals the initial linear speed difference; if counterclockwise rotation is required, the direction of the difference is adjusted to keep the average linear speed of the two belts consistent with the basic line speed of the production line, ensuring the overall conveying speed of the container is stable and does not affect the rhythm matching of the front and rear workstations.
[0075] For example, the formulas for the target linear velocity v1 of the first belt and the target linear velocity v2 of the second belt are v1=v0+Δv / 2 and v2=v0-Δv / 2, respectively. This allocation method can ensure that the average linear velocity of the two belts is always equal to the basic linear velocity v0 of the production line, avoid the container from moving back and forth in the conveying channel, and ensure smooth connection of workstations.
[0076] Then, combining the same pulley diameter and transmission ratio, the target linear velocity is converted into the target speed value of the corresponding motor, and the initial speed parameters are calculated. For example, according to the correspondence between motor speed and linear velocity, the target speed value of each belt is rpm=(v×60) / (π×pulley diameter mm / 1000) / transmission ratio.
[0077] Based on the above step S30, combined with the production line conveying parameters and bottle type parameters, the initial speed difference is calculated, which can provide a basic basis for speed adjustment in subsequent control, ensuring that the overall positioning adjustment process is adapted to the production line rhythm.
[0078] S40: Obtain the fusion history recognition error under the current visual detection mode, perform feedforward compensation on the initial speed difference based on the fusion history recognition error, generate an optimized control command, and send the optimized control command to the lower-level controller through the serial communication protocol to drive the dual-clamping belt actuator to run with the compensated speed difference, so that the container rotates to the target angle value during the movement.
[0079] In this embodiment, the fusion of historical identification error is obtained by fusing the historical identification errors of the first current angle value and the second current angle value, reflecting the reliability of the current angle value calculation result. If the fusion of historical identification error is large, it indicates that the current angle calculation result has a greater risk of deviation, and the initial speed difference is compensated and corrected.
[0080] Feedforward compensation reduces the impact of detection errors on rotation adjustment accuracy and improves positioning success rate. After the optimized control commands are generated, they are packaged according to the command format recognizable by the lower-level machine through a preset serial communication protocol and directly sent to the lower-level motion controller. The controller then controls the drive motors of the double clamping belts on both sides to operate stably according to the compensated speed difference. Ultimately, this drives the container to gradually adjust its angle as it travels through the rotation zone, rotating to the target angle just as it reaches the outlet, thus completing the intelligent control of the bottle rotation positioning detection. For example, the preset serial communication protocol can adopt the Modbus RTU protocol, which is widely used in industrial motion control, has strong anti-interference capabilities, and provides stable and reliable communication, thus meeting the communication requirements of the device and the lower-level controller of this invention.
[0081] The process of obtaining the fusion history recognition error under the current visual detection mode and performing feedforward compensation on the initial rotation speed difference based on the history recognition error includes:
[0082] Based on the historical recognition errors of the top-shot mode and the side-shot mode, the fused historical recognition error is obtained by weighting them according to the first confidence level weight and the second confidence level weight.
[0083] The initial speed difference is compensated based on a preset feedforward compensation coefficient;
[0084] When the fusion history identification error is positive, the rotation speed difference is increased to compensate in advance;
[0085] When the fusion history identification error is negative, the rotation speed difference is reduced to suppress excessive rotation.
[0086] In this embodiment of the application, firstly, the historical recognition errors of the top-shot mode and the side-shot mode are weighted and summed together with the first confidence weight and the second confidence weight calculated in step S10 to obtain the fused historical recognition error corresponding to the current recognition result. This fused historical recognition error comprehensively reflects the overall deviation level of the current angle measurement and is more comprehensive and reliable than the error assessment of a single mode.
[0087] Subsequently, the initial rotational speed difference is corrected based on the fusion of historical identification errors and the preset feedforward compensation coefficient: if the fusion of historical identification errors is positive, it means that the currently calculated angle value is smaller than the actual angle, and the rotational speed difference needs to be increased to compensate for the rotation amount to ensure that the rotation can be completed in the final position; if the fusion of historical identification errors is negative, it means that the currently calculated angle value is larger than the actual angle, and the rotational speed difference needs to be reduced to avoid excessive rotation. This compensation mechanism can effectively offset the impact of historical identification errors on the current adjustment process and further improve the accuracy of rotational positioning.
[0088] For example, the initial speed difference can be compensated by the formula Δv'=Δv+k×ef, where Δv' is the compensated initial linear velocity difference, Δv is the original calculated initial linear velocity difference, k is the preset feedforward compensation coefficient, and ef is the fusion history identification error obtained in this calculation. This formula realizes linear compensation of the error for the speed difference, which can meet the calculation requirements of real-time control of industrial production lines. The preset feedforward compensation coefficient can be calibrated and adjusted according to the mechanical friction characteristics of different production lines to adapt to different equipment operating conditions. For example, it can be selected in the range of 0.8-1.2 according to the actual debugging results of the production line.
[0089] Furthermore, the optimized control commands are sent to the lower-level controller via a serial communication protocol, including:
[0090] The target speed and execution time of the dual belts are assembled into a command frame according to the protocol format;
[0091] Calculate the cyclic redundancy check (CRC) code of the instruction frame, append the CRC code to the end of the instruction frame, and then send it out.
[0092] Start the timeout timer and wait for the confirmation response frame from the lower-level controller;
[0093] If no acknowledgment is received within the preset timeout period, the current command frame will be automatically retransmitted. Once the maximum number of retransmissions is reached, a communication failure alarm will be triggered.
[0094] It periodically sends heartbeat keep-alive command frames to monitor the status of the serial communication link, and automatically executes the disconnection and reconnection mechanism when a link disconnection is detected.
[0095] The serial communication protocol uses a custom frame format, which includes a frame header, command word, data length, data field, and checksum.
[0096] In this embodiment, the compensated dual-belt target speed and preset execution time are first assembled according to the agreed custom frame format, and then the frame header identifier, corresponding control command word, data length field, and data field composed of speed and time parameters are filled in sequentially.
[0097] Secondly, the cyclic redundancy check (CRC) code of the entire instruction frame is calculated and appended to the end of the instruction frame to complete the framing. This ensures that the data integrity during instruction transmission is verifiable. After framing is completed, transmission is initiated, and a preset timeout timer is started to wait for the lower-level controller to return an acknowledgment frame. If no valid acknowledgment frame is received within the timeout period, the transmission is considered a failure, and the currently assembled instruction frame is automatically retransmitted. When the cumulative number of retransmissions reaches the preset upper limit and no acknowledgment is received, a communication fault alarm signal is triggered to remind on-site maintenance personnel to check the communication link. The preset upper limit is set according to the average communication interference level in the industrial field, for example, it can be set to 3 times, which avoids false alarms caused by occasional interference and can promptly indicate continuous communication faults.
[0098] During normal operation of the equipment, heartbeat keep-alive command frames are sent to the lower-level computer at fixed intervals to monitor the connectivity of the serial communication link in real time. Once an abnormal disconnection of the link is detected, the disconnection and reconnection mechanism is automatically executed to attempt to re-establish the communication connection, so as to avoid the entire production line from being stopped due to occasional communication interference and to ensure the continuous operation and stability of the production line.
[0099] Based on the above steps S40, the deviation in the angle detection stage can be effectively offset by the feedforward compensation of historical identification errors. At the same time, the reliable serial communication mechanism ensures the stable issuance of control commands and guarantees that the dual clamping belts operate stably according to the optimized speed difference, ultimately improving the overall accuracy and success rate of bottle positioning.
[0100] S50: After the rotation action is completed, the camera is triggered again to capture the image of the bottle for secondary visual verification, obtain the verification angle value after the actual rotation, calculate the current execution deviation, and predict the rotation excess trend value of the next container based on the current execution deviation. The rotation excess trend value is compared with the preset excess threshold, the current positioning result is recorded, and the fusion history recognition error is updated based on the current execution deviation.
[0101] In this embodiment, after the rotation action is completed, the container leaves the rotation area and arrives at the subsequent detection station. The top or side camera is triggered to capture the bottle image again, and the actual angle of the bottle positioning mark is re-identified to obtain the verification angle value. The difference between the verification angle value and the preset target angle value is obtained to obtain the actual execution deviation of this rotation positioning. Then, combined with the historical multi-round execution deviation, the rotation over-trend value that may occur in the next container positioning is calculated by the sliding window averaging method. The rotation over-trend value is compared with the preset over-threshold, and the positioning result is recorded.
[0102] After completing the verification calculation, the actual execution deviation obtained this time is updated according to the detection modes of top shooting and side shooting, respectively, to update the historical recognition error of the corresponding mode. At the same time, the calculation parameters of the fused historical recognition error are updated to provide a more accurate error basis for the feedforward compensation of the rotation positioning of the next container, forming a closed-loop control of "detection-adjustment-verification-update", continuously iterating and optimizing the positioning accuracy to adapt to the slow changes in production line conditions such as bottle friction and belt wear.
[0103] This process involves triggering a camera to capture an image of the bottle for secondary visual verification, obtaining the verification angle value after the actual rotation, and calculating the deviation of this execution, including:
[0104] After the rotation is completed and the container moves to the preset verification station, the camera is triggered to simultaneously capture a top-down verification image and a side-view verification image.
[0105] The first verification angle value and the second verification angle value are extracted independently, and the first verification angle value and the second verification angle value are weighted and fused according to the first confidence weight and the second confidence weight to obtain the fused verification angle value;
[0106] The difference between the fused verification angle value and the target angle value is calculated as the execution deviation for this operation. A positive execution deviation indicates excessive rotation, while a negative deviation indicates insufficient rotation.
[0107] The absolute value of the deviation in this execution is compared with a preset single deviation threshold. If it exceeds the single deviation threshold, the positioning is determined to be unqualified, and an alarm or rejection signal is triggered.
[0108] In this embodiment, firstly, after the container enters the verification station, the top camera and the side camera are simultaneously triggered to capture images. Using the hardware configuration of dual-mode vision, the first verification angle value and the second verification angle value are extracted respectively. The first confidence weight and the second confidence weight pre-calculated in this detection are used to perform weighted fusion on the two verification angle values to obtain a more fused verification angle value.
[0109] Next, the difference between the fusion verification angle value and the preset target angle value is calculated to obtain the actual execution deviation of this rotation positioning. That is, the actual execution deviation = fusion verification angle value - target angle value. A positive actual execution deviation indicates that the actual rotation angle exceeds the target angle, which is considered excessive rotation; a negative actual execution deviation indicates that the actual rotation angle does not reach the target angle, which is considered insufficient rotation.
[0110] After obtaining the execution deviation, the absolute value of the deviation is compared with the preset single deviation threshold. If the absolute value of the deviation exceeds the single deviation threshold, the positioning is directly determined to be unqualified. An audible and visual alarm is triggered according to the production line configuration, or a rejection signal is directly sent to the sorting mechanism to remove the unqualified container from the production line to avoid affecting subsequent inspection processes.
[0111] The preset single-item deviation threshold is set according to the positioning angle accuracy requirements of the bottle rotation detection task. It can generally be set to 1°, which can meet the positioning accuracy requirements of most common detection processes, and can also be flexibly adjusted for special high-precision detection requirements to adapt to different production task requirements.
[0112] Further, based on the predicted rotation excess trend value of the next container according to the current execution deviation, the rotation excess trend value is compared with a preset excess threshold, the current positioning result is recorded, and the fusion history recognition error is updated according to the current execution deviation, including:
[0113] Obtain the current execution deviation sequence of the most recent preset number of consecutive positioning, where the preset number is the length of the trend prediction window;
[0114] To calculate the rotation overshoot trend value of the next container, add the most recent execution deviation to the difference between the most recent execution deviation and the previous execution deviation to obtain the rotation overshoot trend value.
[0115] If the excessive rotation trend value exceeds a preset excessive threshold, a warning signal is generated, and a deceleration compensation factor is added to the control command of the next container. The deceleration compensation factor is used to further correct the compensated speed difference, and the correction method is as follows:
[0116] The final speed difference is obtained by multiplying the feedforward compensated speed difference by the difference between the product of the preset deceleration intensity coefficient and the normalized rotational excess trend value.
[0117] The positioning result, execution deviation, and rotation overshoot trend value are recorded in the local database to generate a real-time statistical report. The execution deviation is added to the error statistics queue, and the fusion historical identification error is updated.
[0118] In this embodiment, firstly, the historical execution deviations of the most recent preset number are retrieved from the preset error statistics queue. The preset number ranges from 3 to 10 times, resulting in a continuous deviation sequence. The length of this sequence corresponds to a preset trend prediction window, which can reflect the overall trend of recent positioning deviation changes. The preset error statistics queue is a first-in-first-out sliding window queue. Whenever a new execution deviation is stored in the queue, the oldest old deviation is automatically removed to ensure that the queue always retains the execution deviation data of the most recent N times, accurately reflecting the deviation change trend under the current working conditions.
[0119] Subsequently, the deviation trend of the next execution is predicted based on the change in deviation between two adjacent executions. That is, the rotation excess trend value is equal to the most recent execution deviation plus the difference between the most recent execution deviation and the previous execution deviation. If the calculated rotation excess trend value exceeds the preset excess threshold, it indicates that there may be continuous rotation excess deviation in the future. At this time, a trend warning signal is generated and recorded in the system log to remind the operation and maintenance personnel to pay attention to the changes in the working condition. The preset excess threshold is set according to the positioning accuracy requirements, and is generally 70% of the single deviation threshold.
[0120] On the other hand, a deceleration compensation factor is added to the calculation of the control command for the next container to be processed, further correcting the speed difference that has already undergone feedforward compensation. The correction formula can be expressed as follows: , where Δv'' is the final output speed difference, λ is the preset deceleration intensity coefficient, and en is the normalized rotation excess trend value. This correction can suppress the continuous rotation excess offset trend in advance, further reducing the probability of positioning error.
[0121] Finally, the qualified / unqualified judgment result of this positioning, the actual execution deviation, and the calculated rotation overshoot trend value are recorded together in the local operation database, and a real-time statistical report on positioning accuracy is automatically generated. At the same time, the execution deviation is added to the error statistics queue, the earliest historical error data in the queue is eliminated, and the parameter update of the fusion historical identification error is completed, providing a more accurate error basis for the feedforward compensation calculation of the next container.
[0122] In summary, compared with existing technologies, this application uses a dual-mode visual fusion detection system with top and side views. First, it calculates the confidence weights of the detection results under each mode separately, and then weights and fuses them to obtain a more reliable initial angle measurement result. Next, it weights and calculates the fusion error based on the historical recognition errors of the two modes, and performs feedforward compensation correction on the initial rotation speed difference. At the same time, it sends control commands through reliable serial communication with reconnection and retransmission mechanism. After rotation is completed, it performs secondary fusion verification to obtain the actual execution deviation, predicts the rotation deviation trend based on the sliding window and makes advance corrections, and finally forms a closed-loop iterative intelligent control process. This not only solves the problem that the angle measurement is inaccurate due to bottle shape and label interference in a single visual mode, but also offsets the cumulative deviation caused by mechanical wear and friction changes through feedforward compensation and trend correction, improving the accuracy and success rate of bottle rotation positioning, and adapting to the detection needs of high-speed industrial production lines.
[0123] In summary, the embodiments of this application have at least the following technical effects:
[0124] This application provides a dual-vision fusion-based bottle rotation correction control method. First, it simultaneously acquires images of the bottle body using both top-view and side-view modes, and then weights and fuses the angle information. Compared to traditional single-vision modes, this effectively avoids recognition errors caused by bottle reflection, printing color differences, and production line vibration. Second, it calculates the initial speed difference of the dual-clamping belts based on the bottle diameter parameters, the basic production line speed, and the length of the rotating zone. It also incorporates feedforward compensation based on historical recognition errors and dynamically corrects the rotation trend based on continuous execution deviation prediction, adapting to different bottle sizes and production line speed fluctuations to meet flexible production requirements. Finally, a secondary vision verification step is added to statistically analyze the positioning results in real time, promptly eliminate unqualified products, and update the historical recognition errors, continuously optimizing positioning accuracy and effectively improving the pass rate of bottle rotation positioning and the overall production line stability.
[0125] Through the above technical solution, this application can be adapted to different bottle types and production line conditions. The bottle rotation positioning accuracy and correction accuracy are significantly better than the traditional single vision open-loop control scheme, which can effectively reduce the defect rate of subsequent processes and improve the overall production efficiency of the filling production line.
[0126] Example 2, as Figure 3 As shown, based on the same inventive concept as the dual-vision fusion bottle-spinning correction control method provided in Embodiment 1, this application also provides a dual-vision fusion bottle-spinning correction control system, including:
[0127] The visual inspection module 11 is used to synchronously acquire images of the container body, perform visual inspection and image preprocessing on the images of the body, and extract the current angle value of the current positioning mark relative to the reference point. The visual inspection includes top shooting mode and side shooting mode.
[0128] The shortest path angle difference acquisition module 12 is used to read the target angle value in the recipe parameters, calculate the shortest path angle difference between the current angle value and the target angle value, and determine the rotation direction based on the shortest path angle difference.
[0129] The initial speed difference calculation module 13 is used to obtain the bottle diameter parameters of the container, the basic linear velocity of the production line and the length of the rotating area, and calculate the required initial speed difference of the double clamping belts based on the shortest path angle difference value.
[0130] The control command optimization module 14 is used to obtain the historical recognition error under the current visual detection mode, perform feedforward compensation on the initial speed difference based on the historical recognition error, generate optimized control commands, and send the optimized control commands to the lower-level controller through the serial communication protocol to drive the dual-clamping belt actuator to run with the compensated speed difference, so that the container rotates to the target angle value during the movement.
[0131] The positioning result recording module 15 is used to trigger the camera to capture the image of the bottle again after the rotation action is completed for secondary visual verification, obtain the verification angle value after the actual rotation, calculate the current execution deviation, predict the rotation excess trend value of the next container based on the current execution deviation, compare the rotation excess trend value with the preset excess threshold, record the positioning result, and update the historical recognition error based on the current execution deviation.
[0132] Furthermore, in one embodiment of the application, visual inspection of the bottle image includes:
[0133] The steps for visual inspection using top-down shooting mode include:
[0134] The Hough circle detection algorithm is used to detect the circular outline of the bottle mouth in the bottle body image and obtain the coordinates of the center of the bottle mouth.
[0135] A circular region of interest is defined with the center of the bottle mouth as the center, and a location marker is searched within the circular region of interest;
[0136] Extract the center point of the positioning mark, calculate the polar angle of the center point relative to the center of the bottle mouth, and use the polar angle as the first current angle value;
[0137] Visual inspection is performed using a side-view shooting mode, and the steps include:
[0138] A template matching algorithm is used to match a preset positioning mark template in the bottle image to obtain the coordinates of the center point of the matching area;
[0139] The arc length is calculated based on the pixel offset between the center point coordinates and the image reference point, combined with the bottle diameter parameter of the container, and then the second current angle value is calculated from the arc length.
[0140] The first current angle value and the second current angle value are weighted and fused according to the first confidence weight and the second confidence weight to obtain the fused current angle value;
[0141] The first confidence weight and the second confidence weight are calculated based on the historical recognition error of the top-shot mode and the historical recognition error of the side-shot mode.
[0142] Furthermore, image preprocessing includes:
[0143] The acquired bottle images are converted to grayscale, transforming the three-channel image into a single-channel grayscale image;
[0144] Gaussian filtering is used to reduce noise in the grayscale image;
[0145] A contrast-limited adaptive histogram equalization algorithm is used to enhance the contrast of the denoised image;
[0146] The enhanced image is cropped according to the preset region of interest parameters to extract the effective region containing the bottle opening and positioning marks.
[0147] In one embodiment, the initial speed difference calculation module 13 is specifically used for:
[0148] Based on the basic linear velocity of the production line and the length of the rotating zone, calculate the dwell time of the container in the rotating zone;
[0149] The angular velocity is calculated by the difference between the container's dwell time in the rotation zone and the shortest path angle.
[0150] Based on the bottle diameter parameters, calculate the initial linear velocity difference of the dual clamping belts;
[0151] Obtain the pulley diameter and transmission ratio of the double clamping belts, and convert the initial linear velocity difference into the target rotational speed values of the first belt and the second belt, respectively. The rotational speed difference between the first belt and the second belt is the initial linear velocity difference, and the resultant force of the rotational speeds of the two belts drives the container to rotate at an angular velocity.
[0152] Further, the diameter of the pulleys and the transmission ratio of the double-clamping belts are obtained, and the initial linear velocity difference is converted into the target rotational speed values of the first belt and the second belt, respectively, including:
[0153] Based on the basic linear velocity of the production line, the target linear velocity of the first belt and the target linear velocity of the second belt are calculated. The difference between the target linear velocity of the first belt and the target linear velocity of the second belt is equal to the initial linear velocity difference, and the sign of the difference is determined by the rotation direction.
[0154] Based on the target linear velocity of the first belt and the target linear velocity of the second belt, obtain the target rotational speed of the first belt and the target rotational speed of the second belt;
[0155] The pulleys of the first belt and the second belt have the same diameter and transmission ratio.
[0156] Further, in one embodiment, obtaining the fusion history recognition error under the current visual detection mode, and performing feedforward compensation on the initial rotational speed difference based on the history recognition error, includes:
[0157] Based on the historical recognition errors of the top-shot mode and the side-shot mode, the fused historical recognition error is obtained by weighting them according to the first confidence level weight and the second confidence level weight.
[0158] The initial speed difference is compensated based on a preset feedforward compensation coefficient;
[0159] When the fusion history identification error is positive, the rotation speed difference is increased to compensate in advance;
[0160] When the fusion history identification error is negative, the rotation speed difference is reduced to suppress excessive rotation.
[0161] Furthermore, the optimized control commands are sent to the lower-level controller via a serial communication protocol, including:
[0162] The target speed and execution time of the dual belts are assembled into a command frame according to the protocol format;
[0163] Calculate the cyclic redundancy check (CRC) code of the instruction frame, append the CRC code to the end of the instruction frame, and then send it out.
[0164] Start the timeout timer and wait for the confirmation response frame from the lower-level controller;
[0165] If no acknowledgment is received within the preset timeout period, the current command frame will be automatically retransmitted. Once the maximum number of retransmissions is reached, a communication failure alarm will be triggered.
[0166] It periodically sends heartbeat keep-alive command frames to monitor the status of the serial communication link, and automatically executes the disconnection and reconnection mechanism when a link disconnection is detected.
[0167] The serial communication protocol uses a custom frame format, which includes a frame header, command word, data length, data field, and checksum.
[0168] In one embodiment, a camera is triggered to capture an image of the bottle for secondary visual verification, obtaining the verification angle value after actual rotation, and calculating the deviation of this execution, including:
[0169] After the rotation is completed and the container moves to the preset verification station, the camera is triggered to simultaneously capture a top-down verification image and a side-view verification image.
[0170] The first verification angle value and the second verification angle value are extracted independently, and the first verification angle value and the second verification angle value are weighted and fused according to the first confidence weight and the second confidence weight to obtain the fused verification angle value;
[0171] The difference between the fused verification angle value and the target angle value is calculated as the execution deviation for this operation. A positive execution deviation indicates excessive rotation, while a negative deviation indicates insufficient rotation.
[0172] The absolute value of the deviation in this execution is compared with a preset single deviation threshold. If it exceeds the single deviation threshold, the positioning is determined to be unqualified, and an alarm or rejection signal is triggered.
[0173] Further, based on the predicted rotation excess trend value of the next container according to the current execution deviation, the rotation excess trend value is compared with a preset excess threshold, the current positioning result is recorded, and the fusion history recognition error is updated according to the current execution deviation, including:
[0174] Obtain the current execution deviation sequence of the most recent preset number of consecutive positioning, where the preset number is the length of the trend prediction window;
[0175] To calculate the rotation overshoot trend value of the next container, add the most recent execution deviation to the difference between the most recent execution deviation and the previous execution deviation to obtain the rotation overshoot trend value.
[0176] If the excessive rotation trend value exceeds a preset excessive threshold, a warning signal is generated, and a deceleration compensation factor is added to the control command of the next container. The deceleration compensation factor is used to further correct the compensated speed difference, and the correction method is as follows:
[0177] The final speed difference is obtained by multiplying the feedforward compensated speed difference by the difference between the product of the preset deceleration intensity coefficient and the normalized rotational excess trend value.
[0178] The positioning result, execution deviation, and rotation overshoot trend value are recorded in the local database to generate a real-time statistical report. The execution deviation is added to the error statistics queue, and the fusion historical identification error is updated.
Claims
1. A method for controlling the deviation of a rotating bottle through dual-vision fusion, characterized in that, The method includes: Simultaneously acquire container bottle images, perform visual inspection and image preprocessing on the bottle images, and extract the current angle value of the current positioning mark relative to the reference point. The visual inspection includes top shooting mode and side shooting mode. Read the target angle value from the recipe parameters, calculate the shortest path angle difference between the current angle value and the target angle value, and determine the rotation direction based on the shortest path angle difference; Obtain the container's bottle diameter parameters, the production line's basic linear velocity, and the length of the rotating zone. Calculate the required initial speed difference of the double-clamping belts based on the shortest path angle difference. The fusion history recognition error in the current visual detection mode is obtained, and the initial speed difference is compensated by the fusion history recognition error. An optimized control command is generated and sent to the lower-level controller through the serial communication protocol to drive the dual clamping belt actuator to run with the compensated speed difference, so that the container rotates to the target angle value during the movement. After the rotation is completed, the camera is triggered again to capture images of the bottle for secondary visual verification, obtain the verification angle value after the actual rotation, calculate the execution deviation, and predict the rotation excess trend value of the next container based on the execution deviation. The rotation excess trend value is compared with the preset excess threshold, the positioning result is recorded, and the fusion history recognition error is updated based on the execution deviation.
2. The dual-vision fusion-based bottle rotation correction control method according to claim 1, characterized in that, Visual inspection of the bottle image includes: The steps for visual inspection using top-down shooting mode include: The Hough circle detection algorithm is used to detect the circular outline of the bottle mouth in the bottle body image and obtain the coordinates of the center of the bottle mouth. A circular region of interest is defined with the center of the bottle mouth as the center, and a location marker is searched within the circular region of interest; Extract the center point of the positioning mark, calculate the polar angle of the center point relative to the center of the bottle mouth, and use the polar angle as the first current angle value; Visual inspection is performed using a side-view shooting mode, and the steps include: A template matching algorithm is used to match a preset positioning mark template in the bottle image to obtain the coordinates of the center point of the matching area; The arc length is calculated based on the pixel offset between the center point coordinates and the image reference point, combined with the bottle diameter parameter of the container, and then the second current angle value is calculated from the arc length. The first current angle value and the second current angle value are weighted and fused according to the first confidence weight and the second confidence weight to obtain the fused current angle value; The first confidence weight and the second confidence weight are calculated based on the historical recognition error of the top-shot mode and the historical recognition error of the side-shot mode.
3. The dual-vision fusion-based bottle rotation correction control method according to claim 1, characterized in that, Image preprocessing includes: The acquired bottle images are converted to grayscale, transforming the three-channel image into a single-channel grayscale image; Gaussian filtering is used to reduce noise in the grayscale image; A contrast-limited adaptive histogram equalization algorithm is used to enhance the contrast of the denoised image; The enhanced image is cropped according to the preset region of interest parameters to extract the effective region containing the bottle opening and positioning marks.
4. The dual-vision fusion bottle-rotation correction control method according to claim 1, characterized in that, Obtain the container's diameter parameters, the production line's basic linear velocity, and the length of the rotating zone. Calculate the required initial speed difference of the dual-clamping belts based on the shortest path angle difference, including: Based on the basic linear velocity of the production line and the length of the rotating zone, calculate the dwell time of the container in the rotating zone; The angular velocity is calculated by the difference between the container's dwell time in the rotation zone and the shortest path angle. Based on the bottle diameter parameters, calculate the initial linear velocity difference of the dual clamping belts; Obtain the pulley diameter and transmission ratio of the double clamping belts, and convert the initial linear velocity difference into the target rotational speed values of the first belt and the second belt, respectively. The rotational speed difference between the first belt and the second belt is the initial linear velocity difference, and the resultant force of the rotational speeds of the two belts drives the container to rotate at an angular velocity.
5. The dual-vision fusion-based bottle rotation correction control method according to claim 4, characterized in that, Obtain the pulley diameter and transmission ratio of the dual-clamping belts, and convert the initial linear velocity difference into target rotational speed values for the first belt and the second belt, respectively, including: Based on the basic linear velocity of the production line, the target linear velocity of the first belt and the target linear velocity of the second belt are calculated. The difference between the target linear velocity of the first belt and the target linear velocity of the second belt is equal to the initial linear velocity difference, and the sign of the difference is determined by the rotation direction. Based on the target linear velocity of the first belt and the target linear velocity of the second belt, obtain the target rotational speed of the first belt and the target rotational speed of the second belt; The pulleys of the first belt and the second belt have the same diameter and transmission ratio.
6. The dual-vision fusion bottle-rotation correction control method according to claim 1, characterized in that, Obtain the fusion history recognition error under the current visual detection mode, and perform feedforward compensation on the initial rotation speed difference based on the history recognition error, including: Based on the historical recognition errors of the top-shot mode and the side-shot mode, the fused historical recognition error is obtained by weighting them according to the first confidence level weight and the second confidence level weight. The initial speed difference is compensated based on a preset feedforward compensation coefficient. When the fusion history identification error is positive, the rotation speed difference is increased to compensate in advance; When the fusion history identification error is negative, the rotation speed difference is reduced to suppress excessive rotation.
7. The dual-vision fusion bottle-rotation correction control method according to claim 1, characterized in that, The optimized control commands are sent to the lower-level controller via a serial communication protocol, including: The target speed and execution time of the dual belts are assembled into a command frame according to the protocol format; Calculate the cyclic redundancy check (CRC) code of the instruction frame, append the CRC code to the end of the instruction frame, and then send it out. Start the timeout timer and wait for the confirmation response frame from the lower-level controller; If no acknowledgment is received within the preset timeout period, the current command frame will be automatically retransmitted. Once the maximum number of retransmissions is reached, a communication failure alarm will be triggered. It periodically sends heartbeat keep-alive command frames to monitor the serial communication link status, and automatically executes the disconnection and reconnection mechanism when a link disconnection is detected. The serial communication protocol uses a custom frame format, which includes a frame header, command word, data length, data field, and checksum.
8. The dual-vision fusion method for bottle rotation correction control according to claim 1, characterized in that, Trigger the camera to capture an image of the bottle for secondary visual verification, obtain the verification angle value after actual rotation, and calculate the deviation of this execution, including: After the rotation is completed and the container moves to the preset verification station, the camera is triggered to simultaneously capture a top-down verification image and a side-view verification image. The first verification angle value and the second verification angle value are extracted independently, and the first verification angle value and the second verification angle value are weighted and fused according to the first confidence weight and the second confidence weight to obtain the fused verification angle value; The difference between the fused verification angle value and the target angle value is calculated as the execution deviation for this operation. A positive execution deviation indicates excessive rotation, while a negative deviation indicates insufficient rotation. The absolute value of the deviation in this execution is compared with a preset single deviation threshold. If it exceeds the single deviation threshold, the positioning is determined to be unqualified, and an alarm or rejection signal is triggered.
9. The dual-vision fusion bottle-rotation correction control method according to claim 8, characterized in that, Based on the predicted rotation excess trend value of the next container according to the current execution deviation, the rotation excess trend value is compared with a preset excess threshold, and the current positioning result is recorded. Simultaneously, the fusion history recognition error is updated based on the current execution deviation, including: Obtain the current execution deviation sequence of the most recent preset number of consecutive positioning, where the preset number is the length of the trend prediction window; To calculate the rotation overshoot trend value of the next container, add the most recent execution deviation to the difference between the most recent execution deviation and the previous execution deviation to obtain the rotation overshoot trend value. If the excessive rotation trend value exceeds a preset excessive threshold, a warning signal is generated, and a deceleration compensation factor is added to the control command of the next container. The deceleration compensation factor is used to further correct the compensated speed difference, and the correction method is as follows: The final speed difference is obtained by multiplying the feedforward compensated speed difference by the difference between the product of the preset deceleration intensity coefficient and the normalized rotational excess trend value. The positioning result, execution deviation, and rotation overshoot trend value are recorded in the local database to generate a real-time statistical report. The execution deviation is added to the error statistics queue, and the fusion historical identification error is updated.
10. A dual-vision fusion bottle-spinning correction control system, characterized in that, A method for implementing a dual-vision fusion-based bottle-spinning correction control according to any one of claims 1-9 includes: The visual inspection module is used to synchronously acquire images of the container body, perform visual inspection and image preprocessing on the bottle body images, and extract the current angle value of the current positioning mark relative to the reference point. The visual inspection includes top shooting mode and side shooting mode. The shortest path angle difference acquisition module is used to read the target angle value in the recipe parameters, calculate the shortest path angle difference between the current angle value and the target angle value, and determine the rotation direction based on the shortest path angle difference. The initial speed difference calculation module is used to obtain the container diameter parameters, the basic linear velocity of the production line and the length of the rotating area, and calculate the required initial speed difference of the double clamping belts based on the shortest path angle difference value. The control command optimization module is used to obtain the historical recognition error under the current visual detection mode, perform feedforward compensation on the initial speed difference based on the historical recognition error, generate optimized control commands, and send the optimized control commands to the lower-level controller through the serial communication protocol to drive the dual-clamping belt actuator to run with the compensated speed difference, so that the container rotates to the target angle value during the movement. The positioning result recording module is used to trigger the camera to capture images of the bottle again after the rotation action is completed for secondary visual verification, obtain the verification angle value after the actual rotation, calculate the current execution deviation, predict the rotation excess trend value of the next container based on the current execution deviation, compare the rotation excess trend value with the preset excess threshold, record the positioning result, and update the historical recognition error based on the current execution deviation.