Brushless motor rotor angle determination method and device, equipment and storage medium
By using an extended Kalman filter with multimodal fusion and adaptive temperature drift compensation, the temperature drift error and real-time performance issues of brushless motor rotor angle measurement are resolved, achieving high-precision angle measurement over a wide temperature range and full speed range, meeting the high-precision control requirements of industrial servo and other fields.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGDONG SENEASY INTELLIGENT TECH CO LTD
- Filing Date
- 2025-12-19
- Publication Date
- 2026-05-01
AI Technical Summary
The measurement of rotor angle of brushless motors has problems such as significant temperature drift error, poor adaptability to single mode, and difficulty in balancing measurement real-time performance and accuracy, resulting in low-speed jitter and high-speed step loss, which cannot meet the requirements of high-precision control.
By employing multimodal fusion technology, and through the confidence weight allocation of Hall sensors, incremental encoders, and back EMF observation modules, combined with a segmented temperature drift coupling model and a parameter-adaptive extended Kalman filter, high-precision and high-real-time measurement of rotor angles can be achieved.
Over a wide temperature range and full speed range, the rotor angle measurement error is reduced from 0.5° to 2° to below 0.1°, ensuring high precision and stability under complex operating conditions and meeting the requirements of high-precision control.
Smart Images

Figure CN121966353A_ABST
Abstract
Description
Methods, devices, equipment, and storage media for determining the rotor angle of a brushless motor Technical Field
[0001] This application relates to the field of brushless motor technology, and in particular to a method, apparatus, device and storage medium for determining the rotor angle of a brushless motor. Background Technology
[0002] A brushless motor is a DC motor that uses electronic commutation technology to replace the traditional mechanical commutator (carbon brush). It is widely used in high-precision control scenarios such as industrial servo systems, drones, and robot joints. The measurement accuracy of the rotor angle directly determines the control performance of the brushless motor.
[0003] In related technologies, the measurement of rotor angle of brushless motors has many shortcomings. First, temperature drift error is significant, and encoder zero-point offset and Hall installation deviation change with temperature, resulting in low-speed jitter and high-speed step loss. Second, single-mode adaptability is poor, encoder solutions are costly and susceptible to vibration interference, and back EMF solutions lack low-speed accuracy and cannot cover the full speed range of 0 to 10000 rpm. Finally, it is difficult to balance measurement real-time performance and measurement accuracy. Complex algorithms result in calculation delays exceeding 1 ms, which cannot meet the motor control requirements for angle update frequency (≥1 kHz). Summary of the Invention
[0004] This application provides a method, apparatus, device, and storage medium for determining the rotor angle of a brushless motor, in order to solve the problems of significant temperature drift error, poor single-mode adaptability, and difficulty in balancing measurement real-time performance and measurement accuracy in brushless motor rotor angle measurement.
[0005] To address the aforementioned technical problems, in a first aspect, this application provides a method for determining the rotor angle of a brushless motor, comprising: synchronously acquiring raw angle data from a Hall sensor, an incremental encoder, and a back EMF observation module; determining the confidence weights of the Hall sensor, the incremental encoder, and the back EMF observation module based on the rotor speed, and weighting and fusing the raw angle data of the Hall sensor, the incremental encoder, and the back EMF observation module to obtain an initial fused angle; calculating a temperature drift compensation angle based on real-time acquired motor temperature, motor phase current, and rotor speed using a segmented temperature drift coupling model, and compensating the initial fused angle based on the temperature drift compensation angle to obtain a temperature drift compensated angle; and inputting the temperature drift compensated angle into a parameter-adaptive extended Kalman filter for state estimation and filtering to obtain an estimated rotor angle value at the current moment.
[0006] The method for determining the rotor angle of a brushless motor provided in this application achieves high-precision, high-real-time, and high-reliability rotor angle measurement across a wide temperature range and full speed range through the synergy of multi-modal fusion, adaptive temperature drift compensation, and parameter-adaptive extended Kalman filtering. By using a segmented temperature drift coupling model and parameter-adaptive extended Kalman filter, the angle measurement error can be reduced from 0.5° to 2° in traditional methods to below 0.1° within a wide temperature range (-40℃ to 125℃), effectively overcoming the measurement reference drift caused by temperature changes and ensuring angle stability in all weather conditions or harsh environments. Through speed-based dynamic confidence weight allocation and multi-modal fusion, the method comprehensively utilizes the low-speed reference reliability of Hall sensors, the direct measurement accuracy of incremental encoders at medium to high speeds, and the excellent dynamic performance of back EMF observation at high speeds, maintaining high measurement accuracy across the entire speed range from 0 to 10000 rpm, thus solving the problem of insufficient performance of a single sensor at specific speed ranges. It can be seen that this method, through a three-level modular processing flow, realizes multi-source information acquisition, system error compensation and optimal estimation output, which can effectively meet the high-precision angle measurement needs of brushless motors in complex working conditions such as high-speed operation, variable load and ambient temperature fluctuation in consumer electronics, industrial servo and other fields.
[0007] In one embodiment, determining the confidence weights of the Hall sensor, the incremental encoder, and the back EMF observation module based on the rotor speed includes: if the rotor speed is less than or equal to a first speed threshold, then determining the confidence weights of the Hall sensor and the incremental encoder based on the rotor speed, and resetting the confidence weight of the back EMF observation module to zero; wherein, as the rotor speed increases, the confidence weight of the Hall sensor decreases, and the confidence weight of the incremental encoder increases; if the first speed threshold is less than or equal to a second speed threshold, then determining the confidence weights of the Hall sensor and the incremental encoder based on the rotor speed. The rotational speed determines the confidence weights of the incremental encoder and the back EMF observation module, respectively, and the confidence weight of the Hall sensor is reset to zero. When the rotor speed increases, the confidence weight of the incremental encoder decreases, and the confidence weight of the back EMF observation module increases. If the rotor speed is greater than a second speed threshold, the confidence weights of the incremental encoder and the back EMF observation module are set to a first preset weight value and a second preset weight value, respectively, and the confidence weight of the Hall sensor is reset to zero. The first preset weight value is less than the second preset weight value.
[0008] In one implementation, the step of calculating the temperature drift compensation angle using a segmented temperature drift coupling model based on real-time acquired motor temperature, motor phase current, and rotor speed includes: if a first temperature threshold ≤ motor temperature < second temperature threshold, then obtaining a first low-temperature coefficient, a second low-temperature coefficient, and a low-temperature constant, and calculating the temperature drift compensation angle based on the first low-temperature coefficient, the second low-temperature coefficient, the low-temperature constant, the motor temperature, and the rotor speed; if the second temperature threshold ≤ motor temperature < third temperature threshold, then obtaining a first normal temperature coefficient, a second normal temperature coefficient, and a normal temperature constant, and calculating the temperature drift compensation angle based on the first normal temperature coefficient, the second normal temperature coefficient, the normal temperature constant, the motor temperature, and the motor phase current. Calculate the temperature drift compensation angle; if the third temperature threshold ≤ the motor temperature ≤ the fourth temperature threshold, then obtain the first high temperature coefficient, the second high temperature coefficient, the third high temperature coefficient, and the high temperature constant, and calculate the temperature drift compensation angle based on the first high temperature coefficient, the second high temperature coefficient, the third high temperature coefficient, the high temperature constant, the motor temperature, the rotor speed, and the motor phase current; wherein, the initial values of the first low temperature coefficient, the second low temperature coefficient, the low temperature constant, the first normal temperature coefficient, the second normal temperature coefficient, the normal temperature constant, the first high temperature coefficient, the second high temperature coefficient, the third high temperature coefficient, and the high temperature constant are obtained by fitting experimental data using the offline least squares method.
[0009] In one embodiment, the method further includes: constructing an observation vector and a parameter vector to be estimated, wherein the observation vector includes the motor temperature, the rotor speed, and the motor phase current; the parameter vector to be estimated includes any one of low-temperature parameters, normal-temperature parameters, and high-temperature parameters; the low-temperature parameters include a first low-temperature coefficient, a second low-temperature coefficient, and a low-temperature constant; the normal-temperature parameters include a first normal-temperature coefficient, a second normal-temperature coefficient, and a normal-temperature constant; and the high-temperature parameters include a first high-temperature coefficient, a second high-temperature coefficient, a third high-temperature coefficient, and a high-temperature constant; obtaining a residual vector at the current moment based on the observation vector at the current moment, the measured error vector at the current moment, and the parameter vector to be estimated at the previous moment; the measured error vector is determined based on the zero-position signal of the incremental encoder and the over-part signal of the back EMF observation module; updating the parameter vector to be estimated at the current moment based on the parameter vector to be estimated at the previous moment, the gain vector at the current moment, and the residual vector at the previous moment; the gain vector is used to characterize the influence weight of the observation vector at the current moment on the parameter vector to be estimated.
[0010] In one embodiment, after inputting the temperature drift compensated angle into a parameter-adaptive extended Kalman filter for state estimation and filtering to obtain the rotor angle estimate at the current moment, the method further includes: obtaining the rotor angle prediction value at the current moment based on the angular velocity estimate output by the extended Kalman filter at the previous moment; if the difference between the rotor angle prediction value at the current moment and the temperature drift compensated angle at the current moment is outside a preset difference range, then determining a prediction correction angle based on the rotor angle prediction value at the current moment and the temperature drift compensated angle at the current moment; and correcting the rotor angle estimate value based on the prediction correction angle.
[0011] In one embodiment, the step of inputting the temperature drift-compensated angle into a parameter-adaptive extended Kalman filter for state estimation and filtering to obtain the rotor angle estimate at the current moment includes: initializing the state vector and covariance matrix of the extended Kalman filter, wherein the state vector includes the rotor angle and rotor angular velocity; constructing a state transition model and an observation model of the extended Kalman filter, wherein the state transition model is characterized by a state transition matrix and process noise, and the observation model is characterized by the rotor angle estimate and observation noise; generating a prior estimate of the state vector and a prior estimate of the covariance matrix at the current moment based on the state vector and covariance matrix at the previous moment through the state transition model; generating the Kalman gain matrix at the current moment based on the prior estimate of the covariance matrix and the observation model; generating a posterior estimate of the covariance matrix at the current moment based on the prior estimate of the Kalman gain matrix and the covariance matrix; generating a posterior estimate of the state vector at the current moment based on the measured error vector, the observation model, the prior estimate of the state vector, and the Kalman gain matrix, and determining the rotor angle estimate at the current moment based on the posterior estimate of the state vector.
[0012] In one embodiment, before generating the Kalman gain matrix at the current moment based on the prior estimation of the covariance matrix and the observation model, the method further includes: dynamically adjusting the variance matrix of the process noise according to the rotor speed, and dynamically adjusting the variance matrix of the observation noise according to the confidence weights of the Hall sensor, the incremental encoder, and the back EMF observation module.
[0013] Secondly, this application provides a device for determining the rotor angle of a brushless motor, comprising: a synchronous acquisition module for synchronously acquiring raw angle data from a Hall sensor, an incremental encoder, and a back EMF observation module; a weighted fusion module for determining the confidence weights of the Hall sensor, the incremental encoder, and the back EMF observation module according to the rotor speed, and performing weighted fusion on the raw angle data of the Hall sensor, the incremental encoder, and the back EMF observation module to obtain an initial fused angle; an angle compensation module for calculating a temperature drift compensation angle based on the real-time acquired motor temperature, motor phase current, and rotor speed through a segmented temperature drift coupling model, and compensating the initial fused angle according to the temperature drift compensation angle to obtain a temperature drift compensated angle; and a rotor angle determination module for inputting the temperature drift compensated angle into a parameter-adaptive extended Kalman filter for state estimation and filtering to obtain an estimated rotor angle value at the current moment.
[0014] Thirdly, this application provides a computer device, characterized in that it includes a processor and a memory, the memory being used to store a computer program, which, when executed by the processor, implements the above-described method for determining the rotor angle of a brushless motor.
[0015] Fourthly, this application provides a computer-readable storage medium, characterized in that it stores a computer program, which, when executed by a processor, implements the above-described method for determining the rotor angle of a brushless motor. Attached Figure Description
[0016] Figure 1 is a flowchart illustrating the method for determining the rotor angle of a brushless motor according to an embodiment of this application; Figure 2 is a structural diagram illustrating the device for determining the rotor angle of a brushless motor according to an embodiment of this application; Figure 3 is a structural diagram illustrating the electronic device according to an embodiment of this application. Detailed Implementation
[0017] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0018] Please refer to Figure 1, which is a flowchart illustrating a method for determining the rotor angle of a brushless motor according to an embodiment of this application. As shown in Figure 1, the method for determining the rotor angle of a brushless motor in this embodiment includes steps S101 to S104, which are detailed below: Step S101: Synchronously acquire the raw angle data from the Hall sensor, incremental encoder, and back EMF observation module.
[0019] In this step, the Hall sensor can acquire three Hall signals (H1 / H2 / H3), which determine the sector where the rotor is located. Each sector covers 60° of electrical angle. By detecting the edge of the Hall signal change, the moment of entry into the current sector (t_in) and the current sampling moment (t_now) can be accurately recorded. Then, based on the real-time speed of the brushless motor, the electrical angle increment of the current sector at the sampling moment can be determined. Based on the electrical angle increment of the current sector and the initial electrical angle of the current sector, the real-time electrical angle of the brushless motor at the sampling moment can be obtained. Since brushless motors typically have multiple pairs of magnetic poles, the mechanical angle of the brushless motor can be obtained based on the real-time electrical angle and the number of pole pairs. Furthermore, the real-time electrical angle of the brushless motor can be calibrated based on the static installation deviation, making the real-time electrical angle of the brushless motor more accurate. The static installation deviation of the brushless motor can be calibrated using a laser positioning instrument before leaving the factory. Preferably, an electrical angle calibration table can be pre-stored for correction of the electrical angle at low speeds.
[0020] In this step, the incremental encoder is coaxially connected to the motor rotor. As the motor rotor rotates, the incremental encoder outputs two staggered pulse signals (A / B). Each pulse represents a fixed, extremely small angle the rotor has rotated. The incremental encoder itself generates 1024 sets of A / B pulses (i.e., 1024 lines) per revolution. By capturing the rising and falling edges of each pulse in a chip (such as an FPGA), the signal change points can be increased by four times. Combined with the phase difference between phases A and B, a 16x frequency multiplication is ultimately achieved (hardware counting; a 1024-line encoder corresponds to 16384 pulses / revolution, with an accuracy of 0.087° / pulse). By comparing the phase order of the A and B phase signals, it can be determined whether the rotor is rotating forward or backward. The counter in the controller increments or decrements the pulse count according to the direction to obtain the cumulative pulse count. To prevent cumulative errors, the incremental encoder outputs a Z-phase zero-position pulse per revolution. Resetting the pulse counter after detecting the Z-phase zero-position pulse eliminates cumulative errors. Furthermore, in high-speed or vibrating environments, electrical noise may cause brief anomalies in the pulse signal. Pulse loss can be identified using a pulse loss detection algorithm. For example, pulse loss is determined by the absence of pulse changes for five consecutive sampling cycles. If pulse loss is detected, the number of pulses that should have been counted during the "pulse loss" period is predicted based on the rotor speed at the last moment before the pulse loss. This predicted value is then used to temporarily correct the pulse count, thereby avoiding angle jumps caused by noise.
[0021] In this step, the back EMF observation module can calculate the bus voltage division and thus determine the three-phase voltage by measuring the power transistor's conduction state, and determine the three-phase current by sampling with Hall sensors. Then, the three-phase voltage and three-phase current are transformed from the three-phase stationary coordinate system to the two-phase stationary coordinate system using Clark transformation to simplify the calculation and eliminate winding coupling. Then, the extended back EMF model (considering the influence of inductance and resistance temperature drift) is used to calculate the extended back EMF, and the back EMF components in the two-phase stationary coordinate system are obtained respectively. and And thus through the back electromotive force component and Calculate the real-time electrical angle of the brushless motor The mechanical angle of the brushless motor is calculated by combining the pole pair number. Since the back EMF amplitude is very small and the signal-to-noise ratio is low at low speeds (e.g., <500 rpm), the calculated electrical angle is easily affected by noise. Therefore, a current ripple compensation factor (positively correlated with the PWM duty cycle) can be introduced to improve the signal-to-noise ratio. The back EMF signal is amplified by the current ripple compensation factor, and the amplified back EMF signal is used to calculate the electrical angle of the brushless motor, making the electrical angle of the brushless motor more stable at low speeds.
[0022] Step S102: Determine the confidence weights of the Hall sensor, the incremental encoder, and the back EMF observation module according to the rotor speed, and perform weighted fusion of the original angle data of the Hall sensor, the incremental encoder, and the back EMF observation module to obtain the initial fused angle.
[0023] In this step, because the physical principles by which Hall sensors, incremental encoders, and back EMF observation modules measure the rotor angle of brushless motors differ, and the accuracy, reliability, and effectiveness of each are strongly correlated with rotor speed, using a Hall sensor, incremental encoder, or back EMF observation module alone is insufficient for accurate measurement of the brushless motor rotor angle. Therefore, determining the confidence weights of the Hall sensor, incremental encoder, or back EMF observation module according to different rotor speeds and performing weighted fusion can achieve accurate rotor angle measurement across the entire speed range. For Hall sensors, they provide discrete absolute sector references, but interpolation is required within the sector, and the interpolation error increases with higher speeds. In the low-speed range, they provide a stable reference and have a higher weight; as the speed increases, their interpolation error increases, and their weight decreases linearly, gradually relinquishing their dominant position and preventing their inherent defects from becoming a bottleneck for accuracy. For incremental encoders, they can provide high-precision rotor angle measurement, but at high speeds, the pulse frequency is high and they are susceptible to vibration interference. In the low-to-medium speed range, their high precision advantage is obvious, and they have a high weight. In the high-speed range, to avoid the risk of pulse loss and high computing power consumption, the weight is reduced, but their absolute zero-position function is retained, continuously providing the system with a low weight to provide a cumulative error calibration benchmark. For the back EMF observation module, at low rotor speeds, the signal is weak, the signal-to-noise ratio is too low, and the calculation error is large. Therefore, its weight is reduced to 0 to avoid introducing noise and errors. At medium-to-high speeds, its signal is strong, non-contact, and has good real-time performance. Its weight gradually increases until it becomes dominant, giving full play to its advantages of high-speed and high-dynamic performance.
[0024] In a preferred embodiment, when determining the confidence weights of the Hall sensor, incremental encoder, and back EMF observation module based on the rotor speed, if the rotor speed is less than or equal to a first speed threshold, the confidence weights of the Hall sensor and incremental encoder are determined based on the rotor speed, and the confidence weight of the back EMF observation module is reset to zero. As the rotor speed increases, the confidence weight of the Hall sensor decreases, and the confidence weight of the incremental encoder increases. If the first speed threshold is less than or equal to a second speed threshold, the confidence weights of the incremental encoder and back EMF observation module are determined based on the rotor speed, and the confidence weight of the Hall sensor is reset to zero. As the rotor speed increases, the confidence weight of the incremental encoder decreases, and the confidence weight of the back EMF observation module increases. If the rotor speed is greater than the second speed threshold, the confidence weights of the incremental encoder and back EMF observation module are set to a first preset weight value and a second preset weight value, respectively, and the confidence weight of the Hall sensor is reset to zero. The first preset weight value is less than the second preset weight value.
[0025] For example, if The confidence weights of the Hall sensor are indicated. The confidence weights represent the input and output weights of an incremental encoder. Let n represent the confidence weight of the back EMF observation module, and n represent the rotor speed. Then, the following condition is met: .
[0026] If n ≤ 1000 rpm, then , , If 1000 < n ≤ 3000 rpm, then , , If n > 3000 rpm, then , , .
[0027] Furthermore, if This represents the raw angle data from the Hall sensor. This represents the raw angle data of the incremental encoder. This represents the raw angle data from the back electromotive force observation module. If the initial fusion angle is given, then the following condition is met. .
[0028] Furthermore, during mode switching (adjustment of confidence weights for Hall sensors, incremental encoders, and back EMF observation modules), a smooth switching mechanism can be used to limit the rotor angle jump amplitude. For example, a first-order low-pass filter (time constant τ=5ms) can be introduced to limit the rotor angle jump amplitude to ≤0.05°. In addition, sensor health assessment indicators (such as encoder pulse jitter and back EMF signal-to-noise ratio) can be designed. When the health score is <0.6 (out of 1), the weight of the corresponding sensor is automatically reduced to below 0.1, thereby improving redundancy.
[0029] Step S103: Based on the real-time collected motor temperature, motor phase current and rotor speed, calculate the temperature drift compensation angle through the segmented temperature drift coupling model, and compensate the initial fusion angle according to the temperature drift compensation angle to obtain the temperature drift compensation angle.
[0030] In this step, the initial fusion angle will systematically drift with changes in ambient and operating temperatures. By calculating the temperature drift compensation angle using a segmented temperature drift coupling model and compensating the initial fusion angle based on the temperature drift compensation angle, the temperature drift error can be actively and adaptively modeled and compensated in real time, thereby significantly reducing the temperature drift error and ensuring that the angle after temperature drift compensation maintains high accuracy over a wide temperature range (e.g., -40℃ to 125℃).
[0031] It should be noted that the effect of temperature on the system is not a simple linear relationship. For example, in the low-temperature region (-40℃ to -10℃), the nonlinear effect of the material is significant; in the high-temperature region (>60℃), new physical effects such as magnetic performance decay may occur, and a single linear model cannot accurately fit the entire temperature range. This step adopts a piecewise temperature drift coupling model based on experimental data, and establishes compensation functions that best fit the physical characteristics of different temperature ranges (e.g., a quadratic function for low temperatures and a current cross term introduced for high temperatures), achieving a high-precision approximation of complex temperature drift phenomena. Motor temperature is the direct driving variable and state characterization of temperature drift error, directly reflecting the thermal state of the environment and the motor; motor phase current is the dynamic heat source that leads to temperature rise (Joule heating and iron loss), and is also a factor causing magnetic saturation effect. The introduction of motor phase current allows the model to distinguish between "temperature drift caused by the environment" and "temperature drift caused by the heating of its own operating current", resulting in more accurate compensation; rotor speed affects heat dissipation conditions and is related to the back EMF signal-to-noise ratio, indirectly affecting the temperature drift performance of different measurement modes. By using motor temperature, motor phase current, and rotor speed as model inputs, the segmented temperature drift coupling model can dynamically respond to the actual operating state of the brushless motor (whether it is operating under light load and cold conditions or under heavy load and hot conditions), thereby providing accurate "state-following" compensation and dynamically offsetting system errors over a wide temperature range.
[0032] In a preferred embodiment, based on real-time collected motor temperature, motor phase current, and rotor speed, when calculating the temperature drift compensation angle using a segmented temperature drift coupling model, if the first temperature threshold ≤ motor temperature < second temperature threshold, then a first low-temperature coefficient, a second low-temperature coefficient, and a low-temperature constant are obtained, and the temperature drift compensation angle is calculated based on the first low-temperature coefficient, the second low-temperature coefficient, the low-temperature constant, the motor temperature, and the rotor speed; if the second temperature threshold ≤ motor temperature < third temperature threshold, then a first normal temperature coefficient, a second normal temperature coefficient, and a normal temperature constant are obtained, and the temperature drift compensation angle is calculated based on the first normal temperature coefficient, the second normal temperature coefficient, the normal temperature constant, and the motor temperature. The temperature drift compensation angle is calculated based on the motor phase current. If the third temperature threshold ≤ motor temperature ≤ fourth temperature threshold, the first high temperature coefficient, the second high temperature coefficient, the third high temperature coefficient, and the high temperature constant are obtained. The temperature drift compensation angle is calculated based on the first high temperature coefficient, the second high temperature coefficient, the third high temperature coefficient, the high temperature constant, the motor temperature, the rotor speed, and the motor phase current. The initial values of the first low temperature coefficient, the second low temperature coefficient, the low temperature constant, the first normal temperature coefficient, the second normal temperature coefficient, the normal temperature constant, the first high temperature coefficient, the second high temperature coefficient, the third high temperature coefficient, and the high temperature constant are obtained by fitting experimental data using the offline least squares method.
[0033] For example, based on 100 sets of experimental data (from -40℃ to 125℃, collected every 5℃), the segmented temperature drift coupling model is divided into three intervals according to the inflection points of temperature drift characteristics (-10℃, 60℃): low temperature interval, normal temperature interval, and high temperature interval.
[0034] In the low-temperature range (-40℃ to -10℃, nonlinearity ≥5%), the temperature drift compensation angle is determined by the following formula (quadratic term compensation for nonlinearity): Within the normal temperature range (-10℃ to 60℃, nonlinearity ≤2%), the temperature drift compensation angle is determined by the following formula (simplified calculation for linear models): In the high-temperature range (60℃ to 125℃, nonlinearity ≥3%), the temperature drift compensation angle is determined by the following formula (considering the square term of rotational speed and the cross term of current-temperature): ;in, Indicates the temperature drift compensation angle. Indicates the first low temperature coefficient. Indicates the second low temperature coefficient. Represents the low temperature constant. Indicates the first room temperature coefficient. This represents the second room temperature coefficient. Represents the constant at room temperature. Indicates the first high temperature coefficient. This indicates the second high temperature coefficient. Indicates the third high temperature coefficient. Represents the high temperature constant. Indicates motor temperature. Indicates the phase current of the motor. This indicates the rotor speed.
[0035] Because the temperature drift characteristics of brushless motors are not constant, but rather slowly change over time due to individual motor differences, component aging, and variations in operating conditions (such as different loads and heat dissipation conditions), the fixed parameter model calibrated offline at the motor's factory cannot accurately match the dynamic drift characteristics of the motor in actual operation over a long period. Therefore, a recursive least squares method with a forgetting factor (FF-RLS) can be used to update the first low temperature coefficient, second low temperature coefficient, low temperature constant, first normal temperature coefficient, second normal temperature coefficient, normal temperature constant, first high temperature coefficient, second high temperature coefficient, third high temperature coefficient, and high temperature constant in real time (for example, the forgetting factor λ is 0.98), executed once every 10ms.
[0036] In a preferred embodiment, when updating parameters, firstly, an observation vector and a parameter vector to be estimated are constructed. The observation vector includes motor temperature, rotor speed, and motor phase current. The parameter vector to be estimated includes any one of low-temperature parameters, normal-temperature parameters, and high-temperature parameters. The low-temperature parameters include a first low-temperature coefficient, a second low-temperature coefficient, and a low-temperature constant. The normal-temperature parameters include a first normal-temperature coefficient, a second normal-temperature coefficient, and a normal-temperature constant. The high-temperature parameters include a first high-temperature coefficient, a second high-temperature coefficient, a third high-temperature coefficient, and a high-temperature constant. Then, the residual vector at the current moment is obtained based on the observation vector at the current moment, the measured error vector at the current moment, and the parameter vector to be estimated at the previous moment. The measured error vector is determined based on the zero-position signal of the incremental encoder and the over-part signal of the back EMF observation module. Finally, the parameter vector to be estimated at the current moment is updated based on the parameter vector to be estimated at the previous moment, the gain vector at the current moment, and the residual vector at the previous moment. The gain vector is used to characterize the influence weight of the observation vector at the current moment on the parameter vector to be estimated.
[0037] For example, the observation vector is represented as The vector of parameters to be estimated is represented as Taking the low-temperature range (-40℃ to 10℃, nonlinearity ≥5%) as an example, , The residual vector at the current time step can be represented by the following formula: ;in, This represents the residual vector at the current time step. This represents the observation vector at the current moment. This represents the measured error vector at the current moment. The vector of parameters to be estimated at the previous moment represents the difference between the mechanical angle corresponding to the zero-position signal of the incremental encoder and the mechanical angle corresponding to the zero-crossing signal of the back EMF observation module. The vector of parameters to be estimated at the current moment can be represented by the following formula: ;in, This represents the vector of parameters to be estimated at the current moment; This represents the gain vector at the current time. , Indicates the forgetting factor, Let the covariance matrix at the previous time step be denoted as . .
[0038] Furthermore, to prevent the divergence of low-temperature, normal-temperature, and high-temperature parameters, upper and lower limits of the parameters can be preset (e.g., When a parameter exceeds its upper or lower limit, the corresponding parameter will be reset to its initial calibration value at the same temperature. The angle after temperature drift compensation can be expressed by the following formula: , This indicates the angle after temperature drift compensation. Indicates the initial fusion angle. This indicates the temperature drift compensation angle. Preferably, this step can also use amplitude limiting filtering (single compensation amount ≤ 0.2°) to avoid abnormal angle jumps after temperature drift compensation.
[0039] Step S104: Input the temperature drift compensated angle into the parameter adaptive extended Kalman filter for state estimation and filtering to obtain the rotor angle estimate at the current moment.
[0040] In this step, variable sampling rate filtering and predictive correction are performed using a parameter-adaptive extended Kalman filter (EPA), balancing accuracy and real-time performance within a lightweight framework. The EPA not only estimates the rotor angle at the current moment but also simultaneously estimates key state variables such as angular velocity, enabling high-performance control (e.g., predictive control). The EPA uses the motor's kinematic model (state equations) to predict the rotor angle and then performs a statistically optimal fusion of the predicted value and the actual measured value (i.e., the angle after temperature drift compensation). Furthermore, the EPA dynamically determines the fusion weights based on the "confidence" in the model and measurements (i.e., process noise variance Q and observation noise variance R). When measurement noise is high, the confidence of the model prediction is increased, resulting in a smoother output; when dynamic changes are drastic (model prediction is inaccurate), the confidence of the new measured value is increased, resulting in a rapid response, thus achieving a dynamic balance between smoothness and speed.
[0041] In a preferred embodiment, after step S104, the rotor angle estimate can be corrected. First, based on the angular velocity estimate output by the extended Kalman filter at the previous moment, the predicted rotor angle for the current moment is obtained. If the difference between the predicted rotor angle for the current moment and the angle after temperature drift compensation is outside a preset difference range, a predicted correction angle is determined based on the predicted rotor angle for the current moment and the angle after temperature drift compensation. The rotor angle estimate is then corrected based on the predicted correction angle. The predicted rotor angle for the current moment can be expressed by the following formula: ;in, This represents the predicted rotor angle at the current moment. This represents the estimated angular velocity output by the extended Kalman filter at the previous time step. Indicates the current angular velocity. This represents the sampling time interval. The prediction correction angle can be expressed by the following formula: ;in, Indicates the predicted correction angle. This is a preset proportional coefficient. This is the angle after temperature drift compensation at the current moment. Correcting the rotor angle estimate based on the predicted correction angle can effectively avoid the occurrence of cumulative errors.
[0042] In a preferred embodiment, when performing step S104, the state vector and covariance matrix of the extended Kalman filter are first initialized, and the state vector includes the rotor angle and rotor angular velocity. Then, the state transition model and observation model of the extended Kalman filter are constructed. The state transition model is characterized by the state transition matrix and process noise, and the observation model is characterized by the rotor angle estimate and observation noise. Based on the state vector and covariance matrix of the previous time step, the prior estimate of the state vector and the prior estimate of the covariance matrix of the current time step are generated through the state transition model. Next, the Kalman gain matrix of the current time step is generated based on the prior estimate of the covariance matrix and the observation model. The posterior estimate of the covariance matrix of the current time step is generated based on the prior estimate of the Kalman gain matrix and the covariance matrix. Finally, the posterior estimate of the state vector of the current time step is generated based on the measured error vector, the observation model, the prior estimate of the state vector, and the Kalman gain matrix, and the rotor angle estimate of the current time step is determined based on the posterior estimate of the state vector.
[0043] For example, the initialized state vector is The initialized covariance matrix is ,in, and These represent the initial estimated values of the rotor angle and rotor angular velocity, respectively. and Let represent the initial estimated variances of the rotor angle and rotor angular velocity, respectively; the state transition model of the extended Kalman filter is expressed as follows: ;in, Represents the state transition matrix. Indicates process noise. Indicates the sampling interval and process noise. It follows a Gaussian distribution with zero mean and variance matrix Q(k).
[0044] The state transition model of the extended Kalman filter is represented as follows: ;in, This represents the estimated rotor angle. This represents observation noise. It follows a Gaussian distribution with zero mean and variance matrix R(k).
[0045] In a preferred embodiment, before generating the Kalman gain matrix for the current moment based on the prior estimation of the covariance matrix and the observation model, the variance matrix of the process noise can be dynamically adjusted according to the rotor speed, and the variance matrix of the observation noise can be dynamically adjusted according to the confidence weights of the Hall sensor, the incremental encoder and the back EMF observation module.
[0046] For example, when the rotor speed is low, the variance matrix Q(k) is set to... When the rotor speed is high, the variance matrix Q(k) is set to By dynamically adjusting the variance matrix of process noise based on rotor speed, dynamic tracking capability can be enhanced at higher rotor speeds, while filtering smoothness can be improved and jitter suppressed at lower rotor speeds.
[0047] Furthermore, when the confidence weight of the incremental encoder is high, the variance matrix R(k) is set to 1e-5, and when the confidence weight of the back EMF observation module is high, the variance matrix R(k) is set to 5e-5; the update frequency of the rotor angle estimate can be switched according to the rotor speed (2kHz at low speed and 5kHz at high speed) to ensure that the delay is ≤1ms.
[0048] Furthermore, the matrix operations of the extended Kalman filter algorithm can be optimized by fixed-point conversion (32-bit integers replace floating-point) to reduce computation time. Fixed-point conversion optimization can reduce computation time from 120μs to 35μs. The temperature drift model parameters can be determined by a combination of piecewise lookup table and linear interpolation (a set of coefficients is stored every 10℃), reducing Flash memory usage from 8KB to 2KB. The computational requirements can be met by a 32-bit mid-range MCU.
[0049] The method for determining the rotor angle of a brushless motor provided in this application achieves high-precision, high-real-time, and high-reliability rotor angle measurement across a wide temperature range and full speed range through the synergy of multi-modal fusion, adaptive temperature drift compensation, and parameter-adaptive extended Kalman filtering. By using a segmented temperature drift coupling model and parameter-adaptive extended Kalman filter, the angle measurement error can be reduced from 0.5° to 2° in traditional methods to below 0.1° within a wide temperature range (-40℃ to 125℃), effectively overcoming the measurement reference drift caused by temperature changes and ensuring angle stability in all weather conditions or harsh environments. Through speed-based dynamic confidence weight allocation and multi-modal fusion, the method comprehensively utilizes the low-speed reference reliability of Hall sensors, the direct measurement accuracy of incremental encoders at medium to high speeds, and the excellent dynamic performance of back EMF observation at high speeds, maintaining high measurement accuracy across the entire speed range from 0 to 10000 rpm, thus solving the problem of insufficient performance of a single sensor at specific speed ranges. It can be seen that this method, through a three-level modular processing flow, realizes multi-source information acquisition, system error compensation and optimal estimation output, which can effectively meet the high-precision angle measurement needs of brushless motors in complex working conditions such as high-speed operation, variable load and ambient temperature fluctuation in consumer electronics, industrial servo and other fields.
[0050] To implement the method for determining the rotor angle of a brushless motor corresponding to the above-described method embodiments, and to achieve the corresponding functions and technical effects, please refer to Figure 2. Figure 2 shows a structural block diagram of a device for determining the rotor angle of a brushless motor provided in an embodiment of this application. For ease of explanation, only the parts relevant to this embodiment are shown. The brushless motor rotor angle determination device 20 provided in this application embodiment includes a synchronous acquisition module 21, a weighted fusion module 22, an angle compensation module 23, and a rotor angle determination module 24, as described below: The synchronous acquisition module 21 is used to synchronously acquire the original angle data of the Hall sensor, the incremental encoder, and the back EMF observation module; the weighted fusion module 22 is used to determine the confidence weights of the Hall sensor, the incremental encoder, and the back EMF observation module according to the rotor speed, and to perform weighted fusion on the original angle data of the Hall sensor, the incremental encoder, and the back EMF observation module to obtain an initial fused angle; the angle compensation module 23 is used to calculate the temperature drift compensation angle based on the real-time acquired motor temperature, motor phase current, and rotor speed through a segmented temperature drift coupling model, and to compensate the initial fused angle according to the temperature drift compensation angle to obtain the temperature drift compensated angle; the rotor angle determination module 24 is used to input the temperature drift compensated angle into a parameter adaptive extended Kalman filter for state estimation and filtering to obtain the rotor angle estimate value at the current moment.
[0051] The aforementioned brushless motor rotor angle determination device can implement the brushless motor rotor angle determination method of the above method embodiments. The options in the above method embodiments are also applicable to this embodiment, and will not be detailed here. The remaining contents of this application embodiment can be referred to the contents of the above method embodiments, and will not be repeated in this embodiment.
[0052] The brushless motor in this embodiment can be a three-phase permanent magnet synchronous motor (rated speed 6000 rpm, rated current 5A, number of pole pairs 8); the Hall sensor is a 3-channel Hall sensor (accuracy ±3°); the incremental encoder is a 1024-line incremental encoder (16x frequency); the back EMF observation module uses a DS18B20 temperature sensor (accuracy ±0.5℃) and an ACS712 current sensor. The processor is a 32-bit microprocessor (400MHz clock speed), equipped with an FPGA for incremental encoder pulse subdivision.
[0053] Figure 3 is a schematic diagram of the structure of a computer device provided in an embodiment of this application. As shown in Figure 3, the computer device 30 of this embodiment includes: at least one processor 31 (only one is shown in Figure 3), a memory 32, and a computer program 33 stored in the memory 32 and executable on the at least one processor 31. When the processor 31 executes the computer program 33, it implements the steps in any of the above method embodiments.
[0054] The computer device 30 may be a desktop computer or a cloud server, etc. The computer device 30 may include, but is not limited to, a processor 31 and a memory 32. Those skilled in the art will understand that Figure 3 is merely an example of the computer device 30 and does not constitute a limitation on the computer device 30. It may include more or fewer components than shown, or combine certain components, or different components, such as input / output devices, network access devices, etc.
[0055] The processor 31 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0056] In some embodiments, the memory 32 may be an internal storage unit of the computer device 30, such as a hard disk or memory of the computer device 30. In other embodiments, the memory 32 may be an external storage device of the computer device 30, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 30. Furthermore, the memory 32 may include both internal and external storage units of the computer device 30. The memory 32 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory 32 can also be used to temporarily store data that has been output or will be output.
[0057] In addition, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above method embodiments.
[0058] This application provides a computer program product that, when run on a computer device, enables the computer device to execute the steps described in the various method embodiments above.
[0059] In the several embodiments provided in this application, it will be understood that each block in the flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the figures. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved.
[0060] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0061] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of this application. It should be understood that the above descriptions are merely specific embodiments of this application and are not intended to limit the scope of protection of this application. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application for those skilled in the art.
Claims
1. A method for determining the rotor angle of a brushless motor, characterized in that, include: The system synchronously acquires raw angle data from a Hall sensor, an incremental encoder, and a back EMF observation module. Based on the rotor speed, the confidence weights of each component are determined, and the raw angle data from these components are weighted and fused to obtain an initial fused angle. Based on real-time acquired motor temperature, motor phase current, and rotor speed, a segmented temperature drift coupling model is used to calculate a temperature drift compensation angle. This compensation angle is then used to compensate for the initial fused angle, resulting in a temperature drift compensated angle. Finally, the temperature drift compensated angle is input to a parameter-adaptive extended Kalman filter for state estimation and filtering to obtain the current rotor angle estimate.
2. The method for determining the rotor angle of a brushless motor as described in claim 1, characterized in that, The step of determining the confidence weights of the Hall sensor, the incremental encoder, and the back EMF observation module based on the rotor speed includes: if the rotor speed is less than or equal to a first speed threshold, then the confidence weights of the Hall sensor and the incremental encoder are determined based on the rotor speed, and the confidence weight of the back EMF observation module is reset to zero. When the rotor speed increases, the confidence weight of the Hall sensor decreases, and the confidence weight of the incremental encoder increases. If the first speed threshold is less than the rotor speed and less than a second speed threshold, then the confidence weights of the incremental encoder and the back EMF observation module are determined based on the rotor speed, and the confidence weight of the Hall sensor is reset to zero. When the rotor speed increases, the confidence weight of the incremental encoder decreases, and the confidence weight of the back EMF observation module increases. If the rotor speed is greater than the second speed threshold, then the confidence weights of the incremental encoder and the back EMF observation module are set to a first preset weight value and a second preset weight value, respectively, and the confidence weight of the Hall sensor is reset to zero. The first preset weight value is less than the second preset weight value.
3. The method for determining the rotor angle of a brushless motor as described in claim 1, characterized in that, The calculation of the temperature drift compensation angle based on real-time collected motor temperature, motor phase current, and rotor speed using a segmented temperature drift coupling model includes: if a first temperature threshold ≤ motor temperature < second temperature threshold, then a first low-temperature coefficient, a second low-temperature coefficient, and a low-temperature constant are obtained, and the temperature drift compensation angle is calculated based on the first low-temperature coefficient, the second low-temperature coefficient, the low-temperature constant, the motor temperature, and the rotor speed; if a second temperature threshold ≤ motor temperature < third temperature threshold, then a first normal temperature coefficient, a second normal temperature coefficient, and a normal temperature constant are obtained, and the temperature drift compensation angle is calculated based on the first normal temperature coefficient, the second normal temperature coefficient, the normal temperature constant, the motor temperature, and the motor phase current. Temperature drift compensation angle; if the third temperature threshold ≤ the motor temperature ≤ the fourth temperature threshold, then the first high temperature coefficient, the second high temperature coefficient, the third high temperature coefficient, and the high temperature constant are obtained, and the temperature drift compensation angle is calculated based on the first high temperature coefficient, the second high temperature coefficient, the third high temperature coefficient, the high temperature constant, the motor temperature, the rotor speed, and the motor phase current; wherein, the initial values of the first low temperature coefficient, the second low temperature coefficient, the low temperature constant, the first normal temperature coefficient, the second normal temperature coefficient, the normal temperature constant, the first high temperature coefficient, the second high temperature coefficient, the third high temperature coefficient, and the high temperature constant are obtained by fitting experimental data using the offline least squares method.
4. The method for determining the rotor angle of a brushless motor as described in claim 3, characterized in that, The method further includes: constructing an observation vector and a parameter vector to be estimated, wherein the observation vector includes the motor temperature, the rotor speed, and the motor phase current; the parameter vector to be estimated includes any one of low-temperature parameters, normal-temperature parameters, and high-temperature parameters; the low-temperature parameters include a first low-temperature coefficient, a second low-temperature coefficient, and a low-temperature constant; the normal-temperature parameters include a first normal-temperature coefficient, a second normal-temperature coefficient, and a normal-temperature constant; and the high-temperature parameters include a first high-temperature coefficient, a second high-temperature coefficient, a third high-temperature coefficient, and a high-temperature constant; obtaining a residual vector at the current moment based on the observation vector at the current moment, the measured error vector at the current moment, and the parameter vector to be estimated at the previous moment; the measured error vector is determined based on the zero-position signal of the incremental encoder and the over-part signal of the back EMF observation module; updating the parameter vector to be estimated at the current moment based on the parameter vector to be estimated at the previous moment, the gain vector at the current moment, and the residual vector at the previous moment; the gain vector is used to characterize the influence weight of the observation vector at the current moment on the parameter vector to be estimated.
5. The method for determining the rotor angle of a brushless motor as described in claim 1, characterized in that, After inputting the temperature drift compensated angle into a parameter-adaptive extended Kalman filter for state estimation and filtering to obtain the rotor angle estimate at the current moment, the method further includes: obtaining the rotor angle prediction value at the current moment based on the angular velocity estimate output by the extended Kalman filter at the previous moment; if the difference between the rotor angle prediction value at the current moment and the temperature drift compensated angle at the current moment is outside a preset difference range, then determining a prediction correction angle based on the rotor angle prediction value at the current moment and the temperature drift compensated angle at the current moment; and correcting the rotor angle estimate value based on the prediction correction angle.
6. The method for determining the rotor angle of a brushless motor as described in claim 5, characterized in that, The step of inputting the temperature drift-compensated angle into a parameter-adaptive extended Kalman filter for state estimation and filtering to obtain the rotor angle estimate at the current moment includes: initializing the state vector and covariance matrix of the extended Kalman filter, wherein the state vector includes the rotor angle and rotor angular velocity; constructing the state transition model and observation model of the extended Kalman filter, wherein the state transition model is characterized by the state transition matrix and process noise, and the observation model is characterized by the rotor angle estimate and observation noise; generating a prior estimate of the state vector and a prior estimate of the covariance matrix at the current moment based on the state vector and covariance matrix at the previous moment through the state transition model; generating the Kalman gain matrix at the current moment based on the prior estimate of the covariance matrix and the observation model; generating a posterior estimate of the covariance matrix at the current moment based on the prior estimate of the Kalman gain matrix and the covariance matrix; generating a posterior estimate of the state vector at the current moment based on the measured error vector, the observation model, the prior estimate of the state vector, and the Kalman gain matrix, and determining the rotor angle estimate at the current moment based on the posterior estimate of the state vector.
7. The method for determining the rotor angle of a brushless motor as described in claim 6, characterized in that, Before generating the Kalman gain matrix at the current moment based on the prior estimation of the covariance matrix and the observation model, the method further includes: dynamically adjusting the variance matrix of the process noise according to the rotor speed, and dynamically adjusting the variance matrix of the observation noise according to the confidence weights of the Hall sensor, the incremental encoder and the back EMF observation module.
8. A device for determining the rotor angle of a brushless motor, characterized in that, include: The synchronous acquisition module is used to synchronously acquire the raw angle data from the Hall sensor, incremental encoder, and back EMF observation module. The weighted fusion module is used to determine the confidence weights of the Hall sensor, the incremental encoder, and the back EMF observation module according to the rotor speed, and to perform weighted fusion on the original angle data of the Hall sensor, the incremental encoder, and the back EMF observation module to obtain the initial fused angle; the angle compensation module is used to calculate the temperature drift compensation angle based on the real-time collected motor temperature, motor phase current, and rotor speed through a segmented temperature drift coupling model, and to compensate the initial fused angle according to the temperature drift compensation angle to obtain the temperature drift compensated angle; The rotor angle determination module is used to input the temperature drift compensated angle into a parameter adaptive extended Kalman filter for state estimation and filtering to obtain the rotor angle estimate at the current moment.
9. A computer device, characterized in that, It includes a processor and a memory, the memory being used to store a computer program, which, when executed by the processor, implements the method for determining the rotor angle of a brushless motor as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the method for determining the rotor angle of a brushless motor as described in any one of claims 1 to 7.
Citation Information
Cited By
Temperature compensation method and system for magnetoelectric angular displacement sensor based on PSO-LSSVM and adaptive Kalman filter
CN122170748A