Method for position output of motor angle magnetic field
By collecting the magnetic field, temperature, and load torque signals of the motor, calculating the magnetic field coupling correction coefficient and dynamic weight, and adjusting the duty cycle of the PWM control signal in conjunction with the closed-loop feedback mechanism, the problem of large motor angle positioning error was solved, and high-precision control of the motor under multiple operating conditions was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI SAGA AUTOMOBILE PARTS CO LTD
- Filing Date
- 2025-12-04
- Publication Date
- 2026-05-12
AI Technical Summary
Existing motor angle magnetic field positioning schemes fail to effectively quantify the coupled effects of multiple factors, resulting in increased positioning errors as operating conditions change, which affects the stability of motor control and user experience.
By collecting the magnetic field, temperature, and load torque signals of the motor, calculating the magnetic field coupling correction coefficient and dynamic weight, and adjusting the duty cycle of the PWM control signal in conjunction with the closed-loop feedback mechanism, the precise positioning of the motor angle is achieved.
It improves the positioning accuracy of the motor under high and low temperature and load fluctuation conditions, ensures the stability and accuracy of motor operation, and reduces positioning errors.
Smart Images

Figure CN121567006B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automotive electronics technology, and more specifically to a method for angular magnetic field positioning output of a motor. Background Technology
[0002] In the field of small motor control in the automotive industry, the accuracy of the motor's angle magnetic field positioning output directly affects the operational stability of related automotive functions. For example, motors for car window lifts and seat adjustments require precise angle positioning to achieve smooth start-stop and position control. Existing motor angle magnetic field positioning solutions mostly focus only on the acquisition and analysis of the magnetic field signal itself, neglecting the coupling effects of multiple factors during motor operation. Firstly, the hysteresis characteristics of motor magnets cause the magnetic field signal to exhibit nonlinear characteristics. The nonlinearity of the magnetic field increases with the cumulative working time of the magnets, directly affecting the accuracy of angle analysis. Secondly, the temperature fluctuation range of the automotive operating environment is large, from -40℃ to 125℃. Temperature changes alter the permeability of the magnets, leading to a shift in the magnetic field signal amplitude. Simultaneously, the motor load torque changes frequently with operating conditions. For example, resistance encountered when lifting or lowering a window can cause a sudden increase in load torque. This change in load torque alters the air gap magnetic flux density distribution of the motor, further exacerbating the distortion of the magnetic field signal. The coupling effect of the aforementioned magnetic field nonlinearity, temperature drift, and load torque fluctuation causes the positioning error of the existing solution to exceed 5% with the change of operating conditions. In environments with frequent vehicle start-stop or high and low temperatures, the accumulation of errors will lead to motor control inaccuracy, resulting in problems such as motion jamming and position deviation, which seriously affects the user experience and the service life of the motor.
[0003] Based on the above problems, there is an urgent need for a motor angle magnetic field positioning output method that can quantify the coupled influence of multiple factors and dynamically adapt to changes in working conditions, so as to solve the problems of low positioning accuracy and poor environmental adaptability of existing solutions. Summary of the Invention
[0004] The present invention aims to provide a method for motor angle magnetic field positioning output, comprising the following steps: outputting a PWM control signal to the motor to adjust the motor's operating state; acquiring the motor's magnetic field signal through a magnetic field signal acquisition module, and acquiring the motor's ambient temperature signal and load torque signal through a multi-parameter monitoring module; calculating a magnetic field coupling correction coefficient based on the nonlinear characteristics of the acquired temperature signal, load torque signal, and magnetic field signal; calculating a dynamic weight based on the deviation value of the temperature signal, the nonlinearity of the magnetic field signal, and the value of the load torque signal; combining the magnetic field coupling correction coefficient and the dynamic weight, calculating a comprehensive positioning error based on the motor's original angle signal and reference angle signal; and adjusting the duty cycle of the PWM control signal according to the comprehensive positioning error through a closed-loop feedback mechanism to achieve motor angle positioning output.
[0005] Preferably, the magnetic field signal acquisition module uses a triaxial Hall sensor. The triaxial Hall sensor acquires the X-axis and Y-axis directional component signals of the motor magnetic field in a non-contact manner. The output terminal of the triaxial Hall sensor is connected to the input terminal of the MCU control module. The MCU control module receives the magnetic field signal transmitted by the triaxial Hall sensor and analyzes it.
[0006] Preferably, the multi-parameter monitoring module includes a temperature sensor and a torque sensor. The temperature sensor is used to collect the temperature signal of the motor stator winding, and the torque sensor is used to collect the load torque signal of the motor output shaft. The output terminal of the multi-parameter monitoring module is connected to the input terminal of the MCU control module. The MCU control module receives the temperature signal and the load torque signal and performs preprocessing.
[0007] Preferably, the MCU control module adopts an ARM Cortex-M7 core chip. The MCU control module has a built-in signal deconstruction unit, coefficient calculation unit, weight calculation unit and error calculation unit. The signal deconstruction unit is used to convert the magnetic field signal into the original angle signal of the motor. The coefficient calculation unit is used to calculate the magnetic field coupling correction coefficient. The weight calculation unit is used to calculate the dynamic weight. The error calculation unit is used to calculate the comprehensive positioning error.
[0008] Preferably, the magnetic field coupling correction coefficient The calculation satisfies the following formula:
[0009] ;
[0010] in, α is the magnetic field coupling correction coefficient, dimensionless; α is the temperature influence coefficient, the value of which is determined by the material of the motor magnet, and the unit is °C. -1 ; This is the temperature deviation value, in °C. The value is equal to the collected temperature signal value minus the reference temperature value under rated operating conditions of the motor; β is the torque influence coefficient, in units of... The value is determined by the air gap structure of the motor; M is the load torque signal value, in N·m; γ is the magnetic field nonlinearity correction coefficient, which is dimensionless and its value is determined by the hysteresis characteristics of the motor magnets. The nonlinearity of the magnetic field is expressed as a percentage. It is equal to the ratio of the amplitude of the harmonic component to the amplitude of the fundamental component in the magnetic field signal multiplied by 100.
[0011] Preferably, the calculation of the dynamic weight ω satisfies the following formula:
[0012] ;
[0013] Where ω is the dynamic weight, dimensionless, and 0 < ω < 1; k1 is the temperature deviation weighting coefficient, in °C. -1 The value is determined based on the positioning error sensitivity of the motor in different temperature ranges; k2 is the magnetic field nonlinearity weighting coefficient, in percentage. -1 The value is determined based on the degree of influence of magnetic field nonlinearity on positioning error; k3 is the load torque weighting coefficient, with units of... The value is determined based on the degree to which changes in load torque affect the positioning error; | represents the absolute value of the temperature deviation, in °C; denoted as , where is the magnetic field nonlinearity, expressed as %; and M is the load torque signal value, expressed as N·m.
[0014] Preferably, the comprehensive positioning error The calculation satisfies the following formula:
[0015] ;
[0016] in, The overall positioning error is expressed in degrees (°); θ rav The original angle signal value is expressed in degrees (θ). rav Obtained by deconstructing the magnetic field signal; θ ref The reference angle signal value is expressed in degrees (θ). ref Pre-set according to the motor's position output requirements; ω is the magnetic field coupling correction coefficient, which is dimensionless; ω is the dynamic weight, which is dimensionless.
[0017] Preferably, the total response time of the closed-loop feedback mechanism does not exceed 20ms. The closed-loop feedback mechanism includes four stages: signal acquisition and update, coefficient weight recalculation, error assessment, and PWM adjustment. When the comprehensive positioning error is greater than the preset error threshold, the closed-loop feedback mechanism triggers the MCU control module to increase the duty cycle adjustment amplitude of the PWM control signal. When the comprehensive positioning error is less than or equal to the preset error threshold, the closed-loop feedback mechanism triggers the MCU control module to decrease the duty cycle adjustment amplitude of the PWM control signal.
[0018] Preferably, the duty cycle adjustment logic of the PWM control signal satisfies: when the overall positioning error At that time, among them, The preset error threshold; the duty cycle adjustment amount of the PWM control signal. ,when hour, ,in This is a baseline adjustment amount, dimensionless, and its value is determined based on the motor's speed response characteristics. This is the amount of duty cycle adjustment for a single operation, and it is dimensionless.
[0019] Preferably, the MCU control module is also connected to a storage module, which is used to store historical data of the collected magnetic field signal, temperature signal, and load torque signal, as well as calculation records of magnetic field coupling correction coefficient, dynamic weight, and comprehensive positioning error. The storage capacity of the storage module is not less than 8GB, and the data write rate is not less than 500kbps.
[0020] Compared with the prior art, the present invention has the following advantages:
[0021] This invention collects multiple parameters such as magnetic field, temperature, and load torque to construct a magnetic field coupling correction coefficient and dynamic weight model, quantifying the coupling effect of multiple factors and solving the positioning error problem caused by neglecting coupling in existing technologies. The closed-loop feedback mechanism dynamically adjusts the PWM according to the comprehensive positioning error, improving the positioning accuracy of the motor under high and low temperature and load fluctuation conditions. The collaborative work of multiple modules ensures the real-time performance of signal processing and control, meeting the high stability operation requirements of automotive small motors. Attached Figure Description
[0022] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are merely exemplary, and those skilled in the art can derive other embodiments based on the provided drawings without creative effort.
[0023] Figure 1 This is a flowchart of the motor angle magnetic field positioning output method of the present invention;
[0024] Figure 2 This is a diagram of a magnetic field signal processing system architecture based on Triaxis technology.
[0025] Figure 3 Schematic diagram of zero-point configuration for programmable magnetic field angle detection;
[0026] Figure 4 This is a schematic diagram of the peripheral circuit of the magnetic field angle detection device. Detailed Implementation
[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0028] The concepts involved in this application will first be described with reference to the accompanying drawings. It should be noted that the following descriptions of various concepts are only for the purpose of making the content of this application easier to understand and do not constitute a limitation on the scope of protection of this application; furthermore, the embodiments and features in the embodiments of this application can be combined with each other unless otherwise specified. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0029] Traditional technical solutions have the following technical problems: Existing motor angle magnetic field positioning solutions only collect magnetic field signals and ignore the coupling effects of magnetic field nonlinearity, temperature drift and load torque fluctuations, which leads to the positioning error increasing with the change of working conditions and motor control inaccuracy.
[0030] Based on this, please refer to Figures 1-4 This embodiment provides a method for determining the position of a motor angle magnetic field, including the following steps:
[0031] S1: Outputs a PWM control signal to the motor to adjust the motor's operating state;
[0032] S2: The magnetic field signal of the motor is acquired through the magnetic field signal acquisition module, and the ambient temperature signal and load torque signal of the motor are acquired through the multi-parameter monitoring module.
[0033] S3: Calculate the magnetic field coupling correction coefficient based on the nonlinear characteristics of the collected temperature signal, load torque signal, and magnetic field signal;
[0034] S4: Calculate the dynamic weights based on the deviation of the temperature signal, the nonlinearity of the magnetic field signal, and the value of the load torque signal;
[0035] S5: Combining the magnetic field coupling correction coefficient and dynamic weight, the comprehensive positioning error is calculated based on the original angle signal and reference angle signal of the motor;
[0036] S6: Through a closed-loop feedback mechanism, the duty cycle of the PWM control signal is adjusted according to the comprehensive positioning error to achieve a fixed-position output of the motor angle.
[0037] The implementation of this technical solution relies on a complete process architecture encompassing control, data acquisition, computation, and feedback. In the PWM control signal output stage, the PWM output unit of the MCU control module generates a 1kHz PWM signal, which is transmitted to the motor via the power drive circuit. The initial duty cycle of the PWM signal is set to 50%, and the initial motor speed is set according to the positioning requirements, such as setting the initial speed of a window lift motor to 100rpm.
[0038] In the signal acquisition stage, the magnetic field signal acquisition module uses a triaxial Hall sensor, model Melexis MLX90393, installed inside the motor stator with a 0.5mm air gap to the magnet. It acquires the X-axis and Y-axis components of the magnetic field at 100Hz via an I2C bus. In the multi-parameter monitoring module, the temperature sensor is an NTC thermistor, attached to the surface of the motor stator windings, acquiring temperature signals ranging from -40℃ to 125℃. The output analog signal is converted to a digital signal via an ADC. The torque sensor is an HBMT40B, installed on the motor output shaft, acquiring load torque signals ranging from 0 to 10 N·m, and transmitting data via an SPI bus. Then, in the parameter calculation stage, after receiving the acquired signals, the MCU control module first performs a Fourier transform on the magnetic field signal to extract the fundamental and harmonic components, and calculates the magnetic field nonlinearity. Then, based on the difference between the temperature signal and the reference temperature (set to 25℃), the following is obtained: Combined with the load torque M, substitute into the formula to calculate With ω; finally, based on the original angle (Obtained from the X-axis and Y-axis components of the magnetic field using the arctangent algorithm) and reference angle (For example, if the fully closed position of the car window is set to 0°, and the fully open position is set to 90°), calculate. In the closed-loop feedback loop, the MCU control module executes the feedback process every 20ms. >0.5° (preset threshold) When ), press =0.05·( / 0.5) Adjust the PWM duty cycle, such as When =1°, =0.1, the duty cycle is adjusted from 50% to 50.1%; when When ≤0.5°, =0.05·( / (2×0.5)), such as When =0.3°, =0.015, duty cycle fine-tuning 0.015. This scheme solves the problem of large positioning error in existing technologies by acquiring multiple parameters and coupling calculations, and achieves precise control of the motor angle.
[0039] The technical effects achieved by this solution include: multi-parameter coupling calculation to quantify the impact of errors, closed-loop feedback to dynamically adjust PWM, reducing motor positioning errors, improving adaptability to operating conditions, and ensuring stable motor operation.
[0040] Traditional technical solutions have the following technical problems: existing magnetic field acquisition modules mostly use single-axis sensors, which have limited acquisition dimensions and unstable communication with the control module, resulting in low magnetic field signal resolution accuracy.
[0041] Based on this, the magnetic field signal acquisition module employs a triaxial Hall sensor. This triaxial Hall sensor acquires the X-axis and Y-axis components of the motor's magnetic field in a non-contact manner. The output of the triaxial Hall sensor is connected to the input of the MCU control module, which receives and analyzes the magnetic field signal transmitted by the triaxial Hall sensor. This technical solution's magnetic field signal acquisition module needs to achieve multi-dimensional and stable signal acquisition. The triaxial Hall sensor selected is the Melexis MLX90393, which supports X, Y, and Z-axis magnetic field acquisition. In this solution, only the X-axis and Y-axis acquisition functions are enabled, with an acquisition range of ±50mT and a 16-bit resolution, capable of capturing minute changes in the magnetic field signal.
[0042] The sensor's VDD pin is connected to a 3.3V power supply, the VSS pin is grounded, and the SDA and SCL pins are connected to the I2C interface of the MCU control module, corresponding to the I2C1 pin of the STM32H743. The communication rate is set to 400kHz to ensure real-time data transmission. During sensor installation, its sensing surface is tangent to the rotational trajectory of the motor rotor magnet. The installation position is determined through calibration to ensure that the X-axis component of the magnetic field corresponds to the tangential direction of the motor rotation, and the Y-axis component corresponds to the radial direction, avoiding signal distortion caused by directional deviation. After receiving the X-axis and Y-axis magnetic field data transmitted by the sensor, the MCU control module first performs filtering using a moving average filtering algorithm with a window size of 5 to remove high-frequency noise. Then, it uses a coordinate transformation algorithm to convert the X-axis and Y-axis magnetic field components into polar coordinates to obtain the magnetic field amplitude and angle, where the angle is the original angle signal θ of the motor. rav For example, when the X-axis magnetic field component is 20 mT and the Y-axis magnetic field component is 15 mT, θ rav =arctan(15 / 20)=36.87°. This solution solves the problems of limited dimensions and unstable communication in existing acquisition modules by using multi-dimensional acquisition and stable communication of a triaxial sensor, providing accurate data for subsequent angle analysis.
[0043] The technical effects achieved by this solution include: multi-dimensional acquisition of magnetic field signals, stable data transmission, improved accuracy of magnetic field signal analysis, and provision of a reliable data foundation for motor angle positioning.
[0044] Traditional technical solutions have the following technical problems: In existing multi-parameter acquisition modules, temperature and torque signals are acquired independently, and signal preprocessing is lacking, resulting in a lack of accurate data support for the coupled analysis of parameters and magnetic field signals.
[0045] Based on this, the multi-parameter monitoring module includes a temperature sensor and a torque sensor. The temperature sensor is used to collect the temperature signal of the motor stator winding, and the torque sensor is used to collect the load torque signal of the motor output shaft. The output terminal of the multi-parameter monitoring module is connected to the input terminal of the MCU control module. The MCU control module receives the temperature signal and the load torque signal and performs preprocessing.
[0046] The multi-parameter monitoring module of this technical solution needs to achieve coordinated acquisition and preprocessing of temperature and torque signals. An NTC thermistor, model EPCOSB57540G103F, is used as the temperature sensor. Its resistance changes with temperature at a coefficient of -4.7% / ℃, and its resistance is 10kΩ at 25℃. The sensor is connected to the ADC interface of the MCU control module via a voltage divider circuit, specifically the ADC1 pin of the STM32H743. A 10kΩ high-precision resistor is used for the voltage divider, and the ADC sampling accuracy is set to 12 bits with a sampling frequency of 50Hz. After receiving the resistance signal from the temperature sensor, the MCU control module converts the resistance value to a temperature value using a lookup table method. For example, a resistance value of 5kΩ corresponds to a temperature of 45℃. Simultaneously, a first-order low-pass filter algorithm (cutoff frequency of 1Hz) is used to remove fluctuation noise from the temperature signal, resulting in a smooth temperature signal. The torque sensor selected is the HBMT40B, with a range of 0-10 N·m and an accuracy class of 0.1. It transmits torque data at a frequency of 50 Hz via the SPI bus (corresponding to the SPI2 pin of the MCU), using a 24-bit binary data format. After receiving the torque data, the MCU control module first verifies it using a CRC check to ensure data integrity, then converts the binary number into the actual torque value. For example, if the received data is 0x1388, the corresponding torque is 2 N·m. Finally, it applies a moving average filter to the torque signal with a window size of 3 to eliminate instantaneous errors caused by load fluctuations. The preprocessed temperature and torque signals are stored in the MCU's buffer and updated every 100 ms, providing accurate parameters for calculating the magnetic field coupling correction coefficient. This solution addresses the inaccuracy issues of existing modules through collaborative acquisition and preprocessing, supporting multi-parameter coupling analysis.
[0047] The technical effects achieved by this solution include: collaborative acquisition of temperature and torque signals, preprocessing to improve data accuracy, providing reliable parameters for coupled calculations, and ensuring the accuracy of positioning error assessment.
[0048] Traditional technical solutions have the following technical problems: existing MCU control modules have limited functions and lack dedicated signal processing and calculation units, resulting in low efficiency in multi-parameter processing and inability to meet real-time control requirements.
[0049] Based on this, the MCU control module adopts an ARM Cortex-M7 core chip. The MCU control module has a built-in signal deconstruction unit, coefficient calculation unit, weight calculation unit and error calculation unit. The signal deconstruction unit is used to convert the magnetic field signal into the original angle signal of the motor. The coefficient calculation unit is used to calculate the magnetic field coupling correction coefficient. The weight calculation unit is used to calculate the dynamic weight. The error calculation unit is used to calculate the comprehensive positioning error.
[0050] The MCU control module of this technical solution needs to have efficient multi-unit collaborative processing capabilities. The MCU selected is the STM32H743VIT6, based on the ARM Cortex-M7 core, with a main frequency of up to 480MHz, supporting single-precision floating-point arithmetic, and capable of quickly executing complex algorithms. The signal deconstruction unit is implemented by the MCU's DMA controller and timer in collaboration. The DMA controller (DMA1) is responsible for receiving magnetic field X-axis and Y-axis data from the I2C interface and transmitting it to the memory buffer at a transmission rate of 100Hz. The timer (TIM2) triggers a signal deconstruction task every 10ms, calling the arctangent algorithm (using the CORDIC algorithm with an accuracy of 0.01°) to convert the X-axis and Y-axis magnetic field components into the original angles. The algorithm execution time is no more than 1ms. The coefficient calculation unit is implemented by the MCU's floating-point unit (FPU), which receives the preprocessed temperature data. Load torque M and magnetic field nonlinearity According to the formula Calculate, where α is 0.002℃. -1 Based on the properties of neodymium iron boron magnets, β is set to 0.05. Based on the motor's 0.5mm air gap structure, with γ set to 0.01, and considering the hysteresis characteristics of the magnet, the FPU's calculation time is no more than 0.5ms. The weight calculation unit calls the MCU's arithmetic logic unit (ALU) according to the formula:
[0051] Calculate, where k1 = 0.02℃ -1 The low-temperature range exhibits high error sensitivity, with k²=0.1%. -1 The nonlinear effect of the magnetic field is significant, k3=0.03N -1 ·m -1 The load torque has a moderate impact, and the ALU takes no more than 0.3ms to perform the calculation.
[0052] Error calculation unit integration The calculation result of ω is obtained according to the formula. The calculations, invoking absolute value and multiplication instructions, take no more than 0.2ms to execute. Each unit is managed by the MCU's task scheduler (using the FreeRTOS operating system), with task priorities from high to low as follows: error calculation, coefficient calculation, weight calculation, and signal deconstruction, ensuring real-time performance. This solution addresses the low efficiency of existing MCUs by using dedicated units for processing, thus meeting real-time control requirements.
[0053] The technical effects achieved by this solution include: dedicated units collaboratively processing multiple parameters, improving data processing efficiency, ensuring real-time calculation and control, and guaranteeing the timeliness and accuracy of motor positioning.
[0054] Traditional technical solutions have the following technical problems: existing magnetic field correction coefficients only consider a single factor and do not quantify the coupling effect of temperature, torque and magnetic field nonlinearity, resulting in poor correction effect and inability to effectively compensate for positioning errors.
[0055] Based on this, the magnetic field coupling correction coefficient The calculation satisfies the following formula:
[0056] ;
[0057] in, α is the magnetic field coupling correction coefficient, dimensionless; α is the temperature influence coefficient, the value of which is determined by the material of the motor magnet, and the unit is °C. -1 ; This is the temperature deviation value, in °C. The value is equal to the collected temperature signal value minus the reference temperature value under rated operating conditions of the motor; β is the torque influence coefficient, in units of... The value is determined by the air gap structure of the motor; M is the load torque signal value, in N·m; γ is the magnetic field nonlinearity correction coefficient, which is dimensionless and its value is determined by the hysteresis characteristics of the motor magnets. The nonlinearity of the magnetic field is expressed as a percentage. It is equal to the ratio of the amplitude of the harmonic component to the amplitude of the fundamental component in the magnetic field signal multiplied by 100.
[0058] This technical solution The calculations require a clear understanding of the physical meaning, basis for value selection, and formula logic of each parameter, and must be verified through actual operating conditions. First, the parameter definitions and value logic are as follows: α is the temperature influence coefficient. The motor magnet uses neodymium iron boron (N35) material, whose permeability temperature coefficient is -0.12% / ℃. To quantify the effect of temperature on the magnetic field, α is set to 0.002℃. -1 That is, for every 1°C increase in temperature, the amplitude of the magnetic field signal changes by 0.2%; To account for temperature deviation, the reference temperature is set to the motor's rated operating temperature of 25℃. For example, if the collected temperature is 35℃, =10℃; β is the torque influence coefficient. The motor air gap is 0.5mm. For every 1N·m increase in load torque, the air gap magnetic flux density decreases by 0.5%, therefore β is taken as 0.05. The effect of torque on the attenuation of the magnetic field is reflected by the exponential function exp(-β·M); γ is the magnetic field nonlinearity correction coefficient. The hysteresis characteristics of the magnet cause the harmonic components to increase with the working time. The experiment shows that for every 1% increase in the magnetic field nonlinearity, the positioning error increases by 0.1%, so the value of γ is 0.01. To determine the nonlinearity of the magnetic field, the 3rd and 5th harmonic components are extracted by performing a Fourier transform on the magnetic field signal. For example, if the fundamental amplitude is 20 mT, the 3rd harmonic amplitude is 0.4 mT, and the 5th harmonic amplitude is 0.2 mT, then... =(0.4+0.2) / 20×100=3%. Secondly, an example of formula application: In the operation of a car window raising and lowering, the collected temperature T=45℃, =45-25=20℃; Load torque M=3N·m; Magnetic field nonlinearity =3%; Substituting into the formula: (1+0.002×20)=1.04; exp(-0.05×3)=exp(-0.15)≈0.8607; (1-0.01×3)=0.97; Final =1.04×0.8607×0.97≈0.87, indicating that the magnetic field signal is affected by coupling under this operating condition and needs to be corrected by a coefficient of 0.87 to accurately reflect the actual magnetic field state. Finally, the formula is verified: by measuring under different temperature and torque conditions, the positioning error before and after correction is compared. For example, the positioning error before correction is 1.2°, and the error after correction is 1.2×0.87≈1.04°, which is close to the actual measurement error of 1.05°, and the error is less than 1%, verifying the effectiveness of the formula.
[0059] The technical effects achieved by this scheme include: quantifying the influence of multi-factor coupling on the magnetic field, through... Correcting magnetic field signal deviations improves the accuracy of magnetic field signals and provides a reliable basis for calculating positioning errors.
[0060] Traditional technical solutions have the following technical problems: the existing weight allocation uses fixed values and does not dynamically adjust according to the real-time influence of temperature, magnetic field nonlinearity, and torque, resulting in a lack of specificity in positioning error assessment and an inability to adapt to changes in working conditions.
[0061] Based on this, the calculation of the dynamic weight ω satisfies the following formula:
[0062] ;
[0063] Where ω is the dynamic weight, dimensionless, and 0 < ω < 1; k1 is the temperature deviation weighting coefficient, in °C. -1The value is determined based on the positioning error sensitivity of the motor in different temperature ranges; k2 is the magnetic field nonlinearity weighting coefficient, in percentage. -1 The value is determined based on the degree of influence of magnetic field nonlinearity on positioning error; k3 is the load torque weighting coefficient, with units of... The value is determined based on the degree of influence of load torque variation on positioning error; |ΔT| is the absolute value of temperature deviation, in °C. denoted as , where is the magnetic field nonlinearity, expressed as %; and M is the load torque signal value, expressed as N·m.
[0064] The calculation of ω in this technical solution requires clarifying the logic behind the weighting coefficients, the physical meaning of the formulas, and verification under operating conditions. Firstly, the weighting coefficients are determined based on the following: k1 is the temperature deviation weighting coefficient. The motor has high sensitivity to positioning errors in the low-temperature range of -40℃ to 0℃; for every 1℃ temperature deviation, the error increases by 0.2%. Therefore, k1 is set to 0.02℃. -1 k2 is the magnetic field nonlinearity weighting coefficient. For every 1% increase in magnetic field nonlinearity, the positioning error increases by 1%, a significant impact; therefore, k2 is set to 0.1%. -1 k3 is the load torque weighting coefficient. For every 1 N·m increase in load torque, the positioning error increases by 0.3%, which is a moderate impact. Therefore, k3 is set to 0.03. .
[0065] In the formula, the numerator is the weighted sum of temperature deviation and magnetic field nonlinearity, and the denominator is the weighted sum of the three. The magnitude of ω reflects the proportion of temperature and magnetic field nonlinearity in the coupling effect. The larger ω is, the more significant the influence of temperature and magnetic field nonlinearity on positioning error, which should be given special consideration in error assessment.
[0066] Formula application example: Operating condition 1: Low temperature and high nonlinearity: | |=30℃ (T=-5℃) =5%, M=2N·m; numerator=0.02×30+0.1×5=0.6+0.5=1.1; denominator=1.1+0.03×2=1.16; ω=1.1 / 1.16≈0.948, indicating that the influence of temperature and magnetic field nonlinearity accounts for 94.8% under this working condition, which needs to be corrected.
[0067] Operating Condition 2: High Torque, Low Nonlinearity |=5℃ (T=30℃) =1%, M=8N·m; Numerator=0.02×5+0.1×1=0.1+0.1=0.2; Denominator=0.2+0.03×8=0.44; ω=0.2 / 0.44≈0.455, indicating that the influence of temperature and magnetic field nonlinearity accounts for 45.5% under this working condition, and the influence of load torque accounts for an even higher proportion. Working condition verification: In working condition 1, without dynamic weighting, the positioning error assessment value is 1.5°. After using ω=0.948, the assessment value is 1.5×0.948≈1.42°, which is close to the actual error of 1.4°. In working condition 2, without dynamic weighting, the assessment value is 1.3°. After using ω=0.455, the assessment value is 1.3×0.455≈0.59°, which is close to the actual error of 0.6°, verifying the applicability of the formula.
[0068] The technical effects achieved by this solution include: dynamically adapting to changes in working conditions, adjusting weight allocation, improving the pertinence of positioning error assessment, and ensuring the accuracy of error assessment under different working conditions.
[0069] Current positioning error calculations simply take the difference between the original angle and the reference angle, without incorporating coupling correction coefficients and dynamic weights. This fails to reflect the true error value under actual working conditions, resulting in inaccurate error assessment.
[0070] Based on this, the comprehensive positioning error The calculation satisfies the following formula:
[0071] ;
[0072] in, The measurement represents the overall positioning error, expressed in degrees (°). This is the original angle signal value, in degrees. Obtained by deconstructing the magnetic field signal; This is a reference angle signal value, in degrees. Pre-set according to the motor's position output requirements; ω is the magnetic field coupling correction coefficient, dimensionless; ω is the dynamic weight, dimensionless. This technical solution... The calculation needs to integrate the results of previous parameter calculations, clarify the logical chain of the formula and its practical application value, and verify it through experiments.
[0073] Parameter source and formula logic: This is obtained from the deconstruction of magnetic field signals, for example, when the magnetic field X-axis = 17.32 mT and Y-axis = 10 mT. ; Set according to the required position, such as setting the target stop position of the window lift motor to 60°; - | represents the original angle difference, such as the absolute value of the difference between 30° and 60° being 30°; ω is the magnetic field coupling correction coefficient, reflecting the degree of distortion in the magnetic field signal; ω is the dynamic weight, reflecting the proportion of the influence of temperature and magnetic field nonlinearity; the product of these three factors yields... It is the actual error value after adjusting the coupling effect of the original angle difference and the working condition weight.
[0074] Formula application example: Taking a car seat adjustment motor as an example, the positioning requirement is to adjust the seat back angle to 45° ( =45°); Data acquisition conditions: Temperature T=50℃ =25℃, load torque M=4N·m, magnetic field nonlinearity =4%; Calculate the initial parameters: k m =(1+0.002×25)×exp(-0.05×4)×(1-0.01×4)=1.05×exp(-0.2)×0.96≈1.05×0.8187×0.96≈0.82;ω=[0.02×25+0.1×4] / [0.02×25+0.1×4+0.03×4]=(0.5+0.4) / (0.5+0.4+0.12)=0.9 / 1.02≈0.882;Original angle , Substitute into the formula to calculate. =2×0.82×0.882≈1.45°. Finally, the experiment verified that by measuring the actual angle of the motor using a high-precision angle encoder with an accuracy of 0.01°, the actual error was 1.43°, which is consistent with the calculated error. Compared to 1.45°, the error is less than 2%, verifying the accuracy of the formula. If the formula is not used and only the original angle difference of 2° is taken, the deviation from the actual error of 1.43° is 38%, highlighting the necessity of the formula.
[0075] The technical effects achieved by this solution include: integrating coupling correction and dynamic weighting to accurately calculate the actual positioning error, providing a precise basis for closed-loop feedback adjustment, and ensuring the accuracy of the motor's positioning output.
[0076] Traditional technical solutions have the following technical problems: the existing closed-loop feedback mechanism has a long response delay and no differentiated adjustment logic, which leads to untimely or excessive PWM adjustment, affecting the positioning stability of the motor.
[0077] Based on this, the total response time of the closed-loop feedback mechanism does not exceed 20ms. The closed-loop feedback mechanism includes four stages: signal acquisition and update, coefficient weight recalculation, error assessment, and PWM adjustment. When the comprehensive positioning error is greater than the preset error threshold, the closed-loop feedback mechanism triggers the MCU control module to increase the duty cycle adjustment amplitude of the PWM control signal. When the comprehensive positioning error is less than or equal to the preset error threshold, the closed-loop feedback mechanism triggers the MCU control module to decrease the duty cycle adjustment amplitude of the PWM control signal.
[0078] The closed-loop feedback mechanism of this technical solution needs to clearly define the time allocation, execution logic, and differentiated adjustment strategies for each stage. Stage time allocation: In the signal acquisition and update stage, the MCU control module synchronously receives magnetic field, temperature, and torque signals through the DMA controller, with a time consumption of no more than 5ms; in the coefficient weight recalculation stage, the FPU and ALU are called for calculation. The calculation of ω takes no more than 3ms; in the error evaluation stage, the calculation... The comparison with the threshold takes no more than 2ms; the PWM adjustment stage updates the PWM duty cycle and outputs the result, taking no more than 10ms; the total response time = 5 + 3 + 2 + 10 = 20ms, meeting the real-time requirements. Execution logic: The feedback mechanism is triggered every 20ms by the MCU's timer TIM3. After triggering, four stages are executed sequentially. After each stage completes, a flag is used to notify the next stage to start, avoiding resource conflicts caused by parallel execution. Differentiated adjustment strategy: Preset error threshold. The settings depend on the type of motor, such as the window lift motor. =0.5°, seat adjustment motor =1°; when > At that time, the adjustment range of the PWM duty cycle Set as the baseline adjustment amount 2 times, The settings are based on the motor's speed response characteristics, such as those for a car window motor. =0.05, ΔD=0.1; when ≤ hour, Set as 0.5 times, that is =0.025. For example, the current PWM duty cycle of the window motor is 50%. =0.8°>0.5°, then the duty cycle should be adjusted to 50%+0.1%=50.1%; if If the error is 0.3° ≤ 0.5°, then the adjustment is 50% + 0.025% = 50.025%. Stability verification: During the window lifting operation, after 100 consecutive positioning actions, with this feedback mechanism, the positioning error remained stable between 0.3° and 0.6°, with no overshoot. Without this mechanism, the error fluctuated between 0.2° and 1.2°, and three overshoots occurred, verifying the stability of the mechanism. The technical effects achieved by this solution include: rapid response to changes in operating conditions, differentiated adjustment of the PWM amplitude, avoiding over-adjustment or under-adjustment, and improving the stability and accuracy of motor positioning.
[0079] Traditional technical solutions have the following problems: existing PWM duty cycle adjustment lacks clear quantitative logic, and the adjustment amount is set based on experience, which leads to unstable changes in motor speed and affects positioning accuracy.
[0080] Based on this, the duty cycle adjustment logic of the PWM control signal satisfies: when the overall positioning error > ( When the preset error threshold is met, the duty cycle adjustment of the PWM control signal is... = ·( / ),when ≤ hour, = ·( / (2· )),
[0081] in This is a baseline adjustment amount, dimensionless, and its value is determined based on the motor's speed response characteristics. This is the amount of duty cycle adjustment for a single operation, and it is dimensionless.
[0082] The PWM adjustment logic of this technical solution needs to clearly define the basis for the reference adjustment value, the quantization logic of the formula, and the actual application effect. First, the reference adjustment value... The possible values of: The motor's speed-duty cycle characteristic curve was used to determine the speed. Experiments were conducted to measure the motor's speed at different duty cycles. For example, the window lift motor's speed was 95 rpm at 49% duty cycle, 100 rpm at 50% duty cycle, and 105 rpm at 51% duty cycle, with a speed change rate of 5 rpm / %. To ensure smooth speed changes, the single speed adjustment was set to no more than 1 rpm. =0.2, duty cycle adjustment 0.2%, speed change 1 rpm. Next, adjustment logic application example: preset. =0.5°, Operating Condition 1: =0.8°>0.5°, +0.2·(0.8 / 0.5)=0.32, the duty cycle is adjusted from 50% to 50.32%, and the speed is increased from 100rpm to 100+0.32×5=101.6rpm, accelerating the motor's movement towards the target position; Operating condition 2: =0.3°≤0.5°, =0.2·(0.3 / (2×0.5))=0.06, the duty cycle is adjusted from 50% to 50.06%, and the speed is increased to 100+0.06×5=100.3rpm, slowly approaching the target position to avoid overshoot. Finally, the adjustment effect is verified: in the window lifting and positioning experiment, when this logic is used, the time for the motor to adjust from 0° to 90° is 0.9s, and the positioning error is 0.4°; without this logic (fixed) When the value is 0.2, the adjustment time is 0.8s, but the positioning error is 0.8°, and there are 2 overshoots, indicating that the logic improves accuracy while ensuring adjustment speed.
[0083] The technical effects achieved by this solution include: quantifying the PWM duty cycle adjustment to ensure smooth changes in motor speed, avoiding overshoot, and improving positioning accuracy and motion stability.
[0084] Traditional technical solutions have the following technical problems: existing MCU control modules lack large-capacity storage modules, making it impossible to store historical data and calculation records, resulting in the inability to trace the trend of positioning error changes and to optimize control strategies based on historical data.
[0085] Based on this, the MCU control module is also connected to a storage module, which is used to store historical data of the collected magnetic field signal, temperature signal, and load torque signal, as well as calculation records of magnetic field coupling correction coefficient, dynamic weight, and comprehensive positioning error. The storage capacity of the storage module is not less than 8GB, and the data write rate is not less than 500kbps.
[0086] The storage module of this technical solution requires clear hardware selection, storage content format, and data application value. Hardware selection and connection: The storage module uses a MicroSD card, specifically a SanDisk Ultra 32GB, connected to the MCU control module via an SPI bus (corresponding to the MCU's SPI3 pin). The SPI bus rate is set to 10Mbps, and the measured data write rate is 800kbps, meeting the requirement of no less than 500kbps. The storage module is powered by the MCU's 3.3V pin, with a voltage regulator (AMS1117-3.3) ensuring stable power supply. Secondly, storage content and format: Stored data is formatted according to timestamp, magnetic field X-axis, magnetic field Y-axis, temperature, torque, etc. ω and The records are formatted as follows, with a timestamp precision of 1ms. Data is stored in CSV format, with one record stored every 100ms. For example, 20240520143000.000,20.0,15.0,30.0,2.5,0.85,0.90,0.5 corresponds to time, X-axis (mT), Y-axis (mT), temperature (°C), and torque (N·m) respectively. ,ω, (°). The storage module supports cyclic overwrite; when the capacity is full, the oldest 10% of the data is deleted to ensure continuous storage. Finally, data application: historical data can be exported to a host computer via USB interface, and MATLAB software can be used to analyze the trend of positioning error changes, such as statistically analyzing the changes in different temperature ranges within a week. Average value, optimize coefficients such as α and β; calculation records can be used for fault diagnosis, such as when When the reading remains below 0.8, it indicates magnet performance degradation, requiring magnet replacement. Experiments show that after 30 days of continuous operation, the storage module stores approximately 30 × 24 × 3600 × 10 = 25,920,000 data entries, occupying about 500MB of storage space, far below the 8GB capacity, thus meeting long-term storage requirements. The technical effects achieved by this solution include: storing historical data and calculation records, supporting trend analysis and fault diagnosis, providing data support for control strategy optimization, and improving the maintainability and reliability of motor operation.
[0087] The embodiments and / or implementation methods described above are merely preferred embodiments and / or implementation methods for implementing the technology of the present invention, and are not intended to limit the implementation methods of the technology of the present invention in any way. Any person skilled in the art can make some modifications or alterations to other equivalent embodiments without departing from the scope of the technical means disclosed in the content of the present invention, but they should still be regarded as the technology or embodiments that are substantially the same as the present invention.
[0088] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. The above descriptions are only preferred embodiments of this application. It should be noted that due to the limitations of written expression, while there are objectively infinite specific structures, those skilled in the art can make several improvements, modifications, or changes without departing from the principles of this application, and can also combine the above technical features in an appropriate manner. These improvements, modifications, changes, or combinations, or the direct application of the inventive concept and technical solution to other situations without modification, should all be considered within the scope of protection of this application.
Claims
1. A method for locating a motor using an angular magnetic field, characterized in that, Includes the following steps: Output PWM control signals to the motor to adjust the motor's operating status; The magnetic field signal of the motor is acquired by the magnetic field signal acquisition module, and the ambient temperature signal and load torque signal of the motor are acquired by the multi-parameter monitoring module. Based on the nonlinear characteristics of the collected temperature signal, load torque signal and magnetic field signal, the magnetic field coupling correction coefficient is calculated. The dynamic weights are calculated based on the deviation of the temperature signal, the nonlinearity of the magnetic field signal, and the value of the load torque signal. By combining the magnetic field coupling correction coefficient and dynamic weight, the comprehensive positioning error is calculated based on the original angle signal and the reference angle signal of the motor. By using a closed-loop feedback mechanism, the duty cycle of the PWM control signal is adjusted according to the comprehensive positioning error to achieve a fixed-position output of the motor angle; The MCU control module uses an ARM Cortex-M7 core chip. The MCU control module has a built-in signal deconstruction unit, coefficient calculation unit, weight calculation unit and error calculation unit. The signal deconstruction unit is used to convert the magnetic field signal into the original angle signal of the motor. The coefficient calculation unit is used to calculate the magnetic field coupling correction coefficient. The weight calculation unit is used to calculate the dynamic weight. The error calculation unit is used to calculate the comprehensive positioning error. The magnetic field coupling correction coefficient The calculation satisfies the following formula: ; in, α is the magnetic field coupling correction coefficient, dimensionless; α is the temperature influence coefficient, the value of which is determined by the material of the motor magnet, and the unit is °C. -1 ΔT is the temperature deviation value, in °C. ΔT equals the collected temperature signal value minus the reference temperature value under rated operating conditions of the motor; β is the torque influence coefficient, in °C. The value is determined by the air gap structure of the motor; M is the load torque signal value, in N·m; γ is the magnetic field nonlinearity correction coefficient, which is dimensionless and its value is determined by the hysteresis characteristics of the motor magnet. The nonlinearity of the magnetic field is expressed as a percentage. It is equal to the ratio of the amplitude of the harmonic component to the amplitude of the fundamental component in the magnetic field signal multiplied by 100. The overall positioning error The calculation satisfies the following formula: ; in, The measurement represents the overall positioning error, expressed in degrees (°). This is the original angle signal value, in degrees. Obtained by deconstructing the magnetic field signal; This is a reference angle signal value, in degrees. Pre-set according to the motor's position output requirements; ω is the magnetic field coupling correction coefficient, which is dimensionless; ω is the dynamic weight, which is dimensionless.
2. The method for determining the position of a motor angle magnetic field according to claim 1, characterized in that, The magnetic field signal acquisition module uses a triaxial Hall sensor, which acquires the X-axis and Y-axis directional component signals of the motor magnetic field in a non-contact manner. The output terminal of the triaxial Hall sensor is connected to the input terminal of the MCU control module, and the MCU control module receives and analyzes the magnetic field signal transmitted by the triaxial Hall sensor.
3. The method for determining the position of a motor angle magnetic field according to claim 1, characterized in that, The multi-parameter monitoring module includes a temperature sensor and a torque sensor. The temperature sensor is used to collect the temperature signal of the motor stator winding, and the torque sensor is used to collect the load torque signal of the motor output shaft. The output terminal of the multi-parameter monitoring module is connected to the input terminal of the MCU control module. The MCU control module receives the temperature signal and the load torque signal and performs preprocessing.
4. The method for determining the position of a motor angle magnetic field according to claim 2, characterized in that, The dynamic weight ω is calculated according to the following formula: ; Where ω is the dynamic weight, dimensionless, and 0 < ω < 1; k1 is the temperature deviation weighting coefficient, in °C. -1 The value is determined based on the positioning error sensitivity of the motor in different temperature ranges; k2 is the magnetic field nonlinearity weighting coefficient, in percentage. -1 The value is determined based on the degree of influence of magnetic field nonlinearity on positioning error; k3 is the load torque weighting coefficient, with units of... The value is determined based on the degree of influence of load torque variation on positioning error; |ΔT| is the absolute value of temperature deviation, in °C. denoted as , where is the magnetic field nonlinearity, expressed as %; and M is the load torque signal value, expressed as N·m.
5. The method for determining the position of a motor angle magnetic field according to claim 1, characterized in that, The total response time of the closed-loop feedback mechanism does not exceed 20ms. The closed-loop feedback mechanism includes four stages: signal acquisition and update, coefficient weight recalculation, error assessment, and PWM adjustment. When the comprehensive positioning error is greater than the preset error threshold, the closed-loop feedback mechanism triggers the MCU control module to increase the duty cycle adjustment amplitude of the PWM control signal. When the comprehensive positioning error is less than or equal to the preset error threshold, the closed-loop feedback mechanism triggers the MCU control module to decrease the duty cycle adjustment amplitude of the PWM control signal.
6. The method for determining the position of a motor angle magnetic field according to claim 4, characterized in that, The duty cycle adjustment logic of the PWM control signal satisfies: when the overall positioning error At that time, among them The duty cycle adjustment of the PWM control signal is set to the preset error threshold. ,when hour, ,in This is a baseline adjustment amount, dimensionless, and its value is determined based on the motor's speed response characteristics. This is the amount of duty cycle adjustment for a single operation, and it is dimensionless.
7. The method for determining the position of a motor angle magnetic field according to claim 4, characterized in that, The MCU control module is also connected to a storage module, which is used to store historical data of the collected magnetic field signal, temperature signal, and load torque signal, as well as calculation records of magnetic field coupling correction coefficient, dynamic weight, and comprehensive positioning error. The storage capacity of the storage module is not less than 8GB, and the data write rate is not less than 500kbps.