A laser galvanometer automatic focusing method based on polynomial regression algorithm

The automatic focusing method based on the multinomial regression algorithm solves the problem of large errors in traditional manual focusing, achieves high-precision focusing of the laser beam, and improves the quality and efficiency of laser processing, especially in applications involving complex workpiece surfaces.

CN120669383BActive Publication Date: 2026-07-07NINGDE SKEQI INTELLIGENT EQUIP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NINGDE SKEQI INTELLIGENT EQUIP CO LTD
Filing Date
2025-06-11
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Traditional laser galvanometer focusing relies on manual adjustment, resulting in large focus errors that affect the accuracy and quality of laser processing.

Method used

An automatic focusing method based on a multinomial regression algorithm is adopted. Through real-time modeling and dynamic adjustment, it overcomes the undulations and height changes of the target surface and ensures that the laser beam is focused on the target surface.

Benefits of technology

It achieves high-precision focusing of the laser beam, reduces processing errors, and improves welding quality and efficiency. Especially in processing scenarios with inclined or uneven workpiece surfaces, it has the advantages of fast focus finding speed and high precision.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120669383B_ABST
    Figure CN120669383B_ABST
Patent Text Reader

Abstract

This invention relates to an automatic focusing method for laser galvanometers based on a polynomial regression algorithm, including variable definition, data collection of sample data within different power ranges from 10% to 80%, and data preprocessing; employing a piecewise polynomial regression model, and adding an L2 regularization term to the model to prevent overfitting; and minimizing the observed value D. i The model parameters are estimated using the sum of squared errors between the predicted and actual values. The model is used to predict values ​​in real time. When the absolute value of the deviation ∈ between the predicted and actual roundness values ​​D exceeds the threshold Th, the galvanometer height H or laser power P is dynamically adjusted to make D approach the target value D. target =0; the system is based on the optimal height H * The Z-axis position of the galvanometer is adjusted in real time to focus the laser beam at the optimal position; the deviation between the actual value D and the predicted value ∈ is periodically collected to update the regression model coefficients. This invention enables precise focusing of the laser beam, improving product consistency and yield.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of laser processing, optical focusing and automated control technology, and in particular to an automatic focusing method for laser galvanometers based on a polynomial regression algorithm. Background Technology

[0002] In the field of laser processing, precise focusing is crucial for ensuring processing quality and accuracy. Traditional laser galvanometer focusing relies on manual mechanical adjustments or experience-based parameter adjustments. Focusing based on human experience is prone to significant errors due to variations in human skill level, experience level, operating techniques, material type, flatness, and lighting environment, thus affecting the accuracy and quality of laser processing. Summary of the Invention

[0003] The purpose of this invention is to provide an automatic focusing method for laser galvanometers based on a polynomial regression algorithm. Through real-time modeling and dynamic adjustment, it overcomes the defocusing problem caused by factors such as surface undulations and height changes, ensuring that the laser beam can always be well focused on the target surface.

[0004] To achieve the above objectives, the present invention provides the following technical solution: a laser galvanometer autofocusing method based on a polynomial regression algorithm, characterized by comprising the following steps:

[0005] Step S1: Define input variables: laser power P, workpiece tilt angle θ, galvanometer height H, actual roundness value D, predicted value D, and the sum of actual and predicted roundness values ​​D. Deviation ∈, actual roundness deviation threshold Th, optimal height H * ;

[0006] Step S2: Collect sample data in different power ranges from 10% to 80%. Each set of data contains a quadruple (P,θ,H,D) and performs data preprocessing.

[0007] Step S3: Use a piecewise multinomial regression model and add an L2 regularization term to prevent overfitting.

[0008] Step S4: For the piecewise multinomial regression model, minimize the observed value D. i Compared with the predicted value The model parameters β0, β1, β2, β3, β4, γ0, γ1, γ2, γ3 are estimated by the sum of squared errors between them.

[0009] Step S5: Based on the current input values ​​of P, θ, and H, use the model to predict the predicted values ​​in real time. Get the predicted value The absolute value of the deviation ∈ from the actual roundness value D is taken. If the absolute value of the deviation ∈ exceeds the threshold Th, the galvanometer height H or the laser power P is dynamically adjusted to make the actual roundness value D approach the target value D. target =0;

[0010] Step S6: Obtain the optimal height H * The system is based on the optimal height H * The Z-axis position of the galvanometer is adjusted in real time to focus the laser beam at the optimal position;

[0011] Step S7: Periodically collect the actual roundness value D and the predicted value. The deviation ∈ is used to update the regression model coefficients and compensate for interferences such as equipment aging and ambient temperature.

[0012] Furthermore, the data preprocessing in step S2 includes data cleaning, missing value handling, and standardization.

[0013] Furthermore, the piecewise multinomial regression model in step S3 is further defined as follows:

[0014]

[0015] Where D is the actual roundness value, P is the laser power percentage value of 10% to 80%, and θ is the workpiece tilt.

[0016] H is the distance from the galvanometer to the workpiece surface, ∈ is the deviation term, and β0,β1,β2,β3,β4,γ0,γ1,γ2,γ3 are model coefficients.

[0017] Furthermore, the objective function after adding the L2 regularization term in step S3 is:

[0018]

[0019] in For predicted values Minimize the observed value D i The sum of squared errors between them, λ||β|| 2 λ is the L2 regularization term, λ is the regularization parameter, and β is the coefficient vector.

[0020] Furthermore, in step S6, the optimal height H * The formula for obtaining it is

[0021] Where P current For the current power of the sample, θ target The tilt angle of the sample target is calculated by finding an optimal H value, denoted as H. * , making P current θtarget The function D of H reaches its minimum.

[0022] Furthermore, in step S4, the method for calculating the sum of squared errors is as follows: Where n represents the sample size, D i It is the i-th minimized observation. It is the i-th predicted value. It calculates the sum of squared errors between observed and predicted values. This sum is minimized by changing the model parameters, i.e., using the least squares method. This means finding the minimum value of the expression following the function of β, where β is the parameter in the model. This method is introduced to find the optimal fitting curve.

[0023] Furthermore, step S7 further comprises: setting a data acquisition cycle; determining a suitable periodic data acquisition time interval T based on the device operating characteristics and the frequency of interference factor changes; and setting the starting time t of each cycle as follows. n Execution, where n = 1, 2, 3..., at the beginning time t of each cycle. n Collect the actual roundness deviation D and the predicted value. Data on actual equipment operation is collected through sensors and other devices. n Simultaneously, existing regression models are used to predict the operating state at the same time, yielding predictions. Calculate the actual value D n Compared with the predicted value deviation ∈ n , deviation ∈ n This reflects the error in the current regression model's predictions, and the calculation formula is as follows: The obtained deviation ∈ n By combining historical deviation data, the gradient descent method is used to update the coefficients of the regression model in order to minimize the mean squared error. With N as the number of data collection periods as the objective, the regression coefficients are updated using gradient descent with a learning rate of α. The coefficient update formula is as follows:

[0024]

[0025] The updated regression model is used for subsequent prediction and control. The new model prediction will automatically take into account the impact of factors such as equipment aging and ambient temperature, thereby compensating for disturbances and improving prediction accuracy and equipment control precision.

[0026] The beneficial effects of this invention are as follows: This invention achieves coordinated optimization control of power, height, and workpiece tilt, meeting the precision requirements of complex processing scenarios. It employs a fully automatic galvanometer focus-finding method based on a multinomial regression algorithm, effectively solving the bottlenecks of large error range, unstable welding quality, and low welding efficiency associated with manual focus-finding. It features fast focus-finding speed and high accuracy (±0.05mm). Through reasonable data processing, model design, and optimization, the stability and generalization ability of the model are improved, providing a strong guarantee for high-quality and high-precision laser processing. In practical applications, this system is expected to be widely used in various laser processing fields such as laser welding and laser cleaning, improving processing efficiency and product quality. Especially for processing scenarios where workpiece surfaces are tilted or uneven, it can more accurately focus the laser beam, reducing processing errors and improving product consistency and yield. Before each welding cycle, a one-click focus-finding function can be implemented to quickly execute galvanometer focus-finding and verification functions, effectively improving the welding yield of battery modules in the field of new energy lithium battery laser welding. Attached Figure Description

[0027] Figure 1 This is a flowchart of the method of the present invention;

[0028] Figure 2 This is a flowchart of the present invention for preventing model overfitting;

[0029] Figure 3 This is a flowchart of the adaptive compensation method of the present invention. Detailed Implementation

[0030] The invention will now be further described with reference to the accompanying drawings.

[0031] Please see Figures 1 to 3 The present invention provides an automatic focusing method for laser galvanometers based on a polynomial regression algorithm, comprising the following steps:

[0032] Step S1: Define input variables: laser power P, workpiece tilt angle θ, galvanometer height H, actual roundness value D, predicted value D, and the sum of actual and predicted roundness values ​​D. Deviation ∈, actual roundness deviation threshold Th, optimal height H * ;

[0033] Step S2: Collect sample data in different power ranges from 10% to 80%. Each set of data contains a quadruple (P,θ,H,D) and performs data preprocessing.

[0034] Step S3: Use a piecewise multinomial regression model and add an L2 regularization term to prevent overfitting.

[0035] Step S4: For the piecewise multinomial regression model, minimize the observed value D. iCompared with the predicted value The model parameters β0, β1, β2, β3, β4, γ0, γ1, γ2, γ3 are estimated by the sum of squared errors between them.

[0036] Step S5: Based on the current input values ​​of P, θ, and H, use the model to predict the predicted values ​​in real time. Get the predicted value The absolute value of the deviation ∈ from the actual roundness value D is taken. If the absolute value of the deviation ∈ exceeds the threshold Th, the galvanometer height H or the laser power P is dynamically adjusted to make the actual roundness value D... target =0;

[0037] Step S6: Obtain the optimal height H * The system is based on the optimal height H * The Z-axis position of the galvanometer is adjusted in real time to focus the laser beam at the optimal position;

[0038] Step S7: Periodically collect the actual roundness value D and the predicted value. The deviation ∈ is used to update the regression model coefficients and compensate for interferences such as equipment aging and ambient temperature.

[0039] The present invention will be further described below with reference to a specific embodiment:

[0040] An automatic focusing method for laser galvanometers based on a polynomial regression algorithm.

[0041] 1. Input variable definitions: laser power P, workpiece tilt angle θ, galvanometer height H, actual roundness value D and predicted value Deviation ∈, actual roundness deviation threshold Th, optimal height H * Wherein: Laser power P: A percentage value ranging from 10% to 80%, its variation directly affects the energy input and spot characteristics of laser processing. Workpiece tilt θ: Indicates the degree of tilt of the workpiece surface or axis relative to the reference, which has a potential impact on laser focusing and processing effect. Galvanometer height H: The distance (mm) from the galvanometer to the workpiece surface, a key parameter for adjusting the laser focus position. Actual roundness value D: The measured spot roundness value (μm), the actual roundness value D differs from the predicted value. The deviation ∈: that is, the difference between the actual roundness value D and the predicted value. The difference.

[0042] 2. Collect sample data in different power ranges from 10% to 80%. Each data set contains a quadruple (P,θ,H,D) and perform data preprocessing.

[0043] 2.1 Data preprocessing includes data cleaning, missing value handling, and standardization.

[0044] 2.2 The piecewise multinomial regression model is further as follows:

[0045]

[0046] Where D is the actual roundness value, P is the laser power percentage value of 10% to 80%, θ is the workpiece tilt, H is the distance from the galvanometer to the workpiece surface, ∈ is the deviation term, and β0,β1,β2,β3,β4,γ0,γ1,γ2,γ3 are model coefficients.

[0047] 2.3 such as Figure 2 To prevent overfitting, the objective function after adding the L2 regularization term is:

[0048]

[0049] The objective function is the loss function J for model fitting; where For predicted values Minimize the observed value D i The sum of squared errors between them, λ||β|| 2 Here, λ is the L2 regularization term, β is the regularization parameter, and β is the coefficient vector. This process describes the iterative parameter updates based on the loss function during model fitting until convergence.

[0050] Calculate the loss function value J: The process begins by calculating the loss function value J based on the current model parameters. The loss function measures the difference between the model's predicted value and the actual value.

[0051] Judgment criteria: Check whether the loss function value J is less than the pre-set convergence threshold Tj, or whether the number of fitting iterations has reached the preset upper limit N. max The convergence value Tj is a small value; when the loss function decreases to around this value, the model can be considered to have converged. The upper limit of the number of iterations is the maximum number of iterations set to prevent the fitting process from looping infinitely.

[0052] If the conditions are met, it means that the model fit has reached an acceptable state. The process then proceeds to the "output model parameters" step, outputs the current model parameters, and the fitting ends.

[0053] If the conditions are not met, it indicates that the model has not yet converged and training needs to continue. At this point, the "Update Model Parameters" step is initiated. Using optimization algorithms such as gradient descent, the model parameters are adjusted and updated based on the gradient calculated from the loss function, making the model's predictions closer to the true values.

[0054] Iterative calculation: After updating the model parameters, return to the "Calculate the loss function value J" step, recalculate the model loss function value J after updating the parameters, and make the judgment again. Repeat this process until the judgment condition is met, and then end the fitting.

[0055] By adjusting the value of λ, a balance can be struck between goodness of fit and model complexity, thereby improving the model's generalization ability.

[0056] 3. A piecewise multinomial regression model is adopted, and an L2 regularization term is added to prevent the model from overfitting;

[0057] 4. For piecewise multinomial regression models, minimize the observed value D i Compared with the predicted value The model parameters β0, β1, β2, β3, β4, γ0, γ1, γ2, γ3 are estimated by the sum of squared errors between the parameters; the least squares method is the parameter estimation method in this system.

[0058] 4.1 In step S4, the method for calculating the sum of squared errors is as follows: Where n represents the sample size, D i It is the i-th minimized observation. It is the i-th predicted value. It calculates the sum of squared errors between observed and predicted values. This sum is minimized by changing the model parameters, i.e., using the least squares method. This means finding the minimum value of the expression following the function of β, where β is the parameter in the model. This method is introduced to find the optimal fitting curve.

[0059] 5. Based on the current input values ​​of P, θ, and H, use the model to predict the predicted values ​​in real time. Get the predicted value The absolute value of the deviation ∈ from the actual roundness value D is taken. If the absolute value of the deviation ∈ exceeds the threshold Th, the galvanometer height H or the laser power P is dynamically adjusted to make the actual roundness value D... target =0;

[0060] 6. Obtain the optimal height H * The system is based on the optimal height H * The Z-axis position of the galvanometer is adjusted in real time to focus the laser beam at the optimal position;

[0061] 6.1 Optimal Height H * The formula for obtaining it is Where P current For the current power of the sample, θ target The tilt angle of the sample target is calculated by finding an optimal H value, denoted as H. * , making P current θ targe The function D of t and H reaches its minimum.

[0062] 7. Periodically collect the actual roundness value D and the predicted value. The deviation ∈ is used to update the regression model coefficients and compensate for interferences such as equipment aging and ambient temperature. The flowchart of adaptive compensation is as follows: Figure 3 As shown.

[0063] 7.1 Set the acquisition period. Based on the equipment operating characteristics and the frequency of changes in interference factors, determine a suitable periodic acquisition time interval T, with the starting time t of each period being... n Execution, where n = 1, 2, 3..., at the beginning time t of each cycle. n Collect the actual roundness value D and the predicted value. Data on actual equipment operation is collected through sensors and other devices. n Simultaneously, existing regression models are used to predict the operating state at the same time, yielding predictions. Calculate the actual value D n Compared with the predicted value deviation ∈ n , deviation ∈ n This reflects the error in the current regression model's predictions, and the calculation formula is as follows: The obtained deviation ∈ n By combining historical deviation data, the gradient descent method is used to update the coefficients of the regression model in order to minimize the mean squared error. With N as the number of data collection periods as the objective, the regression coefficients are updated using gradient descent with a learning rate of α. The coefficient update formula is as follows:

[0064]

[0065] The updated regression model is used for subsequent prediction and control. The new model prediction will automatically take into account the impact of factors such as equipment aging and ambient temperature, thereby compensating for disturbances and improving prediction accuracy and equipment control precision.

[0066] The process begins with continuous monitoring and adjustment, constantly checking the real-time data D. When data anomalies or insufficiencies are detected, data cleaning strategies such as handling missing values ​​or supplementing boundary data are adopted. Then, it is determined whether the processing strategy is satisfied. If not, the data cleaning strategy is repeated. If it is satisfied, continuous monitoring and adjustment continue.

[0067] In summary, this invention achieves coordinated optimization control of power, height, and workpiece tilt, meeting the precision requirements of complex processing scenarios. It employs a fully automated galvanometer focus-finding method based on a multinomial regression algorithm, effectively addressing bottlenecks such as large error range, unstable welding quality, and low welding efficiency associated with manual focus-finding. The system boasts fast focus-finding speed and high accuracy (±0.05mm). Through reasonable data processing, model design, and optimization, the model's stability and generalization ability are improved, providing a strong guarantee for high-quality and high-precision laser processing. In practical applications, this system is expected to be widely used in various laser processing fields such as laser welding and laser cleaning, improving processing efficiency and product quality. Especially for processing scenarios where workpiece surfaces are tilted or uneven, it can more accurately focus the laser beam, reducing processing errors and improving product consistency and yield. Before each welding cycle, a one-click focus-finding function can be implemented to quickly execute galvanometer focus-finding and verification functions, effectively improving the welding yield of battery modules in the field of new energy lithium battery laser welding.

[0068] The above description is only a preferred embodiment of the present invention and should not be construed as a limitation of this application. All equivalent changes and modifications made in accordance with the scope of the patent application of the present invention should be covered by the present invention.

Claims

1. A method for automatic focusing of a laser galvanometer based on a polynomial regression algorithm, characterized in that: Includes the following steps: Step S1: Input variable definition: 10%~80% of laser power percentage value Workpiece tilt Distance from galvanometer to workpiece surface Actual roundness value D, predicted value Actual roundness value D and predicted value deviation Actual roundness deviation threshold Th, optimal height ; Step S2: Collect sample data in different power ranges from 10% to 80%, with each data set containing a quadruple ( ), and perform data preprocessing; Step S3: Use a piecewise multinomial regression model and add an L2 regularization term to prevent overfitting. Step S4: For the piecewise multinomial regression model, minimize the observed values. Compared with the predicted value The model coefficients are estimated by the sum of squared errors between them. ; Step S5, based on the current Input values, use the model to predict values ​​in real time. ; Obtain predicted values Deviation from the actual roundness value D The absolute value, if the deviation If the absolute value exceeds the threshold Th, dynamically adjust the distance H between the galvanometer and the workpiece surface, or the laser power percentage value P of 10%~80%, to make the actual roundness value D approach the target value. ; Step S6: Obtain the optimal height The system is based on the optimal height The Z-axis position of the galvanometer is adjusted in real time to focus the laser beam at the optimal position; Step S7: Periodically collect the actual roundness value D and the predicted value. deviation Update the regression model coefficients to compensate for interference from equipment aging, ambient temperature, etc.

2. The automatic focusing method for laser galvanometers based on a polynomial regression algorithm according to claim 1, characterized in that: The data preprocessing in step S2 includes data cleaning, missing value handling, and standardization.

3. The laser galvanometer autofocusing method based on polynomial regression algorithm according to claim 1, characterized in that: The piecewise multinomial regression model in step S3 is further defined as follows: ; Where D is the actual roundness value, This represents a laser power percentage value ranging from 10% to 80%. For workpiece tilt, The distance from the galvanometer to the workpiece surface is denoted as . For deviation terms, These are the model coefficients.

4. The laser galvanometer autofocusing method based on polynomial regression algorithm according to claim 1, characterized in that: The objective function after adding the L2 regularization term in step S3 is: ; in For predicted values Minimize the observed value The sum of squared errors between them For L2 regularization terms, For regularization parameters, This is the coefficient vector.

5. The automatic focusing method for laser galvanometers based on a polynomial regression algorithm according to claim 1, characterized in that: The optimal height in step S6 The formula for obtaining it is ; in The current power of the sample, Let H be the tilt angle of the sample target. This calculation formula seeks an optimal H value, denoted as H. , making , The function D of H reaches its minimum.

6. The automatic focusing method for laser galvanometers based on a polynomial regression algorithm according to claim 1, characterized in that: In step S4, the method for calculating the sum of squared errors is as follows: , where n represents the number of samples. It is the i-th minimized observation. It is the i-th predicted value. It calculates the sum of squared errors between observed and predicted values. This sum is minimized by changing the model coefficients, i.e., using the least squares method. This means finding the minimum value of the expression following the function of β, where β is the coefficient in the model. This method is introduced to find the optimal fitting curve.

7. The automatic focusing method for laser galvanometers based on a polynomial regression algorithm according to claim 1, characterized in that: Step S7 further comprises: setting a data acquisition cycle; determining a suitable periodic data acquisition time interval T based on the equipment operating characteristics and the frequency of changes in interference factors; and setting the time interval at the beginning of each cycle. Execution, where n=1,2,3..., at the beginning of each cycle. Collect the actual roundness value D and the predicted value. Collect actual operating values ​​of the equipment through sensors and other devices. Simultaneously, existing regression models are used to predict the operating state at the same time, yielding predictions. Calculate the actual value Compared with the predicted value deviation ,deviation This reflects the error in the current regression model's predictions, and the calculation formula is as follows: = - The obtained deviation The coefficients of the regression model are updated using gradient descent based on historical deviation data; the goal is to minimize the mean squared error (MSE). With N as the target and the number of data collection periods as N, the regression coefficients are updated using gradient descent with a learning rate of α. The coefficient update formula is as follows: ; The updated regression model is used for subsequent prediction and control. The new model prediction will automatically take into account the impact of factors such as equipment aging and ambient temperature, thereby compensating for disturbances and improving prediction accuracy and equipment control precision.