Disclosure of Invention
The invention provides a grating ruler measurement error compensation method for overcoming the technical defect that the measurement accuracy of a grating ruler is often influenced by various error factors.
In order to solve the technical problems, the technical scheme of the invention is as follows:
a grating ruler measurement error compensation method comprises the following steps:
s1, constructing an initial error compensation model and a multi-dimensional bounded optimization model;
the initial error compensation model includes a sub-pixel level positioning network, a decoding layer and a task space,
The multi-dimensional bounded optimization model is established by taking a coupling error of a minimum multi-interference factor as an objective function;
S2, extracting a sub-pixel code channel positioning map by a sub-pixel level positioning network according to the input grating image;
s3, constructing a regression tree in a task space according to the sub-pixel code channel locating diagram, outputting regression results related to each interference factor and migrating the regression results to a multi-dimensional bounded optimization model;
s4, feeding back compensation conditions to the sub-pixel level positioning network according to the regression result by using the multi-dimensional bounded optimization model;
And S5, extracting a new sub-pixel code channel positioning map by the sub-pixel level positioning network according to the compensation condition, inputting the new sub-pixel code channel positioning map into a decoding layer, taking the output decoding result as an accurate measurement result, and completing the measurement error compensation of the grating ruler.
In the scheme, an initial error compensation model and a multi-dimensional bounded optimization model are constructed, the initial error compensation model and the multi-dimensional bounded optimization model are fused through parameter migration, regression results related to all interference factors are obtained according to a grating image during measurement, corresponding compensation conditions are fed back by the multi-dimensional bounded optimization model, and finally accurate measurement results are obtained according to the compensation conditions, so that the error compensation of the grating ruler for measuring the multi-interference factors is realized.
Preferably, the sub-pixel code track map is extracted from the input raster image by:
A1, extracting a multi-scale feature subgraph from an input grating image;
a2, carrying out code channel rough positioning according to the multi-scale characteristic subgraph to obtain a rough code channel positioning graph;
A3, obtaining a sub-pixel code channel locating map according to the multi-scale characteristic subgraph and the coarse code channel locating map.
Preferably, the decoding layer obtains the decoding result by adopting a table look-up mode.
Preferably, the reward function of constructing the regression tree is:
Wherein R i represents the value of the bonus function at the current time, R i-1 represents the value of the bonus function at the previous time, P π represents the conversion function of the task space and the feature set under the current strategy, Representing the mathematical transpose of the transfer function, pi R representing the R-dimension representation of the parameter s, a representing the error value corresponding to the parameter s at the current time, and D representing the set of image features.
Preferably, a source task iteration strategy is introduced to accelerate migration learning:
Qt+τ(st,′)=(1-a′)Qt(st+′)
+′[Q(St,′)+(St+a,′)+…+(st+τ-1,′)/
Wherein Q t+τ(st,′) represents an action cost function of the target scale error compensation model, t represents the number of iterations, S t represents a state quantity at t iterations, a ′ represents a proportional coefficient of the allocated action cost function, Q t(st +a ') represents an action cost function of the source scale error compensation model, α' represents an action, Q (·) represents a cost function, S t+1 represents a state quantity at t+1, S t+τ-1 represents a state quantity at a previous time, and τ represents the number of subtasks.
Preferably, the disturbance factors include temperature errors and vibration errors.
Preferably, the multidimensional bounded optimization model is:
s.t.t1≥T≥t2
f1≥F≥f2
a1≥A≥a2
wherein, C' (. Cndot.) represents a multi-interference factor coupling error, e 1 (T) represents a temperature error, e 2 (A, F) represents a vibration error, T represents a temperature of a grating scale working environment, A represents a vibration amplitude of the grating scale working environment, F represents a vibration frequency of the grating scale working environment, T 1 represents an upper temperature boundary of the grating scale working environment, T 2 represents a lower temperature boundary of the grating scale working environment, F 1 represents an upper vibration frequency boundary of the grating scale working environment, F 2 represents a lower vibration frequency boundary of the grating scale working environment, a 1 represents an upper vibration amplitude boundary of the grating scale working environment, and a 2 represents a lower vibration amplitude boundary of the grating scale working environment.
Preferably, the method further comprises the constraint condition of optimizing the multidimensional bounded optimization model, specifically:
and dividing the interference factor intervals based on a K-means clustering method, respectively calculating errors of temperature, frequency and amplitude, respectively calculating the support degree and the confidence coefficient of the errors, measuring a dullness candidate interval set between the interference factors and the errors, and selecting an interval for obviously inhibiting the grating ruler errors.
Preferably, the method further comprises the following steps:
under the constraint condition of optimization, converting the multidimensional bounded optimization model into the following unconstrained optimization problem:
Wherein I α (·) represents a penalty function, t i represents an upper or lower bound to the temperature of the grating scale working environment, f i represents an upper or lower bound to the frequency of the grating scale working environment, a i represents an upper or lower bound to the amplitude of the grating scale working environment, u represents a calculation parameter of the penalty function, and α represents an Indicator function approximation factor.
Preferably, the regression result S n is a set of error parameters including temperature error and vibration error.
Compared with the prior art, the technical scheme of the invention has the beneficial effects that:
The invention provides a grating ruler measurement error compensation method, which comprises the steps of constructing an initial error compensation model and a multi-dimensional bounded optimization model, fusing the initial error compensation model and the multi-dimensional bounded optimization model through parameter migration, acquiring a regression result associated with each interference factor according to a grating image during measurement, feeding back corresponding compensation conditions through the multi-dimensional bounded optimization model, and finally obtaining an accurate measurement result according to the compensation conditions to realize the grating ruler measurement multi-interference factor error compensation.
Detailed Description
The drawings are for illustrative purposes only and are not to be construed as limiting the present patent;
for the purpose of better illustrating the embodiments, certain elements of the drawings may be omitted, enlarged or reduced and do not represent the actual product dimensions;
It will be appreciated by those skilled in the art that certain well-known structures in the drawings and descriptions thereof may be omitted.
The technical scheme of the invention is further described below with reference to the accompanying drawings and examples.
Example 1
As shown in fig. 1, a method for compensating measuring errors of a grating ruler comprises the following steps:
s1, constructing an initial error compensation model and a multi-dimensional bounded optimization model;
the initial error compensation model includes a sub-pixel level positioning network, a decoding layer and a task space,
The multi-dimensional bounded optimization model is established by taking a coupling error of a minimum multi-interference factor as an objective function;
S2, extracting a sub-pixel code channel positioning map by a sub-pixel level positioning network according to the input grating image;
s3, constructing a regression tree in a task space according to the sub-pixel code channel locating diagram, outputting regression results related to each interference factor and migrating the regression results to a multi-dimensional bounded optimization model;
s4, feeding back compensation conditions to the sub-pixel level positioning network according to the regression result by using the multi-dimensional bounded optimization model;
And S5, extracting a new sub-pixel code channel positioning map by the sub-pixel level positioning network according to the compensation condition, inputting the new sub-pixel code channel positioning map into a decoding layer, taking the output decoding result as an accurate measurement result, and completing the measurement error compensation of the grating ruler.
In the specific implementation process, an initial error compensation model and a multi-dimensional bounded optimization model are constructed, the initial error compensation model and the multi-dimensional bounded optimization model are fused through parameter migration, regression results related to all interference factors are obtained according to grating images during measurement, corresponding compensation conditions are fed back through the multi-dimensional bounded optimization model, and finally accurate measurement results are obtained according to the compensation conditions, so that the error compensation of measuring the multi-interference factors by a grating ruler is realized.
Example 2
A grating ruler measurement error compensation method comprises the following steps:
s1, constructing an initial error compensation model and a multi-dimensional bounded optimization model;
the initial error compensation model includes a sub-pixel level positioning network, a decoding layer and a task space,
More specifically, the decoding layer obtains a decoding result by adopting a table look-up mode, and the coding layer in the decoding layer generates corresponding codes based on a laser etching mode of absolute coding stripes on the glass substrate.
The multi-dimensional bounded optimization model is established by taking a coupling error of a minimum multi-interference factor as an objective function;
S2, extracting a sub-pixel code channel positioning map by a sub-pixel level positioning network according to the input grating image;
More specifically, the sub-pixel code channel localization map is extracted from the input raster image by:
A1, extracting a multi-scale feature subgraph from an input grating image;
a2, carrying out code channel rough positioning according to the multi-scale characteristic subgraph to obtain a rough code channel positioning graph;
A3, obtaining a sub-pixel code channel locating map according to the multi-scale characteristic subgraph and the coarse code channel locating map.
S3, constructing a regression tree in a task space according to the sub-pixel code channel locating diagram, outputting regression results related to each interference factor and migrating the regression results to a multi-dimensional bounded optimization model;
In the specific implementation process, as shown in fig. 2, a regression tree is constructed by dividing the task space through an iteration step, and features of the task space are extracted through an optimization step by using a markov process. The iterative step carries out regression operation on different error types in the task space, carries out linear regression on each group of data to obtain respective corresponding temperature error, vibration error and amplitude error, and the optimization step carries out characteristic extraction on the input image, including but not limited to inclination angle, vibration degree, image definition and the like, and prepares parameters for fusion, namely migration learning, of the next step and a multidimensional bounded constraint model. The subtasks include task nodes which are various image characterizations, the root task is a decoding task in a new environment, and the subtasks are equivalent to dividing the following tasks, so that the task processing speed is improved.
More specifically, the reward function of constructing the regression tree is:
Wherein R i represents the value of the bonus function at the current time, R i-1 represents the value of the bonus function at the previous time, P π represents the conversion function of the task space and the feature set under the current strategy, Representing the mathematical transpose of the transfer function, pi R representing the R-dimension representation of the parameter s, a representing the error value corresponding to the parameter s at the current time, and D representing the set of image features.
More specifically, a source task iteration strategy is introduced to accelerate migration learning:
Qt+τ(st,′)=(1-a′)Qt(st+′)
+′[Q(St,′)+(St+1,′)+…+(st+τ-1,′)/
Wherein Q t+τ(st,′) represents an action cost function of the target scale error compensation model, t represents the number of iterations, S t represents a state quantity at t iterations, a ′ represents a proportional coefficient of the allocated action cost function, Q t(st+′) represents an action cost function of the source scale error compensation model, α ′ represents an action, Q (·) represents a cost function, S t+1 represents a state quantity at t+1, S t+τ-1 represents a state quantity at a previous time, and τ represents the number of subtasks.
In the specific implementation process, the correction degree of the model parameters of the new reward function is judged through the action acceleration function.
S4, feeding back compensation conditions to the sub-pixel level positioning network according to the regression result by using the multi-dimensional bounded optimization model;
And S5, extracting a new sub-pixel code channel positioning map by the sub-pixel level positioning network according to the compensation condition, inputting the new sub-pixel code channel positioning map into a decoding layer, taking the output decoding result as an accurate measurement result, and completing the measurement error compensation of the grating ruler.
Example 3
A grating ruler measurement error compensation method comprises the following steps:
s1, constructing an initial error compensation model and a multi-dimensional bounded optimization model;
the initial error compensation model includes a sub-pixel level positioning network, a decoding layer and a task space,
More specifically, the decoding layer obtains a decoding result by adopting a table look-up mode, and the coding layer in the decoding layer generates corresponding codes based on a laser etching mode of absolute coding stripes on the glass substrate.
The multi-dimensional bounded optimization model is established by taking a coupling error of a minimum multi-interference factor as an objective function;
more specifically, the disturbance factors include a temperature error and a vibration error.
More specifically, the multidimensional bounded optimization model is:
s.t.t1≥T≥t2
f1≥F≥f2
a1≥A≥a2
Wherein ′ (·) represents a multi-interference factor coupling error, e 1 () represents a temperature error, e 2 (, F) represents a vibration error, T represents a temperature of a grating scale working environment, a represents a vibration amplitude of the grating scale working environment, F represents a vibration frequency of the grating scale working environment, T 1 represents an upper temperature boundary of the grating scale working environment, T 2 represents a lower temperature boundary of the grating scale working environment, F 1 represents an upper vibration frequency boundary of the grating scale working environment, F 2 represents a lower vibration frequency boundary of the grating scale working environment, a 1 represents an upper vibration amplitude boundary of the grating scale working environment, and a 2 represents a lower vibration amplitude boundary of the grating scale working environment.
More specifically, as shown in fig. 3, the constraint condition for optimizing the multidimensional bounded optimization model is further included, specifically:
and dividing the interference factor intervals based on a K-means clustering method, respectively calculating errors of temperature, frequency and amplitude, respectively calculating the support degree and the confidence coefficient of the errors, measuring a dullness candidate interval set between the interference factors and the errors, and selecting an interval for obviously inhibiting the grating ruler errors.
More specifically, the method further comprises the following steps:
under the constraint condition of optimization, converting the multidimensional bounded optimization model into the following unconstrained optimization problem:
Wherein I α (·) represents a penalty function, t i represents an upper or lower bound to the temperature of the grating scale working environment, f i represents an upper or lower bound to the frequency of the grating scale working environment, α i represents an upper or lower bound to the amplitude of the grating scale working environment, u represents a calculation parameter of the penalty function, and α represents an Indicator function approximation factor.
In the specific implementation process, the method for solving the unconstrained optimization problem is adopted to solve the above-mentioned problems, so that decoupling of the grating ruler measurement error coupling model is completed, the optimal error suppression experimental condition for the grating ruler measurement is found, data interpretation is provided for the action mechanism of the multi-interference factors on the grating ruler measurement accuracy NSFC 2020, the high-dimensional nonlinear coupling mechanism of the grating ruler measurement error is revealed, and a theoretical basis is provided for the grating ruler measurement error compensation.
S2, extracting a sub-pixel code channel positioning map by a sub-pixel level positioning network according to the input grating image;
More specifically, the sub-pixel code channel localization map is extracted from the input raster image by:
A1, extracting a multi-scale feature subgraph from an input grating image;
a2, carrying out code channel rough positioning according to the multi-scale characteristic subgraph to obtain a rough code channel positioning graph;
A3, obtaining a sub-pixel code channel locating map according to the multi-scale characteristic subgraph and the coarse code channel locating map.
S3, constructing a regression tree in a task space according to the sub-pixel code channel locating diagram, outputting regression results related to each interference factor and migrating the regression results to a multi-dimensional bounded optimization model;
More specifically, the regression result S n is a set of error parameters including temperature error and vibration error.
More specifically, the reward function of constructing the regression tree is:
Wherein R i represents the value of the bonus function at the current time, R i-1 represents the value of the bonus function at the previous time, P π represents the conversion function of the task space and the feature set under the current strategy, Representing the mathematical transpose of the transfer function, pi R representing the R-dimension representation of the parameter s, a representing the error value corresponding to the parameter s at the current time, and D representing the set of image features.
More specifically, a source task iteration strategy is introduced to accelerate migration learning:
Qt+τ(st,′)=(1-a′)Qt(st+′)
+′[Q(St,′)+(St+1,′)+…+(st+τ-1,′)/
Wherein Q t+τ(st,′) represents an action cost function of the target scale error compensation model, t represents the number of iterations, S t represents a state quantity at t iterations, a ′ represents a proportional coefficient of the allocated action cost function, Q t(st+′) represents an action cost function of the source scale error compensation model, α ′ represents an action, Q (·) represents a cost function, S t+1 represents a state quantity at t+1, S t+τ-1 represents a state quantity at a previous time, and τ represents the number of subtasks.
S4, feeding back compensation conditions to the sub-pixel level positioning network according to the regression result by using the multi-dimensional bounded optimization model;
And S5, extracting a new sub-pixel code channel positioning map by the sub-pixel level positioning network according to the compensation condition, inputting the new sub-pixel code channel positioning map into a decoding layer, taking the output decoding result as an accurate measurement result, and completing the measurement error compensation of the grating ruler.
In the specific implementation process, a multidimensional dense measurement compensation matrix shown in fig. 4 is constructed, and the grating ruler searches the corresponding measurement compensation matrix for feedback and image correction according to a regression result S n (current working environment) associated with each interference factor during measurement, so that accurate error compensation is realized.
It is to be understood that the above examples of the present invention are provided by way of illustration only and not by way of limitation of the embodiments of the present invention. Other variations or modifications of the above teachings will be apparent to those of ordinary skill in the art. It is not necessary here nor is it exhaustive of all embodiments. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the invention are desired to be protected by the following claims.