Adaptive workpiece control methods, equipment, media and systems

CN122559977APending Publication Date: 2026-08-14BYD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-04
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0004]然而,上述两种方案在面对不同工件时会存在定位精度不足的缺陷,从而影响工件装配的成功率

Benefits of technology

[0047]本申请提供一种自适应工件控制方法、设备、介质及系统,其中,本申请的方法提出测量当前工件表面相对于视觉系统相机焦平面的实时距离;基于所述实时距离确定焦点补偿量,并基于所述焦点补偿量实现对所述视觉系统的焦点预补偿;基于焦点预补偿后的视觉系统对所述当前工件进行成像,用于实现对所述当前工件的操作控制。在该过程中,基于实时距离与预先标定的基准测量距离的差值确定焦点补偿量,可针对性抵消工件高度变化带来的离焦偏差,从源头避免因离焦导致的成像模糊问题;通过焦点预补偿使视觉系统在成像前已处于精准对焦状态,进而能够稳定获取高精度工件图像,确保后续目标特征提取与坐标转换的准确性,最终有效解决了因工件高度变化引发的定位精度低的核心问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122559977A_ABST
    Figure CN122559977A_ABST
Patent Text Reader

Abstract

This application provides an adaptive workpiece control method, device, medium, and system, relating to automated assembly technology. The method includes: measuring the real-time distance between the current workpiece surface and the focal plane of a vision module camera; determining a focus compensation amount based on the real-time distance, and performing focus pre-compensation on the vision module based on the focus compensation amount; and imaging the current workpiece using the vision module after focus pre-compensation to achieve operational control of the current workpiece. This application can effectively improve the assembly success rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to automated assembly technology, and more particularly to an adaptive workpiece control method, equipment, medium, and system. Background Technology

[0002] In the automated stud assembly process of precision products such as battery cells, vision guidance and robotic arm collaborative control are key technologies for achieving high-precision and high-efficiency assembly.

[0003] Currently, the mainstream technical solutions in the industry are mainly divided into two categories: one is the assembly solution based on 3D vision guidance, which uses a 3D camera to collect 3D point cloud data of the workpiece, directly perceives the spatial position and height information of the workpiece, and guides the robot to complete the assembly action based on this; the other is the assembly solution based on 2D vision guidance, which uses an industrial camera to obtain 2D images of the workpiece, extracts the coordinate information of planar features such as plug holes through image processing algorithms, and then realizes the positioning guidance of the robot.

[0004] However, both of the above methods have the drawback of insufficient positioning accuracy when dealing with different workpieces, which affects the success rate of workpiece assembly. Summary of the Invention

[0005] This application provides an adaptive workpiece control method, device, medium, and system to improve positioning accuracy and ensure workpiece assembly success rate.

[0006] In a first aspect, this application provides an adaptive workpiece control method, the method comprising:

[0007] Measure the real-time distance between the current workpiece surface and the focal plane of the vision module camera;

[0008] The focus compensation amount is determined based on the real-time distance, and the focus pre-compensation of the vision module is achieved based on the focus compensation amount;

[0009] The vision module, after focus pre-compensation, images the current workpiece to enable operation control of the current workpiece.

[0010] In one possible implementation, determining the focus compensation amount based on the real-time distance includes:

[0011] Obtain a pre-calibrated reference measurement distance, which is the distance from the camera focal plane to the surface of the standard workpiece measured by the laser measurement module when the vision module establishes a clear image template of the standard workpiece;

[0012] The difference between the real-time distance and the reference measured distance is calculated, and the difference is used as the focus compensation amount; the focus compensation amount is used to adjust the position of the camera's focal plane.

[0013] In one possible implementation, the vision module based on focus pre-compensation images the current workpiece to achieve operational control of the current workpiece, including:

[0014] The image of the current workpiece is obtained by the vision module after focus pre-compensation, and the pixel coordinates of the target features on the current workpiece are extracted from the image by the image processing algorithm.

[0015] Convert the pixel coordinates into target coordinates in the robot's coordinate system;

[0016] Based on the target coordinates, the robot arm is controlled to perform operations on the current workpiece.

[0017] In one possible implementation, measuring the real-time distance of the current workpiece surface relative to the focal plane of the vision module camera includes:

[0018] The planar movement distance is determined based on the row and column position of the current workpiece in the planar matrix corresponding to the current batch of workpieces;

[0019] The laser measurement module is controlled to move to the measurement position corresponding to the current workpiece based on the planar movement distance;

[0020] The laser measurement module is controlled to measure the real-time distance.

[0021] In one possible implementation, measuring the real-time distance of the current workpiece surface relative to the focal plane of the vision module camera includes:

[0022] Select at least three sampling points on the surface of the current workpiece;

[0023] The laser measurement module is controlled to acquire distance data of the at least three sampling points relative to the camera focal plane.

[0024] Based on the distance data from the at least three sampling points, the real-time distance between the current workpiece surface and the focal plane of the vision module camera is determined.

[0025] In one possible implementation, the method further includes:

[0026] After the robotic arm performs the operation on the current workpiece, the target area of ​​the current workpiece that has been operated on is scanned in three dimensions by the laser measurement module to obtain the actual height data of the current workpiece.

[0027] Calculate the deviation between the actual height data and the preset ideal state;

[0028] If the deviation value exceeds a preset threshold, the robotic arm is controlled to perform a compensating pressing operation based on the deviation value.

[0029] In one possible implementation, obtaining the actual height data of the current workpiece includes:

[0030] The first height value of the current workpiece surface and the second height value of the assembly body surface are obtained respectively;

[0031] The actual height data is obtained by subtracting the first height value from the second height value.

[0032] Secondly, this application provides an adaptive workpiece control device, the device comprising:

[0033] The measurement module is used to measure the real-time distance between the current workpiece surface and the focal plane of the vision module camera;

[0034] The compensation module is used to determine the focus compensation amount based on the real-time distance, and to perform focus pre-compensation on the vision module based on the focus compensation amount;

[0035] The control module is used to image the current workpiece based on the vision module after focus pre-compensation, and to realize the operation control of the current workpiece.

[0036] Thirdly, this application provides an electronic device, including at least one processor and a memory communicatively connected to the processor;

[0037] The memory stores computer-executed instructions;

[0038] The processor executes computer execution instructions stored in the memory to implement the method as described in any of the first aspects.

[0039] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any of the first aspects.

[0040] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method as described in any of the first aspects.

[0041] Sixthly, this application provides an adaptive workpiece control system, the system comprising: a vision module and electronic equipment;

[0042] The vision module is used to image the current workpiece;

[0043] The electronic device is configured to:

[0044] In response to a preset trigger condition, the real-time distance between the current workpiece surface and the focal plane of the vision module camera is measured;

[0045] The focus compensation amount is determined based on the real-time distance, and the focus pre-compensation of the vision module is achieved based on the focus compensation amount;

[0046] The vision module, after focus pre-compensation, images the current workpiece to enable operation control of the current workpiece.

[0047] This application provides an adaptive workpiece control method, device, medium, and system. The method involves measuring the real-time distance between the current workpiece surface and the focal plane of a vision system camera; determining a focus compensation amount based on the real-time distance; and performing focus pre-compensation on the vision system based on the focus compensation amount. The vision system then images the current workpiece based on the pre-compensated focus, enabling operational control of the workpiece. In this process, determining the focus compensation amount based on the difference between the real-time distance and a pre-calibrated reference measurement distance can specifically offset defocus deviations caused by changes in workpiece height, preventing image blurring due to defocus at the source. Focus pre-compensation ensures the vision system is in precise focus before imaging, enabling stable acquisition of high-precision workpiece images and ensuring the accuracy of subsequent target feature extraction and coordinate transformation. Ultimately, this effectively solves the core problem of low positioning accuracy caused by changes in workpiece height. Attached Figure Description

[0048] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0049] Figure 1 This is a schematic diagram illustrating an application scenario of an adaptive workpiece control method provided in an embodiment of this application.

[0050] Figure 2 A flowchart illustrating an adaptive workpiece control method provided in this application embodiment. Figure 1 ;

[0051] Figure 3 A flowchart illustrating an adaptive workpiece control method provided in this application embodiment. Figure 2 ;

[0052] Figure 4 This is a schematic diagram of the structure of an adaptive workpiece control device provided in an embodiment of this application;

[0053] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0054] Figure 6 This is a schematic diagram of an adaptive workpiece control system provided in an embodiment of this application.

[0055] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0056] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0057] In the automated plug assembly process of precision products such as battery cells, vision guidance and robotic arm collaborative control are key technologies for achieving high-precision and high-efficiency assembly. This type of precision assembly requires extremely high positioning accuracy, typically controlled within the range of 0.02mm, to ensure that the plugs are accurately embedded in the pre-set plug holes on the workpiece, avoiding problems such as plug tilting, jamming, or workpiece damage, thereby guaranteeing the electrical performance and structural stability of the product.

[0058] Currently, the mainstream technical solutions in the industry are mainly divided into two categories: one is the assembly solution based on 3D vision guidance, which uses a 3D camera to collect 3D point cloud data of the workpiece, directly perceives the spatial position and height information of the workpiece, and guides the robot to complete the assembly action based on this; the other is the assembly solution based on 2D vision guidance, which uses an industrial camera to obtain 2D images of the workpiece, extracts the coordinate information of planar features such as plug holes through image processing algorithms, and then realizes the positioning guidance of the robot.

[0059] However, both of the above methods suffer from insufficient positioning accuracy when dealing with workpieces of different heights and specifications, workpiece tolerance fluctuations, or slight offsets in the assembly datum surface, thus affecting the success rate of workpiece assembly.

[0060] Specifically, while 3D vision-guided solutions can perceive height information, they are limited by the inherent contradiction between measurement range and accuracy. In scenarios with a large field of view, it is difficult to maintain high-precision positioning. High-precision 3D cameras often have a small field of view or a short working distance. When faced with the need for assembling various types of plugs over a wide range, they cannot flexibly adapt to the layout and height differences of different workpieces. Furthermore, they have strict requirements on the surface characteristics of the object being measured. Workpieces with reflective, light-absorbing, or transparent materials will interfere with the accuracy of point cloud data acquisition, indirectly leading to positioning deviations.

[0061] For 2D vision-guided solutions, the focal position is fixed. When the height of the workpiece changes, it is easy to cause the vision system to defocus, resulting in blurred images of the plug holes. This significantly increases the error in subsequent feature extraction and coordinate calculation. In traditional technologies, this type of positioning error can reach the order of 0.1~0.3mm, far exceeding the precision requirements of precision assembly.

[0062] Therefore, embodiments of this application provide an adaptive workpiece control method, device, medium, and system to solve the aforementioned problems. Specifically, the method of this application proposes to obtain the real-time distance between the current workpiece surface and the focal plane of the vision module camera, calculate the focus compensation amount based on the real-time distance, and complete the focus pre-compensation of the vision module. Finally, the pre-compensated vision module is used to image the workpiece to achieve precise operation control.

[0063] It is understood that the adaptive workpiece control method of this application is applicable to any scenario of automated assembly and positioning control of precision workpieces, for example, Figure 1 This is a schematic diagram illustrating an application scenario of an adaptive workpiece control method provided in an embodiment of this application, such as... Figure 1 As shown, the adaptive workpiece control method of this application can be used in the automated assembly of battery cells using plugs.

[0064] Currently, in the battery cell stud assembly scenario, traditional technologies generally suffer from the problem of vision module imaging defocusing due to fluctuations in battery cell height tolerance and differences in individual surface flatness. This leads to positioning deviations of target features such as stud holes on the battery cell, ultimately causing assembly defects such as stud misalignment and battery cell damage. At the same time, existing solutions mostly use fixed focus parameters, which cannot be dynamically adjusted according to the actual state of each battery cell, seriously affecting production efficiency and product yield.

[0065] When applying the method of this application to the above-mentioned scenarios, such as Figure 1As shown, the host computer in the automated assembly system is used as the execution subject: when inserting battery cells, for each battery cell to be assembled on the assembly workbench, the real-time distance between its surface and the focal plane of the vision module camera is first measured; then, the focus compensation amount is calculated based on the real-time distance, and the focus pre-compensation of the vision module is completed using the compensation amount; finally, the current battery cell is imaged by the vision module after focus pre-compensation, and the subsequent precise operation control is realized through the execution module based on the clear image.

[0066] In the above process, by performing a complete ranging-compensation-imaging process for each workpiece individually, the visual defocusing problem caused by individual workpiece differences is solved. Specifically, by measuring the range of each workpiece individually, the focus compensation amount is ensured to be targeted, avoiding the defects of a one-size-fits-all parameter setting in mass production; the camera focal plane is adjusted based on the compensation amount to ensure clear imaging of each battery cell, thereby improving the positioning accuracy of the plug hole and effectively avoiding the risk of plug misalignment; at the same time, this workpiece-by-workpiece adaptation mechanism is compatible with battery cells of different specifications and states, thereby improving the versatility and adaptability of the solution.

[0067] It should be understood that, in the above process, the executing entity of the method of this application can also be a lower-level control device such as a PLC controller or an embedded control module, or an industrial control computer can be directly used as an integrated control entity. This embodiment does not limit this. In addition, the application scenarios of the method of this application can also be other scenarios, such as precision assembly of automotive parts, semiconductor chip packaging, and medical device component assembly. This embodiment does not limit this.

[0068] The following detailed description, with reference to the accompanying drawings and using any electronic device as the execution subject, outlines some embodiments of the adaptive workpiece control method of this application. Where the embodiments do not conflict, the following embodiments and features thereof can be combined with each other.

[0069] This application provides an adaptive workpiece control method. Figure 2 A flowchart illustrating an adaptive workpiece control method provided in this application embodiment. Figure 1 ,like Figure 2 As shown, the method in this application embodiment includes:

[0070] S201. Measure the real-time distance between the current workpiece surface and the focal plane of the vision module camera.

[0071] The workpiece can be any component requiring precision assembly and positioning, including but not limited to battery cells, semiconductor chips, automotive micro-components, and medical device parts. This embodiment uses a battery cell (the battery cell to be assembled with plugs) as an example for detailed explanation, and subsequent steps all revolve around the battery cell plugging scenario.

[0072] The camera focal plane refers to the imaging plane of the camera lens in the vision module, that is, the plane on which light can form a clear image after passing through the lens. The position of the camera focal plane is related to the lens focal length and camera installation parameters, and is the core benchmark for judging image clarity.

[0073] In this embodiment, the real-time distance specifically refers to the vertical distance from the current workpiece surface to the camera focal plane. The accuracy of this distance directly affects the accuracy of subsequent focus compensation. Specifically, in this embodiment, the electronic device selects at least three sampling points on the surface of the current workpiece; controls the laser measurement module to acquire the distance data of at least three sampling points relative to the camera focal plane; and determines the real-time distance of the current workpiece surface relative to the focal plane of the vision module camera based on the distance data of at least three sampling points.

[0074] More specifically, this embodiment employs a laser measurement module combined with parallel laser scanning technology to acquire multiple distance data points. The laser measurement module utilizes laser triangulation to achieve high-precision distance measurement. The specific principle is as follows: a measurement triangle is constructed with three vertices: vertex A (laser emitting lens), vertex B (laser spot on the object being measured), and vertex C (receiving lens (CMOS image sensor)). By measuring the angle changes of this triangle, the distance change H between the workpiece surface and the vision system can be calculated. In actual operation, the laser measurement system outputs multiple parallel laser beams, simultaneously projecting them onto at least three preset sampling points on the current workpiece surface. The system receives the laser reflection signals from each sampling point and, combined with the aforementioned triangulation principle, synchronously calculates and acquires the distance data corresponding to each sampling point, achieving parallel acquisition of distance data from multiple sampling points.

[0075] In practical applications, distance data of at least three sampling points can also be obtained by serial laser scanning, that is, the laser beam of the laser measurement module is controlled to scan each preset sampling point in sequence and collect distance data point by point; or an array-type laser measurement module can be used to directly cover each sampling point through the sensor array to achieve synchronous acquisition. This application does not limit this.

[0076] More specifically, after obtaining distance data from at least three sampling points, the electronic device first performs outlier removal on the distance data of each sampling point, for example, by using the 3σ criterion to remove outlier data that deviates from the data mean by more than three times the standard deviation; then it calculates the arithmetic mean of the remaining valid distance data and uses this average value as the real-time distance of the current workpiece surface relative to the camera focal plane.

[0077] In practical applications, real-time distance can also be determined through other methods, which can be flexibly selected according to the type of distance measurement device used. For example, a weighted average method can be used (the average value is calculated after assigning different weights according to the importance of the sampling point's location); or the least squares method can be used to fit the plane equation of the workpiece surface, and the vertical distance from the fitted plane to the camera's focal plane can be used as the real-time distance; if a visual ranging device is used, the pixel coordinates of each sampling point and the camera's intrinsic parameters can be combined to calculate the distance from each sampling point to the focal plane using the triangulation principle, and then the final real-time distance can be obtained by fusion, etc. This application does not limit the specific distance determination method.

[0078] In addition, in practical applications, a single high-precision laser measurement module can be used to sample the workpiece surface multiple times and take the average value, or a visual ranging method combined with laser calibration can be used to obtain the real-time distance, etc. This application does not limit these methods.

[0079] In this embodiment, real-time data is obtained by fusing distance data from at least three sampling points. On the one hand, this effectively avoids single-point measurement errors caused by local protrusions, depressions, or stains on the workpiece surface, improving the stability and accuracy of distance measurement. On the other hand, it can adapt to workpieces with irregular shapes or uneven surfaces, such as irregularly shaped battery cells, accurately characterizing the overall height state of the workpiece surface through multi-sampling point data fusion. In addition, combined with the outlier extraction mechanism, the anti-interference ability of the measurement results can be enhanced, providing reliable data support for subsequent focus compensation and ensuring the clarity of subsequent imaging and the accuracy of assembly positioning.

[0080] In a preferred embodiment, some assembly scenarios typically require assembling multiple workpieces in a batch. To ensure measurement accuracy and subsequent imaging quality, the measurement module needs to be moved to the location of the current workpiece to be assembled. Therefore, this embodiment proposes to establish a planar matrix model for multiple workpieces in the current batch. This planar matrix model includes the row and column arrangement parameters and processing control parameters of the batch of workpieces. Specifically, the number of columns in the matrix is ​​set to i, the number of rows to j, the distance between adjacent workpieces in the column direction is ix, and the distance between adjacent workpieces in the row direction is jy. At the same time, the maximum number of processing times of the matrix is ​​defined as ij (i.e., the total number of workpieces in the batch), and the number of processing times n corresponds to the sequence number of the workpiece to be processed (the initial value of n is 1, representing the processing of the first workpiece, and n increments by 1 after processing is completed, until all ij workpieces are processed).

[0081] Based on this, the electronic device determines the planar movement distance according to the row and column position of the current workpiece in the planar matrix corresponding to the current batch of workpieces; controls the laser measurement module to move to the measurement position corresponding to the current workpiece based on the planar movement distance; and controls the laser measurement module to measure the real-time distance.

[0082] Specifically, row and column positions refer to the column and row coordinates of the current workpiece in the planar matrix. The column coordinates range from 1 to i, and the row coordinates range from 1 to j. Planar movement distance refers to the X-axis and Y-axis movement distances required for the laser measurement module to move from the reference origin (or the measurement position of the previous workpiece) to the measurement position of the current workpiece. The calculation of this distance is based on the preset row and column spacing parameters of the matrix.

[0083] More specifically, the row and column positions are determined as follows: calculate the row and column coordinates of the current workpiece based on the number of processing operations n, where row coordinate = ⌈n / i⌉ and column coordinate = n - (row coordinate - 1) × i; the planar movement distance is determined as follows: if the position of the first workpiece in the matrix (n=1) is taken as the origin, then the X-axis movement distance of the current workpiece = (column coordinate - 1) × ix and the Y-axis movement distance = (row coordinate - 1) × jy; if the position of the previous workpiece is taken as the starting point, then take the difference between the row and column coordinates of the current workpiece and the previous workpiece, and multiply them by the corresponding directional spacing to obtain the distance value of a single movement.

[0084] In practical applications, the absolute coordinates corresponding to the current processing number n can be directly matched by a preset list of absolute coordinates of the workpiece, and then the moving distance of the laser measurement module can be calculated; or the position of the current workpiece can be located in real time by visual recognition technology, and then the moving parameters can be determined, etc. This embodiment does not limit this.

[0085] After obtaining the planar movement distance, the electronic device generates motion commands to control the movement of the laser measurement module based on the planar movement distance. For example, it controls the laser measurement module to move (column coordinate - 1) × ix millimeters along the positive X-axis and (row coordinate - 1) × jy millimeters along the positive Y-axis. After the laser measurement module completes the movement in response to the motion command, it sends a feedback signal to the electronic device. After receiving the feedback signal, the electronic device controls the laser measurement module to perform the aforementioned measurement operation.

[0086] In practical applications, the laser measurement module may not send feedback signals. The electronic device may, based on a preset movement time, issue a movement command and then wait a fixed time interval (e.g., 2 seconds) to assume that the laser measurement module has moved into place and started measurement; or it may determine whether the movement is complete by monitoring the changes in the motor current of the laser measurement module, the position sensor signal, etc. This embodiment does not limit this.

[0087] In addition, in practical applications, the laser measurement module may not need to be moved. Instead, the workpiece can be transported to the fixed measurement position of the laser measurement module by controlling the movement of the motion platform carrying the workpiece. This application does not limit this.

[0088] In this embodiment, the laser measurement module is moved to the current workpiece location. On the one hand, the moving distance is calculated based on a preset planar matrix model, enabling automated and orderly measurement of batch workpieces, effectively improving measurement efficiency before assembly. Simultaneously, this method is adaptable to batch workpieces with different layout specifications, requiring only adjustment of the number of rows and columns and spacing parameters of the planar matrix for reuse, demonstrating strong versatility and flexibility. On the other hand, by precisely controlling the moving path of the laser measurement module, the measurement position is ensured to be accurately aligned with the target area of ​​the workpiece, avoiding measurement errors caused by positional deviations, thereby guaranteeing the accuracy of distance measurement.

[0089] It should be understood that the planar matrix model in this embodiment can be flexibly set as a uniform matrix or a non-uniform matrix according to the workpiece layout requirements of the actual assembly scenario. If all workpieces in a batch are arranged according to a uniform column spacing ix and row spacing jy rule, then the planar matrix is ​​a uniform matrix. In this case, the moving distance can be directly calculated by multiplying the row and column coordinates by the fixed spacing, which is suitable for standardized and large-scale assembly production lines. If there are differences in the layout spacing of workpieces in a batch (for example, the workpiece spacing in some areas is ix1 and ix2, and the row spacing is jy1 and jy2), then the corresponding spacing parameters can be entered into the matrix model according to the row and column positions to form a non-uniform matrix. The moving distance can be calculated by matching the spacing value corresponding to the row and column coordinates of the current workpiece, which meets the needs of irregular layout and customized assembly scenarios.

[0090] S202. Determine the focus compensation amount based on the real-time distance, and perform focus pre-compensation for the vision module based on the focus compensation amount.

[0091] In this embodiment, the focus compensation amount refers to the focal plane position compensation parameter that needs to be adjusted in order to make the focal plane of the vision module's camera accurately match the current workpiece surface and achieve clear imaging. Its value is determined by the difference between the real-time distance of the current workpiece and the reference measurement distance, and can be positive or negative, with positive and negative corresponding to the adjustment direction of the focal plane.

[0092] Specifically, in this embodiment, the electronic device acquires a pre-calibrated reference measurement distance, calculates the difference between the real-time distance and the reference measurement distance, and uses this difference as a focus compensation amount. The reference measurement distance is the distance from the camera focal plane to the surface of the standard workpiece, measured by the laser measurement module, when the vision module establishes a clear image template of the standard workpiece; the focus compensation amount is used to adjust the position of the camera focal plane.

[0093] More specifically, in this embodiment, for workpieces of the same model, before assembly, the reference measurement distance is calibrated using a standard workpiece. A standard workpiece refers to a workpiece of the same model as the workpiece to be assembled, whose surface flatness and height dimensions conform to design standards, and whose parameters are all within the tolerance range of that model workpiece, thus serving as a unified measurement reference.

[0094] The calibration process is as follows: Place the standard workpiece in the preset assembly station, control the laser measurement module to move to the measurement area of ​​the standard workpiece, select at least three sampling points and obtain the distance data from each sampling point to the camera focal plane, remove outliers from the data and calculate the arithmetic mean, which is the reference measurement distance. At the same time, store the reference measurement distance in the database of the electronic device for use in the calculation of focus compensation amount of subsequent batches of workpieces.

[0095] It should be understood that the reference measurement distance is the distance value when the camera's focal plane is precisely matched with the surface of a standard workpiece to achieve a clear image. The position of the focal plane at this point is the optimal imaging position for that type of workpiece. The real-time distance is the actual distance between the current workpiece surface and the camera's initial focal plane. The difference between the two corresponds precisely to the distance the focal plane needs to be adjusted to achieve the optimal imaging position for the current workpiece surface. Therefore, in this embodiment, the difference between the real-time distance and the reference measurement distance can be directly used as the focal length compensation amount f required by the vision module. Numerically, this difference is 1:1 with f, eliminating the need for a complex conversion model and providing accurate parameter support for subsequent focus pre-compensation.

[0096] After obtaining the focus compensation amount, the electronic device sends a focal plane adjustment command to the vision module, controlling the vision module to drive the camera to move in a direction perpendicular to the workpiece surface. The distance moved is equal to the absolute value of the focus compensation amount, and the direction of movement is determined by the sign of the difference. Specifically, if the real-time distance is greater than the reference measurement distance, the camera is controlled to move a corresponding distance away from the workpiece; if the real-time distance is less than the reference measurement distance, the camera is controlled to move a corresponding distance closer to the workpiece, ultimately bringing the camera's focal plane to a suitable imaging position with the current workpiece surface, thus completing the focus pre-compensation.

[0097] In practical applications, a preset correction coefficient can be introduced to calculate the focus compensation amount. The difference between the real-time distance and the reference measurement distance can be calibrated and then used as the compensation amount. Focus pre-compensation can also be achieved by moving the workpiece, that is, keeping the camera position fixed and controlling the motion platform carrying the workpiece to move a corresponding distance in the vertical direction so that the workpiece surface is precisely aligned with the camera focal plane. This application does not limit this.

[0098] In this embodiment, the focus compensation amount is determined based on the reference measurement distance. On the one hand, there is no need to introduce complex optical imaging principle formulas and lens distortion calibration algorithms. Accurate compensation parameters can be obtained simply by calculating the distance difference, which effectively reduces the computational complexity and control difficulty. On the other hand, the reference measurement distance is based on standard workpiece calibration and has a unified reference benchmark, which can effectively eliminate systematic errors caused by different batches of workpieces and different equipment installation states, and ensure the consistency and accuracy of focus compensation.

[0099] S203. The vision module after focus pre-compensation images the current workpiece to realize the operation control of the current workpiece.

[0100] It should be understood that the operation control of the current workpiece specifically refers to various precise operational actions related to workpiece assembly. This operation control needs to be realized through an actuator, such as an industrial robot or robotic arm. In this embodiment, taking the battery cell plug assembly scenario as an example, the corresponding operation control is to control the robot to precisely press the plug into the preset assembly position of the battery cell, thus completing the battery cell plug assembly process.

[0101] In this embodiment, clear positional information of target features on the workpiece surface is obtained by imaging the current workpiece. This allows the electronic device to plan a precise motion path for the actuator based on this information, ultimately controlling the robotic arm to complete the operation control of the current workpiece according to the planned path, ensuring the accuracy and consistency of the assembly action. The target features refer to the key geometric features on the current workpiece directly related to the assembly operation; these are the parts that the actuator needs to precisely align, such as the plug holes in a battery cell, the solder pads on a circuit board, and the locating pin holes in precision parts.

[0102] Specifically, in this embodiment, the electronic device acquires an image of the current workpiece through a vision module after focus pre-compensation, and uses an image processing algorithm to extract the pixel coordinates of the target features on the current workpiece from the image; converts the pixel coordinates into target coordinates in the robot coordinate system; and controls the robot to perform operations on the current workpiece based on the target coordinates.

[0103] More specifically, after the vision module completes focus pre-compensation, the electronic device sends an acquisition command to the vision module, causing the vision module to acquire an image of the current workpiece and transmit it to the electronic device. Upon receiving the workpiece image from the vision module, the electronic device first performs preprocessing operations such as filtering and enhancement to eliminate image noise. Then, it uses image processing algorithms such as edge detection and template matching to locate and extract the pixel coordinates of the target features. Subsequently, combining the hand-eye calibration parameters of the vision module and the robot arm, it converts the pixel coordinates into target coordinates in a Cartesian coordinate system that the robot arm can recognize. Finally, it sends motion control commands to the robot arm, controlling it to move from its initial position to above the target coordinates, adjust its posture, and perform preset operations such as pressing, gripping, or assembly. After the operation is completed, it controls the robot arm to return to its initial position, awaiting the next workpiece operation command.

[0104] The electronic device confirms that the vision module has completed focus pre-compensation by receiving a focal plane adjustment completion signal from the vision module. Specifically, after the vision module completes the position adjustment of the camera's focal plane according to the instructions, it automatically sends a feedback message containing the adjustment status to the electronic device. After the electronic device parses the message and confirms that the status is correct, it determines that focus pre-compensation is complete and then starts the image acquisition process.

[0105] In practical applications, operation control can also be achieved through other means, such as using a vision-guided conveyor belt positioning system in conjunction with pneumatic actuators to complete assembly operations; or using an autonomous mobile robot equipped with a vision module to achieve dynamic grasping and assembly of workpieces, etc. This embodiment does not limit this.

[0106] In this embodiment, operation control is achieved through a process of visual imaging → feature extraction → coordinate transformation → robotic arm control. On the one hand, the conversion from pixel coordinates to the robotic arm coordinate system is completed through hand-eye calibration, realizing precise linkage between visual guidance and mechanical operation. On the other hand, the entire control process is highly automated and requires no manual intervention, thereby improving assembly efficiency, reducing errors caused by manual operation, and ensuring the stability of batch workpiece assembly quality.

[0107] The method provided in this embodiment, through a closed-loop link of real-time ranging, precise compensation, and clear imaging, firstly addresses the imaging blurring problem caused by workpiece processing height errors and placement deviations in fixed focal plane schemes, ensuring that the workpiece target features are always within the camera's optimal imaging range, effectively improving feature recognition accuracy. Secondly, it eliminates the need for complex optical calibration algorithms, completing focus adjustment simply through distance difference calculation, reducing system control complexity and software development difficulty, and adapting to the cycle time requirements of high-speed automated assembly lines. Simultaneously, it tightly integrates distance measurement, focus compensation, and visual guidance operations, effectively avoiding operational deviations caused by imaging errors, and improving the consistency and yield rate of batch workpiece assembly. Furthermore, the core logic of this method does not depend on specific workpieces or actuators, and combined with a planar matrix model, it can seamlessly connect to batch workpiece automated assembly scenarios, possessing strong versatility and scenario adaptability.

[0108] This application also provides an embodiment of an adaptive workpiece control method to further illustrate the control process. Figure 3 A flowchart illustrating an adaptive workpiece control method provided in this application embodiment. Figure 2 ,like Figure 3 As shown, the method in this embodiment includes:

[0109] S301. After the robot arm performs the operation on the current workpiece, the actual height data of the current workpiece is obtained through the laser measurement module.

[0110] It should be understood that the execution timing of the process in this embodiment is after the robot arm completes the initial assembly of the current workpiece and the assembly body, and is used to check whether the assembly is qualified.

[0111] Specifically, in this embodiment, the actual height data is the height difference between the current workpiece and the upper surface of the assembly body. In this embodiment, the electronic device acquires a first height value of the current workpiece surface and a second height value of the assembly body surface; the difference between the first height value and the second height value is used to obtain the actual height data.

[0112] More specifically, the electronic device controls the laser measurement module to move to the target measurement area on the surface of the current workpiece and the reference measurement area on the surface of the assembly body, respectively. At least three sampling points are selected on the surface of the current workpiece for distance measurement. After eliminating abnormal measurement values, the arithmetic mean is calculated to obtain the first height value. Using the same measurement and data processing method, the second height value of the surface of the assembly body is obtained. Finally, the actual height data is determined by calculating the difference between the two height values.

[0113] In practical applications, the surface height between the current workpiece and the assembly body can be directly measured using a contact height gauge, or the height value can be calculated by fitting a two-dimensional image captured by a vision module. This embodiment does not limit this method.

[0114] In this embodiment, by selecting at least three sampling points to calculate the first height value and the second height value, the single measurement error caused by local unevenness of the workpiece surface and deviation of the measurement point can be effectively eliminated, ensuring the accuracy of the height data. At the same time, using the height difference between the two as the actual height data can directly reflect the current assembly height status of the workpiece relative to the assembly body, providing intuitive and reliable data support for subsequent assembly qualification judgment.

[0115] S302. Calculate the deviation between the actual height data and the preset ideal state.

[0116] Specifically, the preset ideal state refers to the theoretical height difference between the surface of the current workpiece and the upper surface of the assembly body after the current workpiece and the assembly body have completed standard assembly. This height difference is determined based on the design drawing parameters of the workpiece and the assembly body, which can ensure that the workpiece meets the functional and dimensional requirements after assembly. The electronic equipment obtains the deviation value by calculating the absolute value of the actual height data and the theoretical height difference.

[0117] S303. If the deviation value exceeds the preset threshold, the robot arm is controlled to perform a compensating pressing operation based on the deviation value.

[0118] Specifically, the preset threshold is the maximum permissible deviation value pre-set based on the tolerance range of the workpiece assembly and the performance requirements. This threshold needs to be determined in conjunction with actual production experience and design standards. If the deviation value exceeds this range, the current workpiece assembly is determined to be unqualified and compensation operation needs to be performed.

[0119] In this embodiment, when the deviation value exceeds a preset threshold, the electronic device sends a compensating pressing command to the robot arm, including the pressing position, pressing stroke, and pressing pressure. The pressing stroke is determined based on the deviation value; that is, the magnitude of the deviation value corresponds to the additional distance the robot arm needs to press down. It should be understood that during the workpiece assembly process, the initial pressing usually only allows the workpiece to initially fit against the assembly body, making it difficult to achieve the ideal assembly height in one go. Over-clogging is generally not an issue. Therefore, after receiving the command, the robot arm moves to the preset pressing point of the current workpiece and performs the pressing operation according to the set stroke and pressure until the workpiece height meets the requirements.

[0120] It should be understood that if the deviation value does not exceed the preset threshold, the current workpiece assembly is deemed qualified. The electronic device does not need to send a compensation pressing command to the robot arm, but directly controls the robot arm to reset and prepare to execute the assembly operation of the next workpiece.

[0121] The method in this embodiment adds a height detection and compensation pressing step after the robot arm's initial assembly. This allows for timely detection and correction of issues such as substandard assembly height, effectively preventing defects such as workpiece malfunction and insufficient assembly precision caused by improper assembly. Simultaneously, the compensation pressing stroke is precisely set based on the deviation value, avoiding workpiece damage caused by blind pressing and ensuring the stability of assembly quality. Furthermore, the entire detection and compensation process is automated, requiring no manual intervention. This improves assembly efficiency and reduces errors caused by manual inspection, making it suitable for large-scale, high-precision automated assembly lines.

[0122] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.

[0123] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0124] The above embodiments introduce an adaptive workpiece control method from the perspective of process flow. The following embodiments introduce an adaptive workpiece control device from the perspective of virtual module or virtual unit. For details, please refer to the following embodiments.

[0125] This application also provides an adaptive workpiece control device for implementing the methods described in the above method embodiments. Figure 4 This is a schematic diagram of the structure of an adaptive workpiece control device provided in an embodiment of this application, as shown below. Figure 4 As shown, in this embodiment, the adaptive workpiece control device may include:

[0126] Measurement module 41 is used to measure the real-time distance between the current workpiece surface and the focal plane of the vision module camera;

[0127] The compensation module 42 is used to determine the focus compensation amount based on the real-time distance and to perform focus pre-compensation for the vision module based on the focus compensation amount.

[0128] The control module 43 is used to image the current workpiece based on the vision module after focus pre-compensation, and to realize the operation control of the current workpiece.

[0129] In one possible implementation of this application embodiment, the compensation module 42 is specifically used for:

[0130] Obtain the pre-calibrated reference measurement distance, which is the distance from the camera focal plane to the surface of the standard workpiece measured by the laser measurement module when the vision module establishes a clear image template of the standard workpiece;

[0131] Calculate the difference between the real-time distance and the reference measured distance, and use the difference as the focus compensation amount; the focus compensation amount is used to adjust the position of the camera's focal plane.

[0132] In one possible implementation of this application embodiment, the control module 43 is specifically used for:

[0133] The image of the current workpiece is obtained by the vision module after focus pre-compensation, and the pixel coordinates of the target features on the current workpiece are extracted from the image by the image processing algorithm.

[0134] Convert pixel coordinates to target coordinates in the robot's coordinate system;

[0135] The robot arm is controlled to perform operations on the current workpiece based on the target coordinates.

[0136] In one possible implementation of this application embodiment, the measurement module 41 is specifically used for:

[0137] The planar movement distance is determined based on the row and column position of the current workpiece in the planar matrix corresponding to the current batch of workpieces;

[0138] The laser measurement module is controlled to move to the measurement position corresponding to the current workpiece based on the planar movement distance.

[0139] Control the laser measurement module to measure real-time distance.

[0140] In one possible implementation of this application embodiment, the measurement module 41 is specifically used for:

[0141] Select at least three sampling points on the surface of the current workpiece;

[0142] The laser measurement module is controlled to acquire distance data of at least three sampling points relative to the camera's focal plane.

[0143] Based on distance data from at least three sampling points, the real-time distance of the current workpiece surface relative to the focal plane of the vision module camera is determined.

[0144] In one possible implementation of this application embodiment, the control module 43 is further configured to:

[0145] After the robotic arm performs its operation on the current workpiece, the target area of ​​the current workpiece that has been operated on is scanned in three dimensions by the laser measurement module to obtain the actual height data of the current workpiece.

[0146] Calculate the deviation between the actual height data and the preset ideal state;

[0147] If the deviation value exceeds the preset threshold, the robotic arm will be controlled to perform a compensating pressing operation based on the deviation value.

[0148] In one possible implementation of this application embodiment, the control module 43 is specifically used for:

[0149] Obtain the first height value of the current workpiece surface and the second height value of the assembly body surface, respectively;

[0150] The actual height data is obtained by subtracting the first height value from the second height value.

[0151] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.

[0152] This application provides an electronic device. Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 5 As shown, Figure 5The illustrated electronic device includes at least one processor 51 and a memory 52. ​​The processor 51 and the memory 52 are connected, for example, via a bus 53. Optionally, the electronic device may also include a transceiver 54. It should be noted that in practical applications, the transceiver 54 is not limited to one, and the structure of this electronic device does not constitute a limitation on the embodiments of this application.

[0153] Processor 51 may be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 51 may also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0154] Bus 53 may include a pathway for transmitting information between the aforementioned components. Bus 53 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Bus 53 may be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0155] The memory 52 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.

[0156] The memory 52 is used to store computer execution instructions for implementing the scheme of this application, and the execution is controlled by the processor 51. The processor 51 is used to execute the computer execution instructions stored in the memory 52 to implement the content shown in the foregoing method embodiments.

[0157] This application also provides a computer-readable storage medium, which may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. Specifically, the computer-readable storage medium stores computer-executable instructions, which are used to implement the methods in the above embodiments.

[0158] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the technical solution of the above method embodiments. Its implementation principle and technical effects are similar, and will not be repeated here.

[0159] This application embodiment also provides an adaptive workpiece control system, the system including: a vision module and an electronic device; wherein, the vision module is used to image the current workpiece; the electronic device is configured to: measure the real-time distance between the surface of the current workpiece and the focal plane of the camera of the vision module; determine the focus compensation amount based on the real-time distance, and realize focus pre-compensation of the vision module based on the focus compensation amount; and image the current workpiece based on the vision module after focus pre-compensation, for realizing operation control of the current workpiece.

[0160] Specifically, how the electronic device controls the vision module, how it measures the real-time distance to determine the focus compensation amount, how it performs focus pre-compensation for the vision module based on the focus compensation amount, and how it performs imaging to achieve operation control of the current workpiece, etc., can be found in the aforementioned method embodiments, and will not be repeated here.

[0161] As an example, Figure 6 This is a schematic diagram of the structure of an adaptive workpiece control system provided in an embodiment of this application, as shown below. Figure 6 As shown in the example, the adaptive workpiece control system includes electronic equipment, a PLC controller, a laser measurement module, a vision module, a robot arm, and an end effector.

[0162] The electronic device, as the core control unit of the system, is responsible for data processing and logic scheduling (such as calculating focus compensation and height deviation). The PLC controller, as the relay unit for hardware execution, receives instructions from the electronic device and converts them into hardware control signals, while also providing feedback on the hardware status. The laser measurement module is responsible for measuring the real-time distance between the current workpiece surface and the focal plane of the vision module (before assembly) and the height difference between the workpiece and the assembly body after assembly (after assembly). The vision module completes clear imaging based on focus pre-compensation and extracts the pixel coordinates of the workpiece target features (such as plug holes). The robot receives PLC instructions and executes assembly actions (such as plug pressing). The end effector, as the execution component of the robot, directly contacts the workpiece (such as plugs) to complete the operation.

[0163] Based on this system, in the nail-plugging scenario, during nail plugging, the electronic device first sends a command to the PLC controller to control the laser measurement module to move to the current cell position and measure the real-time distance between the cell surface and the focal plane of the vision module. Then, the electronic device calculates the focus compensation based on this distance and sends an adjustment command to the vision module through the PLC controller to complete focus pre-compensation. Further, the electronic device controls the vision module to image the cell and extract the pixel coordinates of the nail-plugging hole, converting them into robot coordinates. The PLC controller then controls the robot to drive the end effector to press the nail into the cell. Finally, the laser measurement module again measures the height difference between the top of the nail and the cell body, and the electronic device calculates the deviation value. If the deviation exceeds a threshold, the PLC controller controls the robot to perform compensation pressing; if it does not exceed the threshold, the robot is reset to prepare for the next workpiece operation.

[0164] In the system provided in this embodiment, the laser measurement module, vision module, and robotic arm work together in a closed loop to form a complete process of measurement → compensation → imaging → operation → re-inspection. This not only solves the positioning deviation problem caused by imaging blur in traditional assembly, but also corrects the situation where the assembly height is not up to standard in a timely manner, effectively improving the assembly accuracy and yield rate in scenarios such as battery cell plugs. At the same time, the functions of each module in the system are independent and the interface is unified. By changing the end effector and adjusting the measurement parameters, it can be quickly adapted to different specifications of workpieces or assembly scenarios, and has strong versatility and scalability. In addition, the entire process does not require manual intervention. Combined with the planar matrix model of batch workpieces, it can realize batch continuous assembly, adapting to the cycle time requirements of high-speed automated production lines. While improving assembly efficiency, it also reduces the errors and costs caused by manual operation.

[0165] It should be noted that the functional division between the electronic equipment and the PLC controller in this embodiment is only an exemplary deployment method. In actual applications, it can be flexibly adjusted according to the control architecture requirements of the production line. For example, the PLC controller can also act as the main execution entity, directly completing some data calculations and instruction issuance operations; or the electronic equipment and the PLC controller can work together, with the electronic equipment responsible for complex logic calculations and decisions, and the PLC controller responsible for real-time hardware control. The two interact through a communication protocol to complete the overall process. This application does not strictly limit the specific functional division between the electronic equipment and the PLC controller, as long as the adaptive workpiece control method described in this application can be implemented.

[0166] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.

[0167] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0168] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. An adaptive workpiece control method, characterized in that, The method includes: Measure the real-time distance between the current workpiece surface and the focal plane of the vision module camera; The focus compensation amount is determined based on the real-time distance, and the focus pre-compensation of the vision module is achieved based on the focus compensation amount; The vision module, after focus pre-compensation, images the current workpiece to enable operation control of the current workpiece.

2. The method according to claim 1, characterized in that, The process of determining the focus compensation amount based on the real-time distance includes: Obtain a pre-calibrated reference measurement distance, which is the distance from the camera focal plane to the surface of the standard workpiece measured by the laser measurement module when the vision module establishes a clear image template for the standard workpiece; The difference between the real-time distance and the reference measured distance is calculated, and the difference is used as the focus compensation amount; the focus compensation amount is used to adjust the position of the camera's focal plane.

3. The method according to claim 1 or 2, characterized in that, The vision module based on focus pre-compensation images the current workpiece to achieve operation control of the current workpiece, including: The image of the current workpiece is obtained by the vision module after focus pre-compensation, and the pixel coordinates of the target features on the current workpiece are extracted from the image by the image processing algorithm. Convert the pixel coordinates into target coordinates in the robot's coordinate system; Based on the target coordinates, the robot arm is controlled to perform operations on the current workpiece.

4. The method according to claim 1 or 2, characterized in that, The measurement of the real-time distance between the current workpiece surface and the focal plane of the vision module camera includes: The planar movement distance is determined based on the row and column position of the current workpiece in the planar matrix corresponding to the current batch of workpieces; The laser measurement module is controlled to move to the measurement position corresponding to the current workpiece based on the planar movement distance; The laser measurement module is controlled to measure the real-time distance.

5. The method according to claim 1 or 2, characterized in that, The measurement of the real-time distance between the current workpiece surface and the focal plane of the vision module camera includes: Select at least three sampling points on the surface of the current workpiece; The laser measurement module is controlled to acquire distance data of the at least three sampling points relative to the camera focal plane. Based on the distance data from the at least three sampling points, the real-time distance between the current workpiece surface and the focal plane of the vision module camera is determined.

6. The method according to claim 1 or 2, characterized in that, The method further includes: After the robotic arm performs its operation on the current workpiece, the actual height data of the current workpiece is obtained through the laser measurement module; Calculate the deviation between the actual height data and the preset ideal state; If the deviation value exceeds a preset threshold, the robotic arm is controlled to perform a compensating pressing operation based on the deviation value.

7. The method according to claim 6, characterized in that, The step of obtaining the actual height data of the current workpiece includes: The first height value of the current workpiece surface and the second height value of the assembly body surface are obtained respectively; The actual height data is obtained by subtracting the first height value from the second height value.

8. An electronic device, characterized in that, It includes at least one processor and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-7.

10. An adaptive workpiece control system, characterized in that, The system includes: a vision module and electronic devices; The vision module is used to image the current workpiece; The electronic device is configured to: Measure the real-time distance between the current workpiece surface and the focal plane of the vision module camera; The focus compensation amount is determined based on the real-time distance, and the focus pre-compensation of the vision module is achieved based on the focus compensation amount; The vision module, after focus pre-compensation, images the current workpiece to enable operation control of the current workpiece.