Causal inference compensation system and method for residual magnetic effect of magnetic encoder
By constructing a topological dynamics model and using multi-step delay processing to identify the residual magnetism effect of the magnetic encoder, accurate compensation data is generated, solving the accuracy and stability problems of the magnetic encoder in complex environments, and realizing high-precision and long-term stable angle measurement.
Patent Information
- Application Number
- CN202511429590.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-09
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-10-09
AI Technical Summary
Existing technologies struggle to accurately capture the nonlinear dynamic characteristics of the residual magnetism effect in magnetic encoders, leading to decreased measurement accuracy and insufficient stability, especially in the long term under complex working environments.
By employing a multidimensional G-VAR model based on topological dynamics, combined with multi-step delay processing and reverse factor inference techniques, a singular attractor structure is identified by constructing a three-dimensional Riemannian manifold and a G-VAR model, and compensation data is generated to correct the pulse signal of the magnetic encoder.
It significantly improves the measurement accuracy and stability of magnetic encoders, increases angle measurement accuracy by 3-5 times, enhances environmental adaptability to harsh industrial environments, reduces dynamic response time by 50%, and lowers usage costs.
Smart Images

Figure CN120907587A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of magnetic encoder, in particular to a causal inference compensation system and method for residual magnetism effect of magnetic encoder. BACKGROUND
[0002] Magnetic encoder is a widely used position and angle measurement device in industrial automation, medical equipment, aerospace and other fields. Its working principle is to detect the magnetic field change of magnetic encoder disk or gear through magnetic sensor, and then convert mechanical position or angle into electrical signal. However, in practical application, the magnetic encoder is often affected by residual magnetism effect, resulting in decreased measurement accuracy and stability.
[0003] Residual magnetism effect refers to the phenomenon that magnetic material still retains a certain degree of magnetization state after the external magnetic field is removed. In magnetic encoder, this effect will cause nonlinear distortion and phase offset of sensor output signal, especially in the case of temperature change, external magnetic field interference or long-term operation.
[0004] In the prior art, the compensation for residual magnetism effect of magnetic encoder mainly adopts the following methods: one is through hardware design, such as selecting low residual magnetism material or improving magnetic circuit structure; the other is to use simple signal processing algorithm, such as filtering and digital calibration. However, these methods are mostly based on simplified linear model or empirical parameters, which are difficult to accurately capture the nonlinear dynamic characteristics of residual magnetism effect, especially the long-term stability in complex working environment.
[0005] Therefore, there is an urgent need for a system and method that can fundamentally understand the mechanism of residual magnetism effect and achieve accurate modeling and compensation. SUMMARY
[0006] The purpose of the present application is to provide a causal inference compensation system and method for residual magnetism effect of magnetic encoder, which realizes accurate inference and compensation of residual magnetism effect of magnetic encoder by constructing a multi-dimensional G-VAR model based on topological dynamics, combining multi-step delay processing and reverse factor reasoning technology, thereby significantly improving the measurement accuracy, stability and environmental adaptability of magnetic encoder.
[0007] The present application provides a causal inference compensation system for residual magnetism effect of magnetic encoder, which comprises:
[0008] Three anisotropic magnetoresistance sensors are uniformly arranged along the circumference of the gear for collecting magnetic sensing signals of the magnetic gear;
[0009] A signal processing module is connected with the anisotropic magnetoresistance sensors for Gaussian smoothing and autoregressive filtering of the magnetic sensing signals to generate magnetic sensing data;
[0010] a topological dynamics model unit, connected with the signal processing module, configured to map the magnetic sensing data to a three-dimensional Riemannian manifold, construct a tangent space dynamics representation, and establish a G-VAR model based on the topological structure of the manifold;
[0011] a multi-step delay processing unit, connected with the topological dynamics model unit, configured to perform multi-step delay coordinate embedding on the magnetic sensing data, construct a conditional probability measure space, and generate multi-step prediction values;
[0012] a reverse factor reasoning unit, connected with the multi-step delay processing unit, configured to identify singular attractor structures through reverse trajectory tracking analysis, and calculate a demagnetization effect signal of the anisotropic magnetoresistance sensor;
[0013] a compensation output unit, connected with the reverse factor reasoning unit, configured to generate compensation data according to the demagnetization effect signal, and correct a pulse signal of the magnetic encoder.
[0014] Preferably, the signal processing module comprises:
[0015] a signal conditioning circuit, configured to amplify and preliminarily filter the magnetic sensing signal;
[0016] an A / D conversion circuit, connected with the signal conditioning circuit, configured to convert the analog signal into a digital signal;
[0017] a data preprocessing unit, connected with the A / D conversion circuit, configured to perform fusion processing of a Gaussian smoothing algorithm and an autoregressive algorithm, and generate the magnetic sensing data.
[0018] Preferably, the topological dynamics model unit comprises:
[0019] a manifold mapping sub-unit, configured to map the magnetic sensing data to a three-dimensional Riemannian manifold, and construct a local coordinate system;
[0020] a topological feature extraction sub-unit, connected with the manifold mapping sub-unit, configured to calculate a homology group feature of the manifold, and extract a topological invariant;
[0021] a G-VAR model construction sub-unit, connected with the topological feature extraction sub-unit, configured to establish a G-VAR model based on the topological invariant, and realize multi-scale magnetic field representation.
[0022] Preferably, the multi-step delay processing unit comprises:
[0023] a delay coordinate embedding sub-unit, configured to determine an optimal delay time through mutual information analysis, and construct a trajectory matrix;
[0024] A conditional probability field construction subunit, connected with the delay coordinate embedding subunit, is configured to calculate local probability density in a reconstructed phase space, and establish a conditional probability map;
[0025] An invariant measure identification subunit, connected with the conditional probability field construction subunit, is configured to identify an invariant measure of the system, extract an attractor structure, and realize multi-step prediction.
[0026] Preferably, the reverse factor reasoning unit comprises:
[0027] A state inversion subunit is configured to map an observed magnetic signal to a phase space state point, and calculate an inverse dynamics equation;
[0028] A chaotic characteristic analysis subunit, connected with the state inversion subunit, is configured to calculate Lyapunov exponents and fractal dimensions, and evaluate the complexity of system dynamics;
[0029] A residual magnetism separation subunit, connected with the chaotic characteristic analysis subunit, is configured to identify a system branch manifold, separate a demagnetization effect component, and construct a causal network of the residual magnetism effect and external factors.
[0030] Preferably, the compensation output unit comprises:
[0031] A compensation calculation subunit is configured to generate compensation data according to the demagnetization effect signal;
[0032] An output adjustment subunit, connected with the compensation calculation subunit, is configured to apply the compensation data to an original magnetic encoder signal;
[0033] A feedback optimization subunit, connected with the output adjustment subunit, is configured to monitor compensation effects, and dynamically adjust compensation parameters.
[0034] Preferably, the system further comprises:
[0035] An ARM processor is configured to execute core algorithms of the topological dynamics model unit, the multi-step delay processing unit, and the reverse factor reasoning unit;
[0036] An FPGA unit, connected with the ARM processor through a RapidIO interface, is configured to implement signal preprocessing and parallel data processing;
[0037] A data acquisition card, connected with the FPGA unit, is configured to acquire anisotropic magnetoresistance sensor signals and transmit the signals to the FPGA unit.
[0038] Preferably, the system further comprises:
[0039] A parameter self-adaption unit is configured to dynamically adjust model parameters according to changes in working conditions;
[0040] Anomaly detection unit for identifying abnormal changes in sensor data and model parameters;
[0041] Anomaly response unit connected to the anomaly detection unit for triggering a degraded operation strategy when an anomaly is detected.
[0042] As a preferred, the three anisotropic magnetoresistance sensors are uniformly distributed at 120° angle in the gear circumferential direction, forming a three-point distributed sensing network; the anisotropic magnetoresistance sensors are made of ferrite material or soft iron material, and the angle encoding information is given to the following anisotropic magnetoresistance sensor through the synchronous rotation of the magnetic pole distance.
[0043] The causal inference compensation method of the residual magnetism effect of the magnetic encoder includes the following steps:
[0044] Three anisotropic magnetoresistance sensors are uniformly arranged along the gear circumferential direction for collecting magnetic sensing signals of the magnetic gear;
[0045] The magnetic sensing signals are subjected to Gaussian smoothing and autoregressive filtering to generate magnetic sensing data;
[0046] The magnetic sensing data is mapped to a three-dimensional Riemann manifold to construct a tangent space dynamics representation and establish a G-VAR model based on the manifold topological structure;
[0047] The magnetic sensing data is subjected to multi-step delay coordinate embedding to construct a conditional probability measure space and generate multi-step prediction values;
[0048] The remanence effect signal of the anisotropic magnetoresistance sensor is calculated by identifying the strange attractor structure through reverse trajectory tracking analysis;
[0049] Compensation data is generated according to the remanence effect signal to correct the pulse signal of the magnetic encoder.
[0050] The beneficial effects of the present application include:
[0051] 1. The measurement accuracy is greatly improved: compared with the traditional compensation method, the angle measurement accuracy is improved by 3-5 times, reaching the order of 0.01°, meeting the demand of high-precision industrial application.
[0052] 2. Environmental adaptability is enhanced: stable performance is maintained in the temperature range of-40°C to 85°C, and the suppression ability to external magnetic field interference is improved by more than 10 times, suitable for harsh industrial environment.
[0053] 3. Long-term stability is improved: by accurately modeling the dynamic characteristics of the residual magnetism effect, the system calibration period is prolonged by 3-5 times, reducing the maintenance demand and reducing the use cost.
[0054] 4. Dynamic response optimization: maintain high precision under high-speed changing conditions, dynamic response time is shortened by 50%, suitable for high dynamic application scenarios.
[0055] 5. Universality and scalability: suitable for different models and specifications of magnetic encoders, easy to integrate into existing systems, and good scalability. BRIEF DESCRIPTION OF DRAWINGS
[0056] Figure 1 The overall architecture of the causal inference compensation system for the residual magnetic effect of the magnetic encoder of the application is shown in the figure.
[0057] Figure 2 The structure of the signal processing module of the application is shown in the figure.
[0058] Figure 3 The structure of the topological dynamics model unit of the application is shown in the figure.
[0059] Figure 4 The structure of the multi-step delay processing unit of the application is shown in the figure.
[0060] Figure 5 The structure of the reverse factor reasoning unit of the application is shown in the figure.
[0061] Figure 6 The structure of the compensation output unit of the application is shown in the figure.
[0062] Figure 7 The flow chart of the causal inference compensation method for the residual magnetic effect of the magnetic encoder of the application is shown in the figure. DETAILED DESCRIPTION
[0063] Please refer to Figure 1 - Figure 7 The application will be further described in detail below in combination with the drawings and specific embodiments. It should be noted that the following embodiments are only used to illustrate the application, and are not used to limit the scope of the application.
[0064] Referring to Figure 1 The causal inference compensation system for the residual magnetic effect of the magnetic encoder provided by the application includes three anisotropic magnetoresistance sensors 1, a signal processing module 2, a topological dynamics model unit 3, a multi-step delay processing unit 4, a reverse factor reasoning unit 5, and a compensation output unit 6.
[0065] The three anisotropic magnetoresistance sensors 1 are uniformly arranged along the circumference of the gear 7, forming a three-point distributed sensing network with an angle of 120°. The anisotropic magnetoresistance sensors 1 are made of ferrite material or soft iron material, and real-time magnetic sensing signals of the magnetic gear 8 are collected by synchronous rotation with the gear 7. Preferably, the number of anisotropic magnetoresistance sensors 1 can be 3 or 6, and when the number is 6, they can be arranged with half-tooth staggered to improve spatial resolution.
[0066] In one embodiment of the present application, the sampling frequency of the anisotropic magnetoresistance sensor 1 is set to 10 kHz, and the resolution is 16 bits, to ensure capturing subtle features of the magnetic field changes. In addition, the synchronization error between the sensors is controlled within 1 μs, ensuring the time consistency of the three-point data.
[0067] Referring to Figure 2 , the signal processing module 2 is connected with the anisotropic magnetoresistance sensor 1, for Gaussian smoothing and autoregressive filtering processing of the magnetic sensing signal, to generate the magnetic sensing data. Specifically, the signal processing module 2 includes a signal conditioning circuit 21, an A / D conversion circuit 22, and a data preprocessing unit 23.
[0068] The signal conditioning circuit 21 amplifies and preliminarily filters the magnetic sensing signal. In the present embodiment, the signal amplification uses a low-noise operational amplifier, with a gain set to 20 dB, and the preliminary filtering uses a Butterworth low-pass filter with a cutoff frequency of 1 kHz, effectively suppressing high-frequency noise.
[0069] The A / D conversion circuit 22 is connected with the signal conditioning circuit 21, to convert the analog signal into a digital signal. Preferably, the A / D conversion uses a 16-bit successive approximation type converter, with a conversion rate of 100 kSPS (samples per second), meeting the high-precision data acquisition requirements.
[0070] The data preprocessing unit 23 is connected with the A / D conversion circuit 22, to perform fusion processing of the Gaussian smoothing algorithm and the autoregressive algorithm, to generate the magnetic sensing data. The processing procedure of the Gaussian smoothing and autoregressive fusion algorithm is as follows:
[0071] First, the window length n and the filter weighting value h are set, to perform smoothing processing of the magnetic sensing signal, with the algorithmic expression of the smoothing formula being:
[0072] ,
[0073] wherein, is the smoothed signal value at time t, is the original signal value at time t+i, is the weighting coefficient of the i-th window position, and n is the window length. In the present embodiment, the window length n is preferably 11, and the weighting value h is generated using a standard Gaussian function, specifically:
[0074] ,
[0075] wherein, σ is the standard deviation of the Gaussian function, π is the circular constant, e is the base number of the natural logarithm, and i is the window position index. Preferably, σ = 1.5, which is determined according to experimental tests, and can achieve a good balance between smoothing noise and retaining effective signal features.
[0076] Next, the processed magnetic sensing signal is subjected to first-order difference processing to obtain the magnetic sensing sequence. The algorithmic expression of the difference formula is as follows:
[0077] ,
[0078] Where ΔY(t) is the difference value at time t. Let be the smoothed signal value at time t. Let t be the smoothed signal value at time t-τ, and τ be the lag time. In this embodiment, the lag time τ is preferably set to 5 times the sampling period, i.e., 0.5 ms. This parameter can effectively capture the dynamic changes of the magnetic signal.
[0079] Finally, the magnetic sensing sequence is filtered to obtain the magnetic sensing data Y(t). In this embodiment, autoregressive filtering is used, and its expression is:
[0080] ,
[0081] in, Here are the magnetic sensing data at time t. Let be the difference value at time ti, and p be the order of the autoregressive model. Let i be the i-th autoregressive coefficient. This represents the residual term at time t. The preferred setting is p=3, and the autoregressive coefficient is... It is estimated using the least squares method. Autoregressive filtering can effectively capture the time correlation of signals and improve the signal-to-noise ratio.
[0082] Reference Figure 3 The topological dynamics model unit 3 is connected to the signal processing module 2 and is used to map magnetic sensing data to a three-dimensional Riemannian manifold, construct a tangent space dynamic representation, and establish a G-VAR model based on the manifold topology. The topological dynamics model unit 3 includes a manifold mapping subunit 31, a topological feature extraction subunit 32, and a G-VAR model construction subunit 33.
[0083] Manifold mapping subunit 31 maps the magnetic sensing data to a three-dimensional Riemannian manifold, constructing a local coordinate system. The signal values from the three magnetoresistive sensors... It can be viewed as a point in three-dimensional Euclidean space, through a nonlinear mapping function. Map it to a Riemannian manifold superior:
[0084] ,
[0085] in, It is a nonlinear mapping function. Representing three-dimensional Euclidean space, Riemannian manifold, 、 and are the signal values of three magnetoresistance sensors at time , and is the mapped point on the manifold.
[0086] In this embodiment, the mapping function is implemented by a radial basis function (RBF) network, and the specific form is:
[0087] ,
[0088] wherein, is a three-dimensional magnetic sensor data vector, is the th RBF center point vector, represents the Euclidean distance between the vector and the center point , is a radial basis function, is the weight coefficient of the th RBF node, is the number of RBF network center points. The Gaussian kernel is selected as the radial basis function, and the expression is , wherein is the distance value, is the width parameter of the Gaussian kernel. Preferably, the number of RBF center points is selected from historical data by K-means clustering. This mapping method can maintain the topological relationship of the original data and capture nonlinear characteristics.
[0089] The local coordinate system on the manifold is realized by calculating the tangent space at each point. For a point on the manifold, the tangent space basis is calculated as follows:
[0090] ,
[0091] wherein, and are three basis vectors of the tangent space, represents the gradient of the mapping function to the th variable, and GramSchmidt represents the Gram-Schmidt orthogonalization process for converting a non-orthogonal vector group into an orthogonal basis. This local coordinate system can more accurately describe the local geometric characteristics of the magnetic field change.
[0092] The topological feature extraction subunit 32 is connected with the manifold mapping subunit 31, and is used to calculate the homology group features of the manifold and extract topological invariants. The topological invariants are important tools for describing the essential characteristics of the manifold. In this embodiment, the following topological features are mainly calculated:
[0093] Persistent homology: By constructing the Vietoris-Rips complex, the Betti numbers sequence of the manifold is calculated:
[0094] ,
[0095] wherein, Betti number of the m-th order, the m-th order homology group, the manifold, the distance parameter, the rank of the homology group. In this embodiment, the value range of is preferably 5% to 30% of the fluctuation range of the sensor signal, and is calculated in 10 levels, so as to obtain complete persistent homology features. Topological entropy: used to quantify the complexity of the manifold, and the calculation formula is:
[0096]
[0097] ,
[0098] wherein, topological entropy, manifold, the maximum number of distinct orbits of length n, natural logarithm. In actual calculation, the value of is 5% of the signal standard deviation, and n is 10% of the number of sampling points.
[0099] These topological features constitute the invariants for describing the dynamic behavior of the magnetic field, and provide robust constraint conditions for the G-VAR model.
[0100] The G-VAR model construction subunit 33 is connected with the topological feature extraction subunit 32, and is used to establish the G-VAR model based on the topological invariants, and realize the multi-scale magnetic field representation. The G-VAR (Granger Vector Auto-Regression) model is a multivariate time series model considering causal relationship, and the basic form is:
[0101] ,
[0102] wherein, the magnetic sensor data vector of three sensors at t time, is the autoregressive coefficient matrix of the ith lag time step, p is the model order, is the residual vector at time t, which follows a multivariate normal distribution.
[0103] In the present application, the G-VAR model is extended by introducing topological constraints:
[0104] ,
[0105] where, is the magnetic sensor data vector at time t, is the autoregressive coefficient matrix of the ith lag time step, is the hidden variable vector extracted from topological features at time t-j, is the corresponding coefficient matrix, q is the lag order of hidden variables, is the residual vector at time t. Preferably, p = 3, q = 2, m = 5, these parameters are determined by cross-validation, which can achieve a good balance between model complexity and prediction accuracy.
[0106] The parameter estimation of G-VAR model uses maximum likelihood estimation with topological regularization:
[0107] ,
[0108] where, denotes the estimated parameter set, denotes the model parameter set, is the log-likelihood function, is the regularization term based on topological features, is the regularization coefficient, which controls the regularization strength. Preferably, the value is 0.1. This estimation method can effectively utilize topological information, improve the robustness and generalization ability of the model.
[0109] Referring to Figure 4 , the multi-step delay processing unit 4 is connected with the topological dynamics model unit 3, used for multi-step delay coordinate embedding of the magnetic sensor data, constructing a conditional probability measure space, and generating multi-step prediction values. The multi-step delay processing unit 4 includes a delay coordinate embedding subunit 41, a conditional probability field construction subunit 42, and an invariant measure identification subunit 43.
[0110] The delay coordinate embedding subunit 41 determines the optimal delay time through mutual information analysis, and constructs a trajectory matrix. Delay coordinate embedding is a method of mapping one-dimensional time series to high-dimensional phase space, and its basic form is:
[0111] ,
[0112] where, is the embedding vector at time t, is the scalar magnetic sensor data at time t, is the scalar magnetic sensor data at time t-k, is the scalar magnetic sensor data at time t-k, is the delay time, d is the embedding dimension, k is the delay multiple index.
[0113] optimal delay time determined by the first local minimum of the mutual information function:
[0114] ,
[0115] where, denotes the optimal delay time, denotes the argument at which the function attains its minimum, denotes the mutual information function between the time series Y(t) and its delayed version Y(t-k), k denotes the number of sampling points of the delay.
[0116] The formula of the mutual information function is:
[0117] ,
[0118] where, denotes the mutual information between the random variables X and Y, denotes the joint probability distribution of X and Y, and denote the marginal probability distributions of X and Y, respectively, denotes the natural logarithm, and the sum is taken over all possible values of X and Y.
[0119] In this embodiment, the optimal delay time is determined in the range of 1-20 sampling points by grid search. Experiments show that for the magnetic encoder signal, the optimal delay time is usually between 7-12 sampling points, about 0.7-1.2 ms.
[0120] The embedding dimension d is determined by the False Nearest Neighbors method:
[0121] ,
[0122] where, denotes the proportion of false nearest neighbors when the embedding dimension is d, N denotes the total number of data points, is the step function (1 when the argument is greater than 0, otherwise 0), denotes the d-dimensional representation of the i-th point, denotes the d+1-dimensional representation of the i-th point, denotes the index of the nearest neighbor of the i-th point in the d-dimensional space, Let R represent the Euclidean distance, and R be the threshold. A preferred value for R is 10. When... When the value drops below 0.01, the value of d is considered sufficiently large. In this system, the embedding dimension d is typically between 5 and 8, and experiments show that d=6 can reconstruct the phase space well.
[0123] Based on the optimal delay and embedding dimension, construct the trajectory matrix:
[0124] ,
[0125] in, Represents the trajectory matrix. Indicates the length of the time series. Indicates the first Magnetic sensing data at each time point Indicates the delay time. This indicates the embedding dimension. Each row of the trajectory matrix represents a point in phase space, containing complete information about the system dynamics and providing a foundation for subsequent analysis.
[0126] The conditional probability field construction subunit 42 is connected to the delayed coordinate embedding subunit 41 to calculate the local probability density in the reconstructed phase space and establish the conditional probability mapping. The conditional probability field describes the probability distribution of the system transitioning from the current state to the future state and is key to achieving multi-step prediction.
[0127] First, the local probability density is calculated in the reconstructed phase space. The kernel density estimation (KDE) method is used:
[0128] ,
[0129] in, Point The probability density at that location, Indicates the total number of data points. For kernel function, Indicates the first One observation point. A Gaussian kernel is preferred:
[0130] ,
[0131] in, Represents the kernel function value. Pi is a constant. For the embedding dimension, Represents the bandwidth matrix determinant, Represents an exponential function. Representing vectors transpose, Represents the bandwidth matrix The inverse matrix.
[0132] Bandwidth matrix Determined by Silverman's criterion:
[0133] ,
[0134] in, For bandwidth matrix, For the embedding dimension, For the number of data points, Let be the data covariance matrix. This adaptive bandwidth selection method can automatically adjust the smoothing level according to the data distribution characteristics.
[0135] Next, conditional probability mappings are established. For the current state... The conditional probability distribution after h steps is:
[0136] ,
[0137] in, Indicates the current state After step h, the system status is conditional probability density, Representing state and The joint probability density, Representing state The marginal probability density.
[0138] In practical calculations, the k-nearest neighbor method is used to simplify the calculation:
[0139] ,
[0140] in, This represents the conditional probability density. express In phase space The set of indices of the nearest neighbors This is the Dirac function (1 at zero and 0 elsewhere). Indicates the relationship with the first The nearest neighbor points correspond to Post-step state. Preferably, The value is set to the number of samples. In this system, the usual approach is to take... .
[0141] The invariant measure identification subunit 43 is connected to the conditional probability field construction subunit 42, and is used to identify the invariant measure of the system, extract the attractor structure, and achieve multi-step prediction. An invariant measure is a probabilistic measure describing the long-term behavior of a dynamical system, satisfying:
[0142] ,
[0143] where, denotes the measure value on the set is the invariant measure, is a measurable set in the phase space, denotes the entire phase space, denotes the conditional probability that the next state falls into the set given the current state denotes the integral with respect to the measure
[0144] In this system, the following iterative method is used to solve the invariant measure:
[0145] 1. Initialize a uniform distribution ;
[0146] 2. Iteratively compute: ;
[0147] 3. Stop iteration when
[0148] where, stop iteration when denotes the measure of the th iteration, denotes the distance between two iterated measures, is the convergence threshold, preferably set to 0.001. The number of iterations is usually between 50-100, ensuring that the measure converges sufficiently.
[0149] Based on the invariant measure, the attractor structure of the system is extracted. Attractor is an invariant set in the phase space, representing the long-term behavior of the system. Attractors are identified by density clustering method:
[0150] ,
[0151] where, denotes the set of attractors, denotes the entire phase space, denotes a point in the phase space, is the probability density at point is the threshold value, preferably set to 3 times the average density. In this system, usually 1-3 main attractors can be identified, corresponding to different working states.
[0152] Multi-step prediction is achieved by projecting the invariant measure onto the prediction space. The expected value of h-step prediction is:
[0153] ,
[0154] where, is the prediction at time t+h, is the possible future state, is the given current state , the future state is the conditional probability density of the future state given the current state, integrated over all possible future states.
[0155] In practical calculations, the Monte Carlo method is used:
[0156] ,
[0157] where, is the prediction at time t+h, is the jth sample drawn from the conditional distribution , and M is the total number of samples. Preferably, M = 1000, ensuring statistical stability of the prediction.
[0158] Referring to Figure 5 , the backward factor inference unit 5 is connected with the multi-step delay processing unit 4, and is used to identify the strange attractor structure by backward trajectory tracking analysis, and calculate the demagnetization effect signal of the anisotropic magnetoresistance sensor. The backward factor inference unit 5 includes a state inversion subunit 51, a chaotic characteristic analysis subunit 52, and a residual magnetism separation subunit 53.
[0159] The state inversion subunit 51 maps the observed magnetic signal to the phase space state point, and calculates the inverse dynamics equation. State inversion is the process of deducing the system evolution history from the observed data. For the system, the observed magnetic signal is first mapped to the phase space:
[0160] ,
[0161] where, is the representation of the observed state at time t in the phase space, is the observed magnetic signal at time t, is the phase space mapping function, which is realized based on delay coordinate embedding.
[0162] The inverse dynamics equation describes the reverse evolution process of the system:
[0163] ,
[0164] where, is the system state at time t-1, is the system state at time t, is the inverse mapping of the system dynamics mapping F.
[0165] Since the dynamics of most nonlinear systems are not invertible, the following approximation is adopted:
[0166] ,
[0167] where, denotes the estimated system state at time t-1, denotes the argument that minimizes the following expression, denotes the candidate state to be optimized, denotes the forward dynamics of the system, denotes the known state at time t, denotes the square of the Euclidean distance, is a regularization coefficient, is a regularization term. Preferably, the value of 0.01. This method can find the most reasonable previous state in the case of multiple solutions.
[0168] By recursively applying the inverse dynamics equation, the historical trajectory of the system is reconstructed:
[0169] ,
[0170] where, denotes the system state at time t-k, and n denotes the time step of inversion. In this system, the inversion length n is usually set to 100-500, corresponding to 10-50 ms of historical data, which is sufficient to capture the short-term dynamic characteristics of the residual magnetism effect.
[0171] The chaotic characteristic analysis subunit 52 is connected with the state inversion subunit 51, and is used to calculate the Lyapunov exponent and the fractal dimension, and to evaluate the system dynamics complexity. The Lyapunov exponent quantifies the divergence rate of adjacent orbits, and is an important index for judging whether the system has chaotic characteristics:
[0172] ,
[0173] where, denotes the Lyapunov exponent in the i-th direction, denotes the limit, denotes the natural logarithm, denotes the amplitude of the i-th orthogonal direction after time t, denotes the initial disturbance amplitude.
[0174] In actual calculation, the Wolf algorithm is adopted:
[0175] 1. Select the initial point and the perturbed point nearby;
[0176] 2. Evolve both trajectories simultaneously to time , compute new distance ;
[0177] 3. When distance exceeds threshold , reselect new perturbation point with distance while preserving direction;
[0178] 4. Repeat steps 2-3 until entire time series is traversed
[0179] where denotes initial reference point, denotes initial perturbation vector, denotes perturbation amplitude after time , denotes maximum allowed perturbation amplitude, denotes rescaled perturbation amplitude.
[0180] Maximum Lyapunov exponent characterizes degree of chaos in system, typically denotes system has chaotic behavior. In this system, magnetic encoder typically exhibits weak chaotic behavior with maximum Lyapunov exponent between 0.01-0.1.
[0181] Fractal dimension characterizes geometric complexity of attractor in phase space, computed using correlation dimension:
[0182] ,
[0183] where denotes correlation dimension, denotes limit, denotes natural logarithm, denotes distance threshold, is correlation integral, computed as:
[0184] .
[0185] where denotes correlation integral, denotes total number of data points, is step function, denotes Euclidean distance between point and point .
[0186] In practical computation, fit and The linear relationship yields the fractal dimension. For magnetic encoder systems, the fractal dimension is typically between 1.5 and 2.5, indicating that the system has a moderately complex attractor structure.
[0187] The remanence separation subunit 53 is connected to the chaotic characteristic analysis subunit 52, and is used to identify the branch manifold of the system, separate the demagnetization effect component, and construct a causal network between the remanence effect and external factors. Remanence separation is one of the core innovations of this system, based on the following assumption: the observed magnetic signal Y(t) can be decomposed into an ideal signal component and a remanence effect component:
[0188] ,
[0189] in, Indicates the observed magnetic signal, The ideal signal when there is no residual magnetism. This deviation is caused by the residual magnetism effect.
[0190] Branch manifold identification involves identifying manifold structures in phase space that separate different dynamic behaviors. Manifold learning methods, such as Isomap or Locally Linear Embedding (LLE), are used to project the high-dimensional phase space into a low-dimensional representation.
[0191] ,
[0192] in, This represents a point in a low-dimensional representation space. Represents a point in a higher-dimensional phase space. This is the learning mapping function for the manifold.
[0193] In the low-dimensional representation, different branches are identified using density clustering methods:
[0194] ,
[0195] in, Denotes the set of the i-th branch. This represents a point in a low-dimensional representation space. Represents d-dimensional Euclidean space. For point The probability density at that location, Density threshold For point Clustering labels, This represents a logical AND operation. In this system, 2 to 4 main branches can typically be identified, corresponding to different remanence states.
[0196] The extraction of the remanence effect component is based on the difference in branched manifolds. For each state point... First, determine the branch it belongs to. Then the deviation from the ideal trajectory is calculated:
[0197] ,
[0198] where, represents the remanence effect component at time t, represents the observed magnetic signal at time t, represents the given state belongs to the reference branch the conditional expectation of the magnetic signal, represents the reference branch, usually the branch corresponding to the working state with the smallest remanence effect is selected.
[0199] The causal network of the remanence effect and external factors is constructed by Granger causality analysis:
[0200] ,
[0201] where, represents the remanence effect component at time t, represents the autoregressive coefficient matrix, represents the remanence effect component at time t-i, and p represents the autoregressive order, represents the external factor coefficient matrix, represents the external factor vector at time t-j, and q represents the lag order of the external factor, represents the residual term at time t.
[0202] The significance of each factor is evaluated by F test:
[0203] ,
[0204] where F represents the F statistic, represents the residual sum of squares of the restricted model, represents the residual sum of squares of the unrestricted model, q represents the number of restricted parameters, N represents the sample size, and p represents the autoregressive order. Preferably, the significance level is set to 0.01, ensuring that the identified causal relationship is statistically significant.
[0205] In this embodiment, temperature change is identified as the main external factor affecting the remanence effect, with an F statistic generally between 10-20, much higher than the critical value of 4.61 (p=0.01). This provides a theoretical basis for targeted compensation.
[0206] Referring to Figure 6The compensation output unit 6 is connected with the reverse factor inference unit 5, and is used for generating compensation data according to the demagnetization effect signal, and correcting the pulse signal of the magnetic encoder. The compensation output unit 6 comprises a compensation calculation subunit 61, an output adjustment subunit 62 and a feedback optimization subunit 63.
[0207] The compensation calculation subunit 61 is used for generating compensation data according to the demagnetization effect signal. The calculation of the compensation data is based on the reverse offset of the demagnetization effect signal:
[0208]
[0209] wherein, represents the compensation data at time t, is a compensation coefficient, represents the residual magnetism effect component at time t, is a modulation function, and the influences of temperature T, angular velocity and external magnetic field H are considered. Preferably, the value of the modulation function is 0.8-1.2, which is determined by experiment.
[0210] The calculation formula of the modulation function is:
[0211]
[0212] wherein, represents the value of the modulation function, represents the current temperature, represents the reference temperature, represents the current angular velocity, represents the reference angular velocity, represents the current external magnetic field intensity, represents the reference magnetic field intensity, , and respectively represent the sensitivity coefficients of temperature, angular velocity and magnetic field intensity. In the system, the typical values are , , The adaptive compensation method can adapt to the changes of the residual magnetism effect under different working conditions.
[0213] The output adjustment subunit 62 is connected with the compensation calculation subunit 61, and is used for applying the compensation data to the original magnetic encoder signal. The output signal of the magnetic encoder is usually a pulse sequence, which represents the angle increment. The calculation of the compensated output is:
[0214]
[0215] wherein, represents the number of compensated output pulses at time t, denotes the original pulse output at time t, denotes the compensation increment at time t.
[0216] The compensation increment is converted by the following relationship:
[0217] ,
[0218] wherein, denotes the compensation increment at time t, denotes the rounding function, is a proportional coefficient, indicating the correspondence between angle and pulse number, denotes the integral of the compensation data in the time period from to is the integral period, is the integral variable. Preferably, is set to 1. Through the integral operation, the influence of instantaneous noise is reduced, and the stability of compensation is improved.
[0219] The feedback optimization subunit 63 is connected with the output adjustment subunit 62, and is used for monitoring the compensation effect and dynamically adjusting the compensation parameters. The feedback optimization is based on the following performance indicators:
[0220] Angle error: , wherein, denotes the angle error, denotes the output pulse number after compensation, denotes the reference angle pulse number, denotes the norm.
[0221] Stability index: , wherein, denotes the stability index, denotes the standard deviation function, denotes the output pulse number after compensation, denotes the original pulse output.
[0222] Response time: , wherein, denotes the response time, denotes the time when the compensation response reaches , and denotes the time when the compensation response reaches .
[0223] Based on these indicators, the compensation parameters are dynamically adjusted as follows:
[0224] ,
[0225] wherein, denotes the updated compensation coefficient, denotes the current compensation coefficient, is a learning rate, denotes a performance function about the gradient of the performance function. Preferably, the value of is .
[0226] The comprehensive performance function calculation formula is:
[0227] ,
[0228] wherein, denotes a comprehensive performance function, denotes an angle error, denotes a stability index, denotes a response time, , and are weight coefficients. In the precision priority scenario, the value of , , In the stability priority scenario, the value of .
[0229] Through this closed-loop optimization mechanism, the system can adaptively adjust the compensation strategy to maintain long-term stable compensation effect. In experimental tests, the optimized system can reduce the angle error from the original 0.1° to below 0.01°, while maintaining good stability and dynamic response characteristics.
[0230] In this embodiment, the ARM processor 7 is used to execute the core algorithms of the topological dynamics model unit 3, the multi-step delay processing unit 4 and the reverse factor inference unit 5. Preferably, the ARM processor adopts Cortex-A53 architecture, with a main frequency of 1.5GHz and a memory of 2GB, meeting the real-time processing requirements of complex algorithms.
[0231] The FPGA unit 8 is connected with the ARM processor 7 through the RapidIO interface, and is used to realize signal preprocessing and parallel data processing. Preferably, the FPGA adopts Xilinx Zynq-7000 series, containing 150K logic units and 600 DSP slices, and can efficiently execute signal filtering, FFT transformation and other preprocessing operations. The data transmission rate of the RapidIO interface is 5Gbps, ensuring high-speed data exchange between the ARM and the FPGA.
[0232] The data acquisition card 9 is connected with the FPGA unit 8, and is used for acquiring anisotropic magnetoresistance sensor signals and transmitting the anisotropic magnetoresistance sensor signals to the FPGA unit 8. The data acquisition card adopts a 16-bit high-precision ADC, and has a sampling rate of 1MSPS and a dynamic range of 80dB, thereby meeting the high-precision signal acquisition requirement.
[0233] The parameter adaptive unit 10 is used for dynamically adjusting model parameters according to working condition changes. The parameter adaptation is based on an online learning mechanism, and a stochastic gradient descent method is used to optimize the model parameters.
[0234]
[0235] wherein, represents an updated model parameter set, represents a current model parameter set, is a learning rate, represents a gradient of a loss function L with respect to a parameter at a data point . Preferably, the value of is 0.01, and the loss function adopts a mean square error. This online learning method can adapt to system changes in real time, without the need to completely retrain the model.
[0236] The anomaly detection unit 11 is used for identifying abnormal changes of sensor data and model parameters. The anomaly detection is based on the following rules:
[0237] Data range detection: , wherein represents an absolute value of a deviation of current data from a historical mean value, is a threshold coefficient, is a standard deviation of historical data. Preferably, the value of is 3.
[0238] Change rate detection: , wherein represents an absolute value of a change of data at adjacent time points, is a maximum allowed change rate.
[0239] Model residual error detection: , wherein represents an absolute value of a current residual error, is a threshold coefficient, is a residual error standard deviation. Preferably, the value of is 4.
[0240] When any detection condition is met, an abnormality flag is triggered, and an abnormality response process is started.
[0241] The abnormality response unit 12 is connected with the anomaly detection unit 11, and is used for triggering a degraded operation strategy when an abnormality is detected. The degraded operation includes the following strategies:
[0242] Data repair: median filtering or interpolation repair for abnormal data points;
[0243] Model rollback: temporarily disable complex model components and fallback to a simplified version;
[0244] Parameter freezing: suspend parameter adaptive update and use the latest stable parameters;
[0245] Warning output: send an abnormal warning signal to the upper system;
[0246] Through these strategies, the system can still maintain basic functions in abnormal situations and avoid complete failure. In experimental tests, even with 30% of the sensor data disturbed, the system can still maintain an angular accuracy of 0.05°, showing good robustness.
[0247] Reference Figure 7 The application also provides a causal inference compensation method for residual magnetism effect of a magnetic encoder, comprising the following steps:
[0248] Step S1: uniformly arranging three anisotropic magnetoresistance sensors along the circumference of a gear for collecting magnetic sensing signals of the magnetic gear.
[0249] As described above, the three sensors are uniformly distributed at an angle of 120° along the circumference to form a three-point distributed sensing network, which collects the magnetic sensing signals of the magnetic gear in real time.
[0250] Step S2: performing Gaussian smoothing and autoregressive filtering on the magnetic sensing signals to generate magnetic sensing data.
[0251] This step effectively filters out random noise in the sensor signals through the fusion of Gaussian smoothing algorithm and autoregressive algorithm, while retaining the key features of magnetic field changes. The specific processing process is described in Embodiment 1.
[0252] Step S3: mapping the magnetic sensing data to a three-dimensional Riemann manifold, constructing a tangent space dynamics representation, and establishing a G-VAR model based on the topological structure of the manifold.
[0253] This step is one of the core innovations of the method. By mapping the magnetic sensing data to a three-dimensional Riemann manifold with a specific geometric structure, the nonlinear characteristics of magnetic field changes can be more accurately captured. On the manifold, a tangent space dynamics representation is constructed, topological invariants are extracted, and a G-VAR model is established, laying a foundation for subsequent analysis.
[0254] Step S4: performing multi-step delay coordinate embedding on the magnetic sensing data, constructing a conditional probability measure space, and generating multi-step prediction values.
[0255] This step realizes multi-step prediction of future states by embedding magnetic sensor data into high-dimensional phase space to construct a conditional probability field describing system dynamics. By identifying invariant measures and attractor structures of the system, long-term steady-state characteristics of the system can be captured.
[0256] Step S5: Identify singular attractor structure through reverse trajectory tracking analysis and calculate the demagnetization effect signal of the anisotropic magnetoresistance sensor.
[0257] This step is based on chaos theory and separates the residual magnetism effect component from the total magnetic field change through reverse trajectory tracking and singular attractor analysis. This physical mechanism-based separation method can more accurately identify residual magnetism effects than traditional signal processing methods.
[0258] Step S6: Generate compensation data according to the demagnetization effect signal to correct the pulse signal of the magnetic encoder.
[0259] This step converts the identified demagnetization effect signal into compensation data and applies it to the original magnetic encoder signal to achieve accurate compensation. Through a feedback optimization mechanism, the system can dynamically adjust compensation parameters to maintain long-term stable compensation effects.
[0260] The method steps in this embodiment correspond one-to-one to the system modules, and the specific implementation of each step can refer to the relevant description of the system.
[0261] Through the detailed description of the above embodiments, those skilled in the art can clearly understand the implementation of the present application. The protection scope of the present application includes but is not limited to the above embodiments, and the protection scope of the present application is subject to the claims. Those skilled in the art can make various modifications and variations to the present application without departing from the spirit and scope of the present application, and these modifications and variations all fall within the protection scope of the present application.
Claims
1. A causal inference compensation system for residual magnetism effects of a magnetic encoder, characterized in that, The application relates to a magnetic encoder, comprising: three anisotropic magnetoresistance sensors arranged uniformly along the circumference of a gear for collecting magnetic sensing signals of the magnetic gear; a signal processing module connected with the anisotropic magnetoresistance sensors for performing Gauss smoothing and autoregressive filtering on the magnetic sensing signals to generate magnetic sensing data; a topological dynamics model unit connected with the signal processing module for mapping the magnetic sensing data to a three-dimensional Riemann manifold, constructing tangent space dynamics representation, and establishing a G-VAR model based on the topological structure of the manifold; a multi-step delay processing unit connected with the topological dynamics model unit for performing multi-step delay coordinate embedding on the magnetic sensing data, constructing a conditional probability measure space, and generating multi-step prediction values; a reverse factor reasoning unit connected with the multi-step delay processing unit for identifying singular attractor structures through reverse trajectory tracking analysis and calculating demagnetization effect signals of the anisotropic magnetoresistance sensors; a compensation output unit connected with the reverse factor reasoning unit for generating compensation data according to the demagnetization effect signals and correcting pulse signals of the magnetic encoder.
2. The magnetic encoder residual magnetism effect causal inference compensation system according to claim 1, characterized in that, The signal processing module comprises: a signal conditioning circuit for amplifying and primary filtering the magnetic sensing signals; an A / D conversion circuit connected with the signal conditioning circuit for converting analog signals into digital signals; a data preprocessing unit connected with the A / D conversion circuit for performing fusion processing of Gauss smoothing algorithm and autoregressive algorithm to generate the magnetic sensing data.
3. The magnetic encoder residual magnetism effect causal inference compensation system according to claim 1, characterized in that, The topological dynamics model unit comprises: a manifold mapping subunit for mapping the magnetic sensing data to a three-dimensional Riemann manifold and constructing a local coordinate system; a topological feature extraction subunit connected with the manifold mapping subunit for calculating homology group features of the manifold and extracting topological invariants; a G-VAR model construction subunit connected with the topological feature extraction subunit for establishing a G-VAR model based on the topological invariants and realizing multi-scale magnetic field representation.
4. The magnetic encoder residual magnetism effect causal inference compensation system according to claim 1, characterized in that, The multi-step delay processing unit comprises: a delay coordinate embedding subunit for determining an optimal delay time through mutual information analysis and constructing a trajectory matrix; a conditional probability field construction subunit connected with the delay coordinate embedding subunit for calculating local probability density in a reconstructed phase space and establishing a conditional probability mapping; an invariant measure identification subunit connected with the conditional probability field construction subunit for identifying invariant measures of the system, extracting attractor structures, and realizing multi-step prediction.
5. The magnetic encoder residual magnetism effect causal inference compensation system according to claim 1, characterized in that, The reverse factor reasoning unit comprises: a state inversion subunit for mapping observed magnetic signals to phase space state points and calculating inverse dynamics equations; a chaotic characteristic analysis subunit connected with the state inversion subunit for calculating Lyapunov exponents and fractal dimensions and evaluating system dynamics complexity; a residual magnetism separation subunit connected with the chaotic characteristic analysis subunit for identifying system branch manifolds, separating demagnetization effect components, and constructing a causal network of residual magnetism effects and external factors.
6. The magnetic encoder residual magnetism effect causal inference compensation system according to claim 1, characterized in that, The compensation output unit comprises: a compensation calculation subunit for generating compensation data according to the demagnetization effect signals. An output adjustment subunit, connected with the compensation calculation subunit, is configured to apply the compensation data to the original magnetic encoder signal; A feedback optimization subunit, connected with the output adjustment subunit, is configured to monitor the compensation effect and dynamically adjust the compensation parameters.
7. The magnetic encoder residual magnetism effect causal inference compensation system according to claim 1, characterized in that, Further comprising: An ARM processor configured to execute the core algorithms of the topological dynamics model unit, the multi-step delay processing unit and the reverse factor reasoning unit; An FPGA unit, connected with the ARM processor through a RapidIO interface, is configured to implement signal preprocessing and parallel data processing; A data acquisition card, connected with the FPGA unit, is configured to collect anisotropic magnetoresistance sensor signals and deliver them to the FPGA unit.
8. The magnetic encoder residual magnetism effect causal inference compensation system according to claim 1, characterized in that, Further comprising: A parameter adaptive unit configured to dynamically adjust model parameters according to changes in working conditions; An anomaly detection unit configured to identify abnormal changes in sensor data and model parameters; An anomaly response unit, connected with the anomaly detection unit, is configured to trigger a degraded operation strategy when an anomaly is detected.
9. The magnetic encoder residual magnetism effect causal inference compensation system according to claim 1, characterized in that, The three anisotropic magnetoresistance sensors are uniformly distributed at an angle of 120° in the circumferential direction of the gear, forming a three-point distributed sensing network; the anisotropic magnetoresistance sensors are made of ferrite material or soft iron material, and the angular encoding information is assigned to the following anisotropic magnetoresistance sensors through the synchronous rotational movement of the magnetic pole pitch.
10. A causal inference compensation method for residual magnetism effects of a magnetic encoder, characterized in that, The method comprises the following steps: Three anisotropic magnetoresistance sensors are uniformly arranged along the circumferential direction of the gear to collect magnetic sensor signals of the magnetic gear; The magnetic sensor signals are subjected to Gaussian smoothing and autoregressive filtering to generate magnetic sensor data; The magnetic sensor data is mapped to a three-dimensional Riemann manifold to construct a tangent space dynamics representation and establish a G-VAR model based on the topological structure of the manifold; The magnetic sensor data is subjected to multi-step delay coordinate embedding to construct a conditional probability measure space and generate multi-step prediction values; The singular attractor structure is identified through reverse trajectory tracking analysis, and the demagnetization effect signal of the anisotropic magnetoresistance sensor is calculated; Compensation data is generated according to the demagnetization effect signal to correct the pulse signal of the magnetic encoder.
Citation Information
Patent Citations
Magnetic encoder element for position measurement
CN102052927A
Performance detection method and device for coded disc of magnetic encoder, equipment and medium
CN115388925A
Magnetic encoder compensation system and compensation method thereof
CN115528864A
Online fault diagnosis method and system for low-speed permanent magnet synchronous motor
CN118760947A
Gyroscope-based brushless motor attitude detection and balance control method and system
CN120110250A
