Unity3D-based digital twin spraying method and system for paint spraying robot
Through the digital twin technology based on Unity3D, combined with neural network and multi-physics coupled simulation, real-time perception and adaptive adjustment of paint robots, workpieces and environments are achieved, solving the problem of the lack of real-time perception and adaptive adjustment of existing automated paint equipment, and improving spray quality and efficiency.
Patent Information
- Application Number
- CN202510389503.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-05-23
AI Technical Summary
Existing automated painting equipment lacks real-time perception and adaptive adjustment capabilities for workpiece state and environmental changes, which makes it difficult to ensure uniformity and consistency of the coating.
The digital twin spraying method of spraying robots based on Unity3D is adopted to build perception units through preset sensors, obtain data of the spraying robots, workpieces and environment, and generate and optimize spraying strategies using neural networks and multi-physics coupled simulation.
Real-time perception and adaptive adjustment of workpiece status and environmental changes is achieved, spraying quality and efficiency is improved, paint waste and defective rate is reduced, and equipment failure risk is reduced.
Smart Images

Figure CN120023821A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of robot spray painting, and in particular to a Unity3D-based spray painting robot digital twin spraying method and system. Background Art
[0002] As a common industrial automation equipment, paint spraying robot arms are widely used in coating processes in the fields of automobiles, home appliances, aerospace, etc.
[0003] In traditional painting operations, manual experience and simple automated equipment are mainly relied on. When manually spraying paint, workers rely on their own operating skills and experience to control the movement speed, angle and spraying amount of the spray gun. This method is inefficient and difficult to ensure the uniformity and consistency of the coating. It is easily affected by factors such as the worker's fatigue level and skill level. Although existing automated painting equipment can improve production efficiency, it usually uses a preset fixed spraying program and lacks the ability to perceive and adaptively adjust the workpiece status and environmental changes in real time. Summary of the invention
[0004] The purpose of the present invention is to provide a painting robot digital twin spraying method and system based on Unity3D to solve the following technical problems:
[0005] Current automated painting equipment lacks the ability to perceive and adaptively adjust to workpiece status and environmental changes in real time.
[0006] The purpose of the present invention can be achieved through the following technical solutions:
[0007] A digital twin spraying method of a painting robot based on Unity3D.
[0008] Data collection: Build a perception unit by presetting various sensors and obtain data on the painting robot, the workpiece to be sprayed, and the spraying environment;
[0009] Data processing: interacting the data acquired by the sensing unit with the database information, and screening and analyzing the data;
[0010] Virtual model construction and simulation: Build virtual models of the painting robot and application scenarios based on the virtual modeling platform, and synchronize the acquired data to the virtual model; use neural network calculations to generate spraying strategies with spraying quality and efficiency as the goal, and consider the influence of physical factors on the spraying process for coupled simulation to optimize the spraying strategy in real time;
[0011] Decision-making and control: According to the simulation results, the factors related to the spraying quality are calculated to generate analysis results, and the painting robot is remotely controlled based on the analysis results.
[0012] Preferably, the data acquired by the perception unit includes the motion state data of the painting robot, the position and posture data of the spray gun, the environmental data and the feature data of the workpiece;
[0013] Among them, the motion state data of the painting robot includes the speed of each axis; the position and posture data of the spray gun includes the spatial position and posture angle of the spray gun; the environmental data includes temperature, humidity, and air flow speed; the characteristic data of the workpiece includes shape, size, and surface roughness.
[0014] Preferably, the data processing uses statistical analysis methods through edge computing to screen abnormal data.
[0015] Preferably, the spraying strategy includes defining the state space, action space and reward function, constructing the input state vector, and then using the neural network for training; the specific steps are as follows:
[0016] At each time step, the current workpiece state and environmental parameters are obtained from the perception unit and combined with the current state of the spray gun to form a state vector s t Input the actor network and generate an action vector a t ;
[0017] The action vector a t Applied to the painting simulation environment, multi-physics field coupling simulation is performed to obtain the next state s t+1 and reward r t ;
[0018] Critic network update: Transform the experience tuple (s t ,a t ,r t ,s t+1 ) is stored in the experience replay buffer, and a batch of experience tuples are randomly sampled from it, the target value is calculated according to the target critic network, and the parameters of the critic network are updated using the mean square error loss function;
[0019] Actor network update: Use the policy gradient algorithm to update the parameters of the actor network based on the output of the critic network;
[0020] Target network update: Regularly update the parameters of the target actor network and target critic network to make them track the parameters of the actor network and critic network until the preset spraying quality and efficiency meet the requirements.
[0021] Preferably, the factors of spraying quality include distribution statistics of coating thickness, spraying efficiency, and coating utilization rate.
[0022] In the second aspect, the present application provides a digital twin spraying system of a paint robot based on Unity3D:
[0023] The perception layer includes a perception unit for collecting data on the painting robot, the workpiece to be sprayed, and the spraying environment;
[0024] The data layer is responsible for data transmission, processing and storage. The data layer includes a communication module for data interaction with the painting robot controller, an edge computing unit for data processing and a database for data storage;
[0025] The twin layer is built on a virtual modeling platform, including virtual models of the painting robot and related scenes, interactive interfaces and simulation application modules. It uses neural networks to generate spraying strategies based on the data processed by the data layer with spraying quality and efficiency as the goal. It also has a multi-physics field coupling simulation module to optimize the spraying strategy in real time by considering the influence of various physical factors on the spraying process.
[0026] The application layer provides users with virtual simulation and decision support for spraying operations, including an interactive interface that displays simulation results, an analysis module that performs data analysis and generates reports, a control module that supports remote control and multi-user collaborative operations, and a predictive maintenance module that predicts equipment failures based on historical data;
[0027] System management module: used for the system's cyclic operation management, real-time monitoring of data collection, processing and update processes, and adjustment of system status based on feedback; when a termination instruction is received or an abnormality is detected, the corresponding system cleanup and processing are performed.
[0028] Preferably, the sensing unit is connected to the data layer via a communication interface or a wireless network.
[0029] Preferably, the edge computing unit of the data layer uses a statistical analysis method to filter abnormal data.
[0030] Preferably, the neural network of the twin layer includes defining a state space, an action space and a reward function, constructing a state vector based on the state space and the action space, and outputting an action vector; the state space includes workpiece characteristics, environmental parameters and motion state information of the spray robot, and the action space includes motion parameters and spraying parameters of the spray gun; the reward function is comprehensively defined based on spraying quality and efficiency indicators.
[0031] The beneficial effects of the present invention are as follows: the present invention converts the physical structure of the device into a virtual model through three-dimensional modeling, and according to the motion state data of the painting robot, the position and posture data of the spray gun, the environmental data and the characteristic data of the workpiece and combined with multi-physical field coupling simulation, the spraying trajectory is adaptively optimized in real time according to the workpiece state and environmental changes, thereby improving the spraying quality and efficiency; in addition, the use of virtual models and simulations provides virtual simulation of painting operations, supports remote control and multi-user collaborative work, can optimize the spraying strategy in advance, reduce paint waste and defective rate, and reduce the risk of equipment failure through predictive maintenance.
[0032] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0034] Figure 1 It is the interaction diagram between the perception layer and the data layer in the present invention;
[0035] Figure 2 It is the interaction diagram between the application layer and the twin layer in the present invention;
[0036] Figure 3 This is a flow chart of the use of the digital twin system of the painting robot in the present invention;
[0037] Figure 4 This is a flowchart of neural network calculation in the present invention;
[0038] Figure 5 is a flow chart of the spraying strategy of the present invention;
[0039] Figure 6 This is the interface diagram of the digital twin system of the painting robot of the present invention. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] A digital twin spraying method of a painting robot based on Unity3D:
[0042] Data collection: Build a perception unit by presetting various sensors, and obtain data on the painting robot, the workpiece to be sprayed, and the spraying environment; the acquired data includes the movement state data of the painting robot, the position and posture data of the spray gun, the environment data, and the characteristic data of the workpiece;
[0043] Among them, the motion state data of the painting robot includes the speed of each axis; the position and posture data of the spray gun includes the spatial position and posture angle of the spray gun; the environmental data includes temperature, humidity, and air flow speed; the characteristic data of the workpiece includes shape, size, and surface roughness.
[0044] Data processing: The data acquired by the perception unit is interacted with the database information, and the abnormal data is screened out by statistical analysis methods through edge computing. The data before and after screening are analyzed separately to analyze the causes of the abnormal data. After eliminating the abnormal data, the data after screening is analyzed and judged to see whether it is normal and meets the requirements.
[0045] Virtual model construction and simulation: Build virtual models of the painting robot and application scenarios based on the virtual modeling platform, and synchronize the acquired data to the virtual model; use neural network calculations to generate spraying strategies with spraying quality and efficiency as the goal, and consider the influence of physical factors on the spraying process for coupled simulation to optimize the spraying strategy in real time;
[0046] The specific spraying strategy is that, at each time step, the current workpiece state and environmental parameters are obtained from the perception unit, combined with the current state of the spray gun to form a state vector s t Input the actor network and generate an action vector a t ;
[0047] The action vector a t Applied to the painting simulation environment, multi-physics field coupling simulation is performed to obtain the next state s t+1 and reward r t ;
[0048] Critic network update: Transform the experience tuple (s t ,a t ,r t ,s t+1 ) is stored in the experience replay buffer, and a batch of experience tuples are randomly sampled from it, the target value is calculated according to the target critic network, and the parameters of the critic network are updated using the mean square error loss function;
[0049] Actor network update: Use the policy gradient algorithm to update the parameters of the actor network based on the output of the critic network;
[0050] Target network update: Regularly update the parameters of the target actor network and target critic network to make them track the parameters of the actor network and critic network until the preset spraying quality and efficiency meet the requirements
[0051] Decision-making and control: Based on the simulation results, the factor indicators of spraying quality are calculated to generate analysis results. The factor indicators include the distribution statistics of coating thickness, spraying efficiency, and paint utilization rate. The painting robot is remotely controlled based on the analysis results.
[0052] The present invention collects its own working status data through sensors, such as the speed of each axis of the robot, the position and angle of the spray gun, etc., and then transmits the collected data to the database, and screens and analyzes the data. In the data interaction part, the data in the paint spraying robot controller is transmitted to the computer through serial communication or wireless means, and the control instructions issued by the computer are also sent to the controller. The data is stored in the MySQL database to facilitate subsequent query and analysis. In addition, edge computing is introduced to perform preliminary screening and analysis of the data during the data transmission process to improve the efficiency of data transmission and the system response speed.
[0053] It is built on the Unity3D platform, including the virtual model of the device's physical structure, interactive interface and painting simulation application. The physical structure of the device is converted into a virtual model through 3D modeling, imported into the Unity3D scene and optimized. In the painting simulation application, reinforcement learning is used to generate the spraying trajectory, combined with multi-physical field coupling simulation, considering the impact of environmental factors such as temperature and humidity on the painting process, making the simulation more realistic. At the same time, through real-time adaptive spraying trajectory optimization, the spraying trajectory is dynamically adjusted according to the workpiece status and environmental changes.
[0054] See also Figure 1 and Figure 2 A digital twin spraying system of a paint robot based on Unity3D, including a perception layer, a data layer, a twin layer, and an application layer.
[0055] The perception layer includes a perception unit for collecting data on the painting robot, the workpiece to be sprayed, and the spraying environment;
[0056] The data layer is responsible for data transmission, processing and storage. The data layer includes a communication module for data interaction with the painting robot controller, an edge computing unit for data processing and a database for data storage;
[0057] The twin layer is built on a virtual modeling platform, including virtual models, interactive interfaces and simulation applications of the painting robot and related scenes. It uses neural networks to generate spraying strategies based on the data processed by the data layer with spraying quality and efficiency as the goal. It also has a multi-physics field coupling simulation module to optimize the spraying strategy in real time by considering the influence of various physical factors on the spraying process.
[0058] The application layer provides users with virtual simulation and decision support for spraying operations, including an interactive interface that displays simulation results, an analysis module that performs data analysis and generates reports, a control module that supports remote control and multi-user collaborative operations, and a predictive maintenance module that predicts equipment failures based on historical data;
[0059] System management module: used for the system's cyclic operation management, real-time monitoring of data collection, processing and update processes, and adjustment of system status based on feedback; when a termination instruction is received or an abnormality is detected, the corresponding system cleanup and processing are performed.
[0060] The physical perception layer includes the physical structure of the device, which is the basis of the digital twin system. It is mainly composed of the spraying robot, the workpiece being sprayed, and the external spraying environment. The above physical structure collects its own working status data through sensors, such as the speed of each axis of the robot, the position and angle of the spray gun, etc., and then transmits the collected data to the data layer.
[0061] The data layer is responsible for data transmission, storage, and processing. In the data interaction part, the data in the painting robot controller is transmitted to the digital twin system through serial communication and other means, and the control instructions generated by the digital twin system are also sent to the controller. The data is stored in the MySQL database to facilitate subsequent query and analysis. In addition, edge computing is introduced to perform preliminary screening and analysis of data during data transmission, thereby improving the efficiency of data transmission and the system response speed.
[0062] The twin layer is built on the Unity3D platform, including a virtual model of the device's physical structure, an interactive interface, and a painting simulation module. The physical structure of the device is converted into a virtual model through 3D modeling, imported into the Unity3D scene and optimized. In the painting simulation module, reinforcement learning is used to generate the spraying trajectory, combined with multi-physical field coupling simulation, considering the impact of environmental factors such as temperature and humidity on the painting process, making the simulation more realistic. At the same time, through real-time adaptive spraying trajectory optimization, the spraying trajectory is dynamically adjusted according to the workpiece status and environmental changes.
[0063] The painting simulation module simulates the actual painting process virtually, allowing users to fully understand and analyze the painting operation in a virtual environment.
[0064] See also Figure 3 As an embodiment of the present invention, specifically,
[0065] S1 System Initialization
[0066] S11. Hardware and communication connection
[0067] After the system is started, various sensors in the physical perception layer are initialized first to ensure that the sensors work normally and can accurately collect data, such as checking the speed sensors of each axis of the robot, the position and angle sensors of the spray gun, etc.
[0068] Establish a serial communication connection between the data layer and the painting robot controller, test the stability and accuracy of the communication, and ensure that the data can be transmitted normally.
[0069] S12. Database initialization
[0070] Connect to the MySQL database and check the availability and integrity of the database. If the required table structure does not exist in the database, create the corresponding table to store sensor data, control instructions and other information.
[0071] S13. Unity3D scene loading
[0072] Start the Unity3D platform and load the pre-created virtual model of the device's physical structure, interactive interface, and spray painting simulation module scene. Perform preliminary optimization and adjustments on the virtual model to ensure that the model is displayed normally in the scene.
[0073] As an embodiment of the present invention, specifically,
[0074] S2 Entity Perception Layer Data Collection
[0075] S21. Sensor data collection
[0076] Various sensors collect working status data of the spray robot, the workpiece being sprayed, and the external spray environment in real time according to the set sampling frequency. For example, the robot's axis speed sensors collect the real-time speed of each axis, the spray gun position and angle sensors collect the spatial position and posture angle of the spray gun, and the temperature and humidity sensors collect the temperature and humidity of the external environment.
[0077] S22. Data transmission
[0078] The collected sensor data is sent to the data layer through a data transmission interface (such as a serial port). During the transmission process, the data is encapsulated and verified to ensure the accuracy and integrity of the data.
[0079] As an embodiment of the present invention, specifically,
[0080] S3 data layer processing
[0081] S31. Data reception and analysis
[0082] After receiving the sensor data from the physical perception layer, the data layer parses the data and extracts useful information, such as the speed values of each axis of the robot, the position coordinates and angle values of the spray gun, etc.
[0083] S32, Edge Computing Processing
[0084] Introduce edge computing technology to perform preliminary screening and analysis on the parsed data. For example, according to the preset threshold, filter out abnormal data; perform simple statistical analysis on the data, such as calculating the average, maximum, minimum, etc. Through edge computing, reduce the amount of data that needs to be transmitted to the database and twin layer, and improve data transmission efficiency and system response speed.
[0085] S33. Data storage
[0086] The processed data is stored in the MySQL database. According to the type and purpose of the data, the data is stored in the corresponding table, and the data collection time is recorded to facilitate subsequent query and analysis.
[0087] S34, control command transmission
[0088] If the twin layer generates a control instruction, the data layer will send the received control instruction to the painting robot controller through serial port communication or other means to realize remote control of the painting robot.
[0089] As an embodiment of the present invention, specifically,
[0090] S4 twin layer processing
[0091] S41. Data synchronization and model update
[0092] The twin layer obtains the latest sensor data from the data layer and synchronizes the data to the virtual model. According to the sensor data, the state of the virtual model is updated in real time, such as adjusting the posture of each axis of the virtual robot, the position and angle of the spray gun, so that the virtual model is consistent with the actual device. It should be noted that the virtual model of the painting robot refers to a three-dimensional model of the painting robot created by computer software, which is used to simulate and simulate its behavior and effect during the spraying process. This virtual model is mainly used in industrial design and production processes to help engineers and designers verify the spraying process and the robot's motion path before actual production, reducing errors and costs in actual production. This is a prior art and will not be elaborated here.
[0093] S42, spraying trajectory generation
[0094] In the painting simulation module, a neural network is used to generate the spraying trajectory. With the spraying quality and efficiency as the objective function, the spraying trajectory is optimized through trial and error and learning according to the current workpiece status and environmental parameters. In the process of generating the spraying trajectory, multi-physics field coupling simulation is considered, and the influence of environmental factors such as temperature and humidity on the painting process is incorporated into the algorithm.
[0095] See also Figure 4 As an embodiment of the present invention, specifically,
[0096] The spraying strategy is generated through neural network calculation, which includes actor network, critic network and target network:
[0097] First, define the state space, action space, and reward function
[0098] The workpiece shape, size, surface roughness, ambient temperature, humidity, air flow velocity, and the current spray gun position, angle, speed, flow rate and other information are combined into a state vector as the spray gun's perception of the current environment.
[0099] The combination process is as follows: Step 1: For the shape, size, surface roughness of the workpiece, as well as the position, angle, speed, flow rate and other numerical data of the spray gun, they are first normalized and mapped to the [0,1] interval to facilitate the processing and comparison of the neural network.
[0100] Step 2: For continuous environmental parameters such as ambient temperature, humidity, and air flow rate, first discretize them and divide them into several intervals, and then convert them into vectors using one-hot encoding. For example, if the temperature is divided into three intervals: low temperature, medium temperature, and high temperature, then the one-hot encoding of the temperature is [1,0,0] for low temperature, [0,1,0] for medium temperature, and [0,0,1] for high temperature. Humidity and air flow rate are also processed in a similar way.
[0101] Step 3: Combine into a state vector, connect the normalized numerical data of the workpiece and the spray gun, and the unique-hot-encoded environmental parameter data in sequence to form a complete state vector. For example, assuming that the normalized workpiece shape data is [0.2, 0.3, 0.4], the size data is [0.5, 0.6, 0.7], the surface roughness data is [0.8], the spray gun position data is [0.1, 0.2, 0.3], the angle data is [0.4, 0.5, 0.6], the speed data is [0.7], the flow data is [0.8], the temperature is encoded as [0, 1, 0], the humidity is encoded as [1, 0, 0], and the air flow velocity is encoded as [0, 0, 1], then the final state vector can be expressed as [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0,1, 0,1, 0, 0, 0, 0, 1]
[0102] The action space includes continuous values such as the position adjustment (3D coordinates), angle adjustment (three rotation angles), speed adjustment and flow rate adjustment of the spray gun. The spray gun changes its state by selecting different actions.
[0103] The reward function comprehensively considers the spraying quality and efficiency. The spraying quality is measured by indicators such as the uniformity of the coating thickness and coverage. For example, the closer the coating thickness is to the target value and the more uniform it is, the higher the reward. The spraying efficiency is measured by the spraying time and the paint utilization rate. The shorter the spraying time and the higher the paint utilization rate, the higher the reward. At the same time, negative rewards are given for actions that do not meet the process requirements (such as the spray gun hitting the workpiece).
[0104] The reward function consists of three parts: spraying quality reward Rquality, spraying efficiency reward Refficiency and violation penalty Rpenalty. Its mathematical expression is as follows:
[0105] R=w quality R quality +w efficiency R efficiency +w penalty R penalty w quality 、w efficiency and w penalty are the weights of each part, and satisfy w quality +w efficiency +w penalty =1
[0106] Assume the target coating thickness is t target , the actual coating thickness at each point is t i (i=1,2,…,n), n. is the number of measurement points, and the mean square error (MSE) is used to measure the uniformity of coating thickness. The formula is:
[0107]
[0108] The coating thickness uniformity reward is R thickness =e -αMSE , where α is a positive constant used to adjust the sensitivity of the reward to thickness deviation;
[0109] Coating Coverage Bonus R coverage ;
[0110] Assume that the actual coating coverage is C actual , the target coating coverage is C target , then the coating coverage bonus is:
[0111] R coverage =-β|C actual -C target |;
[0112] Where β is a positive constant used to adjust the sensitivity of the reward to coverage deviation;
[0113] R quality =R thickness +R coverage ;
[0114] Spraying efficiency bonus R efficiency ;
[0115] Spraying efficiency is measured by spraying time and paint utilization;
[0116] Spray Time Bonus R time ;
[0117] Assume the actual spraying time is T actual , the target spraying time is T target , then the spraying time bonus is:
[0118]
[0119] Where r is a positive constant used to adjust the sensitivity of the reward to time deviation;
[0120] Paint Utilization Rate Bonus R utilization ;
[0121] Assume that the actual coating utilization rate is U actual , the target coating utilization rate is U target , then the paint utilization bonus is:
[0122]
[0123] Where δ is a positive constant used to adjust the sensitivity of the reward to the deviation of the paint utilization rate;
[0124] R efficiency =R time +R utilization ;
[0125] Violation Penalty R penalty ;
[0126] If an action that does not meet the process requirements occurs (such as the spray gun colliding with the workpiece), a negative reward will be given. Let the violation mark be P, if the violation P = 1, otherwise P = 0, then the violation penalty is:
[0127] R penalty =-kP;
[0128] Among them, K is a positive constant used to adjust the intensity of the penalty.
[0129] In specific implementation, the following data are collected at each time step: the coating thickness t at each point i , actual coating coverage C actual , actual spraying time T actual , actual coating utilization U actual , mark the violation P, calculate the rewards and penalties for each part, calculate the total reward, and feed the calculated total reward R back to the reinforcement learning algorithm
[0130] Then, initialize the neural network
[0131] Actor network: input state vector, output action vector. Used to generate the optimal action under the current state.
[0132] Critic network: Inputs a state vector and an action vector and outputs a value estimate of the state-action pair. It is used to evaluate the quality of the actions generated by the actor network.
[0133] Initialize the target actor network and target critic network with the same parameters as the actor network and critic network.
[0134] See also Figure 5 , the painting strategy process is as follows:
[0135] 1) State acquisition: At each time step, the current workpiece state and environmental parameters are obtained from the sensor, combined with the current state of the spray gun to form a state vector s t .
[0136] 2) Action selection: The actor network selects the action based on the current state vector s. t Generate action vector a t , and add some noise to increase the exploration.
[0137] 3) Environment interaction: The action vector a t Applied to the painting simulation environment, multi-physics field coupling simulation is performed to consider the influence of factors such as temperature, humidity, and air flow on the painting process, and the next state s is obtained. t+1 and reward r t .
[0138] 4) Experience playback: Experience tuple (s t ,a t ,r t ,s t+1 ) is stored in the experience replay buffer.
[0139] 5) Batch learning: A batch of experience tuples are randomly sampled from the experience replay buffer to update the parameters of the actor network and the critic network.
[0140] 6) Critic network update: The target value is calculated based on the target critic network, and the parameters of the critic network are updated using the mean squared error loss function.
[0141] 7) Actor network update: Using the policy gradient algorithm, the parameters of the actor network are updated according to the output of the critic network, so that the actions generated by the actor network can obtain higher value.
[0142] 8) Target network update: Update the parameters of the target actor network and the target critic network periodically (or at a certain number of steps) so that they slowly track the parameters of the actor network and the critic network.
[0143] When the preset number of training steps is reached or the spraying quality and efficiency reach satisfactory indicators, the training stops.
[0144] The trained actor network is deployed to the actual digital twin system of the painting robot to generate the optimal spraying trajectory based on the real-time workpiece status and environmental parameters. At the same time, new data is continuously collected in actual applications to update and optimize the spraying strategy online.
[0145] It should be noted that:
[0146] 1. The interactive interface in the twin layer is a virtual interface built on a virtual modeling platform (such as Unity3D). This interactive interface exists in a virtual environment and is used to implement interactive operations between users and virtual models and painting simulation applications, rather than physical interactive components of the actual painting robot system;
[0147] 2. The twin layer processes real-time sensor data from the data layer, which reflects the working status of the actual painting robot, the workpiece being sprayed, and the external spraying environment, such as the speed of each axis of the robot, the position and angle of the spray gun, the ambient temperature and humidity, etc. At the same time, it also processes the spraying trajectory-related data generated by the reinforcement learning algorithm in the painting simulation application, as well as the instructions and operation data entered by the user through the interactive interface;
[0148] 3. The interactive interface is the operating interface for users to interact with the virtual model and painting simulation application in the twin layer
[0149] 4. The interactive interface is the interface for users to interact with the virtual model and painting simulation application in the twin layer; the role of the twin layer is to simulate, analyze and interact with the actual painting process in a virtual environment. By optimizing the model, a better spraying strategy is generated, and then these optimized strategies are transmitted to the actual painting robot control through the data layer.
[0150] S43, real-time adaptive optimization
[0151] Monitor the workpiece status and environmental changes in real time, and adjust the spraying trajectory in time when defects are detected on the workpiece surface, changes in ambient temperature and humidity, etc. The optimal spraying trajectory is recalculated and the motion path of the virtual spray gun is updated through a real-time adaptive spraying trajectory optimization algorithm.
[0152] S44, painting effect simulation
[0153] According to the generated spraying trajectory and current environmental parameters, the process of paint spraying from the spray gun, atomization, diffusion and adhesion to the workpiece surface is simulated. In Unity3D, the particle system is used to simulate the atomization effect of the paint, and texture mapping and material update are used to simulate the adhesion and accumulation effect of the paint on the workpiece surface, while considering the impact of environmental factors such as temperature and humidity on the drying speed of the paint and the coating quality.
[0154] S5 application layer interaction and analysis
[0155] S51, interactive interface display
[0156] The simulation results of the twin layer are displayed in real time on the interactive interface, including the status of the virtual model, spraying trajectory, spraying effect and other information. Users can monitor and operate in real time through the interactive interface, such as adjusting spraying parameters, pausing or continuing simulation, and viewing historical data.
[0157] S52. Data analysis and report generation
[0158] The application layer performs data analysis on the results of the spray painting simulation, such as calculating the distribution statistics of coating thickness, spraying efficiency, paint utilization rate and other indicators. Based on the analysis results, a detailed analysis report is generated to provide decision support for users.
[0159] See also Figure 6 , S53, Remote Control and Collaborative Work
[0160] The system supports users to remotely control the operation of the painting robot through the interactive interface, such as starting, stopping, adjusting the movement speed, etc. At the same time, the system realizes the collaborative work of multiple users, and multiple users can monitor and operate the painting process at different locations at the same time.
[0161] S6 system cycle and end
[0162] Loop Processing
[0163] The system continuously runs in a cycle according to the above process, collecting sensor data in real time, processing data, updating virtual models, simulating the painting process, and feeding back the results to the user. During the cycle, the system's operating status is continuously monitored to ensure the stability and reliability of the system.
[0164] System End
[0165] When the user issues an end command or the system encounters an abnormal situation, the system performs cleanup, shuts down sensors, stops data collection and transmission, disconnects from the database and the painting robot controller, and releases system resources.
[0166] The above contents are merely examples and explanations of the concept of the present invention. The technicians in this technical field may make various modifications or additions to the specific embodiments described or replace them in a similar manner. As long as they do not deviate from the concept of the invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.
Claims
1. A painting robot digital twin spraying method based on Unity3D, characterized in that: The following steps are involved: Data collection: Build a perception unit by presetting various sensors and obtain data on the painting robot, the workpiece to be sprayed, and the spraying environment; Data processing: interacting the data acquired by the sensing unit with the database information, and screening and analyzing the data; Virtual model construction and simulation: Build virtual models of the painting robot and application scenarios based on the virtual modeling platform, and synchronize the acquired data to the virtual model; use neural network calculations to generate spraying strategies with spraying quality and efficiency as the goal, and consider the influence of physical factors on the spraying process for coupled simulation to optimize the spraying strategy in real time; Decision-making and control: According to the simulation results, the factors related to the spraying quality are calculated to generate analysis results, and the painting robot is remotely controlled based on the analysis results.
2. According to a Unity3D-based painting robot digital twin spraying method and system according to claim 1, it is characterized in that: The data acquired by the perception unit includes the motion state data of the painting robot, the position and posture data of the spray gun, the environmental data and the feature data of the workpiece; Among them, the motion state data of the painting robot includes the speed of each axis; the position and posture data of the spray gun includes the spatial position and posture angle of the spray gun; the environmental data includes temperature, humidity, and air flow speed; the characteristic data of the workpiece includes shape, size, and surface roughness.
3. The Unity3D-based painting robot digital twin spraying method and system according to claim 1, characterized in that: The data processing uses statistical analysis methods through edge computing to filter out abnormal data.
4. The Unity3D-based painting robot digital twin spraying method and system according to claim 2, characterized in that: The spraying strategy includes defining the state space, action space and reward function, and constructing the input state vector, which is then trained using a neural network; The specific steps are as follows: At each time step, the current workpiece state and environmental parameters are obtained from the perception unit and combined with the current state of the spray gun to form a state vector s t Input the actor network and generate an action vector a t ; The action vector a t Applied to the painting simulation environment, multi-physics field coupling simulation is performed to obtain the next state s t+1 and reward r t ; Critic network update: Transform the experience tuple (s t ,a t ,r t ,s t+1 ) is stored in the experience replay buffer, and a batch of experience tuples are randomly sampled from it, the target value is calculated according to the target critic network, and the parameters of the critic network are updated using the mean square error loss function; Actor network update: Use the policy gradient algorithm to update the parameters of the actor network based on the output of the critic network; Target network update: Regularly update the parameters of the target actor network and target critic network to make them track the parameters of the actor network and critic network until the preset spraying quality and efficiency meet the requirements.
5. The Unity3D-based painting robot digital twin spraying method and system according to claim 1, characterized in that: The factors of spraying quality include distribution statistics of coating thickness, spraying efficiency and coating utilization rate.
6. A digital twin spraying system of a painting robot based on Unity3D, characterized by: The perception layer includes a perception unit for collecting data on the painting robot, the workpiece to be sprayed, and the spraying environment; The data layer is responsible for data transmission, processing and storage. The data layer includes a communication module for data interaction with the painting robot controller, an edge computing unit for data processing and a database for data storage; The twin layer is built on a virtual modeling platform, including virtual models of the painting robot and related scenes, interactive interfaces and simulation application modules. It uses neural networks to generate spraying strategies based on the data processed by the data layer with spraying quality and efficiency as the goal. It also has a multi-physics field coupling simulation module to optimize the spraying strategy in real time by considering the influence of various physical factors on the spraying process. The application layer provides users with virtual simulation and decision support for spraying operations, including an interactive interface that displays simulation results, an analysis module that performs data analysis and generates reports, a control module that supports remote control and multi-user collaborative operations, and a predictive maintenance module that predicts equipment failures based on historical data; System management module: used for the system's cyclic operation management, real-time monitoring of data collection, processing and update processes, and adjustment of system status based on feedback; when a termination instruction is received or an abnormality is detected, the corresponding system cleanup and processing are performed.
7. The Unity3D-based painting robot digital twin spraying system according to claim 5, characterized in that: The sensing unit is connected to the data layer via a communication interface or a wireless network.
8. The Unity3D-based painting robot digital twin spraying method and system according to claim 1, characterized in that: The edge computing unit of the data layer uses a statistical analysis method to filter abnormal data.
9. The Unity3D-based painting robot digital twin spraying system according to claim 1, characterized in that: The neural network of the twin layer includes defining a state space, an action space and a reward function, constructing a state vector based on the state space and the action space, and outputting an action vector; the state space includes workpiece features, environmental parameters and spray robot action state information, and the action space includes the motion parameters and spraying parameters of the spray gun; the reward function is comprehensively defined based on spraying quality and efficiency indicators.
Citation Information
Cited By
Unmanned aerial vehicle-mechanical arm system cooperative control method for precise spraying
CN120479640A
Film coating processing technology simulation and optimization system based on digital twinning
CN120579682A
Thin film coating process simulation and optimization system based on digital twinning
CN120579682B