FMCW laser ranging light source nonlinear correction method based on NN modeling and SAC algorithm
Through the intelligent control method based on NN model and SAC algorithm, the problem of complexity and low automation of nonlinear correction in FMCW laser ranging system is solved, high-precision and stable nonlinear correction is achieved, and the measurement accuracy and System performance.
Patent Information
- Application Number
- CN202410744514.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-10-15
AI Technical Summary
When the existing FMCW laser ranging system expands the frequency modulation coverage, due to the nonlinear characteristics and thermal effects of the tunable laser, the ranging results are seriously distorted, making it difficult to achieve high linear frequency modulation, and the traditional nonlinear correction method is complex and relies on experts Manual adjustment, lack of automation and intelligence.
Using a method based on neural network (NN) modeling and a combination of state value and action value algorithm (SAC), a nonlinear test platform for the FMCW laser ranging system is constructed to collect data, construct a data set, and use the NN model to fit the system characteristics. , and use the SAC algorithm as the framework to design the RL agent to achieve intelligent correction of the modulation current slope.
It effectively corrects the nonlinear problem of the FMCW laser ranging system, improves the measurement accuracy and the stability of the system control, reduces the dependence on expert knowledge, reduces the difficulty of operation, and improves the environmental adaptability and cost-effectiveness of the system.
Smart Images

Figure CN118778013A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the fields of laser radar, laser ranging and artificial intelligence, and provides a nonlinear correction method for an FMCW laser ranging light source based on NN (neural network) modeling and SAC algorithm, which successfully realizes nonlinear correction and achieves the purpose of generating a linear frequency FMCW signal, thereby improving measurement accuracy and performance. Background Art
[0002] The high-precision FMCW laser ranging method has the advantages of strong adaptability to the measurement environment, strong anti-noise and anti-interference ability, low complexity and low cost. It shows broad prospects in many fields such as non-contact profile measurement, medical imaging, and precision instrument manufacturing. FMCW laser ranging is based on the ideal linear frequency modulation assumption and relies on the FMCW interference principle. The distance is obtained by inverting the beat frequency signal obtained by interference. When the frequency modulation coverage range is expanded, the linearity is obviously distorted in a narrow frequency range due to factors such as the strong nonlinearity and thermal effect of the tunable laser itself, and high linear frequency modulation cannot be achieved, which leads to serious distortion of the ranging results. Therefore, how to get rid of the influence of the inherent nonlinear characteristics of the tunable laser is the key to achieving high-precision detection of the FMCW laser ranging system. In this regard, domestic and foreign scholars have successively proposed frequency modulation nonlinear correction methods based on phase-locked principle, sampling principle, frequency comb, iterative algorithm, sideband modulation technology and other mechanisms. Although these methods have been proven effective in theory, these correction techniques usually rely on complex physical theory deductions, which not only increases the difficulty of experiments and analysis, but also may sacrifice the accuracy of overall control in the optimization of local systems. In addition, the above solutions often require manual adjustments and fine operations by experts, which has become a bottleneck in the control of modern optical systems as the requirements for automation and intelligence are increasing.
[0003] In recent years, DL has provided a powerful data-driven method to learn and simulate the behavior of complex systems without detailed physical models. RL enables algorithms to learn optimal behavior strategies in complex and dynamic environments through trial and error. The method that combines DL and RL can achieve automatic and intelligent control of the system without sacrificing accuracy, reduce expert intervention and improve the intelligent level of operation. Therefore, the present invention proposes a nonlinear correction method for FMCW laser ranging light source based on NN modeling and SAC algorithm. Summary of the invention
[0004] In view of the above research problems, the present invention proposes a nonlinear correction method for FMCW laser ranging light source based on NN modeling and SAC algorithm. By establishing an FMCW nonlinear test platform, a large amount of diverse data is collected, and a data set is constructed after data preprocessing. Using this data set, the system characteristics are fitted based on NN. The NN model can refine and capture the inherent nonlinear dynamic characteristics of the system, consider more control relationships between input and output, and fit the physical characteristics of the system more accurately. The NN model provides an accurate training basis for the RL control strategy. Based on NN modeling and SAC control algorithm, the nonlinear problem of the FMCW system is corrected, and the accuracy and stability of system control are improved.
[0005] In order to achieve the above object, the present invention adopts the following technical solution:
[0006] A nonlinear correction method for FMCW laser ranging light source based on NN modeling and SAC algorithm, comprising:
[0007] Step 1: Design and build the FMCW laser nonlinear dynamic system platform;
[0008] Step 2: Collect and process the data obtained in step 1 to construct a data set;
[0009] Step 3: Design a nonlinear correction process based on the NN model and use the SAC algorithm for correction;
[0010] Step 4: According to the NN model in step 3, the nonlinear correction process is designed as a Markov decision process. The RL agent is designed based on the SAC algorithm. The modulation current slope is corrected by RL to realize the nonlinear correction of the FMCW laser ranging light source.
[0011] In the above method, the step 1 is specifically:
[0012] Step 1.1: Design the FMCW laser nonlinear ranging dynamic system, take the modulation current slope as input, use MATLAB data processing, and store the generated modulation current data in FPGA, and then enter the laser driving part. The laser driving part is designed as a current controller and a temperature controller, which are used to generate modulation signals to drive the semiconductor laser and control the temperature of the laser respectively;
[0013] Step 1.2: Drive the 1550nm band DFB laser to emit laser, connect the output end to the isolator and attenuator, enter the interferometer to simulate ranging to obtain the beat frequency signal, and use the photoelectric detector PD to detect the optical signal;
[0014] Step 1.3: Collect data based on the FMCW laser nonlinear ranging dynamic system built in step 2. The oscilloscope saves the PD detection light signal and outputs a 2500-point beat frequency signal.
[0015] In the above method, the step 2 is specifically:
[0016] Step 2.1, collect data, the oscilloscope saves the output as a 2500-point beat frequency signal, the number of sampling points is 2500 points per cycle, first filter, then perform Hilbert transform to obtain a complex signal, select 250-1950 points for modeling and correction, accounting for 83% of the full cycle, use the modulation current slope as input and the beat frequency signal time-frequency as output to construct a data set;
[0017] Step 2.2: Based on the FMCW ranging principle, a NN model is constructed to fit the system characteristics. According to the data set constructed in step 2, 80% is used as the training set and 20% is used as the test set to train and test the NN model.
[0018] In the above method, step 3 is specifically:
[0019] Step 3.1: Construct a data set with the modulation current slope as input and the beat signal time-frequency as output, and construct a NN model based on the data set, as follows:
[0020] In a single cycle, the linear tuning frequency of the laser is expressed as:
[0021] w(t)=w0+F(u(t))
[0022] Where w0 is the initial frequency of the laser sweep, which refers to the starting value of the optical frequency output by the laser before the start of the sweep; t is time; u(t) is the modulation current, and F(·) describes the nonlinear relationship between the laser frequency and the modulation signal; ξ is the sweep rate of the swept laser, that is, the size of the frequency range swept per unit time; the sweep rate ξ can be expressed as:
[0023]
[0024] The electric field intensity of the light source is expressed as:
[0025]
[0026] Where E0 represents the average light intensity; represents the initial phase of the light source, and after an optical path difference of τ, the distance measurement is simulated by the Mach-Zehnder interferometer, and the electric field intensity of the measured light is expressed as:
[0027]
[0028] Where E1 represents the average light intensity. The beat signal is obtained by the interference of the measured light and the emitted light. The beat signal is detected by PD. When light irradiates the PD, the photons will excite the carriers in the PD, thereby generating current. The beat signal detected by the PD is actually the current change caused by the intensity change of the light signal. The beat signal is expressed as:
[0029]
[0030] Where I0 is the beat frequency signal strength, since τ is in the nanosecond order, ξτ 2 / 2 can be ignored compared to w0τ+ξτt, so the beat frequency signal can be simplified to:
[0031] i(t)=|e0(t)+e1(t)| 2 =I0cos(w0τ+ξτt)
[0032] The frequency f of the beat signal can be obtained b for:
[0033] f b =ξτ
[0034] The frequency sweep bandwidth of the light source is B = ξT, where T is the modulation period; the frequency sweep bandwidth is S, so the distance d calculation formula of the FMCW laser ranging system is:
[0035]
[0036] Where c is the speed of light in vacuum; n is the refractive index of light in the measurement medium, and the beat signal frequency f is b The relationship between (t) and the modulation current slope u′(t) is:
[0037] f b (t) = τG(u′(t))
[0038] Where G(u′(t)) is the nonlinear coefficient, the modulation current slope u′(t) is the input, and the beat signal time-frequency f b (t) constructing a data set for output and building a NN model based on the data set;
[0039] Step 3.2: Select a segment from the data set, where the input is C for the modulation current slope and x∈R C×1×W , and then amplify to obtain x1∈R C×H×W , requiring H = W, the output enters the self-attention module, and the weight h0∈R is calculated C×H×W , after normalization by the nonlinear layer, we get h1, which is defined as follows:
[0040] h1 = tanh(attention(h0))
[0041] Step 3.3: Define Mask∈R C×H×W Mask, each row will eventually be converged to 1 by the CNN layer. Each point of the beat frequency signal output will only be affected by the previous point of the corresponding position of the corresponding modulation current slope under the restriction of the Mask mask. The final weight is obtained through the SoftMax layer, and h2 is defined as:
[0042] h2=softmax(h1*Mask)
[0043] Step 3.4: Multiply the additional h2 by x1 to get the output x2∈R after the attention layer C×H×W , transpose x2 to obtain x3∈R C×H×W , after multiple layers of 1×1 convolutional layers, ReLU activation, after the first layer, we get x4∈R C×1024×W , defined as:
[0044] x4=Conv 1×1 (Re LU(x3))
[0045] Step 3.5: After four layers, the number of channels is reduced to 1, and x5∈R is obtained C×1×W , defined as:
[0046] x5=Conv 1×1 {Re LU[Conv 1×1 (Re Lu(Conv 1×1 (x4)))]}
[0047] Remove the second dimension of the output x5 to get the beat signal frequency, where β is the loss function SmoothL1 Loss parameter. The loss function uses the SmoothL1 Loss convergence network. The loss function uses L2Loss when the prediction error is less than β, and uses L1 Loss when the prediction error is greater than β to balance the impact of outliers. The loss function is defined as:
[0048]
[0049] Where x, y are the predicted output and the actual output; z i Defined as:
[0050]
[0051] In the above method, in step 4:
[0052] Action space design: The action space is designed to be one-dimensional, defined as the modulation current slope at each point. Noise is introduced to simulate the error in actual application. The initial value is set to the linear modulation current slope value that needs to be corrected. The action is defined as:
[0053] a i =a0+u i +g i
[0054] Here a0 is the initial value of the modulation current slope; u i Sample the Gaussian strategy for each round to get the action; is the added Gaussian noise; σ n is the standard deviation of Gaussian noise;
[0055] Reward function design: Setting the return function r t for:
[0056] r t =K*|f b (t)-f b |
[0057] Where K is a normalized constant, and f b (t) is the time-frequency of the beat signal predicted by the model, f b is the set target beat signal time-frequency;
[0058] RL agent design based on SAC algorithm: The SAC algorithm introduces entropy regularization. The optimization goal is to maximize the expected return and the entropy of the random strategy at the same time, which is defined as:
[0059]
[0060] Where M is the experience replay pool; s t is the state; t is the action; -log(π(a t |s t )) is the entropy of the random strategy π; R(s t , a t ) is the current state s t Next select action a t Returns; For action a in strategy π t Perform expectation operation on the distribution of In all possible states s t , the expected value is calculated; α is the temperature coefficient, which is the regularization coefficient. At different stages of training, α is dynamically updated adaptively. The larger α is, the stronger the exploratory nature is, which is helpful for strategy learning and reduces the possibility of RL agents falling into local optimality.
[0061] The policy network adopts the Gaussian strategy to select actions, and uses reparameterization to sample action samples from the random strategy of the agent. The loss function of the policy network is:
[0062]
[0063] where π ψ , M is a random strategy, ψ is the parameter of the strategy network; Q μ,i (s t , a t ) are two evaluation networks It means integrating the state and action space, considering all possible combinations of states and actions, and calculating the average value of the expression in these cases; the two action value functions correspond to the value function network with μ1 and μ2 as parameters. Set the value function network parameters to The loss function of the value function network is:
[0064]
[0065] The value of i is 1 or 2; the tuple (s t , aa t , r t ,s t+1 , h) Sample from the experience replay pool M, Q μ,i (s t , aa t ) is the value function network's evaluation of the current state-action pair; is the target value function; h is the termination flag Boolean value; It is the calculation of the expected value of all data sampled from the experience pool M; the convergence error between the two is used to train the value function network, and the soft update of the target value function is defined as:
[0066]
[0067] Where i is 1 or 2; Γ is the soft update ratio parameter; the loss function of the temperature coefficient α is:
[0068]
[0069] Where H is the lower limit of the expected value of the policy entropy, and the target entropy is set to -log4.
[0070] In the above method, step 4 is specifically:
[0071] Based on the SAC algorithm, the RL agent interacts with the NN model. The policy network uses the Gaussian strategy to select actions. The NN model feeds back the environment state after data processing and converts the current state s t With action a t , returns r tThey are all stored in the experience replay pool M, randomly sampled, the value function network is updated, the target value function network is soft-updated, the expected return and the entropy of the random strategy are maximized, the strategy network is updated, and the corrected modulation current slope is output after the final return converges. The corrected modulation current slope is input into the optical dynamic platform to realize nonlinear correction control.
[0072] In the above method, the training process of the RL agent based on the SAC algorithm includes the following steps:
[0073] Step 4.1: Initialize the policy network parameters ψ and the evaluation network parameters μ 1,2 , target evaluation network parameters Initialize temperature coefficient α, experience pool Maximum step size N, maximum number of training rounds E; network update interval T update , learning rate λ μ , ψ , α , soft update ratio Γ parameter;
[0074] Step 4.2, traverse all episodes from episode = 1 to E, and execute:
[0075] Step 4.2.1, initialize the modulation current slope and obtain the initial environmental state s0;
[0076] Step 4.2.2, traverse the round step length t = 0 ~ N, execute:
[0077] Step 4.2.2.1: Gaussian strategy randomly selects the modulation current slope action a t ;
[0078] Step 4.2.2.2: Execute action a t , the environment state is transferred to s t+1 , termination flag Boolean value h, return r t ;
[0079] Step 4.2.2.3, (s t , a t , r t ,s t+1 , h) stored in the experience pool M;
[0080] Step 4.2.2.4, if (tmod T update )==0 then:
[0081] Step 4.2.2.4.1, sample a batch of data sets B from the experience replay pool M;
[0082] Step 4.2.2.4.2, update the critic network parameters,
[0083] Step 4.2.2.4.2, Update actor network parameters,
[0084] Step 4.2.2.4.2. Soft update target actor network parameters μ 1,2 ;
[0085] Step 4.2.2.4.2, Update the temperature coefficient,
[0086] Step 4.2.2.5: If all agents have completed the target point sequence traversal:
[0087] Step 4.2.2.5.1, end the current round, episode←episode+1;
[0088] Step 4.3: Output the corresponding network parameters ψ, μ 1,2 ,
[0089] Compared with the prior art, the present invention has the following beneficial effects:
[0090] 1. The NN model in the present invention is composed of an attention module, a Mask mechanism and a multi-layer CNN network. The weights are calculated by the attention module, and the irrelevant or interfering information in the input data is shielded by the Mask mechanism, so as to successfully fit the time characteristics of the system. The multi-layer CNN network can capture the local and global features of the input data through convolution and pooling operations at different levels, realize multi-scale feature extraction, and help capture data characteristics at different levels, thereby improving the generalization ability and classification accuracy of the model;
[0091] Second, the present invention uses the attention module to calculate weights. The attention module can make the network pay more attention to the key information in the input and improve the network's ability to process complex data. Here, the attention module is designed to calculate weights as a fully connected layer, which simplifies the network and improves the training speed;
[0092] 3. The present invention utilizes the NN model to fit the system characteristics. The NN model can self-adjust and optimize parameters and extract key features by learning the patterns and rules in the data set. It has advantages in characterizing complex nonlinear relationships. The NN model can reduce the need for expert knowledge and manual intervention through self-learning and adjustment, and reduce the difficulty of operation and human errors. In addition, the NN model has a certain error tolerance capability and can provide relatively stable and reliable output even if there is a certain degree of noise or defects in the data.
[0093] Fourth, the present invention builds an RL agent based on the SAC algorithm. The SAC algorithm introduces the maximum entropy principle, encourages exploratory behavior by maximizing the entropy of the strategy, and uses the temperature parameter to adjust the contribution of the policy entropy. While ensuring robustness, SAC can also continue to conduct effective exploration, and introduces soft updates of the target network to improve the stability of the algorithm convergence. In addition, its training process is less sensitive to the selection of hyperparameters, and the parameter adjustment work is relatively simple;
[0094] 5. The present invention realizes nonlinear correction based on the NN model and the SAC algorithm. The intelligent control method reduces the dependence on high-precision devices, thereby helping to reduce the cost of the entire system. In addition, the intelligent correction method enables the system to adapt to changing operating environments and working conditions and has better environmental adaptability. The present invention effectively corrects the nonlinearity in the FMCW ranging process by accurately controlling the frequency tuning process, thereby significantly improving the ranging accuracy of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0095] Figure 1 It is a structural diagram of the method of the present invention;
[0096] Figure 2 It is a schematic diagram of the system of the present invention;
[0097] Figure 3 This is a nonlinear uncorrected beat frequency signal effect diagram in the present invention;
[0098] Figure 4 It is a time-frequency diagram of a single-cycle beat frequency signal that has not been corrected for nonlinearity and has undergone data preprocessing in the present invention;
[0099] Figure 5 It is a schematic diagram of the structure of NN modeling in the present invention;
[0100] Figure 6 It is a schematic diagram of the structure of the RL agent based on the SAC algorithm in the present invention;
[0101] Figure 7 This is a diagram showing the effect of the beat frequency signal after correction by the nonlinear correction method based on NN modeling and SAC algorithm in the present invention. DETAILED DESCRIPTION
[0102] The present invention will be further described below in conjunction with the accompanying drawings and specific implementation methods.
[0103] The FMCW ranging method is widely used in the field of laser ranging. However, the inherent nonlinear characteristics of tunable lasers are the bottleneck that restricts the improvement of its accuracy. In order to cope with the influence of nonlinear factors on the ranging accuracy in FMCW laser ranging, researchers at home and abroad are actively exploring various methods and technologies. Traditional nonlinear correction methods include: frequency modulation nonlinear correction methods based on phase-locked principle, sampling principle, frequency comb, iterative algorithm, sideband modulation technology and other mechanisms. Although these methods have been verified to be effective in theory, these correction technologies have the defects of relying on complex physical theory deduction, being difficult to balance control accuracy and system complexity, generally relying on manual adjustment and fine operation of experts, and having low automation and intelligence. In contrast, the present invention proposes a nonlinear correction method for FMCW laser ranging light source based on NN modeling and SAC algorithm.
[0104] like Figure 1 As shown, the present invention proposes a nonlinear correction method for FMCW laser ranging light source based on NN modeling and SAC algorithm, which is characterized by comprising:
[0105] Step 1: Design and build the FMCW laser nonlinear dynamic system platform, such as Figure 2 As shown;
[0106] The step 1 is specifically as follows:
[0107] Step 1.1: Design the FMCW laser nonlinear ranging dynamic system, take the modulation current slope as input, use MATLAB data processing, and store the generated modulation current data in FPGA, and then enter the laser driving part. The laser driving part is designed as a current controller (LDD) and a temperature controller (TEC), which are used to generate modulation signals to drive the semiconductor laser and control the temperature of the laser respectively;
[0108] Step 1.2: Drive the 1550nm band DFB laser to emit laser, connect the output end to the isolator and attenuator, enter the interferometer to simulate ranging to obtain the beat frequency signal, and use the photoelectric detector PD to detect the optical signal;
[0109] Step 1.3: Collect data based on the FMCW laser nonlinear ranging dynamic system built in step 2. The oscilloscope saves the PD detection light signal and outputs a 2500-point beat frequency signal, such as Figure 3 The figure shows the effect of a nonlinear uncorrected beat frequency signal.
[0110] Step 2: Collect and process the data obtained in step 1 to construct a data set;
[0111] The step 2 is specifically as follows:
[0112] Step 2.1, collect data, the oscilloscope saves the output as a 2500-point beat frequency signal, the sampling points are 2500 points per cycle, first filter, then perform Hilbert transform to obtain a complex signal, select 250-1950 points for modeling and correction, accounting for 83% of the full cycle, use the modulation current slope as input and the beat frequency signal time-frequency as output to construct a data set, such as Figure 4 The figure shows the time-frequency diagram of a single-cycle beat frequency signal without nonlinear correction and after data preprocessing;
[0113] Step 2.2: Based on the FMCW ranging principle, a NN model is constructed to fit the system characteristics. According to the data set constructed in step 2, 80% is used as the training set and 20% is used as the test set to train and test the NN model.
[0114] Step 3: Design a nonlinear correction process based on the NN model and use the SAC algorithm for correction, such as Figure 5 Shown is a schematic diagram of the structure of NN modeling in the present invention;
[0115] The step 3 is specifically as follows:
[0116] Step 3.1: Construct a data set with the modulation current slope as input and the beat signal time-frequency as output, and construct a NN model based on the data set, as follows:
[0117] In a single cycle, the linear tuning frequency of the laser is expressed as:
[0118] w(t)=w0+F(u(t))
[0119] Where W0 is the initial frequency of the laser sweep, which refers to the starting value of the optical frequency output by the laser before the start of the sweep; t is time; u(t) is the modulation current, and F(·) describes the nonlinear relationship between the laser frequency and the modulation signal; ξ is the sweep rate of the swept laser, that is, the size of the frequency range swept per unit time; the sweep rate ξ can be expressed as:
[0120]
[0121] The electric field intensity of the light source is expressed as:
[0122]
[0123] Where E0 represents the average light intensity; represents the initial phase of the light source, and after an optical path difference of τ, the distance measurement is simulated by the Mach-Zehnder interferometer, and the electric field intensity of the measured light is expressed as:
[0124]
[0125] Where E1 represents the average light intensity. The beat signal is obtained by the interference of the measured light and the emitted light. The beat signal is detected by PD. When light irradiates the PD, the photons will excite the carriers in the PD, thereby generating current. The beat signal detected by the PD is actually the current change caused by the intensity change of the light signal. The beat signal is expressed as:
[0126]
[0127] Where I0 is the beat frequency signal strength, since τ is in the nanosecond order, ξτ 2 / 2 can be ignored compared to w0τ+ξτt, so the beat frequency signal can be simplified to:
[0128] i(t)=|e0(t)+e1(t)| 2 =I0cos(w0τ+ξτt)
[0129] The frequency f of the beat signal can be obtained b for:
[0130] f b =ξτ
[0131] The frequency sweep bandwidth of the light source is B = ξT, where T is the modulation period; the frequency sweep bandwidth is B, so the distance d calculation formula of the FMCW laser ranging system is:
[0132]
[0133] Where c is the speed of light in a vacuum; n is the refractive index of light in the measurement medium, and the beat signal frequency f is b The relationship between (t) and the modulation current slope u′(t) is:
[0134] f b (t) = τG(u′(t))
[0135] Where G(u′(t)) is the nonlinear coefficient, the modulation current slope u′(t) is the input, and the beat signal time-frequency f b (t) constructing a data set for output and building a NN model based on the data set;
[0136] Step 3.2: Select a segment from the data set. The input is C for the modulation current slope and x∈R C×1×W , and then amplify to obtain x1∈R C×H×W , requiring H = W, the output enters the self-attention module, and the weight h0∈R is calculated C×H×W , after normalization by the nonlinear layer, we get h1, which is defined as follows:
[0137] h1 = tanh(attention(h0))
[0138] Step 3.3: Define Mask∈R C×H×W Mask, each row will eventually be converged to 1 by the CNN layer. Each point of the beat frequency signal output will only be affected by the previous point of the corresponding position of the corresponding modulation current slope under the restriction of the Mask mask. The final weight is obtained through the SoftMax layer, and h2 is defined as:
[0139] h2=softmax(h1*Mask)
[0140] Step 3.4: Multiply the additional h2 by x1 to get the output x2∈R after the attention layer C×H×W , transpose x2 to obtain x3∈R C×H×W , after multiple layers of 1×1 convolutional layers, ReLU activation, after the first layer, we get x4∈R C×1024×W , defined as:
[0141] x4=Conv 1×1 (Re LU(x3))
[0142] Step 3.5: After four layers, the number of channels is reduced to 1, and x5∈R is obtained C×1×W , defined as:
[0143] x5=Conv 1×1 {Re LU[Conv 1×1 (Re Lu(Conv 1×1 (x4)))]}
[0144] Remove the second dimension of the output x5 to get the beat signal frequency, where β is the loss function SmoothL1 Loss parameter. The loss function uses the SmoothL1 Loss convergence network. The loss function uses L2Loss when the prediction error is less than β, and uses L1 Loss when the prediction error is greater than β to balance the impact of outliers. The loss function is defined as:
[0145]
[0146] Where x, y are the predicted output and the actual output; z i Defined as:
[0147]
[0148] Step 4: Based on the NN model in step 3, the nonlinear correction process is designed as a Markov decision process. The RL agent is designed based on the SAC algorithm. The RL is used to correct the slope of the modulation current to achieve the nonlinear correction of the FMCW laser ranging light source, such as Figure 6 Shown is a schematic diagram of the structure of the RL agent based on the SAC algorithm.
[0149] In step 4:
[0150] Action space design: The action space is designed to be one-dimensional, defined as the modulation current slope at each point. Noise is introduced to simulate the error in actual application. The initial value is set to the linear modulation current slope value that needs to be corrected. The action is defined as:
[0151] a i =a0+u i +g i
[0152] Here a0 is the initial value of the modulation current slope; u i Sample the Gaussian strategy for each round to get the action; is the added Gaussian noise; σ n is the standard deviation of Gaussian noise;
[0153] Reward function design: Setting the return function r t for:
[0154] r t =K*|f b (t)-f b |
[0155] Where K is a normalized constant, and f b (t) is the time-frequency of the beat signal predicted by the model, f b is the set target beat signal time-frequency;
[0156] RL agent design based on SAC algorithm: The SAC algorithm introduces entropy regularization. The optimization goal is to maximize the expected return and the entropy of the random strategy at the same time, which is defined as:
[0157]
[0158] Where M is the experience replay pool; s t is the state; t is the action; -log(π(a t |s t ))] is the entropy of the random strategy π; R(s t , a t ) is the current state s t Next select action a t Returns; For action a in strategy π t Perform expectation operation on the distribution of Indicates that in all possible states s t, the expected value is calculated; α is the temperature coefficient, which is the regularization coefficient. At different stages of training, α is dynamically updated adaptively. The larger α is, the stronger the exploratory nature is, which is helpful for strategy learning and reduces the possibility of RL agents falling into local optimality.
[0159] The policy network adopts the Gaussian strategy to select actions, and uses reparameterization to sample action samples from the random strategy of the agent. The loss function of the policy network is:
[0160]
[0161] where π ψ , M is a random strategy, ψ is the parameter of the strategy network; Q μ,i (s t , a t ) are two evaluation networks It means integrating the state and action space, considering all possible combinations of states and actions, and calculating the average value of the expression in these cases; the two action value functions correspond to the value function network with μ1 and μ2 as parameters. Set the value function network parameters to The loss function of the value function network is:
[0162]
[0163] The value of i is 1 or 2; the tuple (s t , a t , r t ,s t+1 , h) Sample from the experience replay pool M, Q μ,i (s t , a t ) is the value function network's evaluation of the current state-action pair; is the target value function; h is the termination flag Boolean value; It is the calculation of the expected value of all data sampled from the experience pool M; the convergence error between the two is used to train the value function network, and the soft update of the target value function is defined as:
[0164]
[0165] Where i is 1 or 2; Γ is the soft update ratio parameter; the loss function of the temperature coefficient α is:
[0166]
[0167] Where H is the lower limit of the expected value of the policy entropy, and the target entropy is set to -log4.
[0168] In the above method, step 4 is specifically:
[0169] Based on the SAC algorithm, the RL agent interacts with the NN model. The policy network uses the Gaussian strategy to select actions. The NN model feeds back the environment state after data processing and converts the current state s t With action a t , returns r t They are all stored in the experience replay pool M, randomly sampled, the value function network is updated, the target value function network is soft-updated, the expected return and the entropy of the random strategy are maximized, the strategy network is updated, and the corrected modulation current slope is output after the final return converges. The corrected modulation current slope is input into the optical dynamic platform to realize nonlinear correction control.
[0170] In the above method, the training process of the RL agent based on the SAC algorithm includes the following steps:
[0171] Step 4.1: Initialize the policy network parameters ψ and the evaluation network parameters μ 1,2 , target evaluation network parameters Initialize temperature coefficient α, experience pool Maximum step size N, maximum number of training rounds E; network update interval T update , learning rate λ μ , ψ , α , soft update ratio Γ parameter;
[0172] Step 4.2, traverse all episodes from episode = 1 to E, and execute:
[0173] Step 4.2.1, initialize the modulation current slope and obtain the initial environmental state s0;
[0174] Step 4.2.2, traverse the round step length t = 0 ~ N, execute:
[0175] Step 4.2.2.1: Gaussian strategy randomly selects the modulation current slope action a t ;
[0176] Step 4.2.2.2: Execute action a t , the environment state is transferred to s t+1 , termination flag Boolean value h, return r t ;
[0177] Step 4.2.2.3, (s t , a t , r t ,s t+1 , h) stored in the experience pool M;
[0178] Step 4.2.2.4, if (tmod Tupdate )==0 then:
[0179] Step 4.2.2.4.1, sample a batch of data sets B from the experience replay pool M;
[0180] Step 4.2.2.4.2, update the critic network parameters,
[0181] Step 4.2.2.4.2, Update actor network parameters,
[0182] Step 4.2.2.4.2. Soft update target actor network parameters μ 1,2 ;
[0183] Step 4.2.2.4.2, Update the temperature coefficient,
[0184] Step 4.2.2.5: If all agents have completed the target point sequence traversal:
[0185] Step 4.2.2.5.1, end the current round, episode←episode+1;
[0186] Step 4.3: Output the corresponding network parameters ψ, μ 1,2 ,
[0187] The final correction effect is as follows Figure 7 ,The FMCW laser ranging light source nonlinear correction method based on NN modeling and SAC algorithm successfully realizes nonlinear correction and improves the quality and accuracy of FMCW ranging.
[0188] The present invention effectively corrects the nonlinear chirp phenomenon occurring in the frequency tuning process of the laser in the FMCW laser radar system by adopting a nonlinear chirp control method based on the NN model and the SAC algorithm. The process optimizes the frequency tuning behavior of the laser, reduces the nonlinear distortion caused by the nonlinear characteristics of the laser itself and the thermal effect, and improves the measurement accuracy and system performance. In addition, the intelligent control method reduces the dependence on high-precision devices, thereby helping to reduce the cost of the entire system. The intelligent correction method enables the system to adapt to changing operating environments and working conditions, and has better environmental adaptability.
[0189] The above are only representative embodiments of the present invention in many specific application scopes, and do not constitute any limitation on the protection scope of the present invention. Any technical solutions formed by transformation or equivalent replacement fall within the protection scope of the present invention.
Claims
1. A nonlinear correction method for FMCW laser ranging light source based on NN modeling and SAC algorithm, characterized in that: include: Step 1: Design and build the FMCW laser nonlinear dynamic system platform; Step 2: Collect and process the data obtained in step 1 to construct a data set; Step 3: Design a nonlinear correction process based on the NN model and use the SAC algorithm for correction; Step 4: According to the NN model in step 3, the nonlinear correction process is designed as a Markov decision process. The RL agent is designed based on the SAC algorithm. The modulation current slope is corrected by RL to realize the nonlinear correction of the FMCW laser ranging light source.
2. According to claim 1, a FMCW laser ranging light source nonlinear correction method based on NN modeling and SAC algorithm is characterized by: The step 1 is specifically as follows: Step 1.1: Design the FMCW laser nonlinear ranging dynamic system, take the modulation current slope as input, use MATLAB data processing, and store the generated modulation current data in FPGA, and then enter the laser driving part. The laser driving part is designed as a current controller and a temperature controller, which are used to generate modulation signals to drive the semiconductor laser and control the temperature of the laser respectively; Step 1.2: Drive the 1550nm band DFB laser to emit laser, connect the output end to the isolator and attenuator, enter the interferometer to simulate ranging to obtain the beat frequency signal, and use the photoelectric detector PD to detect the optical signal; Step 1.3: Collect data based on the FMCW laser nonlinear ranging dynamic system built in step 2. The oscilloscope saves the PD detection light signal and outputs a 2500-point beat frequency signal.
3. The nonlinear correction method for FMCW laser ranging light source based on NN modeling and SAC algorithm according to claim 1 is characterized in that: The step 2 is specifically as follows: Step 2.1, collect data, the oscilloscope saves the output as a 2500-point beat frequency signal, the number of sampling points is 2500 points per cycle, first filter, then perform Hilbert transform to obtain a complex signal, select 250-1950 points for modeling and correction, accounting for 83% of the full cycle, use the modulation current slope as input and the beat frequency signal time-frequency as output to construct a data set; Step 2.2: Based on the FMCW ranging principle, a NN model is constructed to fit the system characteristics. According to the data set constructed in step 2, 80% is used as the training set and 20% is used as the test set to train and test the NN model.
4. The nonlinear correction method for FMCW laser ranging light source based on NN modeling and SAC algorithm according to claim 1 is characterized in that: The step 3 is specifically as follows: Step 3.1: Construct a data set with the modulation current slope as input and the beat signal time-frequency as output, and construct a NN model based on the data set, as follows: In a single cycle, the linear tuning frequency of the laser is expressed as: w(t)=w0+F(u(t)) Where w0 is the initial frequency of the laser sweep, which refers to the starting value of the optical frequency output by the laser before the start of the sweep; t is time; u(t) is the modulation current, and F(·) describes the nonlinear relationship between the laser frequency and the modulation signal; ξ is the sweep rate of the swept laser, that is, the size of the frequency range swept per unit time; the sweep rate ξ can be expressed as: The electric field intensity of the light source is expressed as: Where E0 represents the average light intensity; represents the initial phase of the light source, and after an optical path difference of τ, the distance measurement is simulated by the Mach-Zehnder interferometer, and the electric field intensity of the measured light is expressed as: Where E1 represents the average light intensity. The beat signal is obtained by the interference of the measured light and the emitted light. The beat signal is detected by PD. When light irradiates the PD, the photons will excite the carriers in the PD, thereby generating current. The beat signal detected by the PD is actually the current change caused by the intensity change of the light signal. The beat signal is expressed as: Where I0 is the beat frequency signal strength, since τ is in the nanosecond order, ξτ 2 / 2 can be ignored compared to w0τ+ξτt, so the beat frequency signal can be simplified to: i(t)=|e0(t)+e1(t)| 2 =I0cos(w0τ+ξτt) The frequency f of the beat signal can be obtained b for: f b =ξτ The frequency sweep bandwidth of the light source is B = ξf; where T is the modulation period; the frequency sweep bandwidth is B, so the distance d calculation formula of the FMCW laser ranging system is: Where c is the speed of light in vacuum; n is the refractive index of light in the measurement medium, and the beat signal frequency f is b The relationship between (t) and the modulation current slope u′(t) is: f b (t)=τG(u′(t)) Where G(u′(t)) is the nonlinear coefficient, the modulation current slope u′(t) is the input, and the beat signal time-frequency f b (t) constructing a data set for output and building a NN model based on the data set; Step 3.2: Select a segment from the data set, where the input is C for the modulation current slope and x∈R C×1×W , and then amplify to obtain x1∈R C×H×W , requiring H = W, the output enters the self-attention module, and the weight h0∈R is calculated C×H×W , after normalization by the nonlinear layer, we get h1, which is defined as follows: h1 = tanh(attention(h0)) Step 3.3: Define Mask∈R C×H×W Mask, each row will eventually be converged to 1 by the CNN layer. Each point of the beat frequency signal output will only be affected by the previous point of the corresponding position of the corresponding modulation current slope under the restriction of the Mask mask. The final weight is obtained through the SoftMax layer, and h2 is defined as: h2=softmax(h1*Mask) Step 3.4: Multiply the additional h2 by x1 to get the output x2∈R after the attention layer C×H×W , transpose x2 to obtain x3∈R C×H×W , after multiple layers of 1×1 convolutional layers, ReLU activation, after the first layer, we get x4∈R C×1024×W , defined as: x4=Conv 1×1 (ReLU(x3)) Step 3.5: After four layers, the number of channels is reduced to 1, and x5∈R is obtained C×1×W , defined as: x5=Conv 1×1 {ReLU[Conv 1×1 (ReLu(Conv 1×1 (x4)))]} Remove the second dimension of the output x5 to get the beat signal frequency, where β is the loss function SmoothL1 Loss parameter. The loss function uses the SmoothL1 Loss convergence network. The loss function uses L2Loss when the prediction error is less than β, and uses L1 Loss when the prediction error is greater than β to balance the impact of outliers. The loss function is defined as: Where x, y are the predicted output and the actual output; z i Defined as:
5. The nonlinear correction method for FMCW laser ranging light source based on NN modeling and SAC algorithm according to claim 1 is characterized in that: In step 4: Action space design: The action space is designed to be one-dimensional, defined as the modulation current slope at each point. Noise is introduced to simulate the error in actual application. The initial value is set to the linear modulation current slope value that needs to be corrected. The action is defined as: a i =a0+u i +g i Here a0 is the initial value of the modulation current slope; u i Sample the Gaussian strategy for each round to get the action; is the added Gaussian noise; σ n is the standard deviation of Gaussian noise; Reward function design: Setting the return function r t for: r t =K*|f b (t)-f b | Where K is a normalized constant, and f b (t) is the time-frequency of the beat signal predicted by the model, f b is the set target beat signal time-frequency; RL agent design based on SAC algorithm: The SAC algorithm introduces entropy regularization. The optimization goal is to maximize the expected return and the entropy of the random strategy at the same time, which is defined as: Where M is the experience replay pool; s t is the state; t is the action; -log(π(a t |s t )) is the entropy of the random strategy π; R(s t , a t ) is the current state s t Next select action a t Returns; For action a in strategy π t Perform expectation operation on the distribution of In all possible states s t , the expected value is calculated; α is the temperature coefficient, which is the regularization coefficient. At different stages of training, α is dynamically updated adaptively. The larger α is, the stronger the exploratory nature is, which is helpful for strategy learning and reduces the possibility of RL agents falling into local optimality. The policy network adopts the Gaussian strategy to select actions, and uses reparameterization to sample action samples from the random strategy of the agent. The loss function of the policy network is: where π ψ’ M is a random strategy, ψ is the parameter of the strategy network; Q μ,i (s t , a t ) are two evaluation networks It means integrating the state and action space, considering all possible combinations of states and actions, and calculating the average value of the expression in these cases; the two action value functions correspond to the value function network with μ1 and μ2 as parameters. Set the value function network parameters to The loss function of the value function network is: The value of i is 1 or 2; the tuple (s t , a t , r t ,s t+1 , h) Sampling from the experience replay pool M, Q μ,i (s t , a t ) is the value function network's evaluation of the current state-action pair; is the target value function; h is the termination flag Boolean value; It is the calculation of the expected value of all data sampled from the experience pool M; the convergence error between the two is used to train the value function network, and the soft update of the target value function is defined as: Where i is 1 or 2; Γ is the soft update ratio parameter; the loss function of the temperature coefficient α is: in is the expected lower limit of the policy entropy, and the target entropy is set to -log4.
6. The nonlinear correction method for FMCW laser ranging light source based on NN modeling and SAC algorithm according to claim 5 is characterized by: The step 4 is specifically as follows: Based on the SAC algorithm, the RL agent interacts with the NN model. The policy network uses the Gaussian strategy to select actions. The NN model feeds back the environment state after data processing and converts the current state s t With action a t , returns r t They are all stored in the experience replay pool M, randomly sampled, the value function network is updated, the target value function network is soft-updated, the expected return and the entropy of the random strategy are maximized, the strategy network is updated, and the corrected modulation current slope is output after the final return converges. The corrected modulation current slope is input into the optical dynamic platform to realize nonlinear correction control.
7. The nonlinear correction method for FMCW laser ranging light source based on NN modeling and SAC algorithm according to claim 6 is characterized by: The training process of the RL agent based on the SAC algorithm includes the following steps: Step 4.1: Initialize the policy network parameters ψ and the evaluation network parameters μ 1,2 , target evaluation network parameters Initialize temperature coefficient α, experience pool Maximum step size N, maximum number of training rounds E; network update interval T update , learning rate λ μ , ψ , α , soft update ratio Γ parameter; Step 4.2, traverse all episodes from episode = 1 to E, and execute: Step 4.2.1, initialize the modulation current slope and obtain the initial environmental state s0; Step 4.2.2, traverse the round step length t = 0 ~ N, execute: Step 4.2.2.1: Gaussian strategy randomly selects the modulation current slope action a t ; Step 4.2.2.2: Execute action a t , the environment state is transferred to s t+1 , termination flag Boolean value h, return r t ; Step 4.2.2.3, (s t , a t , r t ,s t+1 , h) stored in the experience pool M; Step 4.2.2.4, if (tmod T update )==0 then: Step 4.2.2.4.1, sample a batch of data sets B from the experience replay pool M; Step 4.2.2.4.2, update the critic network parameters, Step 4.2.2.4.2, Update actor network parameters, Step 4.2.2.4.
2. Soft update target actor network parameters μ 1,2 ; Step 4.2.2.4.2, Update the temperature coefficient, Step 4.2.2.5: If all agents have completed the target point sequence traversal: Step 4.2.2.5.1, end the current round, episode←episode+1; Step 4.3: Output the corresponding network parameters ψ, μ 1,2 ,
Citation Information
Cited By
Laser focusing spot position positioning and monitoring device
CN119870772A
Adaptive laser frequency stability control method based on reinforcement learning algorithm
CN120085548A
