Water conservancy valve welding posture adjusting method and system based on images and storage medium
By collecting and analyzing the friction welding parameters of hydraulic valves, attitude adjustment parameters were generated, which solved the problem of flange and valve body misalignment during the friction welding process, and improved welding quality and precise positioning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-18
- Publication Date
- 2026-04-21
AI Technical Summary
During the friction welding process of hydraulic valves, the relative friction between the flange and the valve body causes radial movement and axial displacement, which affects the welding quality.
By collecting friction welding parameters, controlling the relative rotation of the valve body and flange, acquiring the current optimal detection position, performing image recognition processing to generate attitude adjustment parameters, and adjusting the attitude of the valve body and flange to ensure accurate positioning.
This improved the quality and precision of hydraulic valve welding, and reduced deviations during the welding process.
Smart Images

Figure CN121892826A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of valve welding, and in particular to an image-based method, system, and storage medium for adjusting the welding posture of hydraulic valves. Background Technology
[0002] Welding of hydraulic valves is part of the hydraulic valve manufacturing process, mainly including valve body welding, sealing surface overlay welding, flange welding, and internal component welding.
[0003] Among related technologies, friction welding has become a commonly used process for welding hydraulic valves due to its advantages of high efficiency, high strength and small deformation. For example, when butt welding flanges and valve bodies, the operator fixes the flange and valve body on the work station, then positions the flange and valve body to ensure that the relative positions between them are accurate. Then, the flange and valve body are rubbed against each other at high speed and a certain pressure is applied to complete the butt welding of the flange and valve body.
[0004] Regarding the aforementioned technologies, during the friction welding process of hydraulic valves, the high-speed relative friction inevitably causes radial movement and axial displacement of the flange and valve body. This results in deviations in the precise positioning of the valve body and flange by the operators, leading to low welding quality of the hydraulic valves, and there is still room for improvement. Summary of the Invention
[0005] To improve the welding quality of hydraulic valves, this application provides an image-based method, system, and storage medium for adjusting the welding posture of hydraulic valves.
[0006] In the first aspect, this application provides an image-based method for adjusting the welding posture of hydraulic valves, employing the following technical solution: Image-based hydraulic valve welding posture adjustment method includes: Collect friction welding parameters for hydraulic valves; The valve body and flange are rotated relative to each other based on the friction welding parameters, and the current optimal detection position is collected. The detection location image is acquired based on the current optimal detection location; Image recognition processing is performed on the detection location image and the preset reference image to generate attitude adjustment parameters; The valve body and flange are adjusted according to the attitude adjustment parameters, and the relative rotation of the valve body and flange is controlled according to the friction welding parameters to weld the valve body and flange.
[0007] Optionally, the steps for acquiring the current optimal detection location include: Collect the current detection location interval and historical detection locations; Determine whether the current detection position interval meets the preset detection position update interval requirement; If it does not meet the requirements, the historical detection position is defined as the current best detection position, and the current detection position is collected at intervals for cyclical judgment. If the conditions are met, the current welding time will be collected. Based on the current welding time, preset candidate detection positions are filtered to generate the current optimal detection position.
[0008] Optionally, the step of filtering preset candidate detection positions based on the current welding time to generate the current optimal detection position includes: Candidate detection locations are initially screened based on the current welding time to generate precise detection locations; The precise detection location is detected to generate parameters affecting the detection location; The influence weight of the current time and location is collected based on the current welding time. The detection location influence parameters are weighted and summed based on the influence weight of the current time location to generate a detection location influence score; The precise detection locations are sorted and filtered based on the influence score of the detection location to generate the current optimal detection location.
[0009] Optionally, the step of initially screening candidate detection locations based on the current welding time to generate precise detection locations includes: The speed of welding is affected by the acquisition process. Calculate the product of the welding influence speed and the current welding time to generate the current welding influence distance; The current welding influence distance and the preset reference welding position are analyzed to generate the welding influence position; Candidate detection locations are screened based on the location affected by welding in order to generate accurate detection locations.
[0010] Optionally, the step of detecting the precise detection location to generate detection location influence parameters includes: Calculate the Euclidean distance between the precise detection position and the preset reference welding position to generate the position distance influence coefficient; The precise detection location is detected to generate the detection location temperature, detection location brightness, and detection location image; Image analysis and processing are performed on the detection location image to generate spot area ratio, edge gradient value, image contrast and grayscale stability coefficient; The temperature, brightness, and spot area ratio at the detection location are analyzed to generate a position interference influence coefficient. The edge gradient values, image contrast, and grayscale stability coefficient are analyzed to generate a positional clarity influence coefficient. The influence coefficients of location distance, location interference, and location clarity are correlated to generate the detection location influence parameter.
[0011] Optionally, the steps for collecting the influence weight of the current time position based on the current welding time include: Based on the current welding time, find the corresponding current welding period in the preset time welding correspondence; Based on the current welding period, the corresponding influence weight of the current time position is found in the preset welding period weight relationship.
[0012] Optionally, the step of performing image recognition processing on the detection location image and a preset reference image to generate pose adjustment parameters includes: The detection location image is analyzed to generate the image coordinates of the detected feature points; The baseline image and the current best detection location are analyzed to generate the coordinates of the baseline feature point image; The difference between the coordinates of the detected feature point image and the coordinates of the reference feature point image is calculated to generate the feature point pixel deviation; Calculate the product of the feature point pixel deviation and the preset visual pixel equivalent to generate the actual feature point deviation; The actual deviation of the feature points is analyzed to generate attitude adjustment parameters.
[0013] Optionally, the step of analyzing the actual deviations of feature points to generate attitude adjustment parameters includes: Calculate the product of the actual deviation of the feature point and the preset rigid body mapping matrix to generate the actual deviation of the welding position; Determine the attitude translation parameters based on the actual deviation of the welding position; Calculate the Euclidean distance between the current optimal detection position and the preset reference welding position to generate the tilt correction distance; Calculate the quotient of the attitude translation parameters and the tilt correction distance to generate the tilt correction parameters; Associate attitude translation parameters and tilt correction parameters to generate attitude adjustment parameters.
[0014] Secondly, this application provides an image-based hydraulic valve welding posture adjustment system, which adopts the following technical solution: Image-based hydraulic valve welding posture adjustment system includes: The acquisition module is used to acquire friction welding parameters, the current optimal detection position, and images of the detection position. A memory for storing a program for the image-based hydraulic valve welding posture adjustment method as described in any of the preceding claims; The processor and the program in the memory can be loaded and executed by the processor to implement the image-based hydraulic valve welding posture adjustment method as described in any of the above.
[0015] Thirdly, this application provides a computer storage medium capable of storing corresponding programs, which facilitates improving the welding quality of hydraulic valves, and adopts the following technical solution: A computer-readable storage medium storing a computer program capable of being loaded by a processor and executing any of the above-described image-based hydraulic valve welding posture adjustment methods.
[0016] In summary, this application includes at least one of the following beneficial technical effects: 1. By detecting the current optimal detection position during welding of the valve body and flange by relative rotation, the detection position image of the current optimal detection position is acquired. After image recognition processing of the detection position image and the reference image, the attitude adjustment parameters are obtained. The attitude adjustment parameters are then used to adjust the attitude of the valve body and flange, maintaining the precise positioning of the valve body and flange during the welding process, thereby improving the welding quality of the hydraulic valve. 2. By detecting the current welding time when the current detection position interval meets the requirement of the detection position update interval, the candidate detection positions are screened based on the current welding time to obtain the current optimal detection position. As the welding time changes, the current optimal detection position changes adaptively, thereby improving the accuracy of detecting welding deviations from the current optimal detection position. 3. By calculating the product of the actual deviation of the feature point and the rigid body mapping matrix, the actual deviation of the welding position is obtained based on the actual deviation of the feature point. Based on the actual deviation of the welding position, the attitude adjustment parameters are calculated to ensure that the attitude adjustment of the valve body and flange is based on the deviation of the welding position, thereby improving the accuracy of the attitude adjustment parameters. Attached Figure Description
[0017] Figure 1 This is a flowchart of the image-based hydraulic valve welding posture adjustment method in the embodiments of this application.
[0018] Figure 2 This is a flowchart of the steps for collecting the current optimal detection position in the embodiments of this application.
[0019] Figure 3 This is a flowchart of the steps in this application embodiment to filter preset candidate detection positions based on the current welding time in order to generate the current optimal detection position.
[0020] Figure 4 This is a flowchart of the steps in this application embodiment to perform preliminary screening of candidate detection positions based on the current welding time in order to generate accurate detection positions.
[0021] Figure 5This is a flowchart of the steps in this application embodiment to detect the precise detection position in order to generate the detection position influence parameters.
[0022] Figure 6 This is a flowchart of the steps in this application embodiment to collect the influence weight of the current time position based on the current welding time.
[0023] Figure 7 This is a flowchart of the steps in this application embodiment to perform image recognition processing on the detection position image and the preset reference image to generate attitude adjustment parameters.
[0024] Figure 8 This is a flowchart of the steps in this application embodiment to analyze the actual deviation of feature points in order to generate attitude adjustment parameters. Detailed Implementation
[0025] To make the purpose, technical solution, and advantages of this application clearer, the following description is provided in conjunction with the appendix. Figures 1 to 8 The present application will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the application.
[0026] Reference Figure 1 This application discloses an image-based method for adjusting the welding posture of hydraulic valves, including the following steps: Step S100: Collect the friction welding parameters of the hydraulic valve.
[0027] Friction welding parameters refer to the process parameters in friction welding of valve bodies and flanges in hydraulic valves, including parameters such as friction speed, friction pressure, upsetting pressure, and welding time. For example, the friction speed is 1450 rpm, the friction pressure is 7.5 MPa, the upsetting pressure is 11.5 MPa, and the welding time is 30 seconds. Operators collect a large number of welding parameters in previous friction welding operations using devices such as pressure sensors, speed sensors, and timers, and then select the welding parameters with the best welding quality as the friction welding parameters input into the processing terminal to ensure the welding quality of the valve body and flange.
[0028] Step S101: Control the relative rotation of the valve body and flange according to the friction welding parameters, and collect the current optimal detection position.
[0029] In this process, after the processing terminal calls the friction welding parameters, it controls the corresponding welding spindle and hydraulic mechanism according to the rotation speed and pressure corresponding to the friction welding parameters. This drives the valve body and flange to rotate relative to each other at the corresponding rotation speed and pressure, thereby starting the friction welding of the valve body and flange. The terminal also detects the current optimal detection position, providing a standard position for subsequent attitude detection of the valve body and flange during friction welding.
[0030] The current optimal detection position refers to the best position for detecting the attitude deviation of the valve body and flange during friction, including the optimal detection position for the valve body and the optimal detection position for the flange. The specific determination method is detailed in [reference needed]. Figure 2 The steps involve determining the optimal detection position, rather than directly detecting the posture deviation of the valve body and flange from the welding position. This avoids the impact of bright areas and high-temperature deformation during the welding process on image acquisition, thereby ensuring the accuracy of the posture image.
[0031] Step S102: Acquire the detection position image based on the current optimal detection position.
[0032] After determining the optimal detection position, the processing terminal controls the industrial camera to acquire an image of the optimal detection position, thereby obtaining a detection position image, which provides data support for subsequent analysis of the posture deviation of the valve body and flange.
[0033] The detection position image refers to the image of the current optimal detection position on the valve body and flange, which is obtained by the processing terminal controlling the industrial camera to capture the current optimal detection position.
[0034] Step S103: Perform image recognition processing on the detection position image and the preset reference image to generate attitude adjustment parameters.
[0035] The reference image refers to the image of the valve body and flange being friction welded in a standard posture. The parameters such as the coaxiality and offset angle of the valve body and flange in the image meet the standards and are stored in the processing terminal by the operator.
[0036] Attitude adjustment parameters refer to the parameters used to adjust the attitude of the valve body and flange, including translation parameters and tilt adjustment parameters. These are obtained by the processing terminal after performing image recognition processing on the detection position image and the reference image. For specific methods, please refer to [reference needed]. Figure 7 The steps.
[0037] Step S104: Adjust the valve body and flange according to the attitude adjustment parameters, and continue to control the relative rotation of the valve body and flange according to the friction welding parameters to weld the valve body and flange.
[0038] After determining the attitude adjustment parameters, the processing terminal controls the three-axis translation mechanism and the tilt adjustment mechanism to adjust the attitude of the valve body and flange according to the translation and tilt parameters corresponding to the attitude adjustment parameters. This ensures that the welding position of the valve body and flange is accurately positioned. Furthermore, the processing terminal controls the corresponding welding spindle and hydraulic mechanism according to the speed and pressure corresponding to the friction welding parameters, driving the valve body and flange to rotate relative to each other at the corresponding speed and pressure. This completes the welding of the valve body and flange and ensures the welding quality of the valve body and flange.
[0039] Reference Figure 2 The steps for acquiring the current optimal detection location include: Step S200: Collect the current detection location interval and historical detection locations.
[0040] The current detection position interval time refers to the interval time since the last update of the best detection position. Every time the processing terminal updates the current best detection position, the processing terminal controls the timer to start counting to obtain the current detection position interval time, providing a time signal for subsequent updates of the current best detection position.
[0041] Historical detection position refers to the current best detection position after the last update. After the processing terminal updates the current best detection position, the updated current best detection position is defined as the historical detection position.
[0042] Step S201: Determine whether the current detection position interval meets the preset detection position update interval requirement.
[0043] Among them, the detection position update interval time refers to the standard interval time for updating the current best detection position. Taking 2 seconds as an example, the requirement for the detection position update interval time is that it is equal to the detection position update interval time.
[0044] The processing terminal determines whether the current detection position interval is equal to the detection position update interval, thereby determining whether the current optimal detection position needs to be updated. This avoids deviation detection from being performed at a fixed position for a long time, which would lead to inaccurate deviation detection.
[0045] Step S2011: If it does not meet the requirements, the historical detection position is defined as the current best detection position, and the current detection position is collected at intervals for cyclic judgment.
[0046] If the processing terminal determines that the current detection location interval is not equal to the detection location update interval, it indicates that the time since the last update of the current best detection location is short. Therefore, the historical detection location is defined as the current best detection location, and the current detection location interval is continuously monitored to continuously monitor whether the current best detection location needs to be updated.
[0047] Step S2012: If the conditions are met, then collect the current welding time.
[0048] If the processing terminal determines that the current detection position interval is equal to the detection position update interval, it indicates that the time since the last update of the current best detection position is long, and the current best detection position needs to be updated again to ensure the accuracy of attitude deviation identification. Therefore, the current welding time is detected to provide data support for the subsequent selection of the current best detection position.
[0049] The current welding time refers to the total time from the start of welding of the valve body and flange to the current time point. It is obtained by timing the welding time by a timer when the welding spindle and hydraulic mechanism at the processing terminal control are used to perform friction welding on the valve body and flange.
[0050] Step S202: Based on the current welding time, filter the preset candidate detection positions to generate the current optimal detection position.
[0051] Among them, the candidate detection position refers to the alternative position that can be used as the current best detection position. The operator determines all positions within the range set by the operator, starting from the welding position, as candidate detection positions.
[0052] The current optimal detection position in this step is the same as the current optimal detection position in step S101. It is obtained by the processing terminal after filtering candidate detection positions based on the current welding time. For details, please refer to [link / reference]. Figure 3 The steps.
[0053] Reference Figure 3 The steps for selecting the optimal detection position based on the current welding time from a set of candidate detection positions include: Step S300: Perform preliminary screening of candidate detection positions based on the current welding time to generate accurate detection positions.
[0054] The precise detection location refers to the candidate detection location that is not affected by the welding of the valve body and flange. During the friction welding process of the valve body and flange, the deformed parts of the valve body and flange will cover the valve body and flange. Due to the uncertainty of deformation, the covered parts cannot be considered as the current optimal detection location. Therefore, the candidate detection locations are initially screened based on the current welding time, and such locations are eliminated to ensure that the candidate locations are those with minimal welding interference. The specific method is described in [reference needed]. Figure 4 The steps.
[0055] Step S301: Detect the precise detection position to generate detection position influence parameters.
[0056] Among them, the detection position influence parameters refer to parameters used to quantify whether a precise detection position is suitable for identifying valve body and flange deviations. These include the position distance influence coefficient, position interference influence coefficient, and position clarity influence coefficient. These three dimensions quantify the degree of influence on valve body and flange deviation identification at this position. The parameters are obtained after the sensor detects the precise detection position. Specific methods are described in [reference needed]. Figure 5 The steps.
[0057] Step S302: Collect the influence weight of the current time position based on the current welding time.
[0058] The current time and position influence weight refers to the weight of different parameters in the detection position influence parameters for the degree of influence on the valve body and flange deviation at that position, calculated by the processing terminal based on the current welding time. The specific method is described in [reference needed]. Figure 6 The steps.
[0059] Step S303: The detection position influence parameters are weighted and summed based on the current time position influence weight to generate the detection position influence score.
[0060] Among them, the detection position influence score refers to the quantified score of interference when accurately detecting the deviation of valve body and flange. The higher the score, the stronger the interference when identifying deviation at this position, and the lower the corresponding accuracy. It is obtained by the processing terminal by weighting and summing the position distance influence coefficient, position interference influence coefficient and position clarity influence coefficient in the detection position influence parameters according to the current time position influence weight.
[0061] Step S304: Sort and filter the precise detection positions according to the detection position influence score to generate the current best detection position.
[0062] In this step, the current optimal detection position is the same as the current optimal detection position in step S202. The processing terminal sorts the detection position based on the detection position influence score of the precise detection position, thereby selecting the detection position with the smallest detection position influence score, and determining the precise detection position corresponding to the detection position influence score as the current optimal detection position. This ensures that the interference is minimized when identifying valve body and flange deviations at this position, the identification error is minimized, and the accuracy of deviation identification is improved.
[0063] Reference Figure 4 The steps for initially screening candidate detection locations based on the current welding time to generate precise detection locations include: Step S400: Collect welding-related data on speed.
[0064] Among them, the welding influence velocity refers to the speed at which the weld deformation area spreads towards the flange and valve body during the friction welding process of the valve body and flange. The change range of the deformation area is detected by the deformation detection sensor, and the welding influence velocity is obtained by calculating the ratio of the change range and the detection time. This provides data support for subsequent analysis of the influence of the weld deformation area on the candidate detection position.
[0065] Step S401: Calculate the product of the welding influence speed and the current welding time to generate the current welding influence distance.
[0066] The current welding influence distance refers to the distance covered by the weld deformation area from the welding position towards the valve body and flange. It is obtained by the processing terminal by calculating the product of the welding influence speed and the current welding time. By determining the current welding influence distance, data support is provided for the subsequent analysis of candidate detection positions that are not affected by the deformation area coverage.
[0067] Step S402: Analyze the current welding influence distance and the preset reference welding position to generate the welding influence position.
[0068] The reference welding position refers to the center position of the friction welding between the valve body and the flange. After the welding spindle and hydraulic mechanism connect the valve body and the flange, the position is obtained by static detection and stored in the processing terminal. The specific detection method can be image detection and coordinate transformation or direct measurement.
[0069] The weld influence location refers to the area covered by the weld deformation zone. Starting from the reference weld position, the processing terminal extends the current weld influence distance in both the flange direction and the valve body direction, thus defining all positions within this distance as the weld influence location.
[0070] Step S403: Filter candidate detection locations based on the location affected by welding to generate accurate detection locations.
[0071] In this step, the precise detection position is the same as that in step S300. The processing terminal removes the positions that are consistent with the welding influence position from the candidate detection positions, thereby avoiding the welding deformation area from covering the candidate positions and causing inaccurate deviation identification. The remaining positions in the candidate detection positions are the precise detection positions.
[0072] Reference Figure 5 The steps for detecting precise detection locations to generate detection location influence parameters include: Step S500: Calculate the Euclidean distance between the precise detection position and the preset reference welding position to generate the position distance influence coefficient.
[0073] The reference welding position in this step is the same as the reference welding position in step S402, and will not be described again here.
[0074] The position distance influence coefficient refers to the degree of influence of the precise detection position on the deviation identification in the distance dimension. The greater the distance, the greater the influence. The processing terminal calculates the distance between the precise detection position and the reference welding position according to the Euclidean distance formula, and then normalizes the distance to obtain the position distance influence coefficient.
[0075] Step S501: Detect the precise detection location to generate the detection location temperature, detection location brightness, and detection location image.
[0076] Among them, the temperature at the detection location refers to the temperature value at the precise detection location, which is obtained by an infrared temperature sensor detecting the precise detection location.
[0077] The brightness at the detection location refers to the brightness at the precise detection location, which is obtained by a photoelectric brightness sensor detecting the precise detection location.
[0078] The detection position image refers to an image of the precise detection position, which is obtained by taking a picture of the precise detection position with an industrial camera.
[0079] By determining the temperature, brightness, and image at the detection location, data support is provided for subsequent quantification of the impact of interference and clarity on deviation identification at the accurate detection location.
[0080] Step S502: Perform image analysis processing on the detection location image to generate spot area ratio, edge gradient value, image contrast and grayscale stability coefficient.
[0081] The spot area ratio refers to the proportion of the area of the spot in the detection location image. The processing terminal uses an image thresholding algorithm to segment the spot area in the detection location image, thereby counting the number of pixels in the spot area, and finally calculating the quotient of the number of spot pixels and the number of image pixels to obtain the spot area ratio.
[0082] The edge gradient value refers to the clarity of the edges in the image at the detection location. It is calculated by the processing terminal using the Canny edge detection algorithm.
[0083] Image contrast refers to the contrast of the image at the detection location, which is calculated by the processing terminal using a grayscale transformation algorithm.
[0084] The grayscale stability coefficient refers to the stability of the image quality at the detection location. It is calculated by the processing terminal through grayscale mean statistics on the image at the detection location.
[0085] By determining the area ratio of the light spot, the edge gradient value, the image contrast, and the gray-level stability coefficient, data support is provided for subsequent quantification of the impact of the precise detection location on deviation recognition in both the interference and clarity dimensions.
[0086] Step S503: Analyze the temperature, brightness, and spot area ratio at the detection location to generate a position interference influence coefficient.
[0087] The position interference influence coefficient refers to the degree of interference of the precise detection position on image acquisition. When the temperature, brightness, and spot area at the precise detection position are too large, it indicates that the degree of interference in the acquired image at the precise detection position is higher. Therefore, the larger the position interference influence coefficient, the greater the interference at the precise detection position. The processing terminal normalizes the temperature, brightness, and spot area ratio at the detection position, respectively. Finally, the normalized values are weighted and summed to obtain the position interference influence coefficient. The weight of temperature is 0.2, and the weights of brightness and spot area ratio are both 0.4.
[0088] Step S504: Analyze the edge gradient values, image contrast, and grayscale stability coefficient to generate a positional clarity influence coefficient.
[0089] The location clarity impact coefficient refers to the degree of influence of the image quality acquired at the accurate detection location on the deviation recognition. The image score is obtained by normalizing the edge gradient value, image contrast and grayscale stability coefficient by the processing terminal and then weighting and summing them. The reciprocal of the image score is then calculated, which is the location clarity impact coefficient. The larger the edge gradient value, image contrast and grayscale stability coefficient, the higher the image quality, and the higher the image score, while the lower the location clarity impact coefficient.
[0090] Step S505: Associate the location distance influence coefficient, location interference influence coefficient, and location clarity influence coefficient to generate the detection location influence parameter.
[0091] In this step, the detection position influence parameter is the same as that in step S301. The processing terminal organizes the position distance influence coefficient, position interference influence coefficient, and position clarity influence coefficient into a vector in order.
[0092] Reference Figure 6 The steps for collecting the influence weight of the current time position based on the current welding time include: Step S600: Find the corresponding current welding period in the preset time welding correspondence based on the current welding time.
[0093] The time-to-weld correspondence refers to the correspondence between different welding times and welding periods. For example, 0 to 5 seconds is the initial stage of friction welding, 5 to 25 seconds is the stable stage of friction welding, and 25 to 30 seconds is the upsetting stage of friction welding. The operator maps the welding time to the welding period to form a mapping table.
[0094] The current welding period refers to the welding period of the valve body and flange at the current moment, which is obtained by the processing terminal by looking up the corresponding mapping table of time welding relationship based on the current welding time.
[0095] Step S601: Based on the current welding period, find the corresponding influence weight of the current time position in the preset welding period weight relationship.
[0096] The weighting relationship of welding periods refers to the correspondence between the influence weights of different welding periods and the current time and position. In the initial stage of friction welding, the interference weight is greater than the distance weight, which is greater than the clarity weight. The interference weight ranges from 0.4 to 0.5, the distance weight ranges from 0.3 to 0.4, and the clarity weight ranges from 0.1 to 0.2. In the stable stage of friction welding, the deformation area spreads and covers some detection points. At this time, the interference weight needs to be increased. The interference weight ranges from 0.6 to 0.7, the distance weight ranges from 0.2 to 0.3, and the clarity weight ranges from 0.1 to 0.2. In the upsetting stage of friction welding, the deformation no longer spreads, and the interference weight decreases. The interference weight ranges from 0.45 to 0.55, the distance weight ranges from 0.3 to 0.35, and the clarity weight ranges from 0.1 to 0.25. The operator creates a mapping table that maps the influence weights of different welding periods to the current time and position.
[0097] The influence weight of the current time position in this step is the same as that in step S302, and is obtained by the processing terminal by looking up the mapping table corresponding to the weight relationship of the current welding period in the welding period.
[0098] Reference Figure 7 The steps for generating pose adjustment parameters by performing image recognition processing on the detected position image and a preset reference image include: Step S700: Analyze the detection location image to generate the image coordinates of the detection feature points.
[0099] Among them, the image coordinates of the detected feature points refer to the pixel coordinates of the detected feature points in the real-time image at the current optimal detection position. The processing terminal uses the ORB feature point detection algorithm to perform feature recognition on the detection position image, thereby identifying the detected feature points at the current optimal detection position. Then, the pixel coordinates of the detected feature points in the detection position image are extracted, which are the image coordinates of the detected feature points. By determining the image coordinates of the detected feature points, data support is provided for subsequent identification of the deviation of the current optimal detection position.
[0100] Step S701: Analyze the reference image and the current best detection position to generate reference feature point image coordinates.
[0101] The reference feature point image coordinates refer to the pixel coordinates of the detected feature point at the current optimal detection position in the standard image. The processing terminal extracts the feature point that is the same as the detected feature point at the current optimal detection position from the reference image, and then extracts the pixel coordinates of the feature point in the reference image, which are the reference feature point image coordinates. By determining the reference feature point image coordinates, standard data is provided for subsequent identification of the deviation of the current optimal detection position.
[0102] Step S702: Calculate the difference between the coordinates of the detected feature point image and the coordinates of the reference feature point image to generate the feature point pixel deviation.
[0103] Among them, the feature point pixel deviation refers to the pixel-level deviation of the feature point at the current optimal detection position. It is obtained by the processing terminal calculating the difference between the coordinates of the detected feature point image and the coordinates of the reference feature point image. By determining the feature point pixel deviation, data support is provided for the subsequent conversion of the actual physical deviation of the current optimal detection position.
[0104] Step S703: Calculate the product of the feature point pixel deviation and the preset visual pixel equivalent to generate the actual feature point deviation.
[0105] Visual pixel equivalent refers to the actual physical size corresponding to a single pixel, taking 0.01mm / pixel as an example.
[0106] The actual deviation of a feature point refers to the actual physical deviation of a feature point at the current optimal detection position. The processing terminal calculates the product of the feature point pixel deviation and the visual pixel equivalent, thereby converting the pixel-level deviation into the actual physical deviation.
[0107] Step S704: Analyze the actual deviation of the feature points to generate attitude adjustment parameters.
[0108] The attitude adjustment parameters in this step are the same as those in step S103, and are obtained by the processing terminal after analyzing the actual deviation of the feature points. The specific method is described in [reference needed]. Figure 8 The steps.
[0109] Reference Figure 8 The steps for analyzing the actual deviations of feature points to generate attitude adjustment parameters include: Step S800: Calculate the product of the actual deviation of the feature point and the preset rigid body mapping matrix to generate the actual deviation of the welding position.
[0110] The rigid body mapping matrix refers to the rotation matrix used to describe the fixed orientation relationship between the current optimal detection position and the reference welding position. The operator establishes a spatial rectangular coordinate system at the welding station and detects at least three sets of non-collinear coordinates on the valve body or flange and the reference welding position through laser positioning or vision positioning. The three sets of coordinates and the reference welding position are then substituted into the rigid body space transformation model. The rigid body space transformation model is solved by singular value decomposition or orthogonal iterative algorithm to obtain the rotation matrix.
[0111] The actual deviation of the welding position refers to the actual physical deviation of the reference welding position, which is obtained by multiplying the actual deviation of the feature point calculated by the processing terminal with the rigid body mapping matrix.
[0112] Step S801: Determine the attitude translation parameters based on the actual deviation of the welding position.
[0113] Among them, the attitude translation parameters refer to the translation distance and direction of the valve body and flange in the three-axis direction. The processing terminal determines the deviation direction and distance of the welding position in the three-axis direction based on the actual deviation of the welding position, and then adjusts the deviation direction of the three-axis direction in the opposite direction, and retains the distance to obtain the attitude translation parameters.
[0114] Step S802: Calculate the Euclidean distance between the current optimal detection position and the preset reference welding position to generate the tilt correction distance.
[0115] The reference welding position in this step is the same as the reference welding position in step S402, and will not be described again here.
[0116] The tilt correction distance refers to the reference length for tilt correction. It is obtained by calculating the Euclidean distance between the current optimal inspection position and the reference welding position using the Euclidean distance formula. By determining the tilt correction distance, a length basis is provided for subsequent tilt correction calculations.
[0117] Step S803: Calculate the quotient of the attitude translation parameter and the tilt correction distance to generate the tilt correction parameter.
[0118] The tilt correction parameter refers to the tilt correction angle of the valve body and flange. It is obtained by calculating the quotient of the offset distance of the three axes in the attitude translation parameters and the tilt correction distance by the processing terminal, and then calculating the arctangent trigonometric function of the quotient.
[0119] Step S804: Associate the attitude translation parameters and tilt correction parameters to generate attitude adjustment parameters.
[0120] In this step, the attitude adjustment parameters are the same as those in step S704. The processing terminal organizes the attitude translation parameters and tilt correction parameters into a unified vector according to a preset order.
[0121] Based on the same inventive concept, embodiments of this application provide an image-based hydraulic valve welding posture adjustment system, including: The data acquisition module is used to acquire friction welding parameters, the current optimal detection position, the detection position image, the current detection position interval time, historical detection positions, the current welding time, the current time and position influence weight, and the welding influence speed. A memory for storing the program for an image-based method for adjusting the welding posture of hydraulic valves; The processor and memory can load and execute the program to implement an image-based method for adjusting the welding posture of hydraulic valves.
[0122] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0123] This application provides a computer-readable storage medium storing a computer program that can be loaded by a processor and executed as an image-based hydraulic valve welding posture adjustment method.
[0124] Computer storage media include, for example, USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media that can store program code.
[0125] Based on the same inventive concept, this application provides a smart terminal, including a memory and a processor. The memory stores a computer program that can be loaded and executed by the processor to perform an image-based hydraulic valve welding posture adjustment method.
[0126] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0127] The above are all preferred embodiments of this application and are not intended to limit the scope of protection of this application. Any feature disclosed in this specification (including the abstract and drawings) may be replaced by other equivalent or similar features unless specifically stated otherwise. That is, unless specifically stated otherwise, each feature is only one example of a series of equivalent or similar features.
Claims
1. An image-based method for adjusting the welding posture of hydraulic valves, characterized in that, include: Collect friction welding parameters for hydraulic valves; The valve body and flange are rotated relative to each other based on the friction welding parameters, and the current optimal detection position is collected. The detection location image is acquired based on the current optimal detection location; Image recognition processing is performed on the detection location image and the preset reference image to generate attitude adjustment parameters; The valve body and flange are adjusted according to the attitude adjustment parameters, and the relative rotation of the valve body and flange is controlled according to the friction welding parameters to weld the valve body and flange.
2. The image-based hydraulic valve welding posture adjustment method according to claim 1, characterized in that, The steps for obtaining the current optimal detection location include: Collect the current detection location interval and historical detection locations; Determine whether the current detection position interval meets the preset detection position update interval requirement; If it does not meet the requirements, the historical detection position is defined as the current best detection position, and the current detection position is collected at intervals for cyclical judgment. If the conditions are met, the current welding time will be collected. Based on the current welding time, preset candidate detection positions are filtered to generate the current optimal detection position.
3. The image-based hydraulic valve welding posture adjustment method according to claim 2, characterized in that, The steps for selecting the optimal detection position based on the current welding time and filtering the preset candidate detection positions include: Candidate detection locations are initially screened based on the current welding time to generate precise detection locations; The precise detection location is detected to generate parameters affecting the detection location; The influence weight of the current time and location is collected based on the current welding time. The detection location influence parameters are weighted and summed based on the influence weight of the current time location to generate a detection location influence score; The precise detection locations are sorted and filtered based on the influence score of the detection location to generate the current optimal detection location.
4. The image-based hydraulic valve welding posture adjustment method according to claim 3, characterized in that, The steps for initially screening candidate detection locations based on the current welding time to generate precise detection locations include: The speed of welding is affected by the acquisition process. Calculate the product of the welding influence speed and the current welding time to generate the current welding influence distance; The current welding influence distance and the preset reference welding position are analyzed to generate the welding influence position; Candidate detection locations are screened based on the location affected by welding in order to generate accurate detection locations.
5. The image-based hydraulic valve welding posture adjustment method according to claim 3, characterized in that, The steps for detecting precise detection locations to generate detection location influence parameters include: Calculate the Euclidean distance between the precise detection position and the preset reference welding position to generate the position distance influence coefficient; The precise detection location is detected to generate the detection location temperature, detection location brightness, and detection location image; Image analysis and processing are performed on the detection location image to generate spot area ratio, edge gradient value, image contrast and grayscale stability coefficient; The temperature, brightness, and spot area ratio at the detection location are analyzed to generate a position interference influence coefficient. The edge gradient values, image contrast, and grayscale stability coefficient are analyzed to generate a positional clarity influence coefficient. The influence coefficients of location distance, location interference, and location clarity are correlated to generate the detection location influence parameter.
6. The image-based hydraulic valve welding posture adjustment method according to claim 3, characterized in that, The steps for determining the influence weight of the current time position based on the current welding time include: Based on the current welding time, find the corresponding current welding period in the preset time welding correspondence; Based on the current welding period, the corresponding influence weight of the current time position is found in the preset welding period weight relationship.
7. The image-based hydraulic valve welding posture adjustment method according to claim 1, characterized in that, The steps for generating pose adjustment parameters by performing image recognition processing on the detected position image and a preset reference image include: The detection location image is analyzed to generate the image coordinates of the detected feature points; The baseline image and the current best detection location are analyzed to generate the coordinates of the baseline feature point image; The difference between the coordinates of the detected feature point image and the coordinates of the reference feature point image is calculated to generate the feature point pixel deviation; Calculate the product of the feature point pixel deviation and the preset visual pixel equivalent to generate the actual feature point deviation; The actual deviation of the feature points is analyzed to generate attitude adjustment parameters.
8. The image-based hydraulic valve welding posture adjustment method according to claim 7, characterized in that, The steps for analyzing the actual deviations of feature points to generate attitude adjustment parameters include: Calculate the product of the actual deviation of the feature point and the preset rigid body mapping matrix to generate the actual deviation of the welding position; Determine the attitude translation parameters based on the actual deviation of the welding position; Calculate the Euclidean distance between the current optimal detection position and the preset reference welding position to generate the tilt correction distance; Calculate the quotient of the attitude translation parameters and the tilt correction distance to generate the tilt correction parameters; Associate attitude translation parameters and tilt correction parameters to generate attitude adjustment parameters.
9. An image-based hydraulic valve welding posture adjustment system, characterized in that, include: The acquisition module is used to acquire friction welding parameters, the current optimal detection position, and images of the detection position. A memory for storing the program of the image-based hydraulic valve welding posture adjustment method as described in any one of claims 1 to 8; The processor and the program in the memory can be loaded and executed by the processor to implement the image-based hydraulic valve welding posture adjustment method as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The computer program is stored and can be loaded by a processor and executed as described in any one of claims 1 to 8.