A method, system and related devices for dynamic compensation of laser galvanometer delay
By constructing a dynamic prediction model based on the TCN architecture and decomposing it into multiple sub-tasks, and dynamically updating the model parameters, the delay problem of the laser galvanometer during high-speed scanning was solved, real-time and accurate compensation of the laser beam was achieved, and the control accuracy and stability of the laser galvanometer were improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 雷文斯(深圳)科技有限公司
- Filing Date
- 2025-08-11
- Publication Date
- 2026-06-26
AI Technical Summary
In existing technologies, the time-varying delay caused by sudden acceleration changes and load variations during high-speed scanning cannot be adjusted in real time, resulting in insufficient dynamic adaptability. This leads to asynchronous laser beam positions, causing problems such as trajectory distortion and uneven energy distribution.
The dynamic prediction model using the TCN architecture collects galvanometer data and decomposes it into multiple sub-tasks to construct a position prediction sub-model, a dynamic prediction sub-model, and a delay prediction sub-model. It generates compensation control commands and dynamically updates the model parameters through the galvanometer deviation weight value to achieve real-time compensation for laser galvanometer delay.
It improves the dynamic compensation efficiency of the laser galvanometer, reduces the deviation caused by delay, enhances the real-time performance and accuracy of laser galvanometer control, and ensures precise scanning of the laser beam.
Smart Images

Figure CN121167133B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of laser processing technology, and in particular to a method, system and related apparatus for dynamic compensation of laser galvanometer delay. Background Technology
[0002] Laser galvanometers are core components in laser processing and optical systems, enabling precise scanning of laser beams through high-speed deflection of reflective mirrors. Due to their advantages in precision, speed, and stability, laser galvanometers are widely used in semiconductor manufacturing, minimally invasive medical surgery, and high-end displays. With industrial development, laser galvanometers are evolving towards higher speeds and greater precision, becoming an indispensable unit in advanced manufacturing technologies.
[0003] During the high-speed operation of a laser galvanometer, control delay can cause the actual position of the laser beam to desynchronize with the commanded position, leading to problems such as trajectory distortion and uneven energy distribution. Existing technologies compensate for this control delay by establishing a physical model of the galvanometer system to calculate the delay and by pre-distorting the commands.
[0004] However, the physical models used in the existing technology employ fixed model parameters. The sudden acceleration changes of the laser galvanometer during high-speed scanning and the load changes under complex trajectories can cause time-varying delays. The physical models with fixed parameters cannot adapt to the changes in the laser galvanometer, resulting in the inability to adjust the control delay of the laser galvanometer in real time, and thus have insufficient dynamic adaptability. Summary of the Invention
[0005] To address the aforementioned technical problems, this application provides a method, system, and related apparatus for dynamic compensation of laser galvanometer delay, which enables dynamic compensation of laser galvanometer delay while improving dynamic compensation efficiency.
[0006] The technical solution provided in this application is described below:
[0007] The first aspect of this application provides a dynamic compensation method for laser galvanometer delay, the dynamic compensation method comprising:
[0008] Galvanometer data is collected and preprocessed to obtain galvanometer data samples. The galvanometer data includes galvanometer motor temperature, galvanometer angle, galvanometer motor current, galvanometer position, galvanometer speed, and galvanometer acceleration.
[0009] Receive target galvanometer trajectory data and construct a dynamic prediction model based on the galvanometer data samples using the TCN architecture;
[0010] The galvanometer data samples are decomposed into multiple sub-tasks based on dimensional features;
[0011] The dynamic prediction model is divided into multiple sub-models according to the multiple sub-tasks. The multiple sub-models include a position prediction sub-model, a dynamic prediction sub-model, and a delay prediction sub-model. The multiple sub-tasks are matched to the multiple sub-models to obtain predicted galvanometer trajectory data and predicted galvanometer time deviation data.
[0012] A compensation control command is generated based on the predicted galvanometer trajectory data and the predicted galvanometer time deviation data, and the compensation control command is sent to the galvanometer drive module.
[0013] After the compensation control command is triggered, the actual galvanometer trajectory data is acquired, and the actual galvanometer trajectory data is compared and calculated incrementally with the target galvanometer trajectory data to obtain multi-dimensional deviation data. The multi-dimensional deviation data includes galvanometer position deviation data, galvanometer dynamic deviation data, and galvanometer time deviation data.
[0014] Calculate the galvanometer deviation weight value based on the multi-dimensional deviation data;
[0015] The model parameters of the multiple sub-models are dynamically updated based on the galvanometer deviation weight value and the multi-dimensional deviation data to generate new compensation control commands.
[0016] Optionally, calculating the galvanometer deviation weight value based on the multi-dimensional deviation data includes:
[0017] A deviation feature space is constructed based on the multi-dimensional deviation data, and the probability density distribution of the multi-dimensional deviation data is calculated based on the deviation feature space.
[0018] Based on the probability density distribution, the galvanometer deviation weight value is calculated using a preset weight calculation function.
[0019] Optionally, the step of dynamically updating the model parameters of the sub-model based on the galvanometer deviation weight value and the multi-dimensional deviation data to generate new compensation control instructions includes:
[0020] The galvanometer deviation weight values are sorted by gradient, and the update priority of the sub-model is determined based on the gradient sorting results.
[0021] Within a preset update time, the model parameters of the sub-model are dynamically updated according to the update priority and in combination with the multi-dimensional deviation data.
[0022] Optionally, the step of generating a compensation control command based on the predicted galvanometer trajectory data and the predicted galvanometer time deviation data, and sending the compensation control command to the galvanometer drive module, includes:
[0023] Extract key feature points from the predicted galvanometer trajectory data. The key feature points include inflection points, acceleration segments, constant speed segments, and deceleration segments.
[0024] Calculate the time compensation amount of the key feature points based on the predicted galvanometer time deviation data;
[0025] Compensation control commands are constructed using the predicted galvanometer trajectory data and the time compensation amount;
[0026] The compensation control command is converted into a PWM pulse sequence, and the PWM pulse sequence is sent to the galvanometer drive module.
[0027] Optionally, after triggering the compensation control command, the actual galvanometer trajectory data is acquired, and the actual galvanometer position data is incrementally compared with the target galvanometer trajectory data to obtain multi-dimensional deviation data, including:
[0028] After the compensation control command is triggered, the actual galvanometer trajectory data is collected, and the timestamp of the actual galvanometer trajectory data is recorded.
[0029] Based on the timestamp, a linear interpolation method is used to map the actual galvanometer trajectory data onto the time axis of the target galvanometer trajectory data;
[0030] Based on the time axis, the actual galvanometer trajectory data is divided into multiple trajectory segments according to a preset incremental step size;
[0031] Within the multiple trajectory segments, multi-dimensional deviation feature vectors are calculated through incremental comparison.
[0032] The multi-dimensional feature vectors are fused using Kalman filtering to obtain multi-dimensional deviation data.
[0033] Optionally, the dynamic compensation method further includes:
[0034] Record the galvanometer deviation weight values and generate historical galvanometer deviation weight values;
[0035] The model parameter adjustment strategy for the dynamic prediction model is determined based on the historical galvanometer deviation weight value.
[0036] Optionally, the step of determining the model parameter adjustment strategy for the dynamic prediction model based on the historical galvanometer deviation weight value includes:
[0037] Determine whether the historical galvanometer deviation weight value is within the preset galvanometer deviation weight threshold;
[0038] If so, then the model parameters of the sub-model are determined based on the galvanometer deviation weight value and the multi-dimensional deviation data;
[0039] If not, the model parameters of the dynamic prediction model are updated based on the historical galvanometer deviation weight values and the multi-dimensional deviation data.
[0040] A second aspect of this application provides a dynamic compensation system for laser galvanometer delay, the dynamic compensation system comprising:
[0041] The acquisition unit is used to acquire galvanometer data and perform preprocessing to obtain galvanometer data samples. The galvanometer data includes galvanometer motor temperature, galvanometer angle, galvanometer motor current, galvanometer position, galvanometer speed, and galvanometer acceleration.
[0042] The construction unit is used to receive target galvanometer trajectory data and construct a dynamic prediction model of the TCN architecture based on the galvanometer data samples.
[0043] A decomposition unit is used to decompose the galvanometer data sample into multiple sub-tasks based on dimensional features;
[0044] A matching unit is used to divide the dynamic prediction model into multiple sub-models according to the multiple sub-tasks, the multiple sub-models including a position prediction sub-model, a dynamic prediction sub-model and a delay prediction sub-model, and to match the multiple sub-tasks to the multiple sub-models to obtain predicted galvanometer trajectory data and predicted galvanometer time deviation data.
[0045] The generation unit is used to generate compensation control commands based on the predicted galvanometer trajectory data and the predicted galvanometer time deviation data, and send the compensation control commands to the galvanometer drive module.
[0046] The comparison unit is used to acquire actual galvanometer trajectory data after the compensation control command is triggered, and to perform incremental comparison calculation between the actual galvanometer trajectory data and the target galvanometer trajectory data to obtain multi-dimensional deviation data. The multi-dimensional deviation data includes galvanometer position deviation data, galvanometer dynamic deviation data and galvanometer time deviation data.
[0047] The calculation unit is used to calculate the galvanometer deviation weight value based on the multi-dimensional deviation data;
[0048] The update unit is used to dynamically update the model parameters of the multiple sub-models based on the galvanometer deviation weight value and the multi-dimensional deviation data, so as to generate new compensation control instructions.
[0049] Optionally, the computing unit is specifically used for:
[0050] A deviation feature space is constructed based on the multi-dimensional deviation data, and the probability density distribution of the multi-dimensional deviation data is calculated based on the deviation feature space.
[0051] Based on the probability density distribution, the galvanometer deviation weight value is calculated using a preset weight calculation function.
[0052] Optionally, the update unit is specifically used for:
[0053] The galvanometer deviation weight values are sorted by gradient, and the update priority of the sub-model is determined based on the gradient sorting results.
[0054] Within a preset update time, the model parameters of the sub-model are dynamically updated according to the update priority and in combination with the multi-dimensional deviation data.
[0055] Optionally, the generation unit is specifically used for:
[0056] Extract key feature points from the predicted galvanometer trajectory data. The key feature points include inflection points, acceleration segments, constant speed segments, and deceleration segments.
[0057] Calculate the time compensation amount of the key feature points based on the predicted galvanometer time deviation data;
[0058] Compensation control commands are constructed using the predicted galvanometer trajectory data and the time compensation amount;
[0059] The compensation control command is converted into a PWM pulse sequence, and the PWM pulse sequence is sent to the galvanometer drive module.
[0060] Optionally, the comparison unit is specifically used for:
[0061] After the compensation control command is triggered, the actual galvanometer trajectory data is collected, and the timestamp of the actual galvanometer trajectory data is recorded.
[0062] Based on the timestamp, a linear interpolation method is used to map the actual galvanometer trajectory data onto the time axis of the target galvanometer trajectory data;
[0063] Based on the time axis, the actual galvanometer trajectory data is divided into multiple trajectory segments according to a preset incremental step size;
[0064] Within the multiple trajectory segments, multi-dimensional deviation feature vectors are calculated through incremental comparison.
[0065] The multi-dimensional feature vectors are fused using Kalman filtering to obtain multi-dimensional deviation data.
[0066] Optionally, the system also includes a determining unit for:
[0067] Record the galvanometer deviation weight values and generate historical galvanometer deviation weight values;
[0068] The model parameter adjustment strategy for the dynamic prediction model is determined based on the historical galvanometer deviation weight value.
[0069] Optionally, the determining unit is specifically used for:
[0070] Determine whether the historical galvanometer deviation weight value is within the preset galvanometer deviation weight threshold;
[0071] If so, then the model parameters of the sub-model are determined based on the galvanometer deviation weight value and the multi-dimensional deviation data;
[0072] If not, the model parameters of the dynamic prediction model are updated based on the historical galvanometer deviation weight values and the multi-dimensional deviation data.
[0073] A third aspect of this application provides a dynamic compensation device for laser galvanometer delay, the dynamic compensation device comprising:
[0074] Processor, memory, input / output units, and bus;
[0075] The processor is connected to the memory, the input / output unit, and the bus;
[0076] The memory stores a program, which the processor invokes to execute the first aspect and any one of the optional methods in the first aspect.
[0077] A fourth aspect of this application provides a computer-readable storage medium on which a program is stored, which, when executed on a computer, performs the methods of the first aspect and any one of the first aspects.
[0078] As can be seen from the above technical solutions, this application has the following beneficial effects:
[0079] A dynamic prediction model based on a TCN architecture is constructed using galvanometer data samples, including galvanometer motor temperature, angle, current, position, speed, and acceleration. The galvanometer data samples are then decomposed into multiple sub-tasks, which are matched to sub-models for position prediction, dynamic prediction, and delay prediction. Predicted galvanometer trajectory and time deviation data are calculated using a multi-task parallel processing approach. Based on this, compensation control commands are generated and sent to the galvanometer drive module to compensate for the delay of the laser galvanometer. After the compensation control command is triggered, the sub-model parameters are dynamically updated within a finite time using the galvanometer deviation weight value, allowing the new compensation control command to more accurately compensate for the laser galvanometer delay. Distributing multiple tasks across multiple sub-models for parallel computation improves the prediction efficiency of the dynamic prediction model. Furthermore, by dynamically updating the sub-model parameters, the compensation control command can be quickly optimized within the limited laser galvanometer operating time, improving the real-time dynamic compensation efficiency of the laser galvanometer, reducing deviations caused by delay, and enhancing the real-time performance and accuracy of laser galvanometer control. By processing multi-dimensional galvanometer data, dividing tasks among sub-models, and updating sub-model parameters in a closed loop, real-time dynamic compensation for galvanometer control delay can be achieved. Attached Figure Description
[0080] To more clearly illustrate the technical solutions in this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0081] Figure 1 A schematic flowchart of an embodiment of the dynamic compensation method for laser galvanometer delay provided in this application;
[0082] Figure 2 A schematic flowchart of another embodiment of the dynamic compensation method for laser galvanometer delay provided in this application;
[0083] Figure 3 A schematic diagram of an embodiment of the dynamic compensation system for laser galvanometer delay provided in this application;
[0084] Figure 4 A schematic diagram of an embodiment of the dynamic compensation device for laser galvanometer delay provided in this application. Detailed Implementation
[0085] This application provides a method, system, and related apparatus for dynamic compensation of laser galvanometer delay, used to achieve dynamic compensation of laser galvanometer delay while improving the efficiency of dynamic compensation. It should be noted that the dynamic compensation method for laser galvanometer delay provided in this application is applied to a laser galvanometer control terminal.
[0086] Please see Figure 1 This application first provides an embodiment of a dynamic compensation method for laser galvanometer delay, which includes:
[0087] S101. Collect galvanometer data and perform preprocessing to obtain galvanometer data samples. The galvanometer data includes galvanometer motor temperature, galvanometer angle, galvanometer motor current, galvanometer position, galvanometer speed, and galvanometer acceleration.
[0088] To reflect the operating status of the galvanometer, various sensors are typically integrated into the galvanometer system, such as temperature sensors, angle encoders, and current sensors. By collecting data from these sensors, galvanometer data reflecting its operating status is obtained. This data includes galvanometer motor temperature, galvanometer angle, galvanometer motor current, galvanometer position, galvanometer speed, and galvanometer acceleration. The galvanometer motor temperature is collected by a temperature sensor installed near the motor to monitor temperature changes caused by continuous operation. The galvanometer angle is acquired by an angle encoder, obtaining the deflection angle of the galvanometer at different times, including the x-axis and y-axis angles, providing the basis for subsequent calculations of the galvanometer position. The galvanometer motor current is collected by a current sensor connected in series in the motor's power supply circuit, reflecting the motor's load; the current changes accordingly when the motor accelerates or the load increases. The galvanometer speed is collected by a speed sensor, reflecting the speed of the galvanometer's movement. The galvanometer position is calculated based on the galvanometer angle and the mechanical structural parameters of the galvanometer system, for example, using the formula... Perform the conversion. The position of the galvanometer. For the focal length of the field lens, The galvanometer angle data represents the actual irradiation position of the laser beam on the working surface. The galvanometer acceleration is obtained by time-difference of the galvanometer velocity, used to reflect the rate of change of the galvanometer velocity.
[0089] After obtaining the galvanometer data, it needs to be preprocessed to remove outliers, filter out noise, and eliminate the influence of dimensions, providing directly usable galvanometer data samples for subsequent model training and data analysis. First, the galvanometer data is cleaned to remove outliers caused by sensor malfunctions, electromagnetic interference, etc., such as sudden temperature deviations or abrupt changes in angle data. Then, methods like moving average filtering and Kalman filtering are used to filter the data, removing high-frequency noise and smoothing the data. Finally, galvanometer data of different magnitudes and units are normalized to form structured galvanometer data samples for subsequent model training and data analysis.
[0090] S102. Receive the target galvanometer trajectory data and construct a dynamic prediction model of the TCN architecture based on the galvanometer data samples.
[0091] Based on galvanometer data samples, a dynamic model for predicting galvanometer trajectory and delay is constructed. First, target galvanometer trajectory data, sent from a host computer (such as a laser processing control system), is received. This target trajectory data represents the ideal motion path the galvanometer should follow. The acquired target galvanometer trajectory data is used for subsequent deviation calculations and model parameter adjustments. Then, using the galvanometer data samples as the training set, a dynamic prediction model based on a TCN (Temporal Convolutional Network) architecture is constructed. The TCN architecture, through causal convolution and dilated convolution, can capture the temporal dependencies of the galvanometer data, such as the influence of velocity changes on subsequent positions and the influence of temperature accumulation on delay. The dynamic prediction model takes galvanometer data samples as input and outputs predicted galvanometer motion state data for future moments, i.e., the predicted galvanometer trajectory data and predicted galvanometer time deviation data in this application.
[0092] S103. Decompose the galvanometer data samples into multiple sub-tasks based on dimensional features;
[0093] Since the purpose of this application is to dynamically compensate for the control delay of the galvanometer in real time, the complex delay compensation problem is decomposed into multiple parallel subtasks based on the dimensional characteristics of the galvanometer data samples. This effectively improves the data computation efficiency of the dynamic prediction model. The dimensional features of the galvanometer data samples are divided based on their physical meaning and differences in their impact on delay. For example, galvanometer position and angle data are directly related to trajectory accuracy, corresponding to the galvanometer position-related subtask; galvanometer velocity, acceleration, and motor current reflect the dynamic characteristics of motion, corresponding to the dynamic response subtask; and because an increase in galvanometer motor temperature may slow down the galvanometer motor response, the correlation between galvanometer motor temperature and time delay is strong, thus classifying it as a time delay subtask. Through task decomposition, the originally multidimensional coupled galvanometer data is transformed into subtasks focused on specific physical meanings, laying the foundation for the division of labor in subsequent sub-models and ensuring that the prediction target of each subtask is clearer and the data features are more concentrated.
[0094] S104. Divide the dynamic prediction model into multiple sub-models according to multiple sub-tasks. The multiple sub-models include a position prediction sub-model, a dynamic prediction sub-model, and a delay prediction sub-model. Match the multiple sub-tasks to the multiple sub-models to obtain the predicted galvanometer trajectory data and the predicted galvanometer time deviation data.
[0095] The dynamic prediction model is broken down into multiple sub-models according to sub-task requirements, and the sub-tasks are matched with the sub-models to output targeted prediction results. Based on the sub-tasks, the dynamic prediction model is divided into three corresponding sub-models: a position prediction sub-model, a dynamic prediction sub-model, and a delayed prediction sub-model. The position prediction sub-model predicts the future trajectory of the galvanometer based on its position and angle; the dynamic prediction sub-model predicts the dynamic response characteristics of the galvanometer motion based on its velocity, acceleration, and motor current; and the delayed prediction sub-model predicts the time deviation of the galvanometer's execution commands based on its temperature, velocity, and acceleration data. Each sub-model is optimized for its corresponding sub-task; for example, the position prediction sub-model enhances spatial accuracy, while the delayed prediction sub-model enhances temporal sensitivity. By matching sub-tasks to their corresponding sub-models, the sub-models are computed in parallel, and finally, the predicted galvanometer trajectory data and predicted galvanometer time deviation data are fused and output, providing a direct basis for the generation of compensation control commands.
[0096] S105. Generate compensation control instructions based on the predicted galvanometer trajectory data and the predicted galvanometer time deviation data, and send the compensation control instructions to the galvanometer drive module.
[0097] Based on the prediction results, specific compensation control commands are generated and driven to execute by the galvanometer, achieving a preliminary closed loop for delay compensation. The compensation amount is calculated using predicted galvanometer trajectory data and predicted galvanometer time deviation data. For example, if the predicted galvanometer trajectory data predicts that the galvanometer should reach position P at a certain time, but there may be a time delay Δt, the compensation control command for that position is sent Δt in advance to offset the delay. The compensation control command is generated based on the compensation amount, and includes parameters such as target position, motion velocity, acceleration, and execution timestamp. Subsequently, the compensation control command is sent to the galvanometer drive module via the communication interface, driving the galvanometer motor to move according to the compensation control command, thereby realizing the predicted galvanometer trajectory data.
[0098] S106. After triggering the compensation control command, the actual galvanometer trajectory data is acquired, and the actual galvanometer trajectory data is compared and calculated incrementally with the target galvanometer trajectory data to obtain multi-dimensional deviation data. The multi-dimensional deviation data includes galvanometer position deviation data, galvanometer dynamic deviation data, and galvanometer time deviation data.
[0099] The effectiveness of compensation control commands is affected by factors such as the mechanical inertia of the galvanometer, motor response delay, and environmental interference. The actual galvanometer trajectory after executing the compensation control command may still deviate from the target galvanometer trajectory, indicating a continued control delay. Therefore, real-time acquisition of actual galvanometer trajectory data is necessary to accurately assess the effectiveness of the compensation control command. For example, if the predicted delay compensation is 5ms, but the actual delay is reduced to 7ms due to motor temperature rise or environmental factors, the deviation needs to be identified through the actual galvanometer trajectory data, requiring adjustments to the parameters of the dynamic prediction model. After triggering the compensation control command, the actual galvanometer trajectory data is acquired. By incrementally comparing the actual galvanometer trajectory data with the target galvanometer trajectory data, the compensation effect is quantified, and multi-dimensional deviation data is extracted as a basis for optimizing the dynamic prediction model. Multi-dimensional deviation data includes galvanometer position deviation data, galvanometer dynamic deviation data, and galvanometer time deviation data. Multi-dimensional deviation data can more comprehensively reflect the operating status of the galvanometer. Galvanometer position deviation data reflects the accuracy of the galvanometer; galvanometer dynamic deviation data reflects the response characteristics of the galvanometer. For example, insufficient acceleration may cause trajectory distortion at corners; galvanometer time deviation data is the core of compensation control. If it is not corrected in time, it may cause compensation failure.
[0100] S107. Calculate the galvanometer deviation weight value based on the multi-dimensional deviation data;
[0101] Based on multi-dimensional deviation data, the influence of each dimensional deviation on the galvanometer control delay is quantified, and galvanometer deviation weight values are calculated to provide a basis for subsequent sub-model parameter updates. There are various methods for calculating galvanometer deviation weight values, such as probability density distribution-based calculations, error sensitivity-based weighted methods, or machine learning methods. The galvanometer deviation weight values can present the degree of influence of different dimensional deviations on the galvanometer control effect, providing a clear quantitative basis for subsequent sub-model parameter updates and avoiding indiscriminate adjustments to each dimensional deviation.
[0102] S108. Dynamically update the model parameters of multiple sub-models based on the galvanometer deviation weight value and multi-dimensional deviation data to generate new compensation control commands.
[0103] Multi-dimensional deviation data is quantified using galvanometer deviation weight values to reflect the degree of influence of each dimension of deviation. Sub-model parameters are dynamically adjusted based on the quantification results to achieve continuous optimization of the compensation effect, forming a complete closed loop. Since real-time dynamic control and compensation of the galvanometer are required, efficiency is crucial in the dynamic prediction, generation of compensation control commands, and model parameter adjustment processes. Therefore, targeted updates of sub-model parameters using galvanometer deviation weight values improve the efficiency of model updates. Sub-models have clear physical meaning and independent functions. Targeted updates of sub-model parameters based on galvanometer deviation weight values and multi-dimensional deviation data reduce coupling interference in parameter adjustments. For example, position deviation mainly affects the spatial mapping parameters of the position prediction sub-model. Updating the entire dynamic prediction model might incorrectly adjust parameters related to time delay. Targeted updates map multi-dimensional deviation data to the sensitive parameters of the corresponding sub-model, improving optimization efficiency. The updated sub-model re-participates in prediction, generating new compensation control commands, enabling the dynamic prediction model to adapt to the dynamic changes of the galvanometer and perform real-time compensation for galvanometer control delay. Through this dynamic update mechanism, deviation is continuously reduced, improving the real-time performance and accuracy of galvanometer control delay compensation.
[0104] In this embodiment, a dynamic prediction model based on a TCN architecture is constructed using galvanometer data samples, including galvanometer motor temperature, galvanometer angle, galvanometer motor current, galvanometer position, galvanometer velocity, and galvanometer acceleration. The galvanometer data samples are then decomposed into multiple sub-tasks and matched to sub-models of position prediction, dynamic prediction, and delay prediction. Predicted galvanometer trajectory data and predicted galvanometer time deviation data are calculated using a multi-task parallel processing approach. Based on this, compensation control commands are generated and sent to the galvanometer drive module to compensate for galvanometer delay. After the compensation control command is triggered, the sub-model parameters are dynamically updated within a finite time using the galvanometer deviation weight value, allowing the new compensation control command to more accurately compensate for galvanometer delay. Distributing multiple tasks to multiple sub-models for parallel computation improves the prediction efficiency of the dynamic prediction model. Furthermore, by dynamically updating the sub-model parameters, the compensation control command can be quickly optimized within the limited galvanometer runtime, improving the real-time dynamic compensation efficiency of the galvanometer, reducing deviations caused by delay, and enhancing the real-time performance and accuracy of galvanometer control. By processing multi-dimensional galvanometer data, dividing tasks among sub-models, and updating sub-model parameters in a closed loop, real-time dynamic compensation for galvanometer control delay can be achieved.
[0105] Please see Figure 2 , Figure 2 Another embodiment of the dynamic compensation method for laser galvanometer delay provided in this application includes:
[0106] S201. Collect galvanometer data and perform preprocessing to obtain galvanometer data samples. The galvanometer data includes galvanometer motor temperature, galvanometer angle, galvanometer motor current, galvanometer position, galvanometer speed, and galvanometer acceleration.
[0107] S202. Receive the target galvanometer trajectory data and construct a dynamic prediction model of the TCN architecture based on the galvanometer data samples.
[0108] S203. Decompose the galvanometer data samples into multiple sub-tasks based on dimensional features;
[0109] S204. Divide the dynamic prediction model into multiple sub-models according to multiple sub-tasks. The multiple sub-models include a position prediction sub-model, a dynamic prediction sub-model, and a delay prediction sub-model. Match the multiple sub-tasks to the multiple sub-models to obtain the predicted galvanometer trajectory data and the predicted galvanometer time deviation data.
[0110] Steps S201 to S204 are similar to steps S101 to S104 described above, and will not be repeated here.
[0111] S205. Extract key feature points from the predicted galvanometer trajectory data. Key feature points include inflection points, acceleration segments, constant speed segments, and deceleration segments.
[0112] Key feature points extracted from the predicted galvanometer trajectory data include inflection points, acceleration segments, constant speed segments, and deceleration segments. Inflection points indicate the location where the trajectory direction changes; acceleration segments represent the transition from low speed to high speed; constant speed segments represent the stage where the galvanometer maintains a stable speed; and deceleration segments represent the transition from high speed to low speed until stopping. Extracting key feature points reflects the differences in the dynamic characteristics of the galvanometer at different motion stages. For example, inflection points may experience trajectory deviations due to inertial impacts; acceleration and deceleration segments are prone to dynamic lag due to changes in acceleration; and errors in constant speed segments are more due to steady-state drift. These key feature points provide precise positional anchors for subsequent targeted compensation, ensuring that compensation measures focus on critical links where errors are frequent and significant, avoiding indiscriminate processing of the entire trajectory, thereby improving compensation efficiency and accuracy.
[0113] S206. Calculate the time compensation amount of key feature points based on the predicted galvanometer time deviation data.
[0114] Time deviation has a significant impact on key feature points. For example, time delays at inflection points can cause steering lag, and time deviations during acceleration can cause time shifts in peak acceleration, thus affecting the synchronization of the overall trajectory. Therefore, it is necessary to calculate the time compensation amount for each key feature point by combining the predicted galvanometer time deviation data. When calculating the time compensation amount, the predicted galvanometer time deviation data needs to be corrected according to the motion characteristics of the key feature points. For example, for feature points with high acceleration, the time compensation amount can be appropriately increased to compensate for the delay caused by inertia. This can be achieved through the formula... Calculate the time compensation amount. This is a dynamic compensation coefficient used to amplify the compensation level during critical stages. To predict galvanometer time deviation data, This is a correction term, determined by the acceleration of the key feature points. The greater the acceleration, the larger the correction term, in order to offset the additional delay caused by inertia.
[0115] S207. Construct compensation control commands by predicting galvanometer trajectory data and time compensation amount;
[0116] After obtaining the time compensation amount, the predicted galvanometer trajectory data is fused with the time compensation amount to construct the final compensation control command. The predicted galvanometer trajectory data forms the basic framework for compensation, while the time compensation amount is a calibration of the predicted galvanometer trajectory data in the time dimension. For example, by advancing or delaying the execution time of key feature points, it compensates for time errors caused by mechanical inertia, drive delays, etc., in the galvanometer. During the construction process, it is necessary to ensure that the time compensation amount and the spatial parameters of the predicted galvanometer trajectory data are linked to avoid distortion of the spatial trajectory caused by adjusting the time alone. For example, this can be achieved through formulas. , Construct compensation control instructions, The compensated position command is obtained by offsetting the predicted galvanometer trajectory data on the time axis. To achieve time calibration, The compensated speed control command, The attenuation coefficient is used to avoid velocity overshoot due to time compensation. Finally, the calculated data are fused to generate a compensation control command. This command includes both the corrected spatial motion parameters and integrated time calibration information, achieving dual-dimensional control of the galvanometer motion in both space and time.
[0117] S208. Convert the compensation control command into a PWM pulse sequence and send the PWM pulse sequence to the galvanometer drive module;
[0118] The constructed compensation control commands are converted into control signals that the galvanometer drive module can directly recognize, namely PWM (Pulse Width Modulation) pulse sequences, and then sent to the galvanometer drive module. By adjusting the frequency and duty cycle of the PWM pulse sequence, the rotation angle, speed, and acceleration of the motor can be precisely controlled. For example, a higher pulse frequency corresponds to a faster motor speed, while pulses with a specific duty cycle can achieve time compensation for key feature points. Through interaction between the PWM pulse sequence and the galvanometer drive module, it is ensured that the optimized parameters in the compensation control commands can be recognized and executed by the galvanometer drive module, ultimately translating the theoretical compensation effect into an actual improvement in trajectory accuracy.
[0119] S209. After triggering the compensation control command, collect the actual galvanometer trajectory data and record the timestamp of the actual galvanometer trajectory data.
[0120] After the compensation control command is triggered, galvanometer data is acquired again, and the data acquired after the compensation control command is triggered is calculated and fused to obtain the actual galvanometer trajectory data. The position data of the actual motion trajectory is acquired in real time through the galvanometer position sensor, and a timer records the timestamp corresponding to each data point. The recording of the timestamps must be synchronized with the acquisition of the galvanometer position data to ensure that each actual position data corresponds to a specific moment in the motion process, providing a time reference for subsequent time axis alignment and deviation calculation, and avoiding errors caused by asynchronous sampling.
[0121] S210. Based on the timestamp, the actual galvanometer trajectory data is mapped to the time axis of the target galvanometer trajectory data using linear interpolation.
[0122] Since the time intervals of the actual galvanometer trajectory data and the target galvanometer trajectory data may differ, linear interpolation is needed to map the actual galvanometer trajectory data onto the time axis of the target galvanometer trajectory data. Time axis alignment eliminates the misalignment between the timestamps of the actual galvanometer trajectory data and the time axis of the target galvanometer trajectory data. When using linear interpolation for mapping, if any time node on the time axis coincides with a certain timestamp, the actual galvanometer trajectory data corresponding to that timestamp is directly used; if any time node on the time axis lies between two timestamps, linear interpolation is performed based on the actual galvanometer trajectory data of those timestamps to calculate the actual galvanometer trajectory data corresponding to that time node. For example, if the time node... timestamp and timestamp Between, the interpolation position is , among them The interpolation position for calculating the actual galvanometer trajectory data. and Each is a timestamp and timestamp The corresponding actual galvanometer trajectory data.
[0123] S211. Divide the actual galvanometer trajectory data into multiple trajectory segments according to the time axis and the preset incremental step size;
[0124] The actual galvanometer trajectory data, aligned along the time axis, is divided into multiple continuous trajectory segments using a preset increment step size. For example, setting the increment step size to 0.1 ms results in each 0.1 ms segment being an independent trajectory data segment. By dividing the continuous trajectory into multiple segments, it discretizes the continuous trajectory into independently analyzable local units, facilitating refined analysis for different motion phases (such as acceleration and constant velocity phases). Each trajectory segment contains complete multi-dimensional information (position, velocity, acceleration), and there is temporal continuity between adjacent trajectory segments, ensuring the completeness of the deviation calculation.
[0125] S212. Calculate multi-dimensional deviation feature vectors by incremental comparison within multiple trajectory segments.
[0126] Within each trajectory segment, a multi-dimensional deviation feature vector is calculated. For each segment, the differences between the actual and target galvanometer trajectory data are incrementally compared across four dimensions: position, velocity, acceleration, and time. For example, the mean absolute error between the actual and target galvanometer trajectory data within the segment is calculated to obtain the position deviation; the actual velocity is obtained by differentiating the position data and compared with the target velocity to calculate the error, resulting in the velocity deviation; the actual acceleration is obtained by differentiating the velocity data again and compared with the target acceleration to obtain the acceleration deviation. Finally, statistical methods (such as mean, variance, and maximum) are used to extract features from the position deviation, velocity deviation, acceleration deviation, and time deviation, forming a multi-dimensional feature vector for each trajectory segment. Incremental comparison ensures that the calculation for each trajectory segment is independent, without relying on data from preceding or following segments, avoiding error accumulation and ensuring sensitivity to local anomalies.
[0127] S213. Multi-dimensional feature vectors are fused using Kalman filtering to obtain multi-dimensional deviation data;
[0128] Multi-dimensional feature vectors may still suffer from issues such as sensor noise interference, lack of correlation between dimensions, and potential discontinuities between trajectory segments. Kalman filtering addresses these issues by constructing a state vector containing position, velocity, acceleration, and time deviations. It then establishes state transition equations based on the physical laws of galvanometer motion (e.g., position deviation accumulates with velocity deviation). First, it predicts the deviation of the current trajectory segment based on the deviation estimate of the previous segment. Then, it corrects the predicted value using the observation deviation of the current segment. By dynamically adjusting the Kalman gain to balance the weights of prediction and observation, it finally fuses the multi-dimensional deviation feature vectors calculated for each trajectory segment using Kalman filtering. This results in multi-dimensional deviation data containing galvanometer position deviation, galvanometer dynamic deviation, and galvanometer time deviation data. Kalman filtering effectively filters out interference factors such as sensor noise and computational errors, such as smoothing high-frequency jitter signals from position sensors, retaining systematic velocity deviations caused by mechanical inertia, and integrating deviation information from the position, dynamic, and time dimensions to form more reliable and continuous multi-dimensional deviation data. This provides accurate error feedback for subsequent sub-model parameter updates.
[0129] S214. Construct a deviation feature space based on multi-dimensional deviation data, and calculate the probability density distribution of the multi-dimensional deviation data based on the deviation feature space;
[0130] Specific algorithms (such as normalization, standardization, and feature extraction) are used to transform the deviation data from each dimension into multi-dimensional deviation feature vectors that reflect the overall degree of deviation. Each element of the multi-dimensional deviation feature vector corresponds to a deviation feature in one dimension, reflecting the deviation characteristics of the galvanometer in multiple dimensions. Subsequently, based on these multi-dimensional deviation feature vectors, a system is constructed... Dimensional bias feature space , and Let these be two distinct multidimensional deviation feature vectors in the deviation feature space. and These represent the i-th element of the multi-dimensional deviation data. The deviation feature space is an abstract mathematical space where each point represents a feature corresponding to a set of multi-dimensional deviation data. The deviation feature space provides a visual representation of the relationships and distribution patterns between different deviation data. The probability density distribution describes the likelihood of deviation data appearing in various regions of the deviation feature space. This can be achieved through methods such as kernel density estimation and parametric distribution fitting (e.g., Gaussian distribution). For example, when estimating the probability density distribution using kernel density, one might use... Perform calculations, where The number of feature vector samples. The kernel bandwidth is used to control the smoothing level. Gaussian kernel function By calculating the probability density distribution, we can quantify the probability of different combinations of deviation features, identify the concentrated and sparse regions of deviation data, and thus gain a deeper understanding of the statistical characteristics and distribution patterns of galvanometer deviation, providing data support for subsequent weight calculations.
[0131] S215. Calculate the galvanometer deviation weight value according to the probability density distribution and the preset weight calculation function;
[0132] After obtaining the probability density distribution of the multi-dimensional deviation data, the galvanometer deviation weight values are calculated using a preset weighting function. This preset weighting function is based on the degree of importance given to different deviations in the actual application scenario; for example, certain deviation dimensions have a greater impact on the galvanometer's working accuracy and require higher weights. The preset weighting function combines factors such as the probability density distribution and the importance coefficients of the deviation dimensions in its calculation. ,in As the dimension importance coefficient, different dimension importance coefficients need to be set in different work scenarios; For the first Multidimensional bias data; This is a probability density enhancement term. When the value is large, the galvanometer deviation weight is amplified by an exponential function. By processing the probability density distribution through this function, the final galvanometer deviation weight value can reflect the importance of different deviation characteristics in the overall deviation assessment, providing a quantitative weight basis for subsequent operations such as galvanometer calibration and performance optimization.
[0133] S216. Record the galvanometer deviation weight value and generate historical galvanometer deviation weight values;
[0134] After calculating the galvanometer deviation weight values, these values need to be stored and recorded to form historical galvanometer deviation weight values. These historical weight values not only include the degree of influence of deviations in each dimension under the current operating conditions, but also are linked to the corresponding galvanometer operating status via timestamps, forming a structured historical database. The accumulation of historical galvanometer deviation weight values provides a basis for subsequent analysis of the long-term trend of deviation influence, and also provides a historical reference benchmark for model parameter adjustment strategies.
[0135] S217. Based on the historical galvanometer deviation weight values, confirm the model parameter adjustment strategy for executing the dynamic prediction model.
[0136] By determining the relationship between historical galvanometer bias weight values and a preset galvanometer bias weight threshold, the adjustment range for the parameters of the dynamic prediction model is determined. This determines whether the adjustment should be made to the parameters of a sub-model or the entire dynamic prediction model. The preset galvanometer bias weight threshold is a critical value for determining the nature of the bias (normal fluctuation or systematic bias). This threshold can be determined by combining the probability density distribution statistics of historical bias data with the critical values of the impact of galvanometer bias on galvanometer performance in practical applications. If the historical galvanometer bias weight values are within the preset threshold, it indicates that the current bias is a normal fluctuation, and only the parameters of the corresponding sub-model need to be updated. For example, when the historical galvanometer bias weight values are within the preset threshold and the positional bias weight accounts for a large proportion, the spatial mapping coefficients of the positional prediction sub-model need to be adjusted. If the historical galvanometer bias weight values exceed the preset threshold, it indicates a systematic bias, requiring a wider adjustment range and updating the overall framework parameters of the dynamic prediction model. For example, adjusting parameters such as the kernel size and the number of residual blocks in the TCN. By employing a tiered adjustment strategy, the stability of the dynamic prediction model can be ensured while avoiding the inability of local parameter adjustments to solve systemic problems.
[0137] S218. Arrange the galvanometer deviation weight values in gradient order and determine the update priority of the sub-model based on the gradient order result.
[0138] The galvanometer bias weights are arranged in a gradient order, from highest to lowest, and the update priority of each sub-model is determined based on the ranking. For example, if the time bias weight is greater than the dynamic bias weight, and the dynamic bias weight is greater than the position bias weight, then the corresponding delay prediction sub-model has the highest priority, followed by the dynamic prediction sub-model, and the position prediction sub-model has the lowest priority. The essence of gradient ranking is to quantify the correlation strength between each sub-model and the current bias, ensuring that parameter update resources are prioritized for the sub-models that have the greatest impact on the overall error, avoiding indiscriminate adjustments that lead to wasted efficiency.
[0139] S219. Within the preset update time, dynamically update the model parameters of the sub-model according to the update priority and in combination with multi-dimensional deviation data.
[0140] Because the dynamic compensation of the galvanometer is time-sensitive, after determining the update priority, it is also necessary to dynamically update the sub-model parameters within a preset update time, incorporating multi-dimensional deviation data. For high-priority sub-models, the latest deviation data is used for parameter iteration (e.g., adjusting temperature and delay mapping coefficients via gradient descent), while low-priority sub-models employ a lightweight update strategy (e.g., only fine-tuning the linear correction coefficients). Within the preset update time, there may be situations where not all sub-models can be updated. In such cases, the parameters of the highest-priority sub-model should be updated first, while the parameters of lower-priority sub-models are preserved. During the update process, model oscillations are avoided by limiting the magnitude of single parameter adjustments. For example, if the delay prediction sub-model has the highest priority and multi-dimensional deviation data shows an average time deviation of 2ms, then the temperature coefficient in its delay prediction formula is updated first, ensuring that key parameter optimization is completed within the preset time, balancing real-time performance and adjustment accuracy.
[0141] In this embodiment, a compensation control command is constructed by extracting key feature points from the predicted galvanometer trajectory data and converting it into a PWM pulse sequence, which is then sent to the galvanometer drive module to achieve data conversion and control. After triggering the compensation control command, actual galvanometer trajectory data is collected and timestamps are recorded. This data is then linearly interpolated to the time axis of the target galvanometer trajectory data to divide the trajectory into segments. Multi-dimensional deviation feature vectors are calculated, and Kalman filtering is used to obtain multi-dimensional deviation data. Time alignment, data filtering, and fusion are used to improve the accuracy and reliability of the multi-dimensional deviation data. Then, a deviation feature space is constructed using the multi-dimensional deviation data, and the probability density distribution is calculated. Based on a preset weight calculation function, the galvanometer deviation weight value is obtained. The distribution characteristics of the multi-dimensional deviation data are used to calculate the galvanometer deviation weight value, reflecting the impact of key deviation dimensions. Simultaneously, historical galvanometer deviation weight values are recorded, and a preset galvanometer deviation weight threshold is used to determine the range for adjusting the dynamic prediction model, i.e., whether to adjust the entire model parameters or sub-model parameters. If adjusting the sub-model, the weight values are arranged according to the gradient to determine the sub-model update priority. Within a preset update time, the sub-model parameters are updated according to the priority, ensuring effective updating of model parameters while improving model update efficiency and dynamic compensation efficiency. Through multi-dimensional data processing, parallel computation of sub-models, and closed-loop parameter updates, real-time dynamic compensation for galvanometer control delay is achieved, improving prediction efficiency, compensation accuracy, and dynamic compensation efficiency. It can specifically optimize key deviation dimensions, reduce deviations caused by galvanometer control delay, and enhance the real-time performance and accuracy of compensation control commands. Furthermore, when updating model parameters, a hierarchical adjustment strategy is adopted, which can improve the stability of the dynamic prediction model and avoid the limitations of local adjustments.
[0142] Please see Figure 3 , Figure 3One embodiment of the dynamic compensation system for laser galvanometer delay provided in this application includes:
[0143] The acquisition unit 301 is used to acquire galvanometer data and perform preprocessing to obtain galvanometer data samples. The galvanometer data includes galvanometer motor temperature, galvanometer angle, galvanometer motor current, galvanometer position, galvanometer speed, and galvanometer acceleration.
[0144] The construction unit 302 is used to receive target galvanometer trajectory data and construct a dynamic prediction model of the TCN architecture based on the galvanometer data samples.
[0145] Decomposition unit 303 is used to decompose galvanometer data samples into multiple sub-tasks based on dimensional features;
[0146] Matching unit 304 is used to divide the dynamic prediction model into multiple sub-models according to multiple sub-tasks. The multiple sub-models include a position prediction sub-model, a dynamic prediction sub-model, and a delay prediction sub-model. The multiple sub-tasks are matched to the multiple sub-models to obtain the predicted galvanometer trajectory data and the predicted galvanometer time deviation data.
[0147] The generation unit 305 is used to generate compensation control commands based on the predicted galvanometer trajectory data and the predicted galvanometer time deviation data, and send the compensation control commands to the galvanometer drive module.
[0148] The comparison unit 306 is used to acquire the actual galvanometer trajectory data after the compensation control command is triggered, and to perform incremental comparison calculation between the actual galvanometer trajectory data and the target galvanometer trajectory data to obtain multi-dimensional deviation data. The multi-dimensional deviation data includes galvanometer position deviation data, galvanometer dynamic deviation data and galvanometer time deviation data.
[0149] The calculation unit 307 is used to calculate the galvanometer deviation weight value based on multi-dimensional deviation data;
[0150] The update unit 308 is used to dynamically update the model parameters of multiple sub-models based on the galvanometer deviation weight value and multi-dimensional deviation data in order to generate new compensation control commands.
[0151] Optionally, the computing unit 307 is specifically used for:
[0152] A deviation feature space is constructed based on multi-dimensional deviation data, and the probability density distribution of the multi-dimensional deviation data is calculated based on the deviation feature space.
[0153] The galvanometer deviation weight value is calculated based on the probability density distribution using a preset weight calculation function.
[0154] Optionally, update unit 308 is specifically used for:
[0155] The galvanometer bias weights are sorted by gradient, and the update priority of the sub-model is determined based on the gradient sorting results.
[0156] Within a preset update time, the model parameters of the sub-model are dynamically updated according to the update priority and in combination with multi-dimensional deviation data.
[0157] Optionally, the generating unit 305 is specifically used for:
[0158] Extract key feature points from the predicted galvanometer trajectory data. Key feature points include inflection points, acceleration segments, constant speed segments, and deceleration segments.
[0159] Calculate the time compensation amount for key feature points based on the predicted galvanometer time deviation data;
[0160] Compensation control commands are constructed by predicting galvanometer trajectory data and time compensation amounts;
[0161] The compensation control command is converted into a PWM pulse sequence, and the PWM pulse sequence is sent to the galvanometer drive module.
[0162] Optionally, the comparison unit 306 is specifically used for:
[0163] After the compensation control command is triggered, the actual galvanometer trajectory data is collected and the timestamp of the actual galvanometer trajectory data is recorded.
[0164] Based on timestamps, a linear interpolation method is used to map the actual galvanometer trajectory data onto the time axis of the target galvanometer trajectory data;
[0165] Based on the time axis, the actual galvanometer trajectory data is divided into multiple trajectory segments according to a preset incremental step size;
[0166] Multi-dimensional deviation feature vectors are calculated through incremental comparison within multiple trajectory segments.
[0167] Multidimensional bias data is obtained by fusing multidimensional feature vectors through Kalman filtering.
[0168] Optionally, the system also includes a determining unit 309, used for:
[0169] Record the galvanometer deviation weight values and generate historical galvanometer deviation weight values;
[0170] The model parameter adjustment strategy for the dynamic prediction model is determined based on the historical galvanometer deviation weight values.
[0171] Optionally, the determining unit 309 is specifically used for:
[0172] Determine whether the historical galvanometer deviation weight values are within the preset galvanometer deviation weight threshold;
[0173] If so, then based on the galvanometer deviation weight value and the model parameters of the multi-dimensional deviation data sub-model;
[0174] If not, the model parameters of the dynamic prediction model are updated based on the historical galvanometer deviation weight values and multi-dimensional deviation data.
[0175] For specific implementation methods, please refer to [the example]. Figure 1 and Figure 2 Examples are not detailed here.
[0176] Please see Figure 4 This application also provides a dynamic compensation device for laser galvanometer delay, comprising:
[0177] Processor 401, memory 402, input / output unit 403, bus 404;
[0178] The processor 401 is connected to the memory 402, the input / output unit 403, and the bus 404;
[0179] The memory 402 stores a program, and the processor 401 calls the program to execute any of the methods described above.
[0180] This application also relates to a computer-readable storage medium on which a program is stored, which, when run on a computer, causes the computer to perform any of the methods described above.
[0181] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0182] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0183] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0184] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0185] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A method for dynamic compensation of laser galvanometer delay, characterized in that, The dynamic compensation method includes: Galvanometer data is collected and preprocessed to obtain galvanometer data samples. The galvanometer data includes galvanometer motor temperature, galvanometer angle, galvanometer motor current, galvanometer position, galvanometer speed, and galvanometer acceleration. Receive target galvanometer trajectory data and construct a dynamic prediction model based on the galvanometer data samples using the TCN architecture; The galvanometer data samples are decomposed into multiple sub-tasks based on dimensional features; The dynamic prediction model is divided into multiple sub-models according to the multiple sub-tasks. The multiple sub-models include a position prediction sub-model, a dynamic prediction sub-model, and a delay prediction sub-model. The multiple sub-tasks are matched to the multiple sub-models to obtain predicted galvanometer trajectory data and predicted galvanometer time deviation data. The position prediction sub-model is used to predict the future position trajectory of the galvanometer based on the galvanometer position and the galvanometer angle. The dynamic prediction sub-model is used to predict the dynamic response characteristics of the galvanometer motion based on the galvanometer velocity, the galvanometer acceleration, and the galvanometer motor current. The delay prediction sub-model is used to predict the time deviation of the galvanometer execution command based on the galvanometer motor temperature, the galvanometer velocity, and the galvanometer acceleration. A compensation control command is generated based on the predicted galvanometer trajectory data and the predicted galvanometer time deviation data, and the compensation control command is sent to the galvanometer drive module. After the compensation control command is triggered, the actual galvanometer trajectory data is acquired, and the actual galvanometer trajectory data is compared and calculated incrementally with the target galvanometer trajectory data to obtain multi-dimensional deviation data. The multi-dimensional deviation data includes galvanometer position deviation data, galvanometer dynamic deviation data, and galvanometer time deviation data. Calculate the galvanometer deviation weight value based on the multi-dimensional deviation data; The model parameters of the multiple sub-models are dynamically updated based on the galvanometer deviation weight value and the multi-dimensional deviation data to generate new compensation control commands.
2. The dynamic compensation method according to claim 1, characterized in that, The step of calculating the galvanometer deviation weight value based on the multi-dimensional deviation data includes: A deviation feature space is constructed based on the multi-dimensional deviation data, and the probability density distribution of the multi-dimensional deviation data is calculated based on the deviation feature space. Based on the probability density distribution, the galvanometer deviation weight value is calculated using a preset weight calculation function.
3. The dynamic compensation method according to claim 1, characterized in that, The step of dynamically updating the model parameters of the sub-model based on the galvanometer deviation weight value and the multi-dimensional deviation data to generate new compensation control instructions includes: The galvanometer deviation weight values are sorted by gradient, and the update priority of the sub-model is determined based on the gradient sorting results. Within a preset update time, the model parameters of the sub-model are dynamically updated according to the update priority and in combination with the multi-dimensional deviation data.
4. The dynamic compensation method according to claim 1, characterized in that, The step of generating a compensation control command based on the predicted galvanometer trajectory data and the predicted galvanometer time deviation data, and sending the compensation control command to the galvanometer drive module, includes: Extract key feature points from the predicted galvanometer trajectory data. The key feature points include inflection points, acceleration segments, constant speed segments, and deceleration segments. Calculate the time compensation amount of the key feature points based on the predicted galvanometer time deviation data; Compensation control commands are constructed using the predicted galvanometer trajectory data and the time compensation amount; The compensation control command is converted into a PWM pulse sequence, and the PWM pulse sequence is sent to the galvanometer drive module.
5. The dynamic compensation method according to claim 1, characterized in that, After triggering the compensation control command, the actual galvanometer trajectory data is acquired, and the actual galvanometer trajectory data is incrementally compared with the target galvanometer trajectory data to obtain multi-dimensional deviation data, including: After the compensation control command is triggered, the actual galvanometer trajectory data is collected, and the timestamp of the actual galvanometer trajectory data is recorded. Based on the timestamp, a linear interpolation method is used to map the actual galvanometer trajectory data onto the time axis of the target galvanometer trajectory data; Based on the time axis, the actual galvanometer trajectory data is divided into multiple trajectory segments according to a preset incremental step size; Within the multiple trajectory segments, multi-dimensional deviation feature vectors are calculated through incremental comparison. The multi-dimensional deviation feature vectors are fused using Kalman filtering to obtain multi-dimensional deviation data.
6. The dynamic compensation method according to any one of claims 1 to 5, characterized in that, The dynamic compensation method further includes: Record the galvanometer deviation weight values and generate historical galvanometer deviation weight values; The model parameter adjustment strategy for the dynamic prediction model is determined based on the historical galvanometer deviation weight value.
7. The dynamic compensation method according to claim 6, characterized in that, The step of determining the model parameter adjustment strategy for the dynamic prediction model based on the historical galvanometer deviation weight value includes: Determine whether the historical galvanometer deviation weight value is within the preset galvanometer deviation weight threshold; If so, the model parameters of the sub-model are updated based on the historical galvanometer deviation weight values and the multi-dimensional deviation data; If not, the model parameters of the dynamic prediction model are updated based on the historical galvanometer deviation weight values and the multi-dimensional deviation data.
8. A dynamic compensation system for laser galvanometer delay, characterized in that, The dynamic compensation system includes: The acquisition unit is used to acquire galvanometer data and perform preprocessing to obtain galvanometer data samples. The galvanometer data includes galvanometer motor temperature, galvanometer angle, galvanometer motor current, galvanometer position, galvanometer speed, and galvanometer acceleration. The construction unit is used to receive target galvanometer trajectory data and construct a dynamic prediction model of the TCN architecture based on the galvanometer data samples. A decomposition unit is used to decompose the galvanometer data sample into multiple sub-tasks based on dimensional features; A matching unit is used to divide the dynamic prediction model into multiple sub-models according to the multiple sub-tasks. The multiple sub-models include a position prediction sub-model, a dynamic prediction sub-model, and a delay prediction sub-model. The multiple sub-tasks are matched to the multiple sub-models to obtain predicted galvanometer trajectory data and predicted galvanometer time deviation data. The position prediction sub-model is used to predict the future position trajectory of the galvanometer based on the galvanometer position and the galvanometer angle. The dynamic prediction sub-model is used to predict the dynamic response characteristics of the galvanometer motion based on the galvanometer velocity, the galvanometer acceleration, and the galvanometer motor current. The delay prediction sub-model is used to predict the time deviation of the galvanometer execution command based on the galvanometer motor temperature, the galvanometer velocity, and the galvanometer acceleration. The generation unit is used to generate compensation control commands based on the predicted galvanometer trajectory data and the predicted galvanometer time deviation data, and send the compensation control commands to the galvanometer drive module. The comparison unit is used to acquire actual galvanometer trajectory data after the compensation control command is triggered, and to perform incremental comparison calculation between the actual galvanometer trajectory data and the target galvanometer trajectory data to obtain multi-dimensional deviation data. The multi-dimensional deviation data includes galvanometer position deviation data, galvanometer dynamic deviation data and galvanometer time deviation data. The calculation unit is used to calculate the galvanometer deviation weight value based on the multi-dimensional deviation data; The update unit is used to dynamically update the model parameters of the multiple sub-models based on the galvanometer deviation weight value and the multi-dimensional deviation data, so as to generate new compensation control instructions.
9. A dynamic compensation device for laser galvanometer delay, characterized in that, The dynamic compensation device includes: Processor, memory, input / output units, and bus; The processor is connected to the memory, the input / output unit, and the bus; The memory stores a program, which the processor invokes to perform the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium contains a program that, when executed on a computer, performs the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Laser galvanometer scanning system and calibration method
CN117600690A
Adaptive adjustment method of galvanometer scanning speed
CN119758744A