A control system and control algorithm for improving laser direction stability
By combining a bidirectional recurrent neural network with a self-attention mechanism and PID control, the problems of slow response speed and low control accuracy of fast mirror control systems in complex environments are solved, achieving high-precision, anti-interference, and adaptive control of the laser beam direction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI INST OF OPTICS & FINE MECHANICS CHINESE ACAD OF SCI
- Filing Date
- 2024-10-24
- Publication Date
- 2026-04-14
AI Technical Summary
Existing fast-reflecting mirror control systems suffer from slow response speed, low control accuracy, and poor environmental adaptability in complex dynamic environments, making it difficult to meet the requirements of demanding application scenarios. In particular, control accuracy is often difficult to guarantee in complex environments.
An intelligent system combining a bidirectional recurrent neural network based on a self-attention mechanism and PID control is adopted. Through the integration of error concepts, online learning mechanisms, and multi-model fusion, deep collaborative optimization of neural network prediction and PID control is achieved, thereby improving the stability and anti-interference capability of the laser beam direction.
It significantly improves the control accuracy and anti-interference capability of the laser beam direction, shortens the dynamic response time, enhances the system's adaptability, and can maintain excellent control performance under various working conditions.
Smart Images

Figure CN119472240B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to precision control technology for laser systems, and in particular to a technology that uses an advanced adaptive control algorithm, combined with a bidirectional recurrent neural network (Bi-RNN) and an attention mechanism, to control a fast-reflecting mirror to improve the directional stability of the laser. Background Technology
[0002] Precise control of lasers is crucial in many fields such as optical communication, precision manufacturing, and medical surgery. Traditional laser control systems use various feedback control algorithms to adjust the position of fast mirrors, thereby correcting the path of the laser beam. However, existing technologies usually rely on traditional control theories. In recent years, studies have also shown that control algorithms based on long short-term memory (LSTM) networks have achieved excellent results in the field of fast mirror control. For example, [1] proposed an adaptive control method based on LSTM, which significantly improved the laser pointing accuracy by learning environmental changes in real time, demonstrating the application prospects of intelligent algorithms in this field.
[0003] References:
[0004] [1] Chang, Hui et al. "Laser Beam Pointing Stabilization Control through Disturbance Classification." Sensors (Basel, Switzerland) 21 (2021): n.
[0005] While these methods are effective, existing fast-reflecting mirror control systems suffer from the following technical problems in complex dynamic environments.
[0006] 1. Slow response speed: Traditional fast-reflecting mirror control systems cannot make timely adjustments when faced with rapidly changing external disturbances, resulting in a lag in system response and affecting overall performance.
[0007] 2. Low control accuracy: Existing control algorithms are not accurate enough when dealing with nonlinear and time-varying systems, making it difficult to meet the requirements of high-precision optical systems. Especially in complex environments, control accuracy is often difficult to guarantee.
[0008] 3. Poor environmental adaptability: It is sensitive to environmental changes and requires frequent parameter adjustments under different working conditions. It is difficult to adapt to changing working environments, which limits the application scope of the system.
[0009] Therefore, a more advanced and adaptive method is needed to monitor and predict the laser path in real time and make high-speed and precise adjustments to maintain the stability of the laser beam. Summary of the Invention
[0010] To address the aforementioned technical problems, this invention proposes a control system and control algorithm for a fast-reflecting mirror based on a bidirectional recurrent neural network incorporating self-attention mechanism and PID control.
[0011] The hardware system includes: a laser source providing stable light source input; a beam shaping module including a high-efficiency collimator and beam expander to improve incident beam quality and overall system performance; a fast-reflecting mirror driven by a high-response piezoelectric ceramic to achieve rapid and precise beam deflection; an imaging sensor using a CCD camera to capture spot position information in real time; a computer serving as a high-performance workstation for running control algorithms and data processing; and NIDAQ boards for high-speed data acquisition and control signal output to ensure system real-time performance.
[0012] This invention realizes an intelligent system combining neural network prediction and PID control to improve the accuracy and anti-interference capability of laser beam direction control. The core technical solution lies in the innovative combination of neural network prediction and PID control to form an intelligent predictive-feedback control system. The highlight is the realization of deep collaborative optimization between neural network and PID. This collaborative optimization strategy fully leverages the predictive power of the neural network and the reliability of PID control, forming a highly intelligent and adaptive control system. Specifically, the collaborative optimization includes the following key aspects:
[0013] 1. Concept of Integrated Error: The system introduces the concept of integrated error, which improves the foresight of control by fusing actual error and future error predicted by neural network. The fusion formula is: E(t)=α*e(t)+(1-α)*e′(t+1), where α is an adjustable weight. This error fusion mechanism enables the computer to anticipate changes in the system, significantly improving control accuracy and response speed.
[0014] 2. Online Learning Mechanism: The neural network model can continuously learn from real-time control data, updating network weights to ensure the prediction model always accurately describes the current system characteristics. Simultaneously, the computer's parameter adjustment strategy is optimized based on the results of online learning, forming a closed-loop self-improvement process.
[0015] 3. Multi-model fusion and anomaly detection: The system implements a multi-model fusion and anomaly detection mechanism. By training multiple neural network models for different operating conditions and employing a dynamic weight allocation strategy, the system can adapt to various complex working environments. The anomaly detection mechanism can identify system behaviors that do not conform to historical patterns, adjust control strategies in a timely manner, and improve the system's robustness.
[0016] To support this deep collaborative optimization, the present invention adopts the following system architecture design:
[0017] 1. Neural Network Prediction: A bidirectional recurrent neural network model based on self-attention mechanism, which includes an input layer, an embedding layer, a bidirectional RNN layer, a self-attention layer, a fully connected layer, and an output layer.
[0018] 2. Improved PID control: In addition to using comprehensive error, techniques such as integral separation, variable integral coefficients, and incomplete derivatives are introduced to further improve control performance.
[0019] 3. Hardware Implementation: The invention adopts a real-time control system based on the NIPXIe platform, which uses a CCD camera and a multi-functional data acquisition card (PXIe-6363) to realize data acquisition and control signal output, ensuring the real-time performance of neural network prediction and PID control.
[0020] 4. Software Architecture: Based on a real-time operating system, it adopts a modular design and a distributed computing framework, which improves the system's reliability and scalability.
[0021] The specific solution of this invention is to propose a control system for improving the stability of laser direction, including: a laser source, a beam shaping module, a fast reflector, an imaging sensor, a computer, and an NIDAQ board; along the optical path transmission direction, the laser source, beam shaping module, fast reflector, and imaging sensor need to be set in sequence.
[0022] The laser source is used to provide a stable incident beam input;
[0023] The beam shaping module includes a collimating lens and a beam expander, used to improve the quality of the incident beam;
[0024] The fast-reflecting mirror is driven by piezoelectric ceramics and is used to achieve beam deflection;
[0025] The imaging sensor employs a CCD camera to capture spot position information in real time. The imaging sensor is electrically connected to a computer and collects spot position information data. After the data is collected, the spot position information data is transmitted to the computer. The computer receives the spot position information as input, runs a control algorithm, and generates a control signal as output. The NIDAQ board is electrically connected to the computer and the fast-reflecting mirror. The NIDAQ board transmits the control signal generated by the computer to the fast-reflecting mirror.
[0026] This invention also proposes a control algorithm for improving laser directional stability. The control algorithm is a bidirectional recurrent neural network based on a self-attention mechanism, used to predict the spot position deviation at the next moment. The specific steps are as follows:
[0027] S1. System Calibration:
[0028] Start the laser source and maintain it for a preset time to allow it to reach a stable working state;
[0029] Adjust the position of the collimating lens to achieve optimal collimation of the beam;
[0030] Adjust the spacing between the beam expander lens groups to achieve the designed beam expansion ratio;
[0031] Control the fast-reflecting mirror to enter the initial state and record the position of the light spot image acquired by the imaging sensor as the basis.
[0032] Precise positioning;
[0033] A preset voltage sequence is applied to the fast-reflecting mirror, and the corresponding changes in the position of the light spot are recorded;
[0034] Establish the mapping relationship between the fast-reflecting mirror driving voltage and the angle quantity, and obtain the system calibration matrix;
[0035] The linear relationship between the fast-reflecting mirror angle deflection and the driving voltage is calculated based on the calibration matrix.
[0036] S2. Data Acquisition and Image Preprocessing:
[0037] Set the target coordinates (x1, y1) for the desired position of the light spot;
[0038] The imaging sensor is activated to capture light spot images in real time, and the image data is transmitted to the computer.
[0039] The computer filters the acquired images to remove noise;
[0040] Use adaptive contrast enhancement technology to improve image contrast;
[0041] The grayscale image is converted into a binary image, and the shape of the light spot is optimized using operations such as dilation and erosion.
[0042] The center coordinates of the light spot are extracted using the centroid method, and the actual position deviation from the expected coordinates is calculated: e(t);
[0043] S3. Neural Network Model Data Processing:
[0044] Use the position deviation e(t) sequence of the past n time points as training samples;
[0045] The preprocessed data is fed into multiple bidirectional recurrent neural network models based on self-attention mechanisms;
[0046] Each neural network model independently calculates and outputs the prediction bias e'(t+1) for the next time step (t+1);
[0047] Collect the prediction results of all neural network models for time t+1;
[0048] The prediction error is converted into an accuracy score and normalized to obtain the weight coefficient wi;
[0049] The weighted summation of each model's weight wi yields the fused prediction bias: e'(t+1)=Σ(wi*e′i(t+1))
[0050] S4. Calculate the overall error E(t):
[0051] Based on the actual deviation e(t) and the predicted deviation e'(t+1), as well as the adjustable weighting factor α (<0<α<1), the comprehensive error is calculated as: E(t)=α*e(t)+(1-α)*e'(t+1).
[0052] S5. Generate control signal: u(t)
[0053] The control signal u(t) is generated, and its mathematical expression is: u(t)=Kp*E(t)+Ki*∫E(τ)dτ+Kd*dE(t) / dt;
[0054] Where E(t) is the comprehensive error calculated in S4; Kp, Ki and Kd are the proportional, integral and derivative control parameters, respectively;
[0055] S6. Control signal output:
[0056] The control signal u(t) is converted into an angle adjustment amount that the fast-reflecting mirror can understand using the NIDAQ board, and then sent to the fast-reflecting mirror's driver.
[0057] Define the minimum adjustment unit θmin as 0.005 degrees, the scaling factor k as 0.1, and the maximum adjustment steps Nmax as 10;
[0058] The adjustment direction is determined by direction = sign(u(t)). If u(t) > 0, sign(u(t)) = 1, indicating adjustment in the positive direction; if u(t) < 0, sign(u(t)) = -1, indicating adjustment in the negative direction.
[0059] Calculate the number of adjustment steps, N = min(floor(|u(t)| / k);
[0060] Generate adjustment instructions, where the adjustment amount θadj = direction * θmin * N;
[0061] Based on the linear relationship between the angle deflection of the fast-reflecting mirror and the driving voltage, the adjustment amount is converted into a voltage signal V;
[0062] The driver of the fast-reflecting mirror adjusts the angle of the fast-reflecting mirror based on the received voltage signal V.
[0063] Furthermore, step S6 yields the voltage signal V = 0.65 + 0.65 * tanh(7.5 * θadj + 0.8 * θadj). 3)
[0064] Furthermore, after executing step S6, the system returns to step S2 and begins a new control loop; simultaneously, the online learning process continues in parallel to continuously optimize the control algorithm. The online learning process is as follows:
[0065] Maintain a fixed-size circular buffer to store control data for the most recent period;
[0066] At regular intervals, samples are randomly drawn from the buffer to form a small batch of training sets;
[0067] A learning rate decay strategy is adopted, in which the learning rate is gradually reduced as training progresses, to ensure that the model converges stably.
[0068] The Adam optimizer is used for weight updates;
[0069] L2 regularization is used to prevent fitting.
[0070] The beneficial effects of this invention are significant:
[0071] 1. Improved control precision: Compared with traditional PID control, this system can reduce the steady-state error of laser beam direction control by about 50%.
[0072] 2. Enhanced anti-interference capability: especially effective suppression of complex nonlinear and time-varying interference.
[0073] 3. Improved dynamic response: The system adjustment time is shortened and the dynamic response speed is improved, enabling it to adapt to rapidly changing control requirements.
[0074] 4. Strong Adaptability: Through collaborative optimization, the system achieves strong adaptability and can maintain excellent control performance under various operating conditions.
[0075] In summary, this invention creates an intelligent and adaptive laser beam direction control system through deep collaborative optimization of neural networks and PID controllers. This system not only demonstrates superior performance in control accuracy, anti-interference capability, real-time performance, and adaptability, but also has broad application prospects, providing an innovative solution for high-precision laser technology and other precision control fields. Attached Figure Description
[0076] Figure 1 This is a system diagram.
[0077] 1-Laser source, 2-Beam shaping module, 3-Fast-reflecting mirror, 4-Imaging sensor, 5-Computer, and 6-NIDAQ board Detailed Implementation
[0078] The present invention will be further described below with reference to implementation examples and accompanying drawings, but this should not be construed as limiting the scope of protection of the present invention. The present invention provides an intelligent system combining neural network prediction and PID control to improve the accuracy and anti-interference capability of laser beam direction control.
[0079] 1. System Structure
[0080] The system mainly consists of a laser source 1, a beam shaping module 2, a fast reflector 3, an imaging sensor 4, a computer 5, and an NIDAQ board 6. The laser source provides a stable beam, and the beam shaping module shapes and expands the beam. The fast reflector uses piezoelectric ceramics to rapidly deflect the beam and precisely adjust its direction. The imaging sensor captures the spot image at the target location in real time. The computer executes control algorithms, processes data, and generates control signals. The data acquisition board transmits the control signals to the fast reflector driver to adjust the fast reflector angle.
[0081] The system initialization and calibration process includes starting the laser source 1 and maintaining it for a preset time (approximately 5 minutes) to achieve a stable operating state. The collimation state of the beam is optimized by adjusting the position of the collimating mirror in the beam shaping module 2, and the beam expander group spacing is adjusted to achieve the designed beam expansion ratio (5x). Subsequently, the fast-reflecting mirror 3 is controlled to enter its initial state (0V drive voltage), the reference position of the light spot acquired by the imaging sensor 4 is recorded, a preset voltage sequence (-10V to +10V, step size 0.2V) is applied to the fast-reflecting mirror, and the corresponding changes in the light spot position are recorded. These data are used to establish a mapping relationship between the fast-reflecting mirror drive voltage and the angle, obtain the system calibration matrix, and calculate the linear relationship between the fast-reflecting mirror angle deflection and the drive voltage.
[0082] These components work together to achieve precise beam control, real-time image acquisition, and rapid response closed-loop feedback, providing technical support for precision optical applications. Rigorous initialization and calibration procedures ensure the system possesses accurate control characteristics and reliable operation.
[0083] 2. System Working Principle
[0084] During system operation, the laser beam emitted from the laser source is first pre-processed by a beam shaping module to improve its directivity. The optimized beam is then reflected by a fast-reflecting mirror, and the beam direction can be changed by adjusting the angle of the mirror. The reflected beam forms a spot on the target and is captured in real time by an imaging sensor. The computer analyzes the image data, extracts the spot's position coordinates, calculates the positional deviation, and generates a control signal. This signal, transmitted via an NIDAQ board, controls the rotation of the fast-reflecting mirror, forming a closed-loop control system.
[0085] 3. Intelligent control algorithm flow
[0086] 3.1 Data Acquisition and Preprocessing
[0087] After setting the desired spot coordinates (x1, y1), the system first acquires a spot image using an imaging sensor. The acquired raw image may contain noise and interference, therefore a series of preprocessing steps are required: random noise is removed from the image using filtering; the image contrast is improved using adaptive contrast enhancement technology; the grayscale image is converted into a binary image to facilitate subsequent spot localization; and the spot shape is optimized using operations such as dilation and erosion to eliminate small interference areas.
[0088] The system then uses the centroid method to extract the center coordinates of the light spot, i.e., the current coordinates (x2, y2). These coordinates are compared with the pre-set desired coordinates to calculate the position deviation of the light spot, e(t) = (|x1-x2|, |y1-y2|). This deviation vector contains components in both the horizontal and vertical directions, serving as the basis for subsequent control.
[0089] 3.2 Neural Network Model and Prediction
[0090] 3.2.1 Neural Network Model:
[0091] This invention employs a bidirectional recurrent neural network model based on a self-attention mechanism for prediction. The network architecture of this model, from bottom to top, comprises the following hierarchical structure:
[0092] The input layer receives a preprocessed sequence of position deviation data, each sequence containing horizontal and vertical deviation components at n time steps.
[0093] The embedding layer maps the input data to a 256-dimensional feature space, capturing the latent feature representation of the data.
[0094] The bidirectional RNN layer employs a two-layer stacked structure, with each layer containing two 128-dimensional RNN units, one for forward and one for backward processing, respectively, from the beginning and end of the sequence. This two-layer stacked design enables the model to extract temporal features layer by layer, forming a hierarchical feature representation.
[0095] The self-attention layer calculates the relevance weights at different positions in the sequence using the query vector (Q), key vector (K), and value vector (V), and adaptively focuses on important time steps using a scaled dot product attention mechanism.
[0096] The fully connected layer contains two hidden layers (128 / 64 neurons) and uses the ReLU activation function for feature combination.
[0097] The output layer uses a linear activation function to predict the horizontal and vertical positional deviations at the next time step.
[0098] This structure effectively captures the temporal features of positional deviation sequences by combining feature extraction, sequence modeling, and attention mechanisms, providing predictive support for control decisions.
[0099] 3.2.2 Neural Network Prediction
[0100] The preprocessed data is used as input and fed into a bidirectional recurrent neural network based on a self-attention mechanism to predict the position deviation at the next time step. This network structure can effectively capture long-term dependencies in time-series data and is very suitable for processing time-continuous data such as laser beam position.
[0101] The network input is a sequence of position deviations over the past n time steps, with a value of 20. Each time step's deviation data includes components in both the horizontal and vertical directions. The network output is the predicted deviation for the next time step (t+1), also containing components in both directions. This network structure, through multi-level feature extraction and nonlinear mapping, combined with bidirectional information flow and a self-attention mechanism, can better capture the temporal characteristics and long-short-term dependencies of beam position changes, thereby improving prediction accuracy and robustness.
[0102] The network is trained using historical data, and its parameters are optimized using the backpropagation algorithm. During online system operation, the network continuously learns and updates, adapting to the dynamic changes in the system and ensuring the stability and adaptability of its predictive performance. This bidirectional recurrent neural network prediction method based on a self-attention mechanism, compared to unidirectional RNN networks, can more comprehensively utilize temporal information, providing more accurate prediction results and a more reliable basis for subsequent control decisions.
[0103] 3.3 Anomaly Detection
[0104] After the prediction bias e'(t+1), for anomaly detection, the system uses moving average and moving standard deviation to identify outliers. Let μt and σt be the moving average and moving standard deviation at time t, respectively. Then, the criteria for anomaly detection can be expressed as:
[0105] |e(t)-μt|>k*σt
[0106] Where k is a preset threshold constant, which is set to 2.
[0107] When an anomaly is detected, the system temporarily adjusts its control strategy, such as increasing reliance on the current actual error and decreasing reliance on prediction. Simultaneously, the system excludes outlier data points from the training buffer. If multiple outliers are detected consecutively, a model retraining process is triggered.
[0108] 3.4 Model Fusion
[0109] First, multiple neural network models are trained for different working conditions. A dynamic weight allocation method is used to calculate the weights of each model based on its prediction accuracy over a recent period. The final prediction result is a weighted average of the predictions from all models. The weight wi is calculated based on the prediction accuracy of each model:
[0110] wi=exp(-λ*MSEi) / Σ(exp(-λ*MSEj))
[0111] Here, MSEi is the mean squared error of the i-th model over the most recent period, and λ is a positive constant used to control the sensitivity of weight allocation. After normalization, i.e., ∑wi=1, the weight coefficients wi are obtained. The mathematical expression for weighted summation of the model fusion based on the weights wi of each model is as follows:
[0112] e'(t+1)=Σ(wi*e′i(t+1))
[0113] Where e′(t+1) is the prediction bias at time t+1 after fusion, and e′i(t+1) is the prediction bias of the i-th model at time t+1.
[0114] 3.5 Calculation of Comprehensive Error
[0115] To fully utilize both the currently observed deviation information and the future deviation information predicted by the neural network, the system introduces the concept of a comprehensive error. The system calculates the comprehensive error E(t) based on the actual position deviation e(t) at the current moment and the predicted position deviation e'(t+1) at the next moment:
[0116] E(t)=α·e(t)+(1-α)·e′(t+1)
[0117] Here, α is an adjustable weighting factor, ranging from 0 to 1. The value of α determines the degree of importance the system places on the current error and the prediction error. A larger α value makes the system pay more attention to the current actual deviation, which is conducive to rapid response; a smaller α value makes the system consider the predicted future deviation more, which is conducive to smooth control and early adjustment.
[0118] The value of α can be dynamically adjusted based on the actual operating conditions of the system. For example, when the system is in a stable state, the value of α can be appropriately reduced to increase the reliance on prediction; when a sudden disturbance is detected, the value of α can be temporarily increased to enhance the system's immediate response capability.
[0119] To prevent integral saturation, the algorithm introduces an integration suppression factor f(|E(t)|). When the error is large, this factor automatically reduces the influence of the integration. In its implementation, a function related to the absolute value of the error is defined:
[0120] f(|E(t)|)=1 / (1+β|E(t)|)
[0121] β is an adjustable parameter that decreases as the error increases, thus enabling dynamic adjustment of the integral term.
[0122] Secondly, to avoid control signal jumps caused by abrupt changes in the error signal, the algorithm performs a differentiation operation on the controlled variable y(t) rather than the error signal. This improvement smooths the differentiation signal by introducing a low-pass filter:
[0123] D(t)=-Kd*(dy(t) / dt) / (1+τf*s)
[0124] Where τf is the filter time constant, and s is the complex frequency variable in the Laplace transform. This treatment effectively reduces the system's sensitivity to noise.
[0125] Finally, the algorithm dynamically adjusts the PID parameters based on the magnitude of the error, achieving more flexible control. This dynamic adjustment mechanism is implemented by defining an error-related parameter adjustment function:
[0126] g(|E(t)|)=η*|E(t)| / (1+γ|E(t)|)
[0127] Where η and γ are adjustable parameters. This function increases its proportional and derivative actions as the error increases, while appropriately decreasing its integral action. The dynamically adjusted PID parameters are:
[0128] Kp(t) = Kp_base + g(|E(t)|)
[0129] Ki(t) = Ki_base - g(|E(t)|)
[0130] Kd(t) = Kd_base + g(|E(t)|)
[0131] 3.6 PID Control
[0132] The improved PID control algorithm operates based on the comprehensive error E(t) calculated by the system, and introduces several optimization measures on the basis of traditional PID control. First, the system establishes a basic PID controller, whose output u(t) consists of three terms: proportional, integral, and derivative.
[0133] u(t)=Kp*E(t)+ki*∫E(τ)dτ+Kd*dE(t) / dt
[0134] f(|E(t)|)=1 / (1+β|E(t)|)
[0135] D(t)=-Kd*(dy(t) / dt) / (1+τf*s)
[0136] g(|E(t)|)=η*|E(t)| / (1+γ|E(t)|)
[0137] Kp(t)=Kp base +g(|E(t)|)
[0138] Ki(t)=Ki base -g(|E(t)|)
[0139] Kd(t)=Kd base +g(|E(t)|)
[0140] The final PID controller output is derived from these optimized terms, and a limiting operation is used to ensure the control signal remains within a reasonable range.
[0141] u_final(t)=max(min(u(t),umax),umin)
[0142] Through these improvements, the PID controller can better adapt to the characteristics of the laser beam control system, providing more accurate and stable control performance under various operating conditions.
[0143] 3.7 Execution Control
[0144] The control signal output process transforms the calculation results of the PID controller into the actual physical adjustment of the fast-reflecting mirror. This process involves several intricate steps and considerations aimed at achieving high-precision angle control. First, based on the calculated PID control signal u(t), the system begins fine-tuning. To achieve high-precision adjustment, a minimum adjustment unit θmin is defined as 0.005 degrees, and a scaling factor k of 0.1 and a maximum adjustment step Nmax of 10 are introduced.
[0145] The determination of direction and number of steps follows this logic:
[0146] direction = sign(u(t))
[0147] If u(t) > 0, sign(u(t)) = 1, indicating a positive adjustment; if u(t) < 0, sign(u(t)) = -1, indicating a negative adjustment.
[0148] N = min(floor(|u(t)| / k), Nmax)
[0149] The actual adjustment amount θadj is calculated as follows:
[0150] θadj = direction * θmin * N
[0151] This method ensures that each adjustment is an integer multiple of the smallest adjustment unit, which helps improve the accuracy and stability of control.
[0152] Next, the system needs to convert θadj into a specific instruction format that the driver can understand. The driver accepts a voltage signal V as input. Based on the linear relationship between the fast-reflecting mirror angle deflection and the driving voltage, the conversion relationship can be expressed as:
[0153] V=0.65+0.65*tanh(7.5*θadj+0.8*θadj^3),
[0154] The system utilizes the NI-DAQmx API to create analog output tasks, configuring the corresponding channels, sampling rate, and buffer size. The converted control signals are sent to the fast-reflecting mirror driver via the analog output channels of the NIDAQ data acquisition board. Upon receiving these control signals, the driver's internal control circuitry converts them into a suitable drive current or drive voltage for the actuator.
[0155] Fast-reflecting mirrors typically employ a dual-axis structure, enabling precise angle adjustments in both the x and y directions. To achieve high-precision angle control, the fast-reflecting mirror's drive system utilizes a high-response actuator made of piezoelectric ceramics. After adjustment, the system waits a short period to allow the adjustment to complete and stabilize.
[0156] Through this iterative fine-tuning process, the system can gradually adjust the fast-reflecting mirror to the desired position without relying on a precise angle-control signal mapping relationship. This method is particularly suitable for experimental scenarios requiring high-precision control and can effectively cope with potential nonlinear characteristics and external disturbances in the system. The high-response actuator can respond to control signals quickly and accurately, achieving minute angle adjustments, thereby ensuring the high precision and high stability of the entire system.
[0157] 3.8 Online Learning Mechanism
[0158] This system employs an online learning mechanism, enabling the neural network model to continuously learn and adapt during system operation. The specific implementation mechanism is as follows:
[0159] Data Management Mechanism: The system is configured with a circular buffer with a capacity of 10,000 samples to store the latest control data. Each data sample contains input features (historical position deviation sequence) and a corresponding label (actual position deviation). When new control data is generated, the system adds it to the buffer; when the buffer reaches its capacity limit, a first-in, first-out (FIFO) strategy is adopted to automatically delete the oldest data sample, ensuring that the buffer always maintains the latest system status information.
[0160] Training Strategy: The system employs a mini-batch training approach, triggering a training process every 100 control cycles. During each training iteration, 256 samples are randomly selected from the circular buffer to form a mini-batch. This random sampling method reduces the correlation between samples and improves training stability. The training process uses the backpropagation algorithm to update network weights, minimizing prediction error.
[0161] Learning rate adjustment: A hybrid learning rate strategy combining stepped decay and cosine annealing is employed. The initial learning rate is set to 0.001. After every 1000 mini-batch training iterations, the learning rate undergoes a stepped decay with a decay factor of 0.9. Within each stepped decay period, cosine annealing is applied for fine-grained adjustment of the learning rate to ensure smooth changes. The lower limit of the learning rate is set to 1e-6 to prevent premature stagnation in the learning process. The cosine annealing cycle is synchronized with the stepped decay; this hybrid strategy ensures both learning stability and maintains sufficient model plasticity.
[0162] Optimization Algorithm: The Adam optimizer is used for weight updates, where the momentum parameter β1 is set to 0.9 for first-order moment estimation; the second-order moment estimation parameter β2 is set to 0.999; and the numerical stability constant ε is set to 1e-8. The Adam optimizer can adaptively adjust the learning rate of each parameter, combining the advantages of momentum and RMSprop, making it suitable for online learning scenarios.
[0163] Regularization and overfitting prevention: L2 regularization is employed with a regularization coefficient λ set to 0.0001. By adding a squared weight term to the loss function, excessively large weight values are suppressed, improving the model's generalization ability. Simultaneously, an early stopping strategy is implemented to monitor validation set performance: if validation performance shows no improvement after 50 consecutive training iterations, training is paused and the current best model is saved; if performance still shows no significant improvement after 500 cumulative training iterations, a model re-initialization mechanism is triggered, but 20% of the original weights are retained as prior knowledge. This approach preserves effective learning experience while providing the model with an opportunity to relearn.
[0164] Through the synergistic effect of these mechanisms, the system can continuously optimize its predictive performance while maintaining stability, adapting to dynamic changes in system parameters and the environment. This adaptive learning capability significantly enhances the robustness and reliability of the control system, providing strong support for high-precision beam control.
Claims
1. A control system for improving laser directional stability, characterized in that, include: Laser source (1), beam shaping module (2), fast reflector (3), imaging sensor (4), computer (5) and NIDAQ board (6); Along the optical path transmission direction, a laser source (1), a beam shaping module (2), a fast reflector (3), and an imaging sensor (4) are arranged in sequence; The laser source (1) is used to provide a stable incident beam input; The beam shaping module (2) includes a collimating mirror and a beam expander, which are used to improve the quality of the incident beam; The fast-reflecting mirror (3) is driven by piezoelectric ceramics to achieve beam deflection; The imaging sensor (4) uses a CCD camera to capture spot position information in real time. The imaging sensor (4) is electrically connected to the computer (5) and collects the spot position information data transmission value to the computer (5). The computer (5) accepts the spot position information as input, runs the control algorithm, and generates a control signal as output. The NIDAQ board (6) is electrically connected to the computer (5) and the fast mirror (3). The NIDAQ board (6) transmits the control signals generated by the computer (5) to the fast mirror (3). The controlled algorithm includes the following steps: S1. System Calibration: Start the laser source (1) and maintain it for a preset time to make it reach a stable working state; Adjust the position of the collimating mirror in the beam shaping module (2) to achieve the best collimation state for the beam; Adjust the spacing between the beam expander groups in the beam shaping module (2) to make the beam expansion magnification meet the design requirements; Control the fast-reflecting mirror (3) to enter the initial state, and record the position of the light spot image acquired by the imaging sensor as the base. Precise positioning; A preset voltage sequence is applied to the fast-reflecting mirror, and the corresponding changes in the position of the light spot are recorded; Establish the mapping relationship between the fast-reflecting mirror driving voltage and the angle quantity, and obtain the system calibration matrix; The linear relationship between the fast-reflecting mirror angle deflection and the driving voltage is calculated based on the calibration matrix. S2. Data Acquisition and Image Preprocessing: The imaging sensor (4) is activated to capture the light spot image in real time and transmit the image data to the computer (5); Set the target coordinates (x1, y1) of the desired position of the light spot; the computer (5) filters the acquired image to remove noise; Use adaptive contrast enhancement technology to improve image contrast; The grayscale image is converted into a binary image, and the shape of the light spot is optimized using operations such as dilation and erosion. The center coordinates (x2, y2) of the light spot were extracted using the centroid method. Calculate the actual position deviation from the expected coordinates: e(t) is (|x1-x2|,|y1-y2|); S3. Neural Network Model Data Processing: Use the position deviation e(t) sequence of the past n time points as training samples; The preprocessed data is fed into multiple bidirectional recurrent neural network models based on self-attention mechanisms; Each neural network model independently calculates and outputs the prediction bias e′(t+1) for the next time step (t+1); Collect the prediction results of all neural network models for time t+1; The prediction error is converted into an accuracy score and normalized to obtain the weight coefficient wi; The weighted summation of each model weight wi yields the fused prediction bias: e′(t+1)=∑(wi*e′i(t+1)); S4. Calculate the overall error E(t): Based on the actual deviation e(t) and the predicted deviation e′(t+1), as well as the adjustable weighting factor α (0<α<1), calculate the comprehensive error: E(t)=α*e(t)+(1-α)*e′(t+1); S5. Generate control signal: u(t) The control signal u(t) is generated, and its mathematical expression is: u(t) = Kp * E(t)+Ki*∫E(τ)dτ+Kd*dE(t) / dt; Where E(t) is the comprehensive error calculated in S4; Kp, Ki and Kd are the proportional, integral and derivative control parameters, respectively; S6. Control signal output: The control signal u(t) is converted into an angle adjustment amount that the fast-reflecting mirror can understand by the NIDAQ board (6), and then sent to the driver of the fast-reflecting mirror (3). Define the minimum adjustment unit θmin as 0.005 degrees, the scaling factor k as 0.1, and the maximum adjustment steps Nmax as 10; The adjustment direction is determined by direction = sign(u(t)). If u(t) > 0, sign(u(t)) = 1, indicating adjustment in the positive direction; if u(t) < 0, sign(u(t)) = -1, indicating adjustment in the negative direction. Calculate the number of adjustment steps, N = min(floor(|u(t)| / k); Generate adjustment instructions, where the adjustment amount θadj = direction * θmin * N; Based on the linear relationship between the angle deflection of the fast-reflecting mirror and the driving voltage, the adjustment amount is converted into a voltage signal V; The driver of the fast-reflecting mirror (3) adjusts the angle of the fast-reflecting mirror (3) according to the received voltage signal V.
2. The control system as described in claim 1, characterized in that, Step S3, after the prediction bias e′(t+1) and before collecting the prediction results of all neural network models for time t+1, performs anomaly detection. The system uses moving average and moving standard deviation to identify outliers. Let μt and σt be the moving average and moving standard deviation at time t, respectively. Then, the criteria for anomaly detection can be expressed as: |e(t)-μt|>k*σt Where k is a preset threshold constant, which is 2; When an anomaly is detected, the system will temporarily adjust the control strategy and exclude abnormal data points. If multiple anomalies are detected consecutively, the model retraining process will be triggered.
3. The control system as described in claim 1, characterized in that, Step S6 yields the voltage signal V = (0.65 + 0.65 * tanh(7.5 * θadj + 0.8 * θadj)). 3 ).
4. The control system as described in claim 1, characterized in that, After executing step S6, the system returns to step S2 and begins a new control loop. Simultaneously, the online learning process continues in parallel, constantly optimizing the control algorithm. The online learning process is as follows: Maintain a fixed-size circular buffer to store control data for the most recent period; At regular intervals, samples are randomly drawn from the buffer to form a small batch of training sets; A learning rate decay strategy is adopted, in which the learning rate is gradually reduced as training progresses, to ensure that the model converges stably. The Adam optimizer is used for weight updates; L2 regularization is used to prevent fitting.
Citation Information
Patent Citations
Device for realizing light beam automatic shaping using shape changing lens
CN1987546A