A self-adaptive optimization method for laser welding parameters based on machine learning
By establishing a deep neural network and Markov decision process to optimize laser welding parameters, the problems of inaccurate quality judgment and inadaptability of parameter optimization in traditional laser welding were solved, and high-precision welding and energy consumption optimization were achieved.
Patent Information
- Application Number
- CN202510926022.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-07
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2045-07-07
AI Technical Summary
Traditional laser welding quality judgment relies on manual experience or simple algorithms, resulting in poor real-time performance and low accuracy. It is difficult to accurately extract the spatial features of the welding image and cannot dynamically feedback the welding quality. The existing laser welding parameter optimization cannot adapt to the changes in the gap between metal parts and the differences in the thermal conductivity of materials, resulting in unstable welding strength, high energy consumption, large deviation in weld width, poor weld continuity, and large cumulative errors.
A deep neural network is established as a weld bead width prediction model. The welding image features are extracted through convolutional layers and pooling layers, and the model is trained with the stochastic gradient descent algorithm to achieve real-time and accurate prediction of the weld bead width. The Markov decision process and SAC algorithm are introduced, and the neural Q network is used to optimize the welding strategy. The cumulative error is reduced through the spatial discount mechanism to achieve adaptive adjustment of the welding speed.
It realizes real-time and accurate judgment and dynamic feedback of welding quality, reduces welding cumulative error, improves welding strength and energy efficiency, and expands the application scope of laser welding.
Smart Images

Figure CN120406181B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of parameter adaptive control, and in particular to a laser welding parameter adaptive optimization method based on machine learning. Background Art
[0002] Adaptive optimization of laser welding parameters is the process of automatically adjusting and optimizing welding parameters during the welding process based on factors such as the material properties of the welding object, the requirements of the weld joint, and the real-time status of the welding process to find the best parameter combination. Traditional welding quality judgment mainly relies on manual experience or simple algorithms, resulting in poor real-time quality judgment and low accuracy. It is also difficult to accurately extract the spatial features of the welding image and cannot dynamically feedback the welding quality. At the same time, existing laser welding parameter optimization uses fixed parameter tables or trial-and-error methods, which cannot adapt to working conditions such as changes in the gap between metal parts and differences in material thermal conductivity. This leads to unstable welding strength, high energy consumption, and difficulty in balancing the relationship between welding speed and quality. It is easy to have large deviations in weld width and poor weld continuity, resulting in cumulative errors when welding long welds. Summary of the Invention
[0003] In view of the above situation, in order to overcome the defects of the existing technology, the present invention provides a method for adaptive optimization of laser welding parameters based on machine learning. In view of the technical problems that traditional welding quality judgment mainly relies on manual experience or simple algorithms, resulting in poor real-time quality judgment, low accuracy, and difficulty in accurately extracting spatial features of welding images, and unable to dynamically feedback welding quality, this solution establishes a deep neural network as a weld bead width prediction model, uses convolutional layers and pooling layers to extract spatial features such as weld bead shape and relative position of metal parts in metal parts welding images, then fuses features through a fully connected layer, and combines the random gradient descent algorithm to train the model to achieve real-time and accurate prediction of weld bead width, convert image features into quantitative quality judgment basis, avoid human subjective errors, and provide a reliable feedback basis for dynamic parameter adjustment; in view of the existing laser welding parameter optimization using a fixed parameter table or trial and error method, which cannot adapt to working conditions such as changes in metal part gaps and differences in material thermal conductivity, resulting in unstable welding strength, high energy consumption, and difficulty in balancing the relationship between welding speed and quality. It is easy to have large weld bead width deviation and poor weld continuity, resulting in cumulative errors when welding long welds, this solution establishes a Markov decision process and introduces a discount factor, adopts SAC (Soft The Actor-Critic algorithm maximizes the entropy regularized reinforcement learning objective, uses a neural Q network as a function approximator, optimizes the Q function parameters by minimizing the Bellman residual, and optimizes the welding strategy parameters by defining the loss function with the KL divergence. The formula for minimizing the squared weld error is rewritten in a spatial discount form, with the weld length and laser position as variables, and an integral reward function defined in combination with the instantaneous welding speed. The spatial discount mechanism reduces the impact of cumulative errors, achieves spatially adaptive adjustment of the welding speed, meets the quality requirements of high-precision welding scenarios, and expands the application scope of laser welding.
[0004] The technical solution adopted by the present invention is as follows: The present invention provides a method for adaptively optimizing laser welding parameters based on machine learning, which specifically includes the following steps:
[0005] Step S1: Configuring hardware equipment, which includes a laser generator, a motion controller, a near-infrared camera, and a position encoder. The laser generator is used to emit welding lasers, the motion controller is used to control the movement of the laser generator, the near-infrared camera is used to obtain real-time images of metal welding, and the position encoder is used to record the coordinates of welding points.
[0006] Step S2: Weld bead width prediction: the center line between the two metal parts is recorded as the center axis. Assuming that the laser line is aligned with the center axis, the weld bead width is predicted from the metal parts welding image to judge the laser welding quality;
[0007] Step S3: Optimizing laser welding parameters, establishing a Markov decision process and introducing a discount factor into the Markov decision process, and achieving the optimal welding strategy by controlling the laser welding speed.
[0008] Furthermore, step S2, weld bead width prediction, specifically comprises: establishing and initializing a deep neural network as a weld bead width prediction model, using a stochastic gradient descent algorithm to train the weld bead width prediction model, the weld bead width prediction model outputting a predicted weld bead width, using the convolution layer and pooling layer of the deep neural network to extract spatial features from the metal part welding image, the spatial features including the weld bead shape and the relative position of the metal parts, and using the fully connected layer of the deep neural network to fuse the spatial features of the metal part welding image to obtain a fused feature. The convolution operation process of the convolution layer is as follows:
[0009] ;
[0010] Where, is the first feature map output by the convolutional layer. Row, No. The element value of the column, The convolution kernel representing the convolution operation is × , and Both are correct The traversal, is the convolution kernel Row, No. The column weight parameter, It is the first Row, No. The pixel value of .
[0011] Furthermore, step S3, optimizing laser welding parameters, specifically includes the following steps:
[0012] Step S31: defining a reinforcement learning model as a parameter optimization model through a Markov decision process, wherein the Markov decision process includes a state space, an action space, an unknown transition probability density of the next state, and a reward value, wherein the state space includes the weld bead width, the metal part gap width, the current welding speed, the laser power, the spot diameter, and the position increment of the previous time step, and the action space includes the laser power increment and the spot diameter increment. The goal of the parameter optimization model is to determine the optimal welding strategy that maximizes the reward value;
[0013] Step S32: Use the SAC algorithm to maximize the entropy regularization reinforcement learning objective, balance the sum of the reward values and the randomness of the welding strategy, use the neural Q network as the function approximator of the welding strategy, collect the state, action and reward values from the replay buffer to form a sampling data set, use the sampling data set to train the parameter optimization model, minimize the residual between the current estimated Q function in the neural Q network and the target Q function based on the Bellman equation, and optimize the network parameters of the Q function. The formula used is as follows:
[0014] ;
[0015] Where, is the Bellman residual, Q is the current estimated Q function, are the network parameters of the Q function, It's expectation. is the target Q function based on the Bellman equation, yes The network parameters of the function, is a discrete time step, is The action of time, is The state at the time, where the calculation method of the target Q function based on the Bellman equation is as follows:
[0016] ;
[0017] Where, is The reward value when is the time discount factor, is The position of the laser line when is the target state value function, The calculation method is as follows:
[0018] ;
[0019] Where, is the welding temperature parameter, is the welding strategy parameter, is the parameterized welding strategy function;
[0020] Step S33: Define the loss function of the parameter optimization model as the KL divergence between the welding strategy and the optimal strategy of the corresponding Q function, and optimize the welding strategy parameters by minimizing the loss function. The formula used is as follows:
[0021] ;
[0022] Where, is the policy loss function;
[0023] Step S34: rewrite the square error minimization formula of the weld into a spatial discount form, and the formula used is as follows:
[0024] ;
[0025] Where, is the weld bead length, is the total time length, It is the center line between the two metal parts, that is, the center axis, It is time The position of the laser at is The error between the target weld bead width and the actual weld bead width, and They are respectively and The points, is The instantaneous welding speed at 10 ...
[0026] Step S35: The reward function is defined by minimizing the square error of the weld. The formula used is as follows:
[0027] ;
[0028] Where, is the integral reward function.
[0029] The beneficial effects achieved by the present invention using the above scheme are as follows:
[0030] (1) In view of the technical problems that traditional welding quality judgment mainly relies on manual experience or simple algorithms, resulting in poor real-time quality judgment, low accuracy, and difficulty in accurately extracting the spatial features of welding images, and unable to dynamically feedback welding quality, this scheme establishes a deep neural network as a weld bead width prediction model, uses convolutional layers and pooling layers to extract spatial features such as weld bead shape and relative position of metal parts in the welding image of metal parts, and then fuses features through a fully connected layer, combined with the stochastic gradient descent algorithm to train the model, to achieve real-time and accurate prediction of weld bead width, convert image features into quantitative quality judgment basis, avoid human subjective errors, and provide a reliable feedback basis for dynamic parameter adjustment;
[0031] (2) The existing laser welding parameter optimization adopts a fixed parameter table or trial and error method, which cannot adapt to working conditions such as changes in the gap between metal parts and differences in material thermal conductivity, resulting in unstable welding strength and high energy consumption. It is also difficult to balance the relationship between welding speed and quality. It is easy to have large deviations in weld width and poor weld continuity, which leads to technical problems such as cumulative errors when welding long welds. This scheme establishes a Markov decision process and introduces a discount factor. It adopts the SAC (Soft Actor-Critic) algorithm to maximize the entropy regularization reinforcement learning objective, uses the neural Q network as a function approximator, optimizes the Q function parameters by minimizing the Bellman residual, and defines the loss function with the KL divergence to optimize the welding strategy parameters. The weld square error minimization formula is rewritten into a spatial discount form. The weld length and laser position are used as variables, and the integral reward function is defined in combination with the instantaneous welding speed. The spatial discount mechanism is used to reduce the influence of cumulative errors, realize spatial adaptive adjustment of welding speed, meet the quality requirements of high-precision welding scenarios, and expand the application scope of laser welding. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 A step connection diagram of a method for adaptively optimizing laser welding parameters based on machine learning provided by the present invention.
[0033] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention. DETAILED DESCRIPTION
[0034] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0035] Example 1: See Figure 1 This embodiment provides a method for adaptively optimizing laser welding parameters based on machine learning. The method comprises the following steps:
[0036] Step S1: Configuring hardware equipment, which includes a laser generator, a motion controller, a near-infrared camera, and a position encoder. The laser generator is used to emit welding lasers, the motion controller is used to control the movement of the laser generator, the near-infrared camera is used to obtain real-time images of metal welding, and the position encoder is used to record the coordinates of welding points.
[0037] Step S2: Weld bead width prediction: the center line between the two metal parts is recorded as the center axis. Assuming that the laser line is aligned with the center axis, the weld bead width is predicted from the metal parts welding image to judge the laser welding quality;
[0038] Step S3: Optimizing laser welding parameters, establishing a Markov decision process and introducing a discount factor into the Markov decision process, and achieving the optimal welding strategy by controlling the laser welding speed.
[0039] Example 2, see Figure 1 This embodiment is based on the above embodiment. Step S2, weld bead width prediction, specifically comprises: establishing and initializing a deep neural network as a weld bead width prediction model, using a stochastic gradient descent algorithm to train the weld bead width prediction model, the weld bead width prediction model outputting a predicted weld bead width, and using the convolution layer and pooling layer of the deep neural network to extract spatial features from the metal part welding image. The spatial features include the weld bead shape and the relative position of the metal parts. The spatial features of the metal part welding image are fused using the fully connected layer of the deep neural network to obtain a fused feature. The convolution operation process of the convolution layer is as follows:
[0040] ;
[0041] Where, is the first feature map output by the convolutional layer. Row, No. The element value of the column, The convolution kernel representing the convolution operation is × , and Both are correct The traversal, is the convolution kernel Row, No. The column weight parameter, It is the first Row, No. The pixel value of .
[0042] Example 3, see Figure 1 This embodiment is based on the above embodiment. In step S3, the laser welding parameters are optimized, specifically including the following steps:
[0043] Step S31: defining a reinforcement learning model as a parameter optimization model through a Markov decision process, wherein the Markov decision process includes a state space, an action space, an unknown transition probability density of the next state, and a reward value, wherein the state space includes the weld bead width, the metal part gap width, the current welding speed, the laser power, the spot diameter, and the position increment of the previous time step, and the action space includes the laser power increment and the spot diameter increment. The goal of the parameter optimization model is to determine the optimal welding strategy that maximizes the reward value;
[0044] Step S32: Use the SAC algorithm to maximize the entropy regularization reinforcement learning objective, balance the sum of the reward values and the randomness of the welding strategy, use the neural Q network as the function approximator of the welding strategy, collect the state, action and reward values from the replay buffer to form a sampling data set, use the sampling data set to train the parameter optimization model, minimize the residual between the current estimated Q function in the neural Q network and the target Q function based on the Bellman equation, and optimize the network parameters of the Q function. The formula used is as follows:
[0045] ;
[0046] Where, is the Bellman residual, Q is the current estimated Q function, are the network parameters of the Q function, It's expectation. is the target Q function based on the Bellman equation, yes The network parameters of the function, is a discrete time step, is The action of time, is The state at the time, where the calculation method of the target Q function based on the Bellman equation is as follows:
[0047] ;
[0048] Where, is The reward value when is the time discount factor, is The position of the laser line when is the target state value function, The calculation method is as follows:
[0049] ;
[0050] Where, is the welding temperature parameter, is the welding strategy parameter, is the parameterized welding strategy function;
[0051] Step S33: Define the loss function of the parameter optimization model as the KL divergence between the welding strategy and the optimal strategy of the corresponding Q function, and optimize the welding strategy parameters by minimizing the loss function. The formula used is as follows:
[0052] ;
[0053] Where, is the policy loss function;
[0054] Step S34: rewrite the square error minimization formula of the weld into a spatial discount form, and the formula used is as follows:
[0055] ;
[0056] Where, is the weld bead length, It is the center line between the two metal parts, that is, the center axis, It is time The position of the laser at is The error between the target weld bead width and the actual weld bead width, and They are respectively and The points, is The instantaneous welding speed at 10 ...
[0057] Step S35: The reward function is defined by minimizing the square error of the weld. The formula used is as follows:
[0058] ;
[0059] Where, is the integral reward function.
[0060] Example 4. This example is based on the above example. In Example 2, a deep neural network is established and initialized as a weld width prediction model. In the specific implementation, the deep neural network has 4 convolution layers, and the convolution kernels are 5×5, 3×3, 3×3 and 3×3 respectively. Each convolution layer is followed by a 2×2 maximum pooling layer. There are 2 fully connected layers, the number of neurons in the first fully connected layer is 100, and the number of neurons in the second fully connected layer is 64.
[0061] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus.
[0062] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
[0063] The present invention and its embodiments are described above. This description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if a person skilled in the art is inspired by this and, without departing from the purpose of the present invention, designs structures and embodiments similar to this technical solution without inventiveness, they shall fall within the scope of protection of the present invention.
Claims
1. A method for adaptive optimization of laser welding parameters based on machine learning, characterized in that: The specific steps include: Step S1: Configuring hardware equipment, which includes a laser generator, a motion controller, a near-infrared camera, and a position encoder. The laser generator is used to emit welding lasers, the motion controller is used to control the movement of the laser generator, the near-infrared camera is used to obtain real-time images of metal welding, and the position encoder is used to record the coordinates of welding points. Step S2: Weld bead width prediction: the center line between the two metal parts is recorded as the center axis. Assuming that the laser line is aligned with the center axis, the weld bead width is predicted from the metal parts welding image to judge the laser welding quality; Step S3: Optimizing laser welding parameters, establishing a Markov decision process and introducing a discount factor in the Markov decision process, and achieving the optimal welding strategy by controlling the laser welding speed, specifically including the following steps: Step S31: defining a reinforcement learning model as a parameter optimization model through a Markov decision process, wherein the Markov decision process includes a state space, an action space, an unknown transition probability density of the next state, and a reward value, and the goal of the parameter optimization model is to determine an optimal welding strategy that maximizes the reward value; Step S32: Using the SAC algorithm to maximize the entropy regularization reinforcement learning objective, balancing the sum of the reward values and the randomness of the welding strategy, using a neural Q network as a function approximator for the welding strategy, collecting states, actions, and reward values from the replay buffer to form a sampling data set, using the sampling data set to train a parameter optimization model, minimizing the residual between the current estimated Q function in the neural Q network and the target Q function based on the Bellman equation, and optimizing the network parameters of the Q function; Step S33: defining the loss function of the parameter optimization model as the KL divergence between the welding strategy and the optimal strategy of the corresponding Q function, and optimizing the welding strategy parameters by minimizing the loss function; Step S34: rewrite the square error minimization formula of the weld into a spatial discount form, and the formula used is as follows: ; Where, is the weld bead length, is the total time length, It is the center line between the two metal parts, that is, the center axis, It is time The position of the laser at is the time discount factor, is The error between the target weld bead width and the actual weld bead width, and They are respectively and The points, is The instantaneous welding speed at 10 ... Step S35: The reward function is defined by minimizing the square error of the weld. The formula used is as follows: ; Where, is the integral reward function.
2. The method for adaptive optimization of laser welding parameters based on machine learning according to claim 1, characterized in that: Step S2, weld bead width prediction, specifically: establish and initialize a deep neural network as a weld bead width prediction model, use a stochastic gradient descent algorithm to train the weld bead width prediction model, and the weld bead width prediction model outputs the predicted weld bead width.