Cable crane intelligent deviation rectifying method based on machine vision and PID (Proportion Integration Differentiation) control
Through the intelligent deviation correction method of the cable machine combining machine vision and PID control, the position of the hanging can be adjusted in real time, solving the problem of the deviation of the hanging can enter the bin under strong wind interference, and improving construction efficiency and quality.
Patent Information
- Application Number
- CN202510764274.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-07-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
During the construction of hydropower stations, due to strong wind interference, the cable machine hoist can cannot be accurately entered into the warehouse, resulting in low transportation efficiency and impact on construction quality, especially in winter, the heat loss inside the greenhouse is severe.
The intelligent deviation correction method of cable machines based on machine vision and PID control is adopted. The images of the hanging can and unloading area are captured in real time through the camera, the center coordinate deviation is identified using the contour detection algorithm, and the deviation value is input into the PID controller to generate the control amount to adjust the position of the cable machines, forming a closed-loop control until the center of the hanging can and the target unloading window overlaps.
It realizes accurate entry of the hanging tank in strong winds, improves transportation efficiency, reduces manual operation difficulty, and ensures construction quality and construction period.
Smart Images

Figure CN120279052A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of dynamic deviation correction for cable cranes entering the bin, and specifically relates to an intelligent deviation correction method for cable cranes based on machine vision and PID control. Background Technique
[0002] Machine vision technology is an important part of automated production and intelligent manufacturing. Machine vision technology can achieve automatic recognition and control of target objects. A controller based on the proportional, integral, and differential of deviation is simply called a PID controller, which is the most common type of process controller in industrial process control. Combining these two technologies of machine vision and PID control can build an efficient and stable automated control system.
[0003] In a certain hydropower station project, the transportation method of using a concrete cable crane to lift a hopper into the bin is adopted. Due to the interference of horizontal strong winds at the site, the hopper often cannot accurately reach the predetermined area. Especially during winter construction, it cannot quickly enter the window of the warm shed on the bin surface. During the on-site operation process, it is often necessary for the cable crane operator and the bin surface coordinator to communicate repeatedly to ensure that the hopper accurately falls into the specified unloading area, resulting in low transportation efficiency, large heat loss inside the winter warm shed, and affecting the construction quality and construction period.
[0004] To solve the problem of the deviation of the hopper from the specified unloading area (such as the window at the top of the warm shed) caused by strong winds, the present invention proposes an intelligent deviation correction method for cable cranes based on machine vision and PID control, and verifies the dynamic correction ability of the algorithm for the hopper and the predetermined landing point under strong wind conditions by building a scaled-down model of a gantry crane and a test platform. Summary of the Invention
[0005] Therefore, in view of the problem of the deviation of the concrete hopper during the entry into the bin in a strong wind environment during the construction of the hydropower station, the present invention proposes an intelligent deviation correction method for cable cranes based on machine vision and PID control.
[0006] The following technical solutions are provided: An intelligent deviation correction method for cable cranes based on machine vision and PID control, including the following steps: (1) Real-time capture the images of the hopper and the unloading area through a camera, use the contour detection algorithm to identify the center coordinates (x1, y1) of the hopper and the center coordinates (x2, y2) of the target unloading window, and calculate the horizontal and vertical deviation values (Δx, Δy) between the two. Among them, Δx = x2 - x1; Δy = y2 - y1; (2) Take the calculated horizontal and vertical deviation values (Δx, Δy) as the input signals of the PID controller.
[0007] (3) The PID controller performs proportional, integral, and differential operations on the deviation according to the compound control strategy to generate the corresponding control quantities (ux, uy); (4)The control variables (ux, uy) are output as motor drive signals through the digital-to-analog conversion module to adjust the moving speed and direction of the X-axis and Y-axis of the cable crane, and dynamically adjust the position of the hanging bucket. (5)The machine vision system continuously detects the position of the hanging bucket, updates the lateral and longitudinal deviation values (Δx, Δy) and feeds them back to the PID controller to form a closed-loop control. Repeat the above steps until the deviation value between the center of the hanging bucket and the center of the target discharge window is less than the set threshold.
[0008] Preferably, the contour detection algorithm steps are as follows: Step 1: Use the raster scan algorithm to scan the image line by line and initialize the input image number NBD; when the gray value of the pixel point (i, j) is non-zero, assign a new boundary number and set the starting point of boundary tracking. Step 2: According to the determination rule of the type characteristics of the former boundary B' and the currently newly detected boundary B, automatically construct a tree structure of the contour to distinguish the nested relationship between the outer boundary and the hole boundary. Step 3: Start boundary tracking from the pixel point (i, j) as the boundary starting point, where the boundary starting point includes the outer boundary starting point and the hole boundary starting point. Step 4: If , then LNBD , which means that when the gray value of the current pixel is not 1, assign the absolute value of the current pixel value to LNBD to update the boundary number of the most recently processed boundary, ensuring that the hierarchical relationship of the contour can be correctly traced during the subsequent scanning process. Continue the raster scan from the position of the pixel point (i, j + 1) until the lower right vertex of the image completes the entire scanning process. Otherwise, continue to perform the raster scan of the image. The parent boundary determined in Step 2 is used to mark the contour hierarchical relationship in the subsequent tracking of Step 3 and update LNBD in Step 4; finally, the parent boundary information will be saved to the contour attributes for geometric analysis (such as contour restoration) use.
[0009] Preferably, Step 1 specifically includes: Let the input image be , represents the gray value of the pixel point at (i, j); the initial NBD is 1; use the raster scan algorithm to scan the image F line by line. When the gray value of the pixel point (i, j) is non-zero, whenever entering the starting position of a new line, reset the LNBD variable to the value 1.
[0010] Preferably, in Step 1, the steps for detecting that the gray value of the pixel point (i, j) is non-zero are as follows: If and , then (i, j) is the outer boundary starting point, NBD += 1, , indicates that the tracking starting point is set to the coordinate (i, j−1) to the left of the current pixel (i, j), which is used as the initial search direction point for subsequent boundary tracking; If and , then (i, j) is the starting point of the hole boundary, NBD += 1, , indicates that the tracking starting point is set to the coordinate (i, j + 1) to the right of the current pixel (i, j), which is used as the initial search direction point for subsequent boundary tracking; If , then LNBD , indicates that LNBD is assigned the value of , that is, the value of LNBD becomes , which is used to dynamically update the value of LNBD to record the number of the boundary to which the current pixel belongs, so as to support the accurate determination of the contour hierarchy relationship; In other cases, jump to step 4.
[0011] Preferably, the determination rules for the type characteristics of the former boundary B' and the currently newly detected boundary B specifically include: Based on the type characteristics of the former boundary B' and the current boundary B, when B' is an outer boundary and B is an outer boundary, the parent boundary of boundary B is the parent boundary of boundary B'; when B' is an outer boundary and B is a hole boundary, the parent boundary of boundary B is boundary B itself; when B' is a hole boundary and B is an outer boundary, the parent boundary of boundary B is boundary B itself; when B' is a hole boundary and B is a hole boundary, the parent boundary of boundary B is the parent boundary of boundary B', so as to determine the parent boundary of the current boundary B.
[0012] Preferably, step 3 specifically includes: a. Taking the pixel point (i, j) as the central unit, with as the initial search direction point, retrieve whether there are non-zero gray-scale pixels in the 4-neighborhood or 8-neighborhood range of the central pixel in a clockwise order; If an effective pixel is detected, the first pixel point satisfying the condition in the clockwise direction is determined as the target adjacent point to be currently tracked; otherwise, let = -NBD, indicating that boundary processing marking is performed on the current pixel, indicating that the pixel has completed boundary tracking and belongs to the external area of the current boundary, and jump to step 4; b. , ; indicates that the leading point of boundary tracking is updated, that is, the coordinate points of the previous search direction and the current point coordinates are recorded, providing a benchmark for the next counterclockwise search of the neighborhood, and is assigned the value of , that is, taking the next adjacent point just found as the new leading direction point, and is assigned to , that is, taking the currently processed pixel point as the new current tracking point; c. Taking as the center, along the counterclockwise direction, starting from 's next point as the starting position, search for 's 4-neighborhood or 8-neighborhood, and judge whether there is a non-zero pixel value; if there is, define the first non-zero pixel point encountered along the counterclockwise direction as ; d. If is the pixel point that has been checked and is a 0 pixel point in step 3.c, then ; It means: set the value of the pixel point with coordinates to negative NBD; If is not the pixel point that has been checked in step 3.c, and , it means: this pixel belongs to the unmarked target area, that is, it has not been assigned any boundary number, then ; It means: set the value of the pixel point with coordinates to NBD; In other cases, remains unchanged and keeps the original value; If and , it means: judge whether the current boundary tracking has looped back to the starting point to form a complete closed contour, : The next adjacent point searched counterclockwise returns to the initial starting point of the boundary tracking, : The current tracking point has moved to the first subsequent point of the boundary path , then jump to step 4; Otherwise, let , , it means: assign the leading point to the original current point , that is, record the current point as the new leading direction, and assign the current point to the newly found adjacent point , that is, move to the next pixel point of the boundary, and jump to c.
[0013] Preferably, the composite control strategy is specifically designed as follows: According to the deviation value between the input signal and the desired output, weighted operations are performed according to the mathematical function relationships of proportion, integral, and differential, and the operation result is used as the control input of the actuator, thereby realizing precise adjustment of the dynamic characteristics of the system; among them, the proportional coefficient, integral time constant, and differential time constant are all obtained by the method of debugging parameters. The composite control strategy of PID control for a continuous control system is as follows: ; In the formula: t is the current time; u(t) is the output signal of the PID controller; K p is the proportional coefficient; T t is the integral time constant; T D is the differential time constant; e(t) is the difference between the given value and the measured value.
[0014] Specifically as follows: 1. Profile detection provides the deviation signal e(t) The machine vision system obtains the center coordinates of the hanging bucket and the discharging window in real time through profile detection algorithms (such as profile extraction and minimum circumscribed rectangle calculation), and calculates the horizontal deviation Δx and vertical deviation Δy between the two. These deviation values directly correspond to e(t) in the PID control formula, that is: e(t)=Δx or e(t)=Δy According to the control requirements, the horizontal and vertical deviations can be respectively input into independent PID controllers to generate corresponding control quantities.
[0015] 2. The PID controller generates the control quantity u(t) After the deviation signal e(t) is input into the PID controller, through the formula:
[0016] The control quantities ux and uy are calculated and are respectively used to adjust the movement of the cable crane on the X-axis and Y-axis.
[0017] 3. Closed-loop feedback realizes dynamic deviation correction The control quantity u(t) drives the cable crane through the motor to adjust the position of the hanging bucket. At the same time, the machine vision system continuously updates the profile detection result to form a closed-loop feedback. This process is iterated repeatedly until the deviations Δx and Δy between the center of the hanging bucket and the center of the discharging window approach zero (for example, the offset is controlled within 1 - 13 mm in the experiment).
[0018] Profile detection is the front-end input source of PID control, providing the real-time position deviation e(t); the PID controller generates a dynamic adjustment signal u(t) based on e(t), and finally realizes precise deviation correction of the hanging bucket under strong wind interference. The two are closely combined through the closed-loop feedback mechanism and jointly constitute the core of the intelligent deviation correction system.
[0019] The present invention has the following advantages: By establishing a reduced-scale model of the gantry crane and a test platform, a test environment including an algorithm model and a numerical control system was constructed, and the effectiveness of the algorithm in correcting deviation under dynamic wind speed disturbances was verified. The experimental results show that the algorithm can detect the position deviation between the hanging bucket and the construction unloading area / window in real time, and achieve precise position adjustment through the PID control algorithm, so that the centers of the two are dynamically coincident. This technology significantly improves the transportation efficiency of the hanging bucket into the silo, and at the same time reduces the difficulty of manual operation, providing a feasible solution for the precise hanging bucket into the silo in complex environments. Description of the Drawings
[0020] Figure 1 Schematic diagram of 4-connectivity for contour detection provided by the present invention; Figure 2 Schematic diagram of 8-connectivity for contour detection provided by the present invention; Figure 3 Flowchart of the contour detection algorithm provided by the present invention; Figure 4 PID system control principle provided by the present invention; Figure 5 Schematic diagram of the overall structure of the cable crane reduced-scale model provided by the present invention; Figure 6 Schematic diagram of the structure of the grabbing device of the cable crane reduced-scale model provided by the present invention; Figure 7 Schematic diagram of the structure of the motor and track system of the cable crane reduced-scale model provided by the present invention; Figure 8 Schematic diagram of the structure of the control circuit board of the cable crane reduced-scale model provided by the present invention; Figure 9 Schematic diagram of the control panel structure of the cable crane reduced-scale model provided by the present invention; Figure 10 Schematic diagram of the deviation correction process of the intelligent cable crane reduced-scale model provided by the present invention; Figure 11 Schematic diagram of the test results of the reduced-scale cable crane regarding the deviation correction time provided by the present invention; Figure 12 Schematic diagram of the test results of the reduced-scale cable crane regarding the absolute value of the offset provided by the present invention. Detailed Embodiments
[0021] The following specific embodiments illustrate the implementation manners of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0022] Contour detection is an important method for extracting the shape features of objects in image processing. Its core concepts include: The image frame is composed of the outermost pixels; in a binary image, the gray value of a pixel takes 0 or 1. The connected region composed of pixels with a gray value of 1 is defined as a 1-connected domain, and the connected region composed of pixels with a gray value of 0 is defined as a 0-connected domain. When the 0-connected domain covers the entire boundary range of the image, this 0-connected domain is called the background; if the 0-connected domain does not contain the complete frame defined by the image boundary, it is regarded as a hole region.
[0023] In terms of connectivity, 4-connectivity means that pixels are adjacent up, down, left, and right, and 8-connectivity includes diagonal adjacency. For example, a 1 pixel is 4(8)-connected, and a 0 pixel is 8(4)-connected. A schematic diagram of 4(8)-connectivity is shown in Figure 1 - Figure 2 as shown Figure 1 is 4-connectivity, Figure 2 is 8-connectivity). A boundary point is a point where a 1 pixel has a 0 pixel in its neighborhood. When there is a surrounding relationship between two connected domains, if S2 surrounds S1 and they have boundary point contact, then S2 is said to directly surround S1. From this, the concepts of outer boundary (0-connected domain surrounds 1-connected domain) and hole boundary (1-connected domain surrounds 0-connected domain) are derived. There is a hierarchical relationship between boundaries. The parent boundary is the upper boundary that directly surrounds the current boundary.
[0024] Contour detection is usually carried out in a raster scan manner (from left to right, from top to bottom). During the scanning process, each newly discovered boundary will be assigned a unique NBD number, and the LNBD number of the previous boundary will be recorded at the same time. The boundary start points are divided into two types: outer boundary and hole boundary, which are the starting positions of the contour tracking algorithm. These concepts together constitute the theoretical basis of contour detection, providing a necessary framework for subsequent boundary tracking and shape analysis.
[0025] As Figure 3 shown, this embodiment provides an intelligent cable machine deviation correction method based on machine vision and PID control, including the following steps: (1) Capture the images of the hanging bucket and the discharging area in real time through a camera, use the contour detection algorithm to identify the center coordinates of the hanging bucket and the center coordinates of the target discharging window, and calculate the horizontal and vertical deviation values (Δx, Δy) between the two; (2) Use the calculated horizontal and vertical deviation values (Δx, Δy) as the input signals of the PID controller.
[0026] (3) The PID controller performs proportional, integral, and differential operations on the deviation according to the composite control strategy to generate the corresponding control quantities (ux, uy); (4)The control variables (ux, uy) are output as motor drive signals through the digital-to-analog conversion module to adjust the moving speed and direction of the cable crane's X-axis and Y-axis, and dynamically adjust the position of the hanging bucket. (5)The machine vision system continuously detects the position of the hanging bucket, updates the lateral and longitudinal deviation values (Δx, Δy), and feeds them back to the PID controller to form a closed-loop control. Repeat the above steps until the deviation value between the center of the hanging bucket and the center of the target discharge window is less than the set threshold.
[0027] Preferably, the contour detection algorithm steps are as follows: Step 1: Use the raster scan algorithm to scan the image line by line and initialize the input image number NBD; when the gray value of the pixel point (i, j) is detected as a non-zero value, reset the input image number LNBD. Step 1 specifically includes: Let the input image be , represents the gray value of the pixel point at (i,j); the initial NBD is 1; use the raster scan algorithm to scan the image F line by line. When the gray value of the pixel point (i, j) is detected as a non-zero value, whenever entering the starting position of a new line, reset the LNBD variable to the value 1.
[0028] After detecting the boundary start point and completing the initial numbering (NBD, LNBD), it is necessary to call the contour detection function through the cv2.findContours() function (to find the contours of the detected object), and by setting mode = cv2.RETR_TREE and method = cv2.CHAIN_APPROX_SIMPLE, hierarchical extraction of all contours in the image can be achieved.
[0029] The input values of the function are: image - the input image, mode - the mode of the contour, method - the contour approximation method.
[0030] (1)image - the input image The image must be an 8-bit single-channel binary image. Therefore, generally, the image is processed into a binary image before being passed in. It is often necessary to perform threshold segmentation or edge detection on the image in advance. After obtaining a satisfactory binary image, passing it in as a parameter will have a better effect.
[0031] (2)mode - the mode of the contour mode determines the extraction method of the contour, and there are a total of 4 different functions.
[0032] cv2.RETR_EXTERNAL: Only detect the outermost contour cv2.RETR_LIST: Retrieves all the contours and saves them in a linked list. No hierarchical relationship is established for the contours.
[0033] cv2.RETR_CCOMP: Detects all the contours in the image and constructs a two-level hierarchical architecture for them. In this hierarchical structure, the upper level is defined as the outer contour boundary of each component, and the second level is the boundary of the holes.
[0034] cv2.RETR_TREE: Retrieves all the contours and constructs a hierarchical tree structure of the contours.
[0035] (3)method - Contour approximation method method determines the representation of the contour. The two commonly used functions are as follows.
[0036] cv2.CHAIN_APPROX_NONE: Outputs the contour in the form of Freeman chain code. It can be represented by a complete line.
[0037] cv2.CHAIN_APPROX_SIMPLE: Compresses the elements in the horizontal, vertical, and diagonal directions and only retains the end point coordinates in that direction. It can be represented by the vertices of a polygon.
[0038] The function return values are: contours - the returned contours, hierarchy - the attributes corresponding to each contour.
[0039] (1)contours The attributes of contours include the number of detected contours, pixel points, and the shape of the points inside the contour.
[0040] (2)hierarchy hierarchy is the data of the hierarchical relationship of the detected contours and can reflect the connection method between the contours.
[0041] Specifically, the steps to detect that the grayscale value of the pixel point (i, j) is non-zero are as follows: If and , then (i,j) is the starting point of the outer boundary, NBD += 1, ; If and , then (i,j) is the starting point of the hole boundary, NBD += 1, ; If , then LNBD ; In other cases, jump to step 4.
[0042] Step 2: Automatically construct a tree structure of the contour according to the parent boundary determination rule to distinguish the nesting relationship between the outer boundary and the hole boundary; specifically including: Based on the type characteristics of the former boundary B' and the current boundary B, when B' is the outer boundary and B is the outer boundary, the parent boundary of boundary B is the parent boundary of boundary B'; when B' is the outer boundary and B is the hole boundary, the parent boundary of boundary B is boundary B itself; when B' is the hole boundary and B is the outer boundary, the parent boundary of boundary B is boundary B itself; when B' is the hole boundary and B is the hole boundary, the parent boundary of boundary B is the parent boundary of boundary B', so as to determine the parent boundary of the current boundary B.
[0043] Step 3: Start boundary tracking from the pixel point (i, j) as the boundary starting point; Step 3 specifically includes: a. Take the pixel point (i, j) as the central unit, and use as the initial search direction point, and retrieve whether there are non-zero gray-scale pixels in the 4-neighborhood or 8-neighborhood range of the central pixel in a clockwise order; If an effective pixel is detected, the first pixel point that meets the conditions in the clockwise direction is determined as the target adjacent point to be currently tracked; otherwise, let =-NBD, indicating: Mark the current pixel for boundary processing, indicating that the pixel has completed boundary tracking and belongs to the external area of the current boundary, and jump to Step 4; b. , ; It means: Update the leading point of boundary tracking, that is, record the coordinate point of the previous search direction and the current point coordinate, provide a reference for the next counterclockwise search of the neighborhood, and assign to , that is, take the just-found next adjacent point as the new leading direction point, and assign to , that is, take the currently processed pixel point as the new current tracking point; c. Take as the center, along the counterclockwise direction, start from 's next point as the starting position, search 's 4-neighborhood or 8-neighborhood, and judge whether there is a non-zero pixel value; if there is, define the first non-zero pixel point encountered in the counterclockwise direction as ; d. If is the pixel point that has been checked in Step 3 c and is a 0 pixel point, then ; It means: Set the value of the pixel point with coordinates to negative NBD; If Pixels that have not been checked in c of step 3, and , indicating that: this pixel belongs to an unmarked target area, that is, no boundary number has been assigned yet, then ; indicating that: set the value of the pixel with coordinates to NBD; In other cases, remain unchanged and keep the original value; If and , indicating that: judge whether the current boundary tracking has looped back to the starting point to form a complete closed contour, : the next adjacent point searched counterclockwise returns to the initial starting point of the boundary tracking, : the current tracking point has moved to the first subsequent point of the boundary path , then jump to step 4; Otherwise, let , , indicating that: assign the leading point to the original current point , that is, record the current point as the new leading direction, and assign the current point to the newly found adjacent point , that is, move to the next pixel point of the boundary, and jump to c.
[0044] Step 4: If , then LNBD , indicating that: when the gray value of the current pixel is not 1, assign the absolute value of the current pixel value to LNBD to update the boundary number of the most recently processed boundary, ensure that the hierarchical relationship of the contour can be correctly traced during the subsequent scanning process, continue the raster scan from the position of the pixel point (i, j + 1) until the lower right vertex of the image to complete the entire scanning process, otherwise, continue to raster scan the image; The parent boundary determined in step 2 is used to mark the contour hierarchical relationship during the subsequent tracking in step 3 and update LNBD in step 4; finally, the parent boundary information will be saved to the contour attributes for geometric analysis (such as contour restoration) use.
[0045] After completing the raster scan and contour tracking, it is necessary to call the contour restoration algorithm, obtain the minimum rectangle of the contour obtained by findcontours through the cv2.minAreaRect() function, and return the four corner points of this minimum rectangle. By judging two different contour areas, determine which of the four corner points belong to the original contour rather than those generated by the algorithm. After finding these points, use the rectangular area and vector characteristics of the target area to perform rectangular restoration, that is, the rectangular area to be recognized, and then the center point of the area can be calculated.
[0046] The cv2.minAreaRect function is based on the rotated Calhoun algorithm, which can find the minimum enclosing rectangle of a set of points. The basic steps of the algorithm are as follows: (1) Convex hull calculation: First, calculate the convex hull of the given point set. Among them, the convex hull is the smallest convex polygon that encloses all points.
[0047] (2) Rotated Calhoun: After obtaining the convex hull, traverse all possible directions by rotating a pair of parallel lines to determine which direction has the smallest rectangle area. In each step, the algorithm keeps a pair of parallel lines close to two sides of the convex hull and keeps the other two pairs of parallel lines passing through points on the convex hull, thus forming a rectangle. During the rotation of these lines, all possible rotated rectangles will be traversed, and then the one with the smallest area is selected.
[0048] (3) Minimum area rectangle: Find the rotated rectangle with the minimum area. This rectangle is represented by four points, which are the four vertices of the rotated rectangle.
[0049] (4) Center point positioning: Calculate the geometric center of the target area based on the rectangle vertex coordinates, providing reference data for subsequent deviation detection (Δx, Δy); Convert the pixel-level information of the contour into geometric parameters available for engineering, ensuring that the machine vision system can output the real-time position relationship between the hanging pot and the target window for the PID controller to perform dynamic correction.
[0050] Preferably, the composite control strategy is specifically designed as follows: According to the deviation value between the input signal and the desired output, perform weighted operations according to the mathematical function relationships of proportion, integral, and differential, and use the operation result as the control input of the actuator, so as to achieve precise adjustment of the dynamic characteristics of the system; among them, the proportional coefficient, integral time constant, and differential time constant are all obtained by adjusting parameters. The composite control strategy of PID control for continuous control systems is as follows: ; In the formula: t is the current time; u(t) is the output signal of the PID controller; K p is the proportional coefficient; T t is the integral time constant; T D is the differential time constant; e(t) is the difference between the given value and the measured value.
[0051] Specifically as follows: 1. Contour detection provides the deviation signal e(t) The machine vision system obtains the central coordinates of the hanging bucket and the discharging window in real time through contour detection algorithms (such as contour extraction and calculation of the minimum circumscribed rectangle), and calculates the lateral deviation Δx and the longitudinal deviation Δy between the two. These deviation values directly correspond to e(t) in the PID control formula, that is: e(t)=Δx or e(t)=Δy According to the control requirements, the lateral and longitudinal deviations can be respectively input into independent PID controllers to generate corresponding control quantities.
[0052] 2. The PID controller generates the control quantity u(t) After the deviation signal e(t) is input into the PID controller, through the formula:
[0053] The control quantities ux and uy are calculated and are respectively used to adjust the movement of the cable crane on the X-axis and Y-axis.
[0054] 3. Closed-loop feedback realizes dynamic deviation correction The control quantity u(t) drives the cable crane through the motor to adjust the position of the hanging bucket. At the same time, the machine vision system continuously updates the contour detection results to form a closed-loop feedback. This process is iterated repeatedly until the deviations Δx and Δy between the center of the hanging bucket and the center of the discharging window approach zero (for example, the offset is controlled within 1 - 13 mm in the experiment).
[0055] Contour detection is the front-end input source of PID control, providing the real-time position deviation e(t); the PID controller generates a dynamic adjustment signal u(t) based on e(t), and finally realizes the precise deviation correction of the hanging bucket under strong wind interference. The two are closely combined through the closed-loop feedback mechanism and jointly constitute the core of the intelligent deviation correction system.
[0056] The control principle of the PID system is as Figure 4 shown: (1)Proportional regulation The proportional controller (P) generates a control quantity according to the deviation signal, and its output is proportional to the input deviation. This control action responds quickly and can effectively reduce the deviation, but it cannot completely eliminate the static error. The static error decreases with the increase of the proportional coefficient, but too high a proportional coefficient will cause system overshoot or oscillation, and it needs to be selected as a compromise according to the characteristics of the controlled object.
[0057] (2)Integral regulation The integral link (I) eliminates the static error by accumulating the deviation. As long as the deviation exists, the integral action continuously adjusts the output until the deviation is zero. The integral time constant determines its strength: the smaller the constant, the stronger the action, but too strong may cause system oscillation and needs to be set reasonably.
[0058] (3)Derivative regulation The derivative link (D) provides anticipatory correction by predicting the trend of deviation changes, improving the dynamic performance. Its action intensity is determined by the derivative time constant: being too large will cause the system to become unstable, and a trade-off between stability and rapidity is required.
[0059] The present invention establishes a reduced-scale model of a gantry crane to verify the dynamic correction ability of the cable crane for the dynamic correction between the suspension tank and the predetermined landing point under strong winds. The structural composition is as follows: The key structures of the gantry crane include a Raspberry Pi, an MCU, and a motor. The structure of the gantry crane is shown in Figure 5 - Figure 9 ; among them, the overall structure of the reduced-scale model of the cable crane includes an electrical panel, operation buttons, power input, switches, etc., which are used to simulate the basic operating mechanism of the cable crane. The grasping device of the reduced-scale model of the cable crane includes a grasping head, a load, and related mechanical structures, which are used to simulate the process of the cable crane grasping and lifting goods. The motor and track system of the reduced-scale model of the cable crane includes X-axis and Y-axis motors and tracks, which are used to simulate the movement and positioning functions of the cable crane in different directions. The control circuit board of the reduced-scale model of the cable crane includes a power module, a signal processing module, interfaces, etc., among which there are the key structures of the gantry crane, namely, a Raspberry Pi, an MCU, and a motor. This part is used to coordinate the operation of the cable crane and realize the control of motors, grasping devices, etc. The control panel of the reduced-scale model of the cable crane includes operation buttons, indicator lights, etc., which are used for the interaction between the user and the cable crane to realize the control and monitoring of the operating state of the cable crane.
[0060] Working condition setting: During the process of the suspension tank entering the bin at a certain hydropower station, the factors affecting the transportation deviation size are the on-site wind speed and the weight of the hoisted object. Therefore, in the reduced-scale model test, the variables set are the wind speed and the weight of the hoisted object, which are controlled by an industrial fan and weights respectively.
[0061] The air gun uses different air outlet wind speeds, and the hoisted object uses different weights. Each working condition keeps the target landing position unchanged, and the gantry crane starts from the zero position each time to study the ability to correct the deviation.
[0062] Result analysis: 1 The nine working conditions of the test results of the intelligent cable crane reduced-scale model are shown in Table 1, and all correct deviation corrections are achieved. Taking working condition one as an example, the deviation correction process of the reduced-scale model is shown in Figure 10 . The test results of the intelligent cable crane reduced-scale model are as Figure 11 - Figure 12 shown.
[0063] In Figure 11 , in the change trend of the deviation correction time with the weight of the weight and the wind speed, the abscissa represents the weight of the weight (g), which are 0 g, 50 g, and 100 g respectively, and each group of weights corresponds to different wind speeds (0 m / s, 0.5 m / s, 1 m / s). The ordinate represents the deviation correction time (s), and the range is from 4.2 seconds to 6.2 seconds.
[0064] Change trend: When the weight of the weight is fixed, the greater the wind speed, the longer the deviation correction time. For example: When the weight of the weight is 0g and the wind speed increases from 0m / s to 1m / s, the deviation correction time extends from 5.1 seconds to 6.2 seconds.
[0065] When the weight of the weight is 50g and the wind speed increases from 0m / s to 1m / s, the deviation correction time extends from 4.6 seconds to 5.4 seconds.
[0066] When the wind speed is fixed, the greater the weight of the weight, the shorter the deviation correction time. For example: When the wind speed is 0m / s and the weight of the weight increases from 0g to 100g, the deviation correction time shortens from 5.1 seconds to 4.2 seconds.
[0067] When the wind speed is 1m / s and the weight of the weight increases from 0g to 100g, the deviation correction time shortens from 6.2 seconds to 5.1 seconds.
[0068] Important nodes: Under condition seven (100g, 0m / s), the deviation correction time is the shortest, which is 4.2 seconds, reflecting the high efficiency when there is no wind and there is a heavy object.
[0069] Under condition three (0g, 1m / s), the deviation correction time is the longest, which is 6.2 seconds, reflecting the low efficiency when there is a light object and strong wind.
[0070] Conclusion: The deviation correction time is inversely proportional to the weight of the weight and directly proportional to the wind speed; increasing the weight of the hoisted object or reducing the wind speed can significantly improve the deviation correction efficiency.
[0071] In Figure 12 the changing trend of the absolute value of the offset with the weight of the weight and the wind speed, the abscissa is the weight of the weight (g), which are 0g, 50g, and 100g respectively, and each group of weights corresponds to different wind speeds (0m / s, 0.5m / s, 1m / s). The ordinate is the absolute value of the offset (mm), and the range is from 1mm to 13mm.
[0072] Changing trend: When the weight of the weight is fixed, the greater the wind speed, the greater the absolute value of the offset. For example: When the weight of the weight is 0g and the wind speed increases from 0m / s to 1m / s, the absolute value of the offset increases from 4mm to 13mm.
[0073] When the weight of the weight is 50g and the wind speed increases from 0m / s to 1m / s, the absolute value of the offset increases from 3mm to 6mm.
[0074] When the wind speed is fixed, the greater the weight of the weight, the smaller the absolute value of the offset. For example: When the wind speed is 0m / s and the weight of the weight increases from 0g to 100g, the absolute value of the offset decreases from 4mm to 1mm.
[0075] When the wind speed is 1 m / s, the weight of the counterweight increases from 0 g to 100 g, and the absolute value of the offset decreases from 13 mm to 4 mm.
[0076] Important nodes: In working condition seven (100 g, 0 m / s), the absolute value of the offset is the smallest, which is 1 mm, indicating that the accuracy is the highest when there is no wind for the heavy object.
[0077] In working condition three (0 g, 1 m / s), the absolute value of the offset is the largest, which is 13 mm, indicating that the accuracy is the lowest when the light object is under strong wind.
[0078] In summary, the absolute value of the offset is inversely proportional to the weight of the counterweight and directly proportional to the wind speed; increasing the weight of the hoisted object or reducing the wind speed can significantly improve the deviation correction accuracy.
[0079] Table 1 Nine working conditions of the intelligent cable crane scale model test results
[0080] Based on the above nine working conditions of the scale model test, the following conclusions can be obtained: (1) The intelligent algorithm combining machine vision and PID control can realize the dynamic correction of the hoisted object and the predetermined landing point under strong wind conditions, so that the center of the concrete lifting bucket coincides dynamically with the center of the greenhouse window. For example, when the wind speed is 1 m / s, the absolute value of the offset of the hoisted object is 13 mm (working condition three), but through dynamic adjustment, the offset gradually decreases to 6 mm (working condition six). The deviation correction time is also shortened from 6.2 seconds (working condition three) to 5.4 seconds (working condition six), indicating that the algorithm can still work effectively under strong wind conditions. During the operation, when the target window is moved, the hoisted object can achieve dynamic tracking; during the falling process of the hoisted object, it overcomes the interference of strong wind and makes dynamic adjustments until the hoisted object falls into the target window.
[0081] (2) The deviation correction algorithm combining machine vision and PID control has a high accuracy. Although it cannot guarantee that the hoisted object falls exactly in the center of the target area, the absolute value of the offset in all working conditions is within the range of 1 - 13 mm, and the hoisted object can fall into the target area. For example, in working condition seven (100 g, 0 m / s), the absolute value of the offset is only 1 mm, and the deviation correction time is 4.2 seconds, which is the best among all working conditions. In working condition three (0 g, 1 m / s), the absolute value of the offset is the largest (13 mm), and the deviation correction time is the longest (6.2 seconds), further proving the positive correlation between the offset and the deviation correction time. Within the error range, for the working conditions with a longer deviation correction time, the offset is often larger. If this algorithm is applied to actual projects, it can meet the functional requirements.
[0082] (3) The rectification efficiency is affected by the wind speed and the weight of the hoisted object. Among the above nine working conditions, the rectification efficiency of working condition seven is the highest, while that of working condition three is the lowest. For example, the rectification time of working condition seven (100 g, 0 m / s) is the shortest (4.2 seconds), while that of working condition three (0 g, 1 m / s) is the longest (6.2 seconds). When the weight of the hoisted object is low (0 g) or the wind speed is high (1 m / s), the amplitude of the hoisted object's swing is large, and the rectification time increases significantly. When the weight of the hoisted object is low or the wind speed is high, it can be observed that the amplitude of the hoisted object's swing is large and it is not easy to stabilize. According to the test results, it can be concluded that the rectification efficiency is directly proportional to the weight of the hoisted object and inversely proportional to the wind speed.
[0083] The present invention proposes a rectification algorithm for the transportation of suspension tanks under the influence of strong winds by combining machine vision and PID control technology. The results of the scaled-down test show that the algorithm can dynamically correct the position of the hoisted object to accurately coincide with the target landing point, and the offset is controlled within 13 mm, meeting the actual engineering requirements. The rectification efficiency is affected by the wind speed and the weight of the hoisted object, and it performs optimally under the working condition of no wind and a large weight of the hoisted object, with the shortest rectification time of only 4.2 seconds. The application of this technology not only improves the efficiency of the suspension tank entering the bin, but also reduces the temperature loss in the greenhouse and the complexity of manual operation.
[0084] Although the present invention has been described in detail with general descriptions and specific embodiments above, based on the present invention, some modifications or improvements can be made, which are obvious to those skilled in the art. Therefore, these modifications or improvements made without departing from the spirit of the present invention all fall within the scope of protection required by the present invention.
Claims
1. An intelligent deviation correction method for cable cranes based on machine vision and PID control, characterized in that: It includes the following steps: (1) Real-time capture the images of the hanging bucket and the discharging area through a camera, use the contour detection algorithm to identify the center coordinates (x1, y1) of the hanging bucket and the center coordinates (x2, y2) of the target discharging window, and calculate the horizontal and vertical deviation values (Δx, Δy) between the two. Where, Δx = x2 - x1; Δy = y2 - y1; (2) Take the calculated horizontal and vertical deviation values (Δx, Δy) as the input signals of the PID controller; (3) The PID controller performs proportional, integral, and differential operations on the deviation according to the compound control strategy to generate the corresponding control quantities (ux, uy); (4) The control quantities (ux, uy) are output as motor drive signals through the digital-to-analog conversion module to adjust the moving speed and direction of the X-axis and Y-axis of the cable machine, and dynamically adjust the position of the hanging bucket; (5) The machine vision system continuously detects the position of the hanging bucket, updates the horizontal and vertical deviation values (Δx, Δy) and feeds them back to the PID controller to form a closed-loop control. Repeat the above steps until the deviation value between the center of the hanging bucket and the center of the target discharging window is less than the set threshold.
2. The intelligent deviation correction method for cable crane based on machine vision and PID control according to claim 1, characterized in that: The steps of the contour detection algorithm are as follows: Step 1: Use the raster scanning algorithm to scan the image line by line and initialize the input image number NBD; when the gray value of the pixel point (i, j) is non-zero, assign a new boundary number and set the starting point of boundary tracking; Step 2: According to the determination rules of the type characteristics of the former boundary B' and the currently newly detected boundary B, automatically construct a tree structure of the contour to distinguish the nested relationship between the outer boundary and the hole boundary; Step 3: Start boundary tracking from the pixel point (i, j) as the boundary starting point, where the boundary starting point includes the outer boundary starting point and the hole boundary starting point; Step 4: If , then LNBD , which means that when the gray value of the current pixel is not 1, the absolute value of the current pixel value is assigned to LNBD to update the boundary number of the most recently processed one, ensuring that the hierarchical relationship of the contour can be correctly traced during the subsequent scanning process. Then, continue the raster scan from the pixel position (i, j + 1) until the entire scanning process is completed at the lower right vertex of the image. Otherwise, continue the raster scan of the image; The parent boundary determined in Step 2 is used to mark the contour hierarchy relationship in the subsequent tracking of Step 3 and update LNBD in Step 4; finally, the parent boundary information will be saved to the contour attributes for geometric analysis.
3. The intelligent deviation correction method for cable crane based on machine vision and PID control according to claim 2, characterized in that: Step 1 specifically includes: Let the input image be , representing the gray value of the pixel at (i, j); the initial NBD is 1; the raster scan algorithm is used to scan the image F row by row. When the gray value of the pixel (i, j) is detected as a non-zero value, whenever entering the starting position of a new row, the LNBD variable is reset to the value 1.
4. An intelligent deviation correction method for a cable crane based on machine vision and PID control according to claim 2, characterized in that: In Step 1, the steps for detecting that the gray value of the pixel point (i, j) is non-zero are as follows: If and , then (i, j) is the starting point of the outer boundary, NBD += 1, , which means: set the tracking starting point to the coordinate (i, j - 1) on the left of the current pixel (i, j), as the initial search direction point for subsequent boundary tracking; If and , then (i, j) is the starting point of the hole boundary, NBD += 1, , indicating that: set the tracking starting point to the coordinate (i, j + 1) on the right side of the current pixel (i, j), which is used as the initial search direction point for subsequent boundary tracking; If , then LNBD , which means: assign LNBD to be , that is, the value of LNBD becomes , which is used to dynamically update the value of LNBD to record the number of the boundary to which the current pixel belongs, so as to support the accurate determination of the contour hierarchy relationship; In other cases, jump to Step 4.
5. The intelligent deviation correction method for a cable crane based on machine vision and PID control according to claim 2, characterized in that: The determination rules of the type characteristics of the former boundary B' and the currently newly detected boundary B specifically include: When B' is the outer boundary and B is the outer boundary, the parent boundary of B is the parent boundary of B'; when B' is the outer boundary and B is the hole boundary, the parent boundary of B is B itself; when B' is the hole boundary and B is the outer boundary, the parent boundary of B is B itself; when B' is the hole boundary and B is the hole boundary, the parent boundary of B is the parent boundary of B', so as to determine the parent boundary of B.
6. The intelligent deviation correction method of a cable crane based on machine vision and PID control according to claim 4, characterized in that: Step 3 specifically includes: a. Taking the pixel point (i, j) as the central unit, with as the initial search direction point, sequentially retrieve whether there are non-zero gray-scale pixels within the 4-neighborhood or 8-neighborhood range of the central pixel in a clockwise order; If a valid pixel is detected, the first pixel point satisfying the condition in the clockwise direction is determined as the target adjacent point currently being tracked; otherwise, let =-NBD, which means: perform a boundary processing mark on the current pixel, indicating that the pixel has completed boundary tracking and belongs to the external area of the current boundary, and jump to step 4; b. , ; Indicates: Update the leading point of boundary tracking, that is, record the coordinates of the point of the previous search direction and the coordinates of the current point, providing a benchmark for the next counterclockwise search of the neighborhood. Assign to be , that is, take the next adjacent point just found as the new leading direction point, and assign to be , that is, take the currently processed pixel point as the new current tracking point; c. Starting from as the center, in the counterclockwise direction, using the next point of as the starting position, search the 4-neighborhood or 8-neighborhood of to determine whether there is a non-zero pixel value; if so, define the first non-zero pixel point encountered in the counterclockwise direction as ; d. If is a 0 pixel point that has been checked in c of Step 3, then ; It means: set the value of the pixel point with the coordinate of to negative NBD; If is not a pixel point already checked in c of Step 3, and , it means that: this pixel belongs to an unmarked target area, that is, no boundary number has been assigned yet, then ; it means that: set the value of the pixel point with coordinates to NBD; In other cases, do not change and keep the original value; If and , it means: Determine whether the current boundary tracking has looped back to the starting point to form a complete closed contour, : The next adjacent point searched counterclockwise has returned to the initial starting point of the boundary tracking, : The current tracking point has moved to the first subsequent point of the boundary path , then jump to step 4; Otherwise, let , , indicating that: assign the leading point to the original current point , that is, record the current point as the new leading direction, and assign the current point to the newly found adjacent point , that is, move to the next pixel point of the boundary, and jump to c.
7. An intelligent deviation correction method for a cable crane based on machine vision and PID control according to claim 1, characterized in that: The compound control strategy is specifically designed as follows: Based on the deviation value between the input signal and the desired output, perform weighted operations according to the mathematical function relationships of proportion, integral, and differential, and use the operation result as the control input of the actuator, so as to achieve precise adjustment of the dynamic characteristics of the system; among them, the proportional coefficient, integral time constant, and differential time constant are all obtained by debugging parameters. The compound control strategy of PID control for continuous control systems is as follows: ; Where: t is the current time; u(t) is the output signal of the PID controller; K p is the proportionality coefficient; T t is the integral time constant; T D is the derivative time constant; e(t) is the difference between the set value and the measured value, e(t)=Δx or e(t)=Δy; the control quantities ux and uy are calculated and used to adjust the movement of the cable crane in the X-axis and Y-axis respectively.
Citation Information
Patent Citations
Design method based on machine vision inspection centring control device
CN101596556A
Dome camera high-precision tracking system and method based on PID algorithm
CN111757011A