Spraying process optimization method and system based on digital twinning
By using a digital twin system to reconstruct the coating thickness distribution in real time and dynamically adjust process parameters, the problems of difficulty in obtaining coating thickness and system deviation in automated spraying of ship sections were solved, and closed-loop control and uniformity improvement of spraying quality were achieved.
Patent Information
- Application Number
- CN202512037825.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-05-05
AI Technical Summary
In automated spraying of ship sections, the uniformity and compliance rate of coating are affected by trajectory planning, process parameters and geometric factors of curved/structural surfaces. Existing technologies have problems such as difficulty in obtaining film thickness online, systematic deviation caused by complex geometry, difficulty in real-time monitoring and online decision-making in high-precision simulation, and lack of soft measurement and dynamic adjustment of process parameters with strong coupling between film thickness and quality in digital twin systems.
A digital twin-based method for optimizing the spraying process is adopted. By constructing a digital twin system of the spray gun, the spraying film thickness distribution is reconstructed in real time, and the film thickness deviation is converted into executable process parameter correction quantities to achieve closed-loop control of spraying quality. This includes offline preparation, online synchronization, soft measurement reconstruction, and online decision-making modules. Parameter distribution and execution are realized by using a proxy model and industrial communication interface.
It improves the uniformity and compliance rate of coating quality, reduces rework and material waste, enhances the precision and transferability of the coating process, and enables real-time visualization of film thickness and dynamic adjustment of process parameters.
Smart Images

Figure CN121980770A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to surface spraying, and more particularly to a method and system for optimizing spraying processes based on digital twins. Background Technology
[0002] In automated spraying of ship sections, coating uniformity and compliance rate are jointly affected by trajectory planning, process parameters (such as gun spacing, speed, pressure / flow rate), and geometric factors of curved / structural surfaces (incident angle, curvature, occlusion). Existing technologies typically suffer from the following shortcomings:
[0003] 1) Difficulty in obtaining film thickness online: On-site operations mostly rely on post-event offline sampling inspection or limited contact thickness measurement, which cannot obtain a continuous film thickness field, making it difficult to locate defect areas in a timely manner, and the process relies on experience.
[0004] 2) Complex geometry leads to systematic deviations: Flat plate calibration or empirical models are difficult to transfer to structural areas such as curved transition areas and corners at the root of stiffeners, which can easily lead to local overspray / underspray;
[0005] 3) High-precision simulation is difficult to perform in real time: Numerical simulations such as CFD have a large computational load, making it difficult to meet the requirements of real-time on-site monitoring and online decision-making;
[0006] 4) Digital twins are "only for viewing, not for control": Existing digital twins mostly remain at the equipment status / trajectory playback display level, lacking soft measurement, out-of-tolerance assessment, and a closed loop for dynamic adjustment of process parameters that are strongly coupled with film thickness quality. Summary of the Invention
[0007] Purpose of the Invention: To address the aforementioned problems, the present invention aims to provide a digital twin-based method and system for optimizing coating processes to improve coating quality. This method can rapidly reconstruct the coating film thickness distribution and visualize it in real-time within the digital twin under conditions where online thickness measurement is unavailable or sparse. Simultaneously, it can convert film thickness deviations into actionable process parameter corrections and distribute them to the controller, achieving closed-loop control of coating quality.
[0008] Technical Solution: To solve the above problems, the present invention provides a spraying process optimization method based on digital twins, comprising the following steps:
[0009] Step 1: Obtain the mesh model of the workpiece;
[0010] Step 2: Plan the initial spraying trajectory and baseline process parameters based on the workpiece's mesh model;
[0011] Step 3: Control the spray gun to perform segmented spraying according to the initial spraying trajectory and reference process parameters, and build a digital twin system of the spray gun. The digital twin system obtains the hit point of the spraying center of the spray gun on the workpiece surface. The digital twin system outputs the spray width characterization parameters through the proxy model according to the reference process parameters of the spray gun, and calculates the film thickness increment in the neighborhood of the hit point based on the spray width characterization parameters.
[0012] Step 4: Based on the incremental film thickness, calculate the reference statistical film thickness for each segment of the segmented spraying. Correct the reference statistical film thickness to the equivalent film thickness using the equivalent deposition coefficient. Calculate the segment error between the equivalent film thickness and the target film thickness. Obtain the spraying thickness trend based on the error of this segment and the segment error of the previous segment, and obtain the strip balance term based on the segment error.
[0013] Step 5: Update the baseline process parameters of the spray gun based on the segment error, coating thickness trend, and strip balance term to obtain the actual process parameters, and control the spray gun spraying through the actual process parameters.
[0014] Furthermore, the reference process parameters include the reference speed of the spray gun. Gun distance ,pressure and equivalent deposition coefficient The deposition coefficient The confirmation method is as follows: the initial spraying trajectory is divided into multiple segments, each segment of the workpiece is divided into structural partitions to obtain the segment structural characteristics of the workpiece, and the equivalent deposition coefficient of each segment of the workpiece is determined according to the segment structural characteristics of the workpiece; the equivalent deposition coefficient of different structural partitions is obtained by experiments or simulations.
[0015] Furthermore, the baseline process parameters input to the proxy model include the nozzle distance of the spray gun. The actual online speed (Active_v) and pressure of the spray gun. The proxy model outputs spray width characterization parameters including the spray width peak characterization quantity A and the diffusion width characterization quantity. .
[0016] Furthermore, the calculation formula for calculating the film thickness increment in the neighborhood of the hit point based on the spray pattern characterization parameters is as follows:
[0017]
[0018] in, This represents a radially decaying deposition kernel with a peak value at the center, where d is the distance from the neighboring pixels to the center pixel.
[0019] Furthermore, the spray gun speed factor is updated based on segment error, coating thickness trend, and strip balance term. Calculate the updated control speed of the spray gun based on the speed factor. :
[0020]
[0021] in, v is the base velocity of the (j+1)th spray gun segment. min As the lower limit of speed, v max This is the upper limit of speed. Limits the rate of change of velocity between adjacent segments.
[0022] Furthermore, the speed factor of the spray gun speed is updated based on segment error, coating thickness trend, and strip balance term:
[0023]
[0024]
[0025]
[0026] in, The updated velocity factor for segment j+1. As the reference speed factor, With velocity factor update The calculated value, s min As the lower limit of the velocity factor, s max This is the upper limit of the velocity factor. To limit the rate of change of the velocity factor, The weight of the segment error for the (j+1)th segment. Let j be the normalized segment error of segment j. Let be the weight of the trend term in the (j+1)th segment. Let j be the trend term after normalization. The weight of the strip balance term for the (j+1)th segment. This is the strip balance term for the j-th segment after normalization.
[0027] Furthermore, the formula for calculating the equivalent film thickness is as follows:
[0028]
[0029] in, The equivalent deposition coefficient, The film thickness is used as a baseline for statistical analysis.
[0030] The formula for calculating segmentation error is:
[0031]
[0032] in, Target film thickness;
[0033] The formula for calculating the trend term is:
[0034]
[0035] The formula for calculating the strip balance term is:
[0036] in, It is the set of time segment numbers for all strip numbers b.
[0037] This invention employs a digital twin-based spraying process optimization system, comprising:
[0038] Offline preparation module: used to acquire the workpiece's mesh model; and to plan the initial spraying trajectory and baseline process parameters based on the workpiece's mesh model.
[0039] Online synchronization module: Control the spray gun to perform segmented spraying according to the initial spraying trajectory and reference process parameters, build a digital twin system of the spray gun, obtain the hit point of the spraying center of the spray gun on the workpiece surface, and output the spray width characterization parameters through the proxy model according to the reference process parameters of the spray gun, and calculate the film thickness increment in the neighborhood of the hit point based on the spray width characterization parameters.
[0040] Soft measurement reconstruction module: Based on the incremental film thickness, the reference statistical film thickness of each segment of the segmented spraying is statistically determined. The reference statistical film thickness is corrected to the equivalent film thickness using the equivalent deposition coefficient. The segment error between the equivalent film thickness and the target film thickness is calculated. The spraying thickness trend is obtained based on the error of this segment and the segment error of the previous segment. The strip balance term is obtained based on the segment error.
[0041] Online decision-making and execution modules: Update the baseline process parameters of the spray gun based on segment error, coating thickness trend, and strip balance term to obtain the actual process parameters, and control the spray gun spraying through the actual process parameters.
[0042] The present invention employs a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above method.
[0043] The present invention employs a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the above method.
[0044] Beneficial effects: Compared with the prior art, the significant advantages of this invention are: film thickness measurement and continuous field reconstruction based on spraying trajectory and process parameters; introduction of geometric consistency correction for curved / structural surfaces to improve reconstruction accuracy and transferability; solving process parameter correction based on reconstructed film thickness deviation and surrogate model sensitivity, and forming an executable parameter sequence under constraints and smoothing conditions; and parameter distribution and execution status readback through industrial communication interfaces (such as OPC UA) to form a monitoring-decision-execution-update closed loop, improving film thickness uniformity and compliance rate, and reducing rework and material waste. Attached Figure Description
[0045] Figure 1 This is a schematic flowchart of the process optimization method of the present invention. Detailed Implementation
[0046] like Figure 1 As shown in this embodiment, a spraying process optimization method based on digital twins includes the following steps:
[0047] Step 1: Offline preprocessing;
[0048] Construct a triangular mesh model of the workpiece, including UV unwrapping; plan the preliminary spraying trajectory and preliminary process parameters based on the workpiece's triangular mesh model; the preliminary spraying trajectory includes an offline trajectory point sequence. ,in This indicates the position of the spray gun. The spray gun direction is the unit normal to the workpiece surface, and the spray gun is always perpendicular to the surface. The baseline process parameters include the baseline speed of the spray gun. Gun distance ,pressure and equivalent deposition coefficient .
[0049] The initial spraying trajectory is divided into multiple segments (e.g., 50–200 mm / segment) at equal intervals or according to a fixed number of points, and the segment sequence is as follows: Assign a unique time segment number, segment_id, to each segment. =j, and record the trajectory point index range i_start, i_end and the spatial / geometric strip number strip_id corresponding to the segment. The purpose of segmentation is to enable the robot PLC to switch parameters and set effective boundaries online in segments, and to ensure that twin statistics and control decisions have consistent index granularity.
[0050] Determine the spraying rules for different structural zones, including planes, curved surfaces, right angle roots / concave corners, etc.; divide each segment of the workpiece into structural zones to obtain the segmental structural characteristics of the workpiece: structural zone number. Curvature index Visibility / Occlusion Index The geometric feature keys of the workpiece are obtained based on the segmental structural characteristics of the workpiece. (Where, Zone 0 is a planar / low-curvature surface; Zone 1 is a general curved surface; Zone 2 is a high-curvature transition surface; Zone 3 is the right-angle root / sharp-edge neighborhood; and Zone 4 is the strong occlusion / concave angle.) The equivalent deposition coefficient is determined based on the geometric feature bonds of the workpiece. The segment level is recorded as The equivalent deposition coefficient is used to correct the baseline statistical film thickness to the equivalent film thickness of the structural region, thereby reducing the systematic bias caused by the structure. The equivalent deposition coefficient can be obtained by experiment or simulation.
[0051] Based on the offline preprocessing results, a SegmentPlanTable and a SegmentFeatureTable are constructed for online control queries. The SegmentPlanTable is used for segment number alignment, segment region statistics, and baseline parameter indexing. The SegmentFeatureTable is used for structure identification, geometric correction, differential parameter tuning, and amplitude limiting constraints. In this embodiment, the SegmentPlanTable is shown in Table 1, and the SegmentFeatureTable is shown in Table 2.
[0052] Table 1: Segment Plan Table
[0053]
[0054] Table 2 Segment Feature Table
[0055]
[0056] The SegmentFeatureTable includes the spray gun's control coefficients and limiting parameters, and at least the weights of the segment error. The weight of trends Weights for strip balance Lower limit of velocity factor Upper limit of velocity factor Velocity factor change rate limit Speed limit Speed limit and the rate of change limit of adjacent segments of velocity The control coefficient and the limiting parameter are adjusted accordingly. The segment feature strategy table is solidified to ensure that online commands can be executed and have different adjustment ranges in different structural areas.
[0057] In the example, a smaller value can be taken in the right-angle root region. (e.g., 15 mm / s) and smaller (e.g., 0.03) indicates that only small corrections are allowed in each segment of the right-angle root region to ensure that the robot is dynamically executable and to avoid overshoot.
[0058] Step 2: Online synchronization and film thickness measurement reconstruction;
[0059] The spray gun is controlled to spray based on the initial spray trajectory and baseline process parameters. The PLC / robot controller acquires the spray gun status in real time and outputs it periodically via OPC UA (Open Data Interchange Standard for Industrial Communication). The output spray gun status includes at least the current spray segment number ActiveSegmentID, the online actual speed Active_v, and the spray gun switch status P_switch. The online actual speed Active_v (mm / s) is read back by the PLC and represents the actual execution speed. The Unity digital twin system uses the current segment number ActiveSegmentID as the online index to ensure that subsequent statistics, table lookups, and command issuance are consistent with the actual execution segment.
[0060] The Unity digital twin system calls the proxy model service when the spray gun is turned on and the system is running, inputting process parameters (preferred h, Active_v, p) and outputting spray pattern characterization parameters. Where A represents the peak spray amplitude characteristic quantity, which controls the peak intensity; This represents the diffusion width and controls it. The Unity digital twin system obtains the point of impact of the spray center on the workpiece surface via raycasting and converts it to UV coordinates (U,V) (consistent with the offline UV region). When the spray gun is activated (P_switch=1), incremental updates are written to neighboring pixels in the film thickness map, preferably in the following form:
[0061]
[0062] Where d is the distance from neighboring pixels to the center pixel (based on pixel scale or converted to surface scale), and the location of the hit point is the center pixel. This represents a radially decaying deposition core with a peak value at the center; It reflects the equivalent deposition correction in the structural region. The film thickness map drives material coloring in real time, enabling online visual monitoring.
[0063] Step 3: Error calculation and online decision-making;
[0064] Based on the statistical film thickness of each segment in the segmented spraying process, when ActiveSegmentID changes from j to j+1, the segment is considered to be... Complete. The Unity digital twin system reads the corresponding film thickness statistical region from the SegmentPlanTable, performs segment region statistics on the film thickness map, and obtains the baseline statistical film thickness for that segment. Then, the equivalent deposition coefficient of the segment is obtained based on the SegmentFeatureTable. The baseline statistical film thickness is corrected to the equivalent film thickness using an equivalent deposition coefficient. The segment error is obtained based on the difference between the equivalent film thickness and the target film thickness. The trend term is obtained based on the segment error of this segment and the segment error of the previous segment: The strip equalization term is obtained based on the segment error of this segment: , is the set of all time segment IDs with strip_id=b.
[0065] Online decision-making follows the principle of "next segment takes effect": It uses the statistical error of segment j to generate a command for segment j+1. The decision module reads the weight and constraint parameters of the segment from the SegmentFeatureTable according to next_segment_id=j+1, and calculates the velocity factor update amount.
[0066]
[0067]
[0068] Normalization process:
[0069]
[0070] in, The updated velocity factor for segment j+1. As the reference speed factor, With velocity factor update The calculated value, s min As the lower limit of the velocity factor, s max This is the upper limit of the velocity factor. To limit the rate of change of the velocity factor, The weight of the segment error for the (j+1)th segment. Let j be the normalized segment error of segment j. Let be the weight of the trend term in the (j+1)th segment. Let j be the trend term after normalization. The weight of the strip balance term for the (j+1)th segment. This is the strip balance term for the j-th segment after normalization.
[0071] And generate command speed:
[0072]
[0073] in, This is the base speed of the (j+1)th segment of the spray gun.
[0074] Step 4: OPC-issued variables and boundaries take effect;
[0075] The Unity digital twin system writes the next command action segment number (NextSegmentID) and recommended speed to the PLC controller. The system sends a trigger bit CmdApply (rising edge), a PLC receive confirmation bit CmdAck (readback), and AutoAdjustEnable: automatically adjusts and enables the settings. Upon receiving CmdApply, the PLC performs a validity check (running state, limit, alarm conditions, etc.). If successful, the command is buffered and takes effect when the execution segment number enters the NextSegmentID segment start point. The PLC controller controls the spray gun to spray at the update speed; if necessary, a smooth transition is achieved using ramp / acceleration limits. The PLC reads back Active_v to Unity, and Unity always participates in film thickness accumulation at the actual readback speed, ensuring consistency between twin reconstruction and execution.
[0076] Step 5: Closed-loop iteration and exception handling;
[0077] The system executes the following loop: read back segment number / speed → predict A, σ using the surrogate model → accumulate and color the film thickness map → perform segment end statistics. Correction and error calculation → Recommend the next Cmd_v segment → OPC issuance → PLC segment boundary takes effect → Readback verification.
[0078] Optionally, a lead time delivery can be used (the command for j+1 is calculated and cached during the execution of segment j) to ensure that parameter preparation is completed before entering structural regions such as curved surfaces / right-angle roots. When an alarm, communication interruption, command verification failure, or abnormal film thickness statistics occur, the system can automatically enter a safety policy: pause automatic adjustment (AutoAdjustEnable=0), roll back to the reference speed, or set a fixed safety speed, and record the event for traceability.
[0079] Example 2
[0080] This embodiment provides a digital twin-based spraying process optimization system, which enables online dynamic parameter adjustment for different structural regions, forming an engineering closed loop of "offline preparation—online synchronization—online reconstruction—error calculation—parameter recommendation—PLC issuance—segment boundary activation—closed-loop iteration".
[0081] The system consists of the following modules:
[0082] Offline preparation module: Based on the workpiece mesh model and offline planned trajectory, it completes trajectory segmentation, segment-surface region mapping, structural partitioning and geometric feature calculation (ZoneID, curvature κ, visibility Vis), and generates segment-level lookup table data;
[0083] Online synchronization module (PLC / OPC): Real-time reading of robot / PLC execution status to achieve virtual-real synchronization (segment number, speed, spray gun switch, etc.);
[0084] Soft Measurement Reconstruction Module (Unity): Combines the spray pattern characterization parameters output by the proxy model with the segment-level geometric correction parameters to accumulate the film thickness in real time and display it with color in the twin scene;
[0085] Online decision-making module (Flask / server): Based on segment-level film thickness error and structural characteristics, calculate the recommended speed / speed factor for the next segment, satisfying the amplitude limit and rate of change constraints;
[0086] Execution and Distribution Module (PLC): Receives and caches online recommended commands, applies them at segment boundaries, controls the spray gun's spraying, and reads back the actual application speed to form a closed loop. Note: The preferred application scenario for this invention is that the spray gun axis remains perpendicular to the target surface throughout the execution process (the spray gun direction is equal to the opposite direction of the surface normal), thereby simplifying attitude acquisition and visibility calculation, and improving online consistency and feasibility.
Claims
1. A method for optimizing a spraying process based on digital twins, characterized in that, Includes the following steps: Step 1: Obtain the mesh model of the workpiece; Step 2: Plan the initial spraying trajectory and baseline process parameters based on the workpiece's mesh model; Step 3: Control the spray gun to perform segmented spraying according to the initial spraying trajectory and reference process parameters, and build a digital twin system of the spray gun. The digital twin system obtains the hit point of the spraying center of the spray gun on the workpiece surface. The digital twin system outputs the spray width characterization parameters through the proxy model according to the reference process parameters of the spray gun, and calculates the film thickness increment in the neighborhood of the hit point based on the spray width characterization parameters. Step 4: Based on the incremental film thickness, calculate the reference statistical film thickness for each segment of the segmented spraying. Correct the reference statistical film thickness to the equivalent film thickness using the equivalent deposition coefficient. Calculate the segment error between the equivalent film thickness and the target film thickness. Obtain the spraying thickness trend based on the error of this segment and the segment error of the previous segment, and obtain the strip balance term based on the segment error. Step 5: Update the baseline process parameters of the spray gun based on the segment error, coating thickness trend, and strip balance term to obtain the actual process parameters, and control the spray gun spraying through the actual process parameters.
2. The spraying process optimization method according to claim 1, characterized in that, The reference process parameters include the reference speed of the spray gun. Gun distance ,pressure and equivalent deposition coefficient The deposition coefficient The confirmation method is as follows: the initial spraying trajectory is divided into multiple segments, each segment of the workpiece is divided into structural partitions to obtain the segment structural characteristics of the workpiece, and the equivalent deposition coefficient of each segment of the workpiece is determined according to the segment structural characteristics of the workpiece; the equivalent deposition coefficient of different structural partitions is obtained by experiments or simulations.
3. The method for optimizing the spraying process according to claim 1, characterized in that, The baseline process parameters input to the proxy model include the nozzle distance. The actual online speed (Active_v) and pressure of the spray gun. The proxy model outputs spray width characterization parameters including the spray width peak characterization quantity A and the diffusion width characterization quantity. .
4. The spraying process optimization method according to claim 3, characterized in that, The formula for calculating the film thickness increment in the neighborhood of the hit point based on the spray pattern characterization parameters is as follows: in, This represents a radially decaying deposition kernel with a peak value at the center, where d is the distance from the neighboring pixels to the center pixel.
5. The spraying process optimization method according to claim 4, characterized in that, Update the spray gun speed factor based on segment error, coating thickness trend, and strip balance term. Calculate the updated control speed of the spray gun based on the speed factor. : in, v is the base velocity of the (j+1)th spray gun segment. min As the lower limit of speed, v max This is the upper limit of speed. Limits the rate of change of velocity between adjacent segments.
6. The method for optimizing the spraying process according to claim 5, characterized in that, The speed factor of the spray gun speed is updated based on segment error, coating thickness trend, and strip balance term: in, The updated velocity factor for segment j+1. Reference speed factor With velocity factor update The calculated value, s min As the lower limit of the velocity factor, s max This is the upper limit of the velocity factor. To limit the rate of change of the velocity factor, The weight of the segment error for the (j+1)th segment. Let j be the normalized segment error of segment j. Let be the weight of the trend term in the (j+1)th segment. Let j be the trend term after normalization. The weight of the strip balance term for the (j+1)th segment. This is the strip balance term for the j-th segment after normalization.
7. The method for optimizing the spraying process according to claim 1, characterized in that, The formula for calculating the equivalent film thickness is: in, The equivalent deposition coefficient, The film thickness is used as a baseline for statistical analysis. The formula for calculating segmentation error is: in, Target film thickness; The formula for calculating the trend term is: The formula for calculating the strip balance term is: in, It is the set of time segment numbers for all strip numbers b.
8. A spraying process optimization system based on digital twins, characterized in that, include: Offline preparation module: used to acquire the mesh model of the workpiece; Based on the workpiece's mesh model, a preliminary spraying trajectory and baseline process parameters are planned; Online synchronization module: Control the spray gun to perform segmented spraying according to the initial spraying trajectory and reference process parameters, build a digital twin system of the spray gun, obtain the hit point of the spraying center of the spray gun on the workpiece surface, and output the spray width characterization parameters through the proxy model according to the reference process parameters of the spray gun, and calculate the film thickness increment in the neighborhood of the hit point based on the spray width characterization parameters. Soft measurement reconstruction module: Based on the incremental film thickness, the reference statistical film thickness of each segment of the segmented spraying is statistically determined. The reference statistical film thickness is corrected to the equivalent film thickness using the equivalent deposition coefficient. The segment error between the equivalent film thickness and the target film thickness is calculated. The spraying thickness trend is obtained based on the error of this segment and the segment error of the previous segment. The strip balance term is obtained based on the segment error. Online decision-making and execution modules: Update the baseline process parameters of the spray gun based on segment error, coating thickness trend, and strip balance term to obtain the actual process parameters, and control the spray gun spraying through the actual process parameters.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
