Hall displacement sensor temperature compensation method for optimizing LS-SVM (Least Square Support Vector Machine) based on mutation fruit fly algorithm

Through the LS-SVM model optimized based on the mutant fruit fly algorithm, the Hall displacement sensor is compensated, which solves the problem of degradation of measurement accuracy caused by temperature drift, and achieves a more efficient temperature compensation effect.

CN119879707APending Publication Date: 2025-04-25SICHUAN YONGXING ELECTRONICS +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411946571.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The output signal of the Hall displacement sensor will drift with the change of temperature, resulting in a decrease in measurement accuracy. The existing temperature compensation method has problems such as hardware complexity and difficulty in selecting parameters.

Method used

The least squares support vector machine (LS-SVM) model optimized based on the mutant fruit fly algorithm is adopted to compensate the Hall displacement sensor to search the parameters of the LS-SVM model through the fruit fly optimization algorithm, and a mutant mechanism is introduced to enhance search diversity and the ability to jump out of local optimality.

Benefits of technology

It effectively reduces the zero-position temperature coefficient and sensitivity coefficient of the sensor, improves the accuracy and stability of temperature compensation, and solves the temperature drift phenomenon.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119879707A_ABST
    Figure CN119879707A_ABST
Patent Text Reader

Abstract

The invention discloses a Hall displacement sensor temperature compensation method for optimizing an LS-SVM based on a variant fruit fly algorithm, and the method comprises the steps: firstly collecting output data of a Hall displacement sensor under different temperature conditions and corresponding environment temperatures, constructing an LS-SVM model, determining a regularization parameter and a kernel function parameter in the model, and then initializing a fruit fly group; the method comprises the following steps: setting an initial search step size, a maximum number of iterations and a group scale, designing a fitness function, then searching by using a fruit fly optimization algorithm, generating a candidate solution, calculating the fitness of the candidate solution, finally introducing a variation mechanism into the fruit fly optimization algorithm, recalculating the fitness of individuals until the maximum number of iterations is reached or the fitness is converged, and finally, carrying out the optimization of the fruit fly optimization algorithm. And the temperature compensation of the Hall displacement sensor is realized. According to the method, a variation mechanism is introduced into a fruit fly optimization algorithm, the search diversity and the capability of jumping out of local optimum are enhanced, the zero temperature coefficient and the sensitivity coefficient of the sensor can be reduced, and temperature compensation of the sensor is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of Hall displacement sensor temperature compensation, and in particular relates to a Hall displacement sensor temperature compensation method based on LS-SVM optimized by a mutant fruit fly algorithm. Background Art

[0002] Hall effect displacement sensors convert measured values ​​into electrical values ​​based on the Hall effect. Due to their non-contact, high reliability, and fast response speed, they are widely used in automotive, industrial automation, electronic equipment, and other fields. However, the output signal of Hall effect displacement sensors drifts with temperature changes, resulting in a decrease in measurement accuracy. This temperature sensitivity necessitates effective temperature compensation when using these sensors in complex environments to improve overall measurement stability and accuracy.

[0003] Existing temperature compensation methods typically include hardware compensation and software compensation. Hardware compensation is complex to implement and expensive, while software compensation is based on establishing a mathematical model to correct the sensor output. LS-SVM is widely used for modeling and correcting sensor signals due to its excellent generalization capabilities when dealing with nonlinear problems. However, the modeling performance of LS-SVM is highly dependent on parameter selection. Improper parameter selection will lead to insufficient generalization of the model, thus affecting the compensation effect. The fruit fly optimization algorithm can perform a global search to find the optimal parameters for the LS-SVM by simulating the behavior of fruit flies searching for food. However, the standard fruit fly algorithm may fall into local optimality in complex optimization problems, resulting in unsatisfactory search results. Therefore, improving search accuracy is also an important current research direction. Summary of the Invention

[0004] To solve the above technical problems, the present invention provides a Hall displacement sensor temperature compensation method based on the LS-SVM optimized by the mutant fruit fly algorithm, which can reduce the zero temperature coefficient and sensitivity coefficient of the sensor, realize temperature compensation of the sensor, and solve problems such as the temperature drift phenomenon of the Hall displacement sensor.

[0005] The technical solution adopted by the present invention is: a temperature compensation method for Hall displacement sensor based on LS-SVM optimized by mutant fruit fly algorithm, the specific steps are as follows:

[0006] S1. Collect the output data of the Hall displacement sensor under different temperature conditions and the corresponding ambient temperature, build an LS-SVM model, and determine the regularization parameters and kernel function parameters in the model;

[0007] S2. Based on step S1, initialize the fruit fly population, set the initial search step size, maximum number of iterations and population size, and design a fitness function;

[0008] S3. Based on step S2, use the fruit fly optimization algorithm to search and generate candidate solutions, that is, seek candidate solutions through olfactory search and visual search, and calculate the fitness of the candidate solutions;

[0009] S4. Based on step S3, the mutation mechanism in the genetic algorithm is introduced into the fruit fly optimization algorithm, and the olfactory search and visual search operations are repeated, and the fitness of the individual is recalculated until the maximum number of iterations is reached or the fitness converges, thereby realizing temperature compensation for the Hall displacement sensor.

[0010] Furthermore, the step S1 is specifically as follows:

[0011] First, the output data of the Hall displacement sensor under different temperature conditions and the corresponding ambient temperature are collected, and the Hall voltage V is defined. H The expression is as follows:

[0012] V H =K·B·I / t (1)

[0013] Where K represents the Hall constant, B represents the magnetic induction intensity perpendicular to the current, I represents the magnetic induction intensity passing through the Hall element, and t represents the thickness of the Hall element.

[0014] Based on the temperature drift effect of the Hall element, a mutant fruit fly algorithm is established to optimize the least squares support vector machine LS-SVM model to compensate the Hall displacement sensor. If the Hall displacement sensor has temperature drift, the input of the Hall displacement sensor to the LS-SVM model is set to U s and U t , that is, the output voltage has a function of the input quantity U(x)=f(U s ,U t ), and then set the initial sample obtained by the calibration experiment as {(U si ,U ti ),U(x)},(i=1,2,...,n), a total of n sample points, and (U s ,U t ) is the input quantity x i , U(x) is the expected output y i .

[0015] Among them, U s Indicates the output voltage of the Hall displacement sensor, which is the normal Hall voltage, U t Indicates the output voltage of the temperature sensor, which is the bias voltage.

[0016] Then, the LS-SVM model is used to fit the relationship between the input x and the output y, as shown below:

[0017]

[0018] Where ω represents the weight coefficient of LS-SVM, and T represents the transposition operation; represents the characteristic function; b represents the offset of LS-SVM.

[0019] Then, through the risk minimization principle, the linear regression problem is transformed into an optimization problem, which is expressed as follows:

[0020]

[0021] Where J represents the objective function of the LS-SVM model, γ represents the regularization parameter, which is used to control the fitting error of the function; e i represents the relaxation factor.

[0022] Then use the Lagrange method to solve ω and obtain the regression equation of LS-SVM, which is expressed as follows:

[0023]

[0024] Among them, αi represents the Lagrange multiplier, m(x i ,x) represents the dot product of the kernel function corresponding to the feature space.

[0025] Without prior information, the model expression designed using the radial basis kernel function is as follows:

[0026]

[0027] Among them, δ 2 Indicates the width of the kernel function.

[0028] Furthermore, in step S3, the fruit fly optimization algorithm is specifically as follows:

[0029] (1) The positions of the fruit fly population are initialized randomly, which are X0 and Y0, i.e. the initial horizontal and vertical coordinates of the fruit flies;

[0030] (2) For each fruit fly individual, use the sense of smell to perform a random search around the current reference point and calculate the new position. The expression is as follows:

[0031]

[0032] Among them, X i and Y i They represent the horizontal and vertical coordinates of the fruit fly's new position respectively. Rand() means generating a random number within the specified range, allowing the fruit fly to move freely within the search range.

[0033] (3) Calculate the distance D between the fruit fly and the origin i , and calculate the food odor concentration judgment value Ji , the expression is as follows:

[0034]

[0035] (4) Based on the food odor concentration judgment function, substitute J into formula (7) i , obtain the odor concentration S obtained at the individual position of the fruit fly i , the expression is as follows:

[0036] S i =Function(J i ) (8)

[0037] (5) Mark the fruit fly with the highest food odor concentration. The expression is as follows:

[0038] [l s ,l i ]=max(S i ) (9)

[0039] Among them, l s Indicates the current maximum odor concentration, l i Indicates the number of the fruit fly with the highest current odor concentration, that is, the number of the better solution.

[0040] (6) The fruit fly group uses vision to lock onto the target and further optimizes the position through visual search, and marks the maximum odor concentration and position coordinates. The expression is as follows:

[0041]

[0042] Among them, S max Indicates the maximum odor concentration.

[0043] (7) Repeat steps (1) to (6) to iterate and determine whether the odor concentration is greater than the previous odor concentration. If so, continue with step (6). If not, continue with the next round of iteration until the number of iterations is met, the iteration terminates, and the candidate solution is output.

[0044] Furthermore, in step S3, the fitness of the candidate solution is calculated as follows:

[0045] The fruit fly optimization algorithm is implemented by adjusting the γ and δ in the LS-SVM model. 2 Optimize and seek the optimal solution. The positions of the fruit flies are γ and δ. 2 The initial position of the fruit fly population is γ and δ 2 The initial value of . Then the candidate solution fitness F n The expression is as follows:

[0046]

[0047] Among them, U i represents the actual sensor output, Represents the predicted value of the LS-SVM model.

[0048] Compare the fitness of each fruit fly larva in the current iteration. If the new position is better than the old position, update the fitness value of the individual.

[0049] Furthermore, the step S4 is specifically as follows:

[0050] 1) Select mutation individuals based on the fitness function, give priority to individuals with poor fitness for mutation, and set a mutation probability P m , determines the number of mutated individuals in each iteration, and the mutation probability can be adjusted as the iteration progresses;

[0051] 2) For the mutant fruit fly individual selected in step 1), randomly perturb its position in the parameter space. Set the position of the fruit fly individual to (X, Y). Then, X and Y can be randomly changed. The expression is as follows:

[0052]

[0053] Here, Rand(-Δ, Δ) represents generating a random number in the interval [-Δ, Δ], and Δ represents controlling the intensity of mutation. The size of Δ is adjusted according to the progress of the search to gradually narrow the range of mutation.

[0054] 3) Adaptive adjustment of variation intensity;

[0055] For individuals with poor fitness, a larger range of mutations is performed; while individuals with better fitness undergo smaller mutations. The adjustment formula for the mutation intensity Δ is as follows:

[0056]

[0057] Among them, Δ max Indicates the initial maximum variation range, count_iteration indicates the current number of iterations, and total_iteration indicates the maximum number of iterations.

[0058] 4) Recalculate the fitness value F of the mutated individual v , and compare it with the original fitness value F n Compare and if the fitness after mutation is better, retain the individual after mutation, otherwise, keep the original position;

[0059] 5) Based on step 4), get the optimal solution F for the current iteration c , F c Compared with the optimal solution F1 obtained in the previous iteration, if Fc ≥F1, then the optimal solution for the group is F c , otherwise it is F1, and then determine whether the current number of iterations is the maximum number of iterations. If so, output the optimal solution of the group. If not, add 1 to the number of iterations, return to step S3, repeat steps S3-S4 until the maximum number of iterations is met, output the optimal solution of the group, and realize temperature compensation of the Hall displacement sensor.

[0060] Beneficial effects of the present invention: The method of the present invention first collects the output data of the Hall displacement sensor under different temperature conditions and the corresponding ambient temperature, and constructs an LS-SVM model, determines the regularization parameters and kernel function parameters in the model, then initializes the fruit fly population, sets the initial search step size, the maximum number of iterations and the population size, and designs the fitness function, then uses the fruit fly optimization algorithm to search, generates candidate solutions, and calculates their fitness, and finally introduces a mutation mechanism into the fruit fly optimization algorithm, recalculates the fitness of the individual until the maximum number of iterations is reached or the fitness converges, thereby achieving temperature compensation for the Hall displacement sensor. The method of the present invention introduces a mutation mechanism into the fruit fly optimization algorithm, enhances the search diversity and the ability to escape the local optimum, improves the global optimization effect and convergence speed, can reduce the zero temperature coefficient and sensitivity coefficient of the sensor, and achieves temperature compensation for the sensor. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 The present invention is a flow chart of a Hall displacement sensor temperature compensation method based on the mutant fruit fly algorithm to optimize LS-SVM. DETAILED DESCRIPTION

[0062] The method of the present invention is further described below with reference to the accompanying drawings and embodiments.

[0063] like Figure 1 As shown in the flowchart of the present invention, a Hall displacement sensor temperature compensation method based on the variant fruit fly algorithm optimized LS-SVM is described. The specific steps are as follows:

[0064] S1. Collect the output data of the Hall displacement sensor under different temperature conditions and the corresponding ambient temperature, build an LS-SVM model, and determine the regularization parameters and kernel function parameters in the model;

[0065] S2. Based on step S1, initialize the fruit fly population, set the initial search step size, maximum number of iterations and population size, and design a fitness function;

[0066] S3. Based on step S2, use the fruit fly optimization algorithm to search and generate candidate solutions, that is, seek candidate solutions through olfactory search and visual search, and calculate the fitness of the candidate solutions;

[0067] S4. Based on step S3, the mutation mechanism in the genetic algorithm is introduced into the fruit fly optimization algorithm to increase the diversity of the search and avoid finding only the local optimal solution. The olfactory search and visual search operations are repeated, and the fitness of the individual is recalculated until the maximum number of iterations is reached or the fitness converges, thereby realizing temperature compensation for the Hall displacement sensor.

[0068] In this embodiment, step S1 is specifically as follows:

[0069] A Hall displacement sensor is a non-contact displacement measurement device based on the Hall effect. When a magnetic field is perpendicular to the current flowing through a conductor or semiconductor, a vertical potential difference, known as the Hall voltage, is generated across the conductor. The Hall displacement sensor uses the movement of a permanent magnet to cause changes in magnetic field strength, thereby changing the Hall voltage. By measuring this voltage change, the displacement of an object can be indirectly calculated.

[0070] First, the output data of the Hall displacement sensor under different temperature conditions and the corresponding ambient temperature are collected, and the Hall voltage V is defined. H The expression is as follows:

[0071] V H =K·B·I / t (1)

[0072] Where K represents the Hall constant, B represents the magnetic induction intensity perpendicular to the current, I represents the magnetic induction intensity passing through the Hall element, and t represents the thickness of the Hall element.

[0073] The internal resistance of a Hall element drifts with temperature, a phenomenon also known as temperature drift. This temperature drift can affect the Hall sensor's bias voltage, causing it to produce a certain output even in the absence of a magnetic field. Therefore, additional compensation is required to correct this.

[0074] Based on the temperature drift effect of the Hall element, a mutant fruit fly algorithm is established to optimize the least squares support vector machine LS-SVM model to compensate the Hall displacement sensor.

[0075] The LS-SVM model is a machine learning algorithm that maps feature vectors to a high-dimensional space and uses a kernel function to make a high-dimensional linear regression problem equivalent to a low-dimensional nonlinear regression problem. Unlike existing SVM algorithms, LS-SVM uses equations as constraints and employs different decision functions to improve the algorithm's convergence speed and accuracy.

[0076] For the Hall displacement sensor, due to the existence of temperature drift, the input of the Hall displacement sensor to the LS-SVM model is set to U s and U t , that is, the output voltage has a function of input quantity U(x)=f(U s ,Ut ), and then set the initial sample obtained by the calibration experiment as {(U si ,U ti ),U(x)},(i=1,2,...,n), a total of n sample points, and (U s ,U t ) is the input quantity x i , U(x) is the expected output y i .

[0077] Among them, U s Indicates the output voltage of the Hall displacement sensor, which is the normal Hall voltage, U t Indicates the output voltage of the temperature sensor, which is the bias voltage.

[0078] Then, the LS-SVM model is used to fit the relationship between the input x and the output y, as shown below:

[0079]

[0080] Where ω represents the weight coefficient of LS-SVM, and T represents the transposition operation; represents the characteristic function; b represents the offset of LS-SVM.

[0081] Then, through the risk minimization principle, the linear regression problem is transformed into an optimization problem, which is expressed as follows:

[0082]

[0083] Where J represents the objective function of the LS-SVM model, γ represents the regularization parameter, which is used to control the fitting error of the function; e i represents the relaxation factor.

[0084] Since ω belongs to a high-dimensional space and cannot be solved directly, the Lagrangian method is used to solve ω and obtain the regression equation of LS-SVM, which is expressed as follows:

[0085]

[0086] Among them, αi represents the Lagrange multiplier, m(x i ,x) represents the dot product of the kernel function corresponding to the feature space.

[0087] In the absence of prior information, the model designed with the radial basis kernel function has smaller errors and more accurate data. The expression is as follows:

[0088]

[0089] Among them, δ 2 Indicates the width of the kernel function.

[0090] The fruit fly optimization algorithm is an intelligent optimization algorithm based on the foraging behavior of fruit flies. It is a simple yet effective swarm intelligence optimization method. Inspired by the behavior of fruit fly populations, it simulates the process of their foraging through smell and vision to optimize complex problems. In this embodiment, in step S3, the fruit fly optimization algorithm is specifically as follows:

[0091] (1) The positions of the fruit fly population are initialized randomly, which are X0 and Y0, i.e. the initial horizontal and vertical coordinates of the fruit flies;

[0092] (2) For each fruit fly individual, use the sense of smell to perform a random search around the current reference point and calculate the new position. The expression is as follows:

[0093]

[0094] Among them, X i and Y i They represent the horizontal and vertical coordinates of the fruit fly's new position respectively. Rand() means generating a random number within the specified range, allowing the fruit fly to move freely within the search range.

[0095] (3) Calculate the distance D between the fruit fly and the origin i , and calculate the food odor concentration judgment value J i , the expression is as follows:

[0096]

[0097] (4) Based on the food odor concentration judgment function, substitute J into formula (7) i , obtain the odor concentration S obtained at the individual position of the fruit fly i , the expression is as follows:

[0098] S i =Function(J i ) (8)

[0099] (5) Mark the fruit fly with the highest food odor concentration. The expression is as follows:

[0100] [l s ,l i ]=max(S i ) (9)

[0101] Among them, l s Indicates the current maximum odor concentration, l i Indicates the number of the fruit fly with the highest current odor concentration, that is, the number of the better solution.

[0102] (6) The fruit fly group uses vision to lock onto the target and further optimizes the position through visual search, marking the maximum odor concentration and position coordinates (the location of the candidate solution). The expression is as follows:

[0103]

[0104] Among them, S max Indicates the maximum odor concentration.

[0105] (7) Repeat steps (1) to (6) to iterate and determine whether the odor concentration is greater than the previous odor concentration. If so, continue with step (6). If not, continue with the next round of iteration until the number of iterations is met, the iteration terminates, and the candidate solution is output.

[0106] In this embodiment, in step S3, the fitness of the candidate solution is calculated as follows:

[0107] The fruit fly algorithm is implemented by adjusting the γ and δ in the LS-SVM model. 2 Optimize and seek the optimal solution. The positions of the fruit flies are γ and δ. 2 The initial position of the fruit fly population is γ and δ 2 The initial value of . Then the candidate solution fitness F n The expression is as follows:

[0108]

[0109] Among them, U i represents the actual sensor output, Represents the predicted value of the LS-SVM model.

[0110] Compare the fitness of each fruit fly larva in the current iteration. If the new position is better than the old position, update the fitness value of the individual.

[0111] The mutation mechanism originates from the phenomenon of sudden change in biological evolution. In FOA, the mutation operation refers to the random perturbation of the positions of certain individuals in a fruit fly population, enabling them to explore new areas. This mechanism can help fruit flies escape the dilemma of local optimal solutions, thereby increasing the chances of global search.

[0112] In this embodiment, step S4 is specifically as follows:

[0113] 1) Select mutation individuals based on the fitness function, give priority to individuals with poor fitness for mutation to increase their possibility of escaping the suboptimal solution, and set a mutation probability P m , determines the number of mutated individuals in each iteration, and the mutation probability can be adjusted as the iteration progresses;

[0114] The individual fitness selection criteria are set according to the actual situation. In this embodiment, the fitness values ​​of all fruit fly individuals are calculated and sorted, and the individuals with the lowest fitness values ​​(i.e., individuals with poor fitness) are mutated.

[0115] 2) For the mutant fruit fly individual selected in step 1), randomly perturb its position in the parameter space. Set the position of the fruit fly individual to (X, Y). Then, X and Y can be randomly changed. The expression is as follows:

[0116]

[0117] Here, Rand(-Δ, Δ) represents generating a random number in the interval [-Δ, Δ]. Δ controls the intensity of the mutation. The size of Δ can be adjusted according to the progress of the search, gradually narrowing the mutation range to improve the accuracy of the subsequent optimization.

[0118] 3) Adaptive adjustment of variation intensity;

[0119] For individuals with poor fitness, a larger range of mutations is performed to increase the possibility of escaping the local optimum; while individuals with better fitness undergo smaller amplitude (small range) mutations to maintain stability.

[0120] The above fitness individual selection is set according to actual conditions. In this embodiment, the individuals with the lowest fitness values ​​of 20% are subjected to a larger range of mutation, and the individuals with the lowest fitness values ​​of 20%-30% are subjected to a smaller range of mutation.

[0121] The adjustment formula of mutation intensity Δ is as follows:

[0122]

[0123] Among them, Δ max Indicates the initial maximum mutation amplitude, count_iteration indicates the current number of iterations, and total_iteration indicates the maximum number of iterations. In this way, the mutation intensity can be gradually reduced as the number of iterations increases.

[0124] 4) Recalculate the fitness value F of the mutated individual v , and compare it with the original fitness value F n Compare and if the fitness after mutation is better, retain the individual after mutation, otherwise, keep the original position;

[0125] 5) Based on step 4), get the optimal solution F for the current iteration c , F c Compared with the optimal solution F1 obtained in the previous iteration, if F c ≥F1, then the optimal solution for the group is F c, otherwise it is F1, and then determine whether the current number of iterations is the maximum number of iterations. If so, output the optimal solution of the group. If not, add 1 to the number of iterations, return to step S3, repeat steps S3-S4 until the maximum number of iterations is met, output the optimal solution of the group, and realize temperature compensation of the Hall displacement sensor.

[0126] In summary, the method of the present invention first constructs an LS-SVM model based on the output data of the sensor, and optimizes the parameters of the LS-SVM model according to the fruit fly optimization algorithm to obtain γ and δ 2 However, the standard fruit fly algorithm may fall into the local optimum in complex optimization problems, resulting in unsatisfactory search results. Therefore, the mutation mechanism is introduced into the fruit fly optimization algorithm to enhance the algorithm's ability to escape the local optimal solution, and improve the global optimization effect and convergence speed, which can achieve faster and better temperature compensation for the sensor.

[0127] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and it should be understood that the scope of protection of the present invention is not limited to such specific descriptions and embodiments. Those skilled in the art can make various other specific variations and combinations based on the technical teachings disclosed in the present invention without departing from the essence of the present invention, and such variations and combinations are still within the scope of protection of the present invention.

Claims

1. A temperature compensation method for Hall displacement sensor based on LS-SVM optimized by mutant fruit fly algorithm, the specific steps are as follows: S1. Collect the output data of the Hall displacement sensor under different temperature conditions and the corresponding ambient temperature, build the LS-SVM model, and determine the regularization parameters and kernel function parameters in the model; S2, based on step S1, initialize the fruit fly population, set the initial search step length, maximum number of iterations and population size, and design a fitness function; S3, based on step S2, using the fruit fly optimization algorithm to search and generate candidate solutions, that is, seeking candidate solutions through olfactory search and visual search, and calculating the fitness of the candidate solutions; S4. Based on step S3, the mutation mechanism in the genetic algorithm is introduced into the fruit fly optimization algorithm, and the olfactory search and visual search operations are repeated, and the fitness of the individual is recalculated until the maximum number of iterations is reached or the fitness converges, thereby realizing temperature compensation for the Hall displacement sensor.

2. According to claim 1, a Hall displacement sensor temperature compensation method based on LS-SVM optimized by mutant fruit fly algorithm is characterized in that: The step S1 is specifically as follows: First, the output data of the Hall displacement sensor under different temperature conditions and the corresponding ambient temperature are collected, and the Hall voltage V is defined. H The expression is as follows: V H =K·B·I / t (1) Wherein, K represents the Hall constant, B represents the magnetic induction intensity perpendicular to the current, I represents the magnetic induction intensity passing through the Hall element, and t represents the thickness of the Hall element; Based on the temperature drift effect of the Hall element, a mutant fruit fly algorithm is used to optimize the least squares support vector machine LS-SVM model to compensate the Hall displacement sensor. If the Hall displacement sensor has temperature drift, the input of the Hall displacement sensor to the LS-SVM model is set to U s and U t , that is, the output voltage has a function of input quantity U(x)=f(U s ,U t ), and then set the initial sample obtained by the calibration experiment as {(U si ,U ti ),U(x)},(i=1,2,...,n), a total of n sample points, and (U s ,U t ) is the input quantity x i , U(x) is the expected output y i ; Among them, U s Indicates the output voltage of the Hall displacement sensor, which is the normal Hall voltage, U t Indicates the output voltage of the temperature sensor, which is the bias voltage; Then the LS-SVM model is used to fit the relationship between the input x and the output y. The expression is as follows: Among them, ω represents the weight coefficient of LS-SVM, and T represents the transposition operation; represents the characteristic function; b represents the offset of LS-SVM; Then, through the risk minimization principle, the linear regression problem is transformed into an optimization problem, and the expression is as follows: Where J represents the objective function of the LS-SVM model, γ represents the regularization parameter, which is used to control the fitting error of the function; i represents the relaxation factor; Then use the Lagrangian method to solve ω and get the regression equation of LS-SVM, which is expressed as follows: Among them, α i represents the Lagrange multiplier, m(x i ,x) represents the dot product of the kernel function corresponding to the feature space; Without prior information, the model expression designed using the radial basis kernel function is as follows: Among them, δ 2 Indicates the width of the kernel function.

3. The temperature compensation method of Hall displacement sensor based on LS-SVM optimized by mutant fruit fly algorithm according to claim 1 is characterized in that: In step S3, the fruit fly optimization algorithm is specifically as follows: (1) The positions of the fruit fly colony are initialized randomly, which are X0 and Y0, i.e., the initial horizontal and vertical coordinates of the fruit flies; (2) For each fruit fly individual, use the sense of smell to perform a random search around the current reference point and calculate the new position. The expression is as follows: Among them, X i and Y i Respectively represent the horizontal and vertical coordinates of the new position of the fruit fly, and Rand() represents generating a random number within the specified range, so that the fruit fly can move freely within the search range; (3) Calculate the distance D between the fruit fly and the origin i , and calculate the food odor concentration judgment value J i , the expression is as follows: (4) Based on the food odor concentration judgment function, substitute J into formula (7) i , obtain the odor concentration S obtained at the individual position of the fruit fly i , the expression is as follows: S i =Function(J i ) (8) (5) Mark the fruit fly with the highest food odor concentration. The expression is as follows: [L s ,L i ]=max(S i ) (9) Among them, l s Indicates the current maximum odor concentration, l i Indicates the number of the fruit fly with the highest current odor concentration, that is, the number of the better solution; (6) The fruit fly colony uses vision to lock onto the target and further optimizes the position through visual search, and marks the maximum odor concentration and position coordinates. The expression is as follows: Among them, S max Indicates the maximum odor concentration; (7) Repeat steps (1) to (6) to iterate and determine whether the odor concentration is greater than the previous odor concentration. If so, continue to step (6). If not, continue to the next round of iteration until the number of iterations is met, the iteration terminates, and the candidate solution is output.

4. The temperature compensation method of Hall displacement sensor based on LS-SVM optimized by variant fruit fly algorithm according to claim 1 is characterized in that: In step S3, the fitness of the candidate solution is calculated as follows: The fruit fly optimization algorithm is based on the γ and δ in the LS-SVM model. 2 Optimize and seek the optimal solution. The positions of the fruit flies are γ and δ. 2 The initial positions of the fruit fly population are γ and δ 2 The initial value of the candidate solution F n The expression is as follows: Among them, U i represents the actual sensor output, represents the predicted value of the LS-SVM model; Compare the fitness of each fruit fly larva in the current iteration. If the new position is better than the old position, update the fitness value of the individual.

5. The temperature compensation method of Hall displacement sensor based on LS-SVM optimized by variant fruit fly algorithm according to claim 1 is characterized in that: The step S4 is specifically as follows: 1) Select mutation individuals based on the fitness function, give priority to individuals with poor fitness for mutation, and set a mutation probability P m , determines the number of mutated individuals in each iteration, and the mutation probability can be adjusted as the iteration progresses; 2) For the mutant fruit fly individual selected in step 1), randomly perturb its position in the parameter space, set the position of the fruit fly individual to (X, Y), then randomly change X and Y, the expression is as follows: Among them, Rand(-Δ,Δ) means generating a random number in the interval [-Δ,Δ], Δ means controlling the intensity of mutation, and the size of Δ is adjusted according to the progress of the search to gradually narrow the mutation range; 3) Adaptive adjustment of variation intensity; For individuals with poor fitness, a larger range of mutations is performed; while individuals with better fitness undergo smaller mutations; the adjustment formula for mutation intensity Δ is as follows: Among them, Δ max Indicates the initial maximum variation range, count_iteration indicates the current number of iterations, and total_iteration indicates the maximum number of iterations; 4) Recalculate the fitness value F of the mutated individual v , and compare it with the original fitness value F n Compare and if the fitness after mutation is better, keep the individual after mutation, otherwise, keep the original position; 5) Based on step 4), get the optimal solution F for the current iteration c , F c Compared with the optimal solution F1 obtained in the previous iteration, if F c ≥F1, then the optimal solution for the group is F c , otherwise it is F1, and then determine whether the current number of iterations is the maximum number of iterations. If so, output the optimal solution of the group. If not, add 1 to the number of iterations and return to step S3. Repeat steps S3-S4 until the maximum number of iterations is met, output the optimal solution of the group, and realize temperature compensation of the Hall displacement sensor.

Citation Information

Patent Citations

  • SVM wind power prediction method

    CN106295908A

  • Pressure sensor temperature compensating method based on FOA-optimized SOM-RBF

    CN106679880A