Current sensor zero offset calibration method and system, medium and terminal
By obtaining the original three-phase current value in the current sensor in real time and performing a zero-position self-learning process under specific conditions, the problem that the current sensor cannot automatically adjust the zero deviation is solved, and automatic calibration is achieved throughout the life cycle, improving system stability and measurement accuracy.
Patent Information
- Application Number
- CN202510064009.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-05-06
AI Technical Summary
The existing current sensors cannot automatically adjust the zero deviation during operation, resulting in incorrect output signals and affecting system stability.
By obtaining the original three-phase current value of the current sensor in real time, when the motor controller is in the IGBT shutdown state and the motor speed is less than the first threshold, the zero-position self-learning process is carried out, the accumulated three-phase current and the number of self-learning times are updated, the average value of the three-phase current is calculated until the self-learning process is stopped, and the original value is calibrated based on the self-learning value.
Automatic calibration of zero-point current offset in the entire life cycle of the current sensor is realized, reducing system instability caused by zero-bias change, and improving calibration stability and accuracy.
Smart Images

Figure CN119936773A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of current sensor calibration, and in particular to a current sensor zero-bias calibration method, system, medium and terminal. Background Art
[0002] Current sensors play a vital role in motor control. They are used to detect the three-phase current of the motor, to achieve precise control of the motor torque and to protect the motor controller. The Hall current sensor has good accuracy and linearity, but has the problem of zero drift, which is mainly caused by external interference (magnetic field, vibration, etc.), power supply voltage fluctuation, sensor aging or fatigue, etc. The existing solution to the zero drift problem is to correct the current zero position deviation by performing zero position self-learning during the power-on initialization process of the motor controller software, but it is impossible to automatically adjust the deviation during the operation of the current sensor, which affects the correctness of its output signal. Summary of the invention
[0003] Embodiments of the present invention provide a current sensor zero-bias calibration method, system, medium and terminal, which realize automatic calibration of zero-point current offset of the current sensor throughout its life cycle to reduce system instability caused by zero-bias changes.
[0004] In order to solve the above technical problems, an embodiment of the present invention provides a current sensor zero-bias calibration method, comprising:
[0005] Obtain the three-phase current original values of the current sensor in real time;
[0006] When the running state of the motor controller meets the preset conditions, the preset three-phase current accumulated value is processed by the zero-position self-learning process, and in each self-learning in the zero-position self-learning process, the three-phase current original value is used to update the current three-phase current accumulated value, and the number of self-learning times is increased by 1, and then based on the current three-phase current accumulated value and the current number of self-learning times, the current three-phase current average value is calculated, until the running state of the motor controller does not meet the preset conditions, then the current zero-position self-learning process is stopped, and based on the current number of self-learning times and the current three-phase current average value, the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process is analyzed and obtained; wherein, the preset condition is that the motor controller is in the IGBT off state and the motor speed is less than the first threshold value;
[0007] After stopping the current zero-position self-learning process, the three-phase current original value is calibrated based on the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process to obtain the calibrated three-phase current value, thereby completing the zero bias calibration of the current sensor.
[0008] In implementing the embodiment of the present invention, the three-phase current original value of the current sensor is obtained in real time. When the running state of the motor controller satisfies the preset condition that the motor controller is in the IGBT off state and the motor speed is less than the first threshold value, the preset three-phase current accumulated value is processed by the zero-position self-learning process, and in each self-learning in the zero-position self-learning process, the three-phase current original value is used to update the current three-phase current accumulated value, and the number of self-learning times is increased by 1, and then based on the current three-phase current accumulated value and the current number of self-learning times, the current three-phase current average value is calculated, until the running state of the motor controller does not meet the above preset conditions, then the current zero-position self-learning process is stopped, and based on the current number of self-learning times and the current three-phase current average value, the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process is analyzed, and finally based on the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process, the three-phase current original value is updated. The initial value is calibrated to obtain the calibrated three-phase current value, and the zero offset calibration of the current sensor is completed. Through the above means, when the motor controller is in the IGBT off state, the current sensor is subjected to static zero position self-learning, and when the motor controller is in the IGBT switching state, the static zero position self-learning is stopped. At this time, the current sensor is in a working state, and then based on the three-phase current zero position self-learning value obtained through static zero position self-learning, the three-phase current original value obtained in real time is calibrated to realize the automatic calibration of the zero current offset of the current sensor throughout its life cycle. Moreover, the number of self-learning times in the zero position self-learning algorithm is a floating point data type, and its value can be infinite, which can avoid the situation where the software program runs away due to value overflow, and can also perform self-learning when the motor controller is in the off state, so as to extend the zero position self-learning time, ensure the stability and accuracy of the current zero position self-learning, and thus improve the stability and accuracy of the current sensor zero offset calibration. In addition, when the operating state of the motor controller meets the preset conditions that the motor controller is in the IGBT off state and the motor speed is less than the first threshold, the preset three-phase current accumulated value is processed by the zero-position self-learning process, so that regular zero-position self-learning can be achieved, which can ensure that the zero bias error is always in a smaller range, reducing system instability caused by zero bias changes.
[0009] As a preferred solution, the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process is analyzed based on the current self-learning times and the current three-phase current average value, specifically:
[0010] When the current zero position self-learning process is stopped, it is determined whether the current number of self-learning times is less than a second threshold value;
[0011] If not, the current three-phase current average value is used as the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process;
[0012] If so, the three-phase current zero-position self-learning value corresponding to the previous zero-position self-learning process is used as the three-phase current self-learning value corresponding to the current zero-position self-learning process.
[0013] According to the preferred scheme of the embodiment of the present invention, when the accumulated number of self-learning times is too small, the three-phase current zero-position self-learning value corresponding to the previous zero-position self-learning process is used as the three-phase current self-learning value corresponding to the current zero-position self-learning process, that is, the three-phase current zero-position self-learning value obtained when the motor controller was in the IGBT off state and the motor speed was less than the first threshold value is used. This can maintain the consistency and stability of the system and avoid system abnormalities caused by large fluctuations in the self-learning value when the motor controller switches quickly between the off and on states.
[0014] As a preferred solution, during each self-learning in the zero-position self-learning process, the three-phase current original value is used to update the current three-phase current accumulated value, and the number of self-learning times is increased by 1, and then based on the current three-phase current accumulated value and the current number of self-learning times, the current three-phase current average value is calculated until the operating state of the motor controller does not meet the preset condition, then the current zero-position self-learning process is stopped, specifically:
[0015] During each self-learning in the zero-position self-learning process, the original value of the three-phase current is added to the current accumulated value of the three-phase current, and then the addition result is used as the new accumulated value of the three-phase current to update the accumulated value of the three-phase current, and the number of self-learning times is increased by 1, and then the updated accumulated value of the three-phase current is divided by the current number of self-learning times, and then the division result is used as the current average value of the three-phase current, until the operating state of the motor controller does not meet the preset conditions, then the current zero-position self-learning process is stopped.
[0016] According to a preferred scheme for implementing the embodiment of the present invention, in the zero-position self-learning process, each time self-learning is performed, the original value of the three-phase current is added to the current accumulated value of the three-phase current to update the accumulated value of the three-phase current and the number of self-learning times is updated, and then the updated accumulated value of the three-phase current is divided by the current number of self-learning times to calculate the average value of the three-phase current. As the number of self-learning times increases, the average value of the three-phase current gradually approaches the true zero-position value, thereby realizing the process of adaptive learning and improving the adaptive ability of the system.
[0017] As a preferred solution, the real-time acquisition of the original three-phase current values of the current sensor is specifically as follows:
[0018] Collect the supply voltage of the current sensor in real time;
[0019] Based on the supply voltage, the output current of the current sensor is calibrated to obtain the original three-phase current values of the current sensor.
[0020] By implementing the preferred solution of the embodiment of the present invention, the power supply voltage of the current sensor is collected in real time, and the output current of the current sensor is calibrated using the power supply voltage of the current sensor, which can effectively suppress the zero offset problem caused by power supply voltage fluctuation.
[0021] As a preferred solution, the output current of the current sensor is calibrated based on the supply voltage to obtain the original three-phase current value of the current sensor, specifically:
[0022] Based on the supply voltage and in combination with a mapping relationship between the output voltage and the output current of the current sensor, calibrating the output voltage of the current sensor;
[0023] According to a preset algorithm, in combination with the calibrated output voltage and the power supply voltage, the three-phase current original values of the current sensor are calculated; wherein the three-phase current original values include the U-phase current original value, the V-phase current original value and the W-phase current original value; the preset algorithm is specifically:
[0024]
[0025] In the formula, I U Indicates the original value of U phase current; I V Indicates the original value of V phase current; I W Indicates the original value of W phase current; V′ out Represents the output voltage after calibration; VDD represents the power supply voltage of the current sensor; A represents the range of the current sensor.
[0026] According to a preferred embodiment of the present invention, the output voltage of the current sensor is calibrated based on the power supply voltage of the current sensor and the mapping relationship between the output voltage and the output current of the current sensor. This can effectively compensate for the influence of power supply voltage fluctuations on the output voltage and improve measurement accuracy.
[0027] As a preferred solution, the three-phase current zero-position self-learning value includes the U-phase current zero-position self-learning value, the V-phase current zero-position self-learning value and the W-phase current zero-position self-learning value; the three-phase current original value includes the U-phase current original value, the V-phase current original value and the W-phase current original value; the calibrated three-phase current value includes the calibrated U-phase current value, the calibrated V-phase current value and the calibrated W-phase current value; after stopping the current zero-position self-learning process, based on the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process, the three-phase current original value is calibrated to obtain the calibrated three-phase current value, and the zero bias calibration of the current sensor is completed, specifically:
[0028]
[0029] In the formula, I U_out Indicates the U-phase current value after calibration; I V_out Indicates the V-phase current value after calibration; I W_out Indicates the W phase current value after calibration; I U Indicates the original value of U phase current; I V Indicates the original value of V phase current; I W Indicates the original value of W phase current; I U_learn Indicates the U-phase current zero position self-learning value; I V_learn Indicates the V-phase current zero position self-learning value; I W_learn Indicates the W-phase current zero position self-learning value.
[0030] By implementing the preferred solution of the embodiment of the present invention, the zero-position self-learning value of the three-phase current is subtracted from the original value of the three-phase current, which can effectively eliminate the zero-bias error of the current sensor and improve the accuracy of current measurement.
[0031] In order to solve the same technical problem, an embodiment of the present invention further provides a current sensor zero-bias calibration system, comprising:
[0032] A data acquisition module is used to obtain the original three-phase current values of the current sensor in real time;
[0033] A zero-position self-learning module is used to perform a zero-position self-learning process on a preset three-phase current accumulated value when the running state of the motor controller meets the preset conditions, and at each self-learning in the zero-position self-learning process, use the three-phase current original value to update the current three-phase current accumulated value, and increase the number of self-learning times by 1, and then calculate the current three-phase current average value based on the current three-phase current accumulated value and the current number of self-learning times, until the running state of the motor controller does not meet the preset conditions, then stop the current zero-position self-learning process, and analyze and obtain the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process based on the current number of self-learning times and the current three-phase current average value; wherein the preset condition is that the motor controller is in the IGBT off state and the motor speed is less than the first threshold value;
[0034] The calibration module is used to calibrate the original value of the three-phase current based on the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process after stopping the current zero-position self-learning process, obtain the calibrated three-phase current value, and complete the zero bias calibration of the current sensor.
[0035] As a preferred solution, the data acquisition module specifically includes:
[0036] A data acquisition unit, used for real-time acquisition of the power supply voltage of the current sensor;
[0037] The current calibration unit is used to calibrate the output current of the current sensor based on the supply voltage to obtain the original value of the three-phase current of the current sensor.
[0038] In order to solve the same technical problem, the present invention also provides a computer-readable storage medium, which includes a stored computer program; wherein, when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the current sensor zero-bias calibration method.
[0039] In order to solve the same technical problem, the present invention also provides a terminal, including a processor, a memory and a computer program stored in the memory; wherein the computer program can be executed by the processor to implement the current sensor zero-bias calibration method. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 : A flow chart of a current sensor zero-bias calibration method provided in Embodiment 1 of the present invention;
[0041] Figure 2 : A schematic diagram of the structure of a current sensor signal acquisition circuit provided in Embodiment 1 of the present invention;
[0042] Figure 3 : A structural diagram of a current sensor zero bias calibration system provided in Example 1 of the present invention. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] Embodiment one:
[0045] Please refer to Figure 1 , is a current sensor zero-bias calibration method provided by an embodiment of the present invention, the method includes steps S1 to S3, each step is specifically as follows:
[0046] Step S1, obtaining the original three-phase current values of the current sensor in real time.
[0047] As a preferred solution, step S1 includes step S11 to step S12, and each step is specifically as follows:
[0048] Step S11, collecting the power supply voltage VDD of the current sensor in real time.
[0049] Step S12: calibrate the output current of the current sensor based on the power supply voltage to obtain the original three-phase current values of the current sensor.
[0050] In this embodiment, please refer to Figure 2 , which is a current sensor signal acquisition circuit. The current sensor signal acquisition circuit is used to collect the power supply voltage of the current sensor in real time.
[0051] As a preferred solution, step S12 includes step S121 to step S122, and each step is specifically as follows:
[0052] Step S121, see equation (1), based on the supply voltage, combined with the output voltage V of the current sensor out With the output current I out The mapping relationship between them is used to calibrate the output voltage of the current sensor.
[0053]
[0054] Where V′ out Represents the output voltage after calibration; VDD represents the supply voltage of the current sensor; A represents the range of the current sensor; I out Indicates the output current of the current sensor.
[0055] Step S122, according to a preset algorithm, combined with the calibrated output voltage and the supply voltage, the three-phase current original values of the current sensor are calculated, wherein the three-phase current original values include the U-phase current original value, the V-phase current original value and the W-phase current original value.
[0056] For the preset algorithm, please refer to formula (2) for details.
[0057]
[0058] In the formula, I U Indicates the original value of U phase current; I V Indicates the original value of V phase current; I W Indicates the original value of W phase current; V′ out Represents the output voltage after calibration; VDD represents the power supply voltage of the current sensor; A represents the range of the current sensor.
[0059] It should be noted that before executing step S2, the following presettings are performed: the self-learning times Count is set to 0, and its data type is floating point type; the three-phase current accumulated values are set to be: U-phase current accumulated value SI U =0, V phase current accumulated value SI V =0 and W phase current accumulated value SI W =0.
[0060] Step S2, when the operating state of the motor controller meets the preset conditions, the preset three-phase current accumulated value is processed by the zero-position self-learning process, and at each self-learning in the zero-position self-learning process, the three-phase current original value is used to update the current three-phase current accumulated value, and the number of self-learning times is increased by 1, and then based on the current three-phase current accumulated value and the current number of self-learning times, the current three-phase current average value is calculated, until the operating state of the motor controller does not meet the preset conditions, then the current zero-position self-learning process is stopped, and based on the current number of self-learning times and the current three-phase current average value, the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process is analyzed.
[0061] The preset condition is that the motor controller is in the IGBT off state and the motor speed is less than a first threshold.
[0062] In this embodiment, the first threshold is 10 rpm.
[0063] It should be noted that the three-phase current zero position self-learning value includes: the U-phase current zero position self-learning value, the V-phase current zero position self-learning value and the W-phase current zero position self-learning value. The three-phase current average value includes: the U-phase current average value, the V-phase current average value and the W-phase current average value.
[0064] As a preferred solution, step S2 includes step S21 to step S24, and each step is specifically as follows:
[0065] Step S21, when the running state of the motor controller meets the preset conditions, the preset three-phase current accumulated value is processed by the zero-position self-learning process, and at each self-learning in the zero-position self-learning process, please refer to formula (3), add the original value of the three-phase current to the current three-phase current accumulated value, and then use the addition result as the new three-phase current accumulated value to update the three-phase current accumulated value, and increase the number of self-learning times by 1, then refer to formula (4), divide the updated three-phase current accumulated value by the current number of self-learning times, and then use the division result as the current three-phase current average value, until the running state of the motor controller does not meet the preset conditions, then stop the current zero-position self-learning process.
[0066]
[0067] Where, SI U Indicates the accumulated value of U phase current; SI V Indicates the accumulated value of V phase current; SI W Indicates the accumulated value of W phase current; I U Indicates the original value of U phase current; I V Indicates the original value of V phase current; I W Indicates the original value of W phase current; Indicates the average value of U phase current; Indicates the average value of V phase current; Indicates the average value of W phase current; Count indicates the number of self-learning times.
[0068] It should be noted that in the zero-position self-learning process, the data type of the accumulated self-learning times is a floating point type.
[0069] Step S22, when stopping the current zero position self-learning process, determine whether the current number of self-learning times is less than the second threshold; if not, execute step S23; if so, execute step S24.
[0070] In this embodiment, the second threshold is 500.
[0071] It should be noted that after stopping the current zero-position self-learning process and before performing the next zero-position self-learning process, the number of self-learning times needs to be reset to zero so that it can be accumulated again when performing the next zero-position self-learning process.
[0072] Step S23, taking the current three-phase current average value as the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process.
[0073] Step S24, taking the three-phase current zero-position self-learning value corresponding to the previous zero-position self-learning process as the three-phase current self-learning value corresponding to the current zero-position self-learning process.
[0074] Step S3, after stopping the current zero-position self-learning process, calibrate the three-phase current original value based on the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process, obtain the calibrated three-phase current value, and complete the zero bias calibration of the current sensor.
[0075] It should be noted that the calibrated three-phase current value includes: a calibrated U-phase current value, a calibrated V-phase current value and a calibrated W-phase current value.
[0076] As a preferred solution, the details of step S3 refer to formula (5).
[0077]
[0078] In the formula, I U_out Indicates the U-phase current value after calibration; I V_out Indicates the V-phase current value after calibration; I W_out Indicates the W phase current value after calibration; I U Indicates the original value of U phase current; I V Indicates the original value of V phase current; I W Indicates the original value of W phase current; I U_learn Indicates the U-phase current zero position self-learning value; IV_learn Indicates the V-phase current zero position self-learning value; I W_learn Indicates the W-phase current zero position self-learning value.
[0079] Please refer to Figure 3 , is a structural diagram of a current sensor zero-bias calibration system provided by an embodiment of the present invention, the system includes a data acquisition module M1, a zero position self-learning module M2 and a calibration module M3, and the specific details of each module are as follows:
[0080] The data acquisition module M1 is used to obtain the original three-phase current values of the current sensor in real time;
[0081] The zero-position self-learning module M2 is used to perform a zero-position self-learning process on a preset three-phase current accumulated value when the running state of the motor controller meets the preset conditions, and at each self-learning in the zero-position self-learning process, use the original value of the three-phase current to update the current three-phase current accumulated value, and increase the number of self-learning times by 1, and then calculate the current three-phase current average value based on the current three-phase current accumulated value and the current number of self-learning times, until the running state of the motor controller does not meet the preset conditions, then stop the current zero-position self-learning process, and analyze and obtain the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process based on the current number of self-learning times and the current three-phase current average value; wherein the preset conditions are that the motor controller is in the IGBT off state and the motor speed is less than the first threshold value;
[0082] The calibration module M3 is used to calibrate the original value of the three-phase current based on the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process after stopping the current zero-position self-learning process, obtain the calibrated three-phase current value, and complete the zero bias calibration of the current sensor.
[0083] As a preferred solution, the data acquisition module M1 specifically includes a data acquisition unit 11 and a current calibration unit 12, and the details of each unit are as follows:
[0084] A data acquisition unit 11 is used to collect the supply voltage of the current sensor in real time;
[0085] The current calibration unit 12 is used to calibrate the output current of the current sensor based on the power supply voltage to obtain the original value of the three-phase current of the current sensor.
[0086] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0087] An embodiment of the present invention further provides a computer-readable storage medium, which includes a stored computer program; wherein, when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute a current sensor zero-bias calibration method described in embodiment 1.
[0088] An embodiment of the present invention further provides a terminal, including a processor, a memory, and a computer program stored in the memory; wherein the computer program can be executed by the processor to implement a current sensor zero-bias calibration method described in Embodiment 1.
[0089] Preferably, the computer program can be divided into one or more modules / units (such as computer program, computer program), one or more modules / units are stored in the memory and executed by the processor to complete the present invention. One or more modules / units can be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal.
[0090] The processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor, or the processor can also be any conventional processor. The processor is the control center of the terminal, and various parts of the terminal are connected using various interfaces and lines.
[0091] The memory mainly includes a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function, etc., and the data storage area can store related data, etc. In addition, the memory can be a high-speed random access memory, or a non-volatile memory, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, and a flash card (Flash Card), etc., or the memory can also be other volatile solid-state storage devices.
[0092] It should be noted that the above-mentioned terminal may include, but is not limited to, a processor and a memory. Those skilled in the art will understand that the above-mentioned terminal is merely an example and does not constitute a limitation on the terminal. It may include more or fewer components, or a combination of certain components, or different components.
[0093] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0094] The present invention provides a current sensor zero-bias calibration method, system, medium and terminal, which obtain the three-phase current original value of the current sensor in real time, and when the running state of the motor controller meets the preset condition that the motor controller is in the IGBT off state and the motor speed is less than the first threshold value, the preset three-phase current accumulated value is processed by the zero-position self-learning process, and in each self-learning in the zero-position self-learning process, the three-phase current original value is used to update the current three-phase current accumulated value, and the number of self-learning times is increased by 1, and then based on the current three-phase current accumulated value and the current number of self-learning times, the current three-phase current average value is calculated, until the running state of the motor controller does not meet the above preset conditions, then the current zero-position self-learning process is stopped, and based on the current number of self-learning times and the current three-phase current average value, the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process is analyzed, and finally based on the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process Learning value, calibrate the original value of the three-phase current, obtain the calibrated three-phase current value, and complete the zero-bias calibration of the current sensor. Through the above means, when the motor controller is in the IGBT off state, the current sensor is subjected to static zero-position self-learning, and when the motor controller is in the IGBT switching state, the static zero-position self-learning is stopped. At this time, the current sensor is in a working state, and then based on the three-phase current zero-position self-learning value obtained through static zero-position self-learning, the real-time acquired three-phase current original value is calibrated to realize the automatic calibration of the zero-point current offset of the current sensor throughout its life cycle. Moreover, the number of self-learning times in the zero-position self-learning algorithm is a floating-point data type, and its value can be infinite, which can avoid the situation where the software program runs away due to value overflow, and can also perform self-learning when the motor controller is in the off state, so as to extend the zero-position self-learning time, ensure the stability and accuracy of the current zero-position self-learning, and thus improve the stability and accuracy of the zero-bias calibration of the current sensor. In addition, when the operating state of the motor controller meets the preset conditions that the motor controller is in the IGBT off state and the motor speed is less than the first threshold, the preset three-phase current accumulated value is processed by the zero-position self-learning process, so that regular zero-position self-learning can be achieved, which can ensure that the zero bias error is always in a smaller range, reducing system instability caused by zero bias changes.
[0095] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. A current sensor zero bias calibration method, characterized in that: include: Obtain the three-phase current original values of the current sensor in real time; When the running state of the motor controller meets the preset conditions, the preset three-phase current accumulated value is processed by the zero-position self-learning process, and in each self-learning in the zero-position self-learning process, the three-phase current original value is used to update the current three-phase current accumulated value, and the number of self-learning times is increased by 1, and then based on the current three-phase current accumulated value and the current number of self-learning times, the current three-phase current average value is calculated, until the running state of the motor controller does not meet the preset conditions, then the current zero-position self-learning process is stopped, and based on the current number of self-learning times and the current three-phase current average value, the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process is analyzed and obtained; wherein, the preset condition is that the motor controller is in the IGBT off state and the motor speed is less than the first threshold value; After stopping the current zero-position self-learning process, the three-phase current original value is calibrated based on the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process to obtain the calibrated three-phase current value, thereby completing the zero bias calibration of the current sensor.
2. A current sensor zero bias calibration method as claimed in claim 1, characterized in that: Based on the current self-learning times and the current three-phase current average value, the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process is analyzed and obtained, specifically: When the current zero position self-learning process is stopped, it is determined whether the current number of self-learning times is less than a second threshold value; If not, the current three-phase current average value is used as the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process; If so, the three-phase current zero-position self-learning value corresponding to the previous zero-position self-learning process is used as the three-phase current self-learning value corresponding to the current zero-position self-learning process.
3. A current sensor zero bias calibration method as claimed in claim 1, characterized in that: During each self-learning in the zero-position self-learning process, the three-phase current original value is used to update the current three-phase current accumulated value, and the number of self-learning times is increased by 1, and then based on the current three-phase current accumulated value and the current number of self-learning times, the current three-phase current average value is calculated until the running state of the motor controller does not meet the preset condition, then the current zero-position self-learning process is stopped, specifically: During each self-learning in the zero-position self-learning process, the original value of the three-phase current is added to the current accumulated value of the three-phase current, and then the addition result is used as the new accumulated value of the three-phase current to update the accumulated value of the three-phase current, and the number of self-learning times is increased by 1, and then the updated accumulated value of the three-phase current is divided by the current number of self-learning times, and then the division result is used as the current average value of the three-phase current, until the operating state of the motor controller does not meet the preset conditions, then the current zero-position self-learning process is stopped.
4. A current sensor zero bias calibration method as claimed in claim 1, characterized in that: The real-time acquisition of the original three-phase current values of the current sensor is specifically as follows: Real-time acquisition of the supply voltage of the current sensor; Based on the supply voltage, the output current of the current sensor is calibrated to obtain the original three-phase current values of the current sensor.
5. A current sensor zero bias calibration method as claimed in claim 4, characterized in that: The output current of the current sensor is calibrated based on the supply voltage to obtain the original three-phase current value of the current sensor, specifically: Based on the supply voltage and in combination with a mapping relationship between the output voltage and the output current of the current sensor, calibrating the output voltage of the current sensor; According to a preset algorithm, in combination with the calibrated output voltage and the power supply voltage, the three-phase current original values of the current sensor are calculated; wherein the three-phase current original values include the U-phase current original value, the V-phase current original value and the W-phase current original value; the preset algorithm is specifically: In the formula, I U Indicates the original value of U phase current; I V Indicates the original value of V phase current; I W Indicates the original value of W phase current; V′ out Represents the output voltage after calibration; VDD represents the power supply voltage of the current sensor; A represents the range of the current sensor.
6. A current sensor zero-bias calibration method as claimed in claim 1, characterized in that: The three-phase current zero-position self-learning value includes the U-phase current zero-position self-learning value, the V-phase current zero-position self-learning value and the W-phase current zero-position self-learning value; the three-phase current original value includes the U-phase current original value, the V-phase current original value and the W-phase current original value; the calibrated three-phase current value includes the calibrated U-phase current value, the calibrated V-phase current value and the calibrated W-phase current value; after stopping the current zero-position self-learning process, based on the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process, calibrating the three-phase current original value to obtain the calibrated three-phase current value, and completing the zero bias calibration of the current sensor, specifically: In the formula, I U_out Indicates the U-phase current value after calibration; I V_out Indicates the V-phase current value after calibration; I W_out Indicates the W phase current value after calibration; I U Indicates the original value of U phase current; I V Indicates the original value of V phase current; I W Indicates the original value of W phase current; I U_learn Indicates the U-phase current zero position self-learning value; I V_learn Indicates the V-phase current zero position self-learning value; I W_learn Indicates the W-phase current zero position self-learning value.
7. A current sensor zero bias calibration system, characterized in that: include: A data acquisition module is used to obtain the original three-phase current values of the current sensor in real time; A zero-position self-learning module is used to perform a zero-position self-learning process on a preset three-phase current accumulated value when the running state of the motor controller meets the preset conditions, and at each self-learning in the zero-position self-learning process, use the three-phase current original value to update the current three-phase current accumulated value, and increase the number of self-learning times by 1, and then calculate the current three-phase current average value based on the current three-phase current accumulated value and the current number of self-learning times, until the running state of the motor controller does not meet the preset conditions, then stop the current zero-position self-learning process, and analyze and obtain the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process based on the current number of self-learning times and the current three-phase current average value; wherein the preset condition is that the motor controller is in the IGBT off state and the motor speed is less than the first threshold value; The calibration module is used to calibrate the original value of the three-phase current based on the three-phase current zero-position self-learning value corresponding to the current zero-position self-learning process after stopping the current zero-position self-learning process, obtain the calibrated three-phase current value, and complete the zero bias calibration of the current sensor.
8. A current sensor zero bias calibration system as claimed in claim 7, characterized in that: The data acquisition module specifically includes: A data acquisition unit, used for real-time acquisition of the power supply voltage of the current sensor; The current calibration unit is used to calibrate the output current of the current sensor based on the supply voltage to obtain the original value of the three-phase current of the current sensor.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program; wherein, when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute a current sensor zero-bias calibration method as described in any one of claims 1 to 6.
10. A terminal, characterized in that: It comprises a processor, a memory and a computer program stored in the memory; wherein the computer program can be executed by the processor to implement a current sensor zero-bias calibration method as described in any one of claims 1 to 6.