Current sensor self-calibration method and system for motor controller and phase current calibration method

By detecting the current sensor with high precision and calculating the gain calibration parameters, the problem of current sensor accuracy limitation in the motor controller is solved, and the automatic calibration and accuracy improvement of the current sensor are achieved.

CN119936769BActive Publication Date: 2025-10-03CHENZHI AUTOMOBILE TECHNOLOGY GROUP CO LTD CHONGQING INNOVATION RESEARCH BRANCH +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510141139.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-08
Publication Date
2025-10-03
Estimated Expiration
2045-02-08

AI Technical Summary

Technical Problem

The accuracy limitation of the current sensor in the existing motor controller and the deviation of the AD sampling circuit cause the current sampling result to deviate from the actual current value. In addition, the existing calibration method complicates the system and has PI parameter matching problems.

Method used

Phase current is collected through high-precision current sensor detection and current sensor to be calibrated, gain calibration parameters and offset calibration parameters are calculated, the calibration process is simplified, and automated calibration is achieved by utilizing the interactive design between the motor controller MCU and the host computer.

Benefits of technology

The calibration accuracy of the current sensor is improved, the calibration system is simplified, the matching problem between the current loop PI control parameters and the system load is solved, and the automatic calibration of the current sensor is realized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119936769B_ABST
    Figure CN119936769B_ABST
Patent Text Reader

Abstract

The present invention discloses a current sensor self-calibration method, system, and phase current calibration method for a motor controller. The method utilizes a high-precision current sensor to detect phase current, which is then collected using the current sensor to be calibrated. Gain and offset calibration parameters are then calculated based on the detection and sampling results. The gain coefficient and offset of the current sensor are simultaneously calibrated, and during the calibration process, the motor controller's memory storage / reading process is verified. This method solves the problem of matching current loop PI control parameters with system load, improves post-calibration accuracy, and ensures the quality of the motor controller product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of motor control, and in particular relates to a current sensor self-calibration method and system for a motor controller, and a phase current calibration method. Background Art

[0002] In motor control technology, current closed-loop control is the foundation for precise torque output, and the sampling accuracy of current sensors directly impacts the performance of the current loop. However, due to the accuracy limitations of the current sensors themselves and the tolerances of the motor controller's analog-to-digital sampling circuit, the current sampling results from the motor controller often deviate from the actual current value. Therefore, prior to using the motor controller, it is essential to calibrate its current sensor.

[0003] CN112763962A discloses a current calibration method for an electric vehicle motor drive control system. The control unit in the motor drive control system uses a current sampling circuit to obtain a current feedback value. By inputting a calibration current into the current sampling circuit and collecting the corresponding current feedback value, a corresponding relationship table of input and output currents is obtained. The corresponding relationship table is applied in the control program to compensate the actual measured current and then used as current closed-loop feedback. However, the method still has the following problems: (1) the use of the motor controller current closed-loop control method is equivalent to introducing a closed-loop control system into the calibration system, which complicates the system and also causes the problem of matching the current loop control PI parameters with different calibration hardware systems; (2) the calibration is performed using a table index (lookup table), which makes the calibration work of the table complex and requires a large amount of calculation. Summary of the Invention

[0004] The object of the present invention is to provide a current sensor self-calibration method and system for a motor controller and a phase current calibration method to simplify the calibration process and improve the calibration accuracy.

[0005] In a first aspect, the current sensor self-calibration method of a motor controller according to the present invention is performed by a host computer and a motor controller in cooperation; the method comprises:

[0006] The MCU of the motor controller outputs a signal with a duty cycle of Duty to control the lower half bridge of the kth phase to turn on (that is, the lower switch tube of the kth phase bridge arm is turned on) and the upper half bridge of the remaining two phases to turn on (that is, the upper switch tubes of the remaining two phase bridge arms are turned on), forming a current loop.

[0007] After the current stabilizes, the motor controller collects the k-th phase current through its own k-th current sensor to be calibrated, and obtains the k-th phase current sampling result SCurrI′ k The host computer detects the k-th phase current through the k-th high-precision current sensor and obtains the k-th phase current detection result BCurrI′ k, and then use the kth phase current detection result BCurrI′ k Sent to the motor controller MCU.

[0008] The MCU of the motor controller records the k-th phase current detection result BCurrI′ k and the k-th phase current sampling result SCurrI′ k After that, it outputs a signal with a duty cycle of Duty to control the upper half bridge of the kth phase to be turned on (that is, the upper switch tube of the kth phase bridge arm is turned on) and the lower half bridge of the remaining two phases to be turned on (that is, the lower switch tubes of the remaining two phase bridge arms are turned on), forming a current loop.

[0009] After the current stabilizes, the motor controller collects the k-th phase current through its own k-th current sensor to be calibrated and obtains the k-th phase current sampling result SCurrI″ k The host computer detects the k-th phase current through the k-th high-precision current sensor and obtains the k-th phase current detection result BCurrI″ k , and then use the kth phase current detection result BCurrI″ k Sent to the motor controller MCU.

[0010] The MCU of the motor controller (2) records the k-th phase current detection result BCurrI″ k And the k-th phase current sampling result SCurrI″ k Then, use the formula: Calculate the gain calibration parameter Gain of the kth current sensor to be calibrated k and offset calibration parameters Offset k .

[0011] If Gain k Within the preset gain range, and Offset k Within the preset bias range, the MCU of the motor controller feeds back the self-calibration success flag and Gain to the upper computer. k 、Offset k , and set the self-calibration success mark and Gain k 、Offset k Store in memory, make NVMGain k =Gain k 、NVMOffset k =Offset k And the self-calibration status is a self-calibration success mark.

[0012] After restarting the motor controller, the host computer verifies the calibration data (i.e. the self-calibration success flag and Gain k 、Offset k) has been successfully stored, the current sensor self-calibration is completed.

[0013] Where k is any integer from 1 to n, n is equal to the total number of phases of the current sensors to be calibrated in the motor controller, and n is 2 or 3 (the total number of current sensors to be calibrated in the motor controller and the total number of high-precision current sensors are also equal to n), NVMGain k Indicates the gain coefficient of the kth current sensor to be calibrated, NVMOffset k Represents the bias of the kth current sensor to be calibrated.

[0014] Preferably, the duty cycle Among them, I ref Indicates the target current during calibration, R s Indicates the phase resistance of the system load (such as a motor or reactor), U cc Indicates the voltage of the high voltage power supply, I ref 、R s 、U dc The preset gain range is 0.97 to 1.03, and the preset offset range is -10A to 10A.

[0015] Preferably, if the gain calibration parameter Gain of the kth current sensor to be calibrated is k Not within the preset gain range, or the offset calibration parameter Offset of the kth current sensor to be calibrated k If the current sensor is not within the preset bias range, the MCU of the motor controller will feedback the self-calibration failure flag to the host computer. After receiving the self-calibration failure flag, the host computer will report the failure of the current sensor to be calibrated and then exit the current sensor self-calibration.

[0016] Preferably, after restarting the motor controller, the MCU of the motor controller reads the self-calibration status in the memory and makes a judgment. If the self-calibration status is not a self-calibration success flag, the NVMGain k =1, NVMOffset k = 0, then set the self-calibration state and NVMGain k 、NVMOffset k Send to the host computer, otherwise (when the self-calibration status is the self-calibration success mark) directly send the self-calibration status and NVMGain k 、NVMOffset k Send to the host computer. The host computer receives the self-calibration status and NVMGain k 、NVMOffset k Finally, check whether the calibration data has been stored successfully.

[0017] Preferably, the host computer verifies whether the calibration data has been stored successfully by: judging whether the self-calibration state is the self-calibration success flag, and NVMGain k and Gain k The difference is less than 0.001, and NVMOffset k and Offset k The difference is less than 0.001; if so, the host computer determines that the calibration data has been stored successfully, otherwise the host computer determines that the calibration data has not been stored successfully, reports a fault in the current sensor to be calibrated, and then exits the current sensor self-calibration.

[0018] Preferably, before the MCU of the motor controller outputs a signal with a duty cycle of Duty to control the lower half bridge of the kth phase to turn on and the upper half bridges of the remaining two phases to turn on, the host computer first controls the low voltage relay to close, wakes up the motor controller, and then controls the high voltage relay to close and turn on the high voltage. The host computer detects the current result of the nth phase BCurrI″ n After being sent to the MCU of the motor controller, the high-voltage relay will be controlled to disconnect and reduce the high voltage.

[0019] Preferably, the host computer restarts the motor controller by first controlling the low-voltage relay to be disconnected and then controlling the low-voltage relay to be closed.

[0020] Preferably, the k-th phase current sampling result SCurrI′ k When the lower half bridge of the kth phase is turned on and the upper half bridges of the remaining two phases are turned on, the motor controller continuously collects data for 1 second through its own kth current sensor to be calibrated, and calculates the average value of the kth phase current within 1 second.

[0021] The k-th phase current detection result BCurrI′ k When the lower half bridge of the kth phase is turned on and the upper half bridges of the remaining two phases are turned on, the host computer continuously detects the current for 1 second through the kth high-precision current sensor and calculates the average value of the kth phase current within 1 second.

[0022] The k-th phase current sampling result SCurrI″ k When the upper half bridge of the kth phase is turned on and the lower half bridges of the remaining two phases are turned on, the motor controller continuously collects data for 1 second through its own kth current sensor to be calibrated, and calculates the average value of the kth phase current within 1 second.

[0023] The k-th phase current detection result BCurrI″ k When the upper half bridge of the kth phase is turned on and the lower half bridges of the remaining two phases are turned on, the host computer continuously detects the current for 1 second through the kth high-precision current sensor and calculates the average value of the kth phase current within 1 second.

[0024] In a second aspect, the current sensor self-calibration system of the motor controller described in the present invention includes a high-voltage power supply, a high-voltage relay, a low-voltage power supply, a low-voltage relay, a motor controller, a host computer, a system load, and n high-precision current sensors. The n high-precision current sensors are respectively connected to the host computer to transmit the current on the corresponding n phase lines to the host computer. The motor controller includes an MCU, a memory (with EEPROM storage / reading function), a driver chip, a three-phase bridge arm, n current sensors to be calibrated, and an AD sampling circuit. The MCU of the motor controller and the host computer are configured to execute the above-mentioned current sensor self-calibration method.

[0025] In a third aspect, the phase current calibration method of the motor controller of the present invention comprises: when the system load is working, the MCU of the motor controller reads the NVMGain in the memory k 、NVMOffset k , and use the formula: I′ k =NVM Gain k *I k +NVMOffset k , calibrate and obtain the k-th phase current I′ of the motor controller k ; Among them, I k represents the k-th phase current (i.e., the k-th phase current before calibration) collected by the k-th current sensor (of the motor controller itself), the NVMGain k 、NVMOffset k It is calibrated using the above current sensor self-calibration method.

[0026] Compared with the prior art, the present invention has the following effects:

[0027] (1) A high-precision current sensor is used to detect the phase current, and the current sensor to be calibrated is used to collect the phase current. Then, the gain calibration parameters and the offset calibration parameters are calculated based on the detection results and the sampling results. This avoids introducing the current acquisition circuit and the current closed-loop PI control system into the calibration process, simplifies the calibration system, and solves the problem of matching the current loop PI control parameters with the system load.

[0028] (2) The gain coefficient and bias of the current sensor are calibrated at the same time. The gain coefficient and bias of the current sensor are substituted into the calculation during calibration, which improves the accuracy after calibration and avoids the use of a large number of tables in the motor controller program.

[0029] (3) Taking the motor controller as the main factor, the interaction sequence between the MCU of the motor controller and the host computer is reasonably designed, which reduces the steps of the host computer operation and realizes the automation of the current sensor calibration. It can be applied to the automatic calibration process of the current sensor when the motor controller is offline, thereby improving the production rhythm.

[0030] (4) During the calibration process, the memory storage / reading process of the motor controller is verified. If the verification fails, a current sensor fault will be reported, thereby ensuring the quality of the motor controller product. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 This is a functional block diagram of a current sensor self-calibration system for a motor controller according to an embodiment of the present invention.

[0032] Figure 2 This is a flowchart of the execution of the host computer in the current sensor self-calibration method of the motor controller according to an embodiment of the present invention.

[0033] Figure 3 This is a flowchart of the execution of the MCU in the current sensor self-calibration method of the motor controller according to an embodiment of the present invention. DETAILED DESCRIPTION

[0034] The present invention will be described in further detail below with reference to the accompanying drawings.

[0035] like Figure 1 As shown, the current sensor self-calibration system for the motor controller in an embodiment of the present invention includes a high-voltage power supply, a high-voltage relay 5, a low-voltage power supply (i.e., a 12V power supply), a low-voltage relay 4, a motor controller 2, a host computer 1, a system load (such as a motor or a reactor), and n high-precision current sensors 3; wherein n is equal to the total number of phases of the current sensors to be calibrated provided in the motor controller 2. The value of n can be 2 or 3, depending on actual needs. Here, n = 2 is used as an example for explanation.

[0036] Two high-precision current sensors 3 are connected to the host computer 1, transmitting the currents of the two corresponding phase lines (i.e., U and V) to the host computer 1. The current of the W phase can be calculated by combining the currents of the U and V phases. The motor controller 2 includes an MCU, memory (i.e., EEPROM), a driver chip, a three-phase bridge arm, two current sensors to be calibrated, and an analog-to-digital sampling circuit. The MCU has EEPROM storage and readout capabilities. The host computer 1 and the MCU communicate via the CAN bus. The MCU outputs PWM control signals to the driver chip, controlling the driver chip to turn on certain switches in the three-phase bridge arm, thus operating the system load. The two current sensors to be calibrated respectively collect the currents of the two phase lines (i.e., U and V). The analog-to-digital sampling circuit is connected to the MCU and the two current sensors to be calibrated, converts the currents of the two phase lines (corresponding to the current sampling results of the U and V phases), and transmits them to the MCU for processing and judgment.

[0037] like Figure 2 、 Figure 3 As shown, the current sensor self-calibration method of the motor controller in the embodiment of the present invention is completed by the aforementioned host computer 1 and the motor controller 2 in cooperation.

[0038] like Figure 2 As shown, the host computer 1 performs the following steps:

[0039] S11, control the low-voltage relay 4 to close, wake up the motor controller 2, and then execute S12.

[0040] S12, control the high-voltage relay 5 to close, apply high voltage to the motor controller 2, and then execute S13.

[0041] S13: Send a self-calibration enable signal (CurrSnsrAutoCaliEn=1) to the MCU, and then execute S14.

[0042] S14. After receiving the start current sampling enable signal (BenchCurrADStart=1) fed back by the MCU for the first time, the first phase current (i.e., U phase current) is continuously detected for 1s through the first high-precision current sensor, and the average value is calculated to obtain the first phase current detection result BCurrI′1, and then S15 is executed.

[0043] S15 , sending the first phase current detection result BCurrI′1 and the detection completion signal (BenchCurrADComplete=1) to the MCU, and then executing S16 .

[0044] S16. After receiving the start current sampling enable signal (BenchCurrADStart=1) from the MCU for the second time, the first phase current (i.e., U phase current) is continuously detected for 1s by the first high-precision current sensor, and the average value is calculated to obtain the first phase current detection result BCurrI″1, and then S17 is executed.

[0045] S17 , sending the first phase current detection result BCurrI″1 and the detection completion signal (BenchCurrADComplete=1) to the MCU, and then executing S18 .

[0046] S18. After receiving the start current sampling enable signal (BenchCurrADStart=1) from the MCU for the third time, the second phase current (i.e., V phase current) is continuously detected for 1s through the second high-precision current sensor, and the average value is calculated to obtain the second phase current detection result BCurrI′2, and then S19 is executed.

[0047] S19 , sending the second phase current detection result BCurrI′2 and the detection completion signal (BenchCurrADComplete=1) to the MCU, and then executing S110 .

[0048] S110. After receiving the start current sampling enable signal (BenchCurrADStart=1) from the MCU for the fourth time, the second phase current (i.e., the V phase current) is continuously detected for 1 second by the second high-precision current sensor, and the average value is calculated to obtain the second phase current detection result BCurrI″2, and then S111 is executed.

[0049] S111 , sending the second phase current detection result BCurrI″2 and the detection completion signal (BenchCurrADComplete=1) to the MCU, and then executing S112 .

[0050] S112, control the high-voltage relay 5 to disconnect, reduce the high voltage, and then execute S113.

[0051] S113. Receive the self-calibration result (self-calibration success flag and Gain1, Offset1, Gain2, Offset2, or self-calibration failure flag) fed back by the MCU, and determine whether the self-calibration is successful; if it is (i.e., when CSAC=1 and Gain1, Offset1, Gain2, Offset2 are received), execute S115, otherwise (i.e., when CSAC=0 is received), execute S114. Among them, the flag bit CSAC=1 indicates that the self-calibration is successful, and the flag bit CSAC=0 indicates that the self-calibration fails. Among them, Gain1 represents the gain calibration parameter of the first current sensor to be calibrated, Offset1 represents the bias calibration parameter of the first current sensor to be calibrated, Gain2 represents the gain calibration parameter of the second current sensor to be calibrated, and Offset2 represents the bias calibration parameter of the second current sensor to be calibrated.

[0052] S114: Report a fault in the current sensor to be calibrated, and then end. After reporting a fault in the current sensor to be calibrated, the motor controller can be blocked to prevent the motor controller with the current sensor fault from being shipped.

[0053] S115 , first control the low-voltage relay 4 to be disconnected, then control the low-voltage relay 4 to be closed (ie, restart the motor controller 2 ), and then execute S116 .

[0054] S116 , after receiving the self-calibration status NVMCSAC and NVMGain1 , NVMOffset1 , NVMGain2 , and NVMOffset2 fed back by the MCU, execute S117 .

[0055] S117: Verify whether the calibration data has been successfully stored. If so, execute S119; otherwise, execute S118. Wherein, NVMGain1 represents the gain coefficient of the first current sensor to be calibrated, NVMOffset1 represents the offset of the first current sensor to be calibrated, NVMGain2 represents the gain coefficient of the second current sensor to be calibrated, and NVMOffset2 represents the offset of the second current sensor to be calibrated.

[0056] Specifically, the standard for the upper computer 1 to successfully verify the calibration data is: the self-calibration state is the self-calibration success flag (that is, NVMCSAC=CSAC=1), and the difference between NVMGain1 and Gain1 is less than 0.001, and the difference between NVMOffset1 and Offset1 is less than 0.001, and the difference between NVMGain2 and Gain2 is less than 0.001, and the difference between NVMOffset2 and Offset2 is less than 0.001.

[0057] S118: Determine that the calibration data is not stored successfully, report that the current sensor to be calibrated is faulty, and then end. After reporting the fault of the current sensor to be calibrated, the motor controller can be intercepted to prevent the motor controller with the current sensor fault from leaving the factory.

[0058] S119: Determine that the calibration data has been successfully stored, complete the current sensor self-calibration, and then end.

[0059] like Figure 3 As shown, the MCU in the motor controller 2 performs the following steps:

[0060] S21, after receiving the automatic calibration enable signal (CurrSnsrAutoCaliEn=1) sent by the host computer 1, outputs a signal with a duty cycle of Duty (i.e. "011") to control the lower half bridge of the first phase to be turned on (i.e. the lower switch tube of the U phase bridge arm is turned on) and the upper half bridge of the remaining two phases to be turned on (i.e. the upper switch tube of the V phase bridge arm and the upper switch tube of the W phase bridge arm are turned on), forming a current loop, waits for 2 seconds (i.e. after the current stabilizes), and executes S22. Among them, the duty cycle I ref Indicates the target current during calibration, R s Indicates the phase resistance of the system load (such as a motor or reactor), U dc Indicates the voltage of the high voltage power supply, I ref 、R s 、U dc All are known parameters.

[0061] S22 , feeding back the current sampling enable signal (BenchCurrADStart=1) to the upper computer 1 for the first time, and simultaneously continuously collecting the first phase current (ie, U phase current) for 1s through its own first current sensor to be calibrated, and then executing S23 .

[0062] S23. After receiving the detection completion signal (BenchCurrADComplete=1) and the first phase current detection result BCurrI′1 from the host computer 1, the current sampling is completed to obtain the first phase current sampling result SCurrI′1; the first phase current detection result BCurrI′1 and the first phase current sampling result SCurrI′1 are recorded at the same time, and then S24 is executed. SCurrI′1 is the average value of the first phase current within 1 second obtained by the motor controller 2 through its own first current sensor to be calibrated, which is continuously collected for 1 second and calculated.

[0063] S24, output a signal with a duty cycle of Duty (i.e., "100") to control the conduction of the upper half bridge of the first phase (i.e., the upper switch tube of the U-phase bridge arm is turned on) and the conduction of the lower half bridges of the remaining two phases (i.e., the lower switch tube of the V-phase bridge arm and the lower switch tube of the W-phase bridge arm are turned on), forming a current loop. After waiting for 2 seconds (i.e., after the current stabilizes), execute S25.

[0064] S25 , feeding back the current sampling enable signal (BenchCurrADStart=1) to the upper computer 1 for the second time, and simultaneously continuously collecting the first phase current (ie, U phase current) for 1s through its own first current sensor to be calibrated, and then executing S26 .

[0065] S26. After receiving the detection completion signal (BenchCurrADComplete=1) and the first phase current detection result BCurrI″1 sent by the upper computer 1, complete the self-current sampling and obtain the first phase current sampling result SCurrI″1; at the same time, record the first phase current detection result BCurrI″1 and the first phase current sampling result SCurrI″1, and then execute S27. Among them, SCurrI″1 is the average value of the first phase current within 1s obtained by the motor controller 2 through its own first current sensor to be calibrated, which is continuously collected for 1s and calculated.

[0066] S27, output a signal with a duty cycle of Duty (i.e., "101") to control the conduction of the lower half bridge of the second phase (i.e., the lower switch tube of the V-phase bridge arm is turned on), and the conduction of the upper half bridges of the remaining two phases (i.e., the upper switch tube of the U-phase bridge arm and the upper switch tube of the W-phase bridge arm are turned on), forming a current loop. After waiting for 2s (i.e., after the current stabilizes), execute S28.

[0067] S28 , feeding back the current sampling enable signal (BenchCurrADStart=1) to the upper computer 1 for the third time, and simultaneously continuously collecting the second phase current (ie, V phase current) for 1s through its own second current sensor to be calibrated, and then executing S29 .

[0068] S29. After receiving the detection completion signal (BenchCurrADComplete=1) and the second-phase current detection result BCurrI′2 from the host computer 1, the controller completes its own current sampling and obtains the second-phase current sampling result SCurrI′2; simultaneously records the second-phase current detection result BCurrI′2 and the second-phase current sampling result SCurrI′2, and then executes S210. SCurrI′2 is the average value of the second-phase current within 1 second, which is calculated by the motor controller 2 through its own second current sensor to be calibrated and continuously collected for 1 second.

[0069] S210, output a signal with a duty cycle of Duty (i.e., "010") to control the conduction of the upper half bridge of the second phase (i.e., the upper switch tube of the V-phase bridge arm is turned on), and the conduction of the lower half bridge of the remaining two phases (i.e., the lower switch tube of the U-phase bridge arm and the lower switch tube of the W-phase bridge arm are turned on), forming a current loop. After waiting for 2s (i.e., after the current stabilizes), execute S211.

[0070] S211 , feeding back the current sampling enable signal (BenchCurrADStart=1) to the upper computer 1 for the fourth time, and simultaneously continuously collecting the second phase current (ie, V phase current) for 1s through its own second current sensor to be calibrated, and then executing S212 .

[0071] S212. After receiving the detection completion signal (BenchCurrADComplete=1) and the second-phase current detection result BCurrI″2 sent by the upper computer 1, complete the self-current sampling and obtain the second-phase current sampling result SCurrI″2; at the same time, record the second-phase current detection result BCurrI″2 and the second-phase current sampling result SCurrI″2, and then execute S213. Among them, SCurrI″2 is the average value of the second-phase current within 1s obtained by the motor controller 2 through its own second current sensor to be calibrated, which is continuously collected for 1s and calculated.

[0072] S213, using the formula: Gain1, Offset1, Gain2, and Offset2 are calculated, and then S214 is executed.

[0073] S214: Determine whether Gain1 and Gain2 are both within a preset gain range, and Offset1 and Offset2 are both within a preset offset range. If so, execute S215; otherwise, execute S216. For example, the preset gain range is 0.97 to 1.03, and the preset offset range is -10A to 10A.

[0074] S215, feedback the self-calibration success flag (CSAC=1) and Gain1, Offset1, Gain2, Offset2 to the upper computer 1, and store the self-calibration success flag (CSAC=1) and Gain1, Offset1, Gain2, Offset2 in the EEPROM, so that NVMGain1=Gain1, NVMOffset1=Offset1, NVMGain2=Gain2, NVMOffset2=Offset2 and the self-calibration status is the self-calibration success flag (ie, NVMCSAC=1), and then execute S217.

[0075] S216: Feedback the self-calibration failure flag (CSAC=0) to the upper computer 1, and then end.

[0076] S217. After restarting, read the self-calibration status NVMCSAC in the EEPROM, and then execute S218.

[0077] S218: Determine whether the self-calibration state NVMCSAC is a self-calibration success flag (ie, whether NVMCSAC=1). If so, execute S220; otherwise, execute S219. The default initial value of NVMCSAC is 2.

[0078] S219 , set NVMGain1=1, NVMOffset1=0, NVMGain2=1, NVMOffset2=0, and then execute S220 .

[0079] S220 , sending the self-calibration status NVMCSAC and NVMGain1 , NVMOffset1 , NVMGain2 , and NVMOffset2 to the host computer 1 , and then ending.

[0080] The phase current calibration method of the motor controller in the embodiment of the present invention includes:

[0081] When the system load is working, the MCU of the motor controller 2 reads NVMGain1, NVMOffset1, NVMGain2, and NVMOffset2 in the EEPROM, and uses the formula: I′1=NVMGain1*I1+NVMOffset1, I′2=NVMGain2*I2+NVMOffset2 to calibrate the first phase current (i.e., U phase current) I′1 and the second phase current (i.e., V phase current I′2) of the motor controller 2; wherein, I1 represents the first phase current collected by the first current sensor (i.e., the first phase current before calibration), I2 represents the second phase current collected by the second current sensor (i.e., the second phase current before calibration), and NVMGain1, NVMOffset1, NVMGain2, and NVMOffset2 are calibrated using the aforementioned current sensor self-calibration method.

[0082] In addition, if n=3, the three high-precision current sensors 3 are respectively connected to the host computer 1, and the currents on the corresponding three phase lines (i.e., U phase, V phase, and W phase) are transmitted to the host computer 1. The motor controller 2 will include three current sensors to be calibrated. The steps executed by the host computer 1 will increase the steps of detecting the third phase current (i.e., W phase current) and collecting the third phase current, and sending it to the MCU for calculation. The gain coefficient NVMGain3 and offset NVMOffset3 of the third current sensor to be calibrated will also be considered when verifying the calibration data. The steps executed by the MCU in the motor controller 2 will increase the steps of calculating the gain calibration parameter Gain3 and the offset calibration parameter Offset3 of the third current sensor to be calibrated. The data of the third current sensor to be calibrated will also be considered during storage and judgment. The specific steps are similar to those of the first (or second) current sensor to be calibrated and will not be repeated here.

[0083] The above description is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with this technical field within the technical scope disclosed in the present invention should be covered by the scope of protection of the present invention.

Claims

1. A method for self-calibration of a current sensor of a motor controller, which is completed by a host computer (1) and a motor controller (2); characterized in that: The method includes: The MCU of the motor controller (2) outputs a signal with a duty cycle of Duty to control the lower half bridge of the kth phase to be turned on and the upper half bridges of the remaining two phases to be turned on, thereby forming a current loop; After the current stabilizes, the motor controller (2) collects the k-th phase current through its own k-th current sensor to be calibrated, and obtains the k-th phase current sampling result SCurrI' k The host computer (1) detects the k-th phase current through the k-th high-precision current sensor (3) and obtains the k-th phase current detection result BCurrI' k , then BCurrI' k Sent to the MCU of the motor controller (2); The MCU of the motor controller (2) records BCurrI' k and SCurrI' k After that, it outputs a signal with a duty cycle of Duty to control the upper half bridge of the kth phase to be turned on and the lower half bridges of the remaining two phases to be turned on, forming a current loop; After the current stabilizes, the motor controller (2) collects the k-th phase current through its own k-th current sensor to be calibrated, and obtains the k-th phase current sampling result SCurrI' k ', the host computer (1) detects the kth phase current through the kth high-precision current sensor (3) and obtains the kth phase current detection result BCurrI' k ', then BCurrI' k 'Sent to the MCU of the motor controller (2); The MCU of the motor controller (2) records BCurrI' k 'and SCurrI' k 'After that, use the formula: Calculate the gain calibration parameter Gain of the kth current sensor to be calibrated k and offset calibration parameters Offset k ; If Gain k Within the preset gain range, and Offset k Within the preset bias range, the MCU of the motor controller (2) feeds back the self-calibration success flag and Gain to the upper computer (1). k 、Offset k , and set the self-calibration success mark and Gain k 、Offset k Store in memory, make NVMGain k =Gain k 、NVMOffset k =Offset k And the self-calibration status is a self-calibration success flag; After the motor controller (2) is restarted, the host computer (1) completes the current sensor self-calibration when it verifies that the calibration data has been successfully stored; Wherein, k is any integer from 1 to n, n is equal to the total number of phases of the current sensors to be calibrated in the motor controller (2), and the value of n is 2 or 3. NVMGain k Indicates the gain coefficient of the kth current sensor to be calibrated, NVMOffset k Represents the bias of the kth current sensor to be calibrated.

2. The current sensor self-calibration method of a motor controller according to claim 1, wherein: The duty cycle Among them, I ref Indicates the target current during calibration, R s Indicates the phase resistance of the system load, U dc Indicates the voltage of the high voltage power supply, I ref 、R s 、U dc All are known parameters; The preset gain range is: 0.97~1.03; the preset offset range is: -10A~10A.

3. The current sensor self-calibration method for a motor controller according to claim 1, wherein: If Gain k Not within the preset gain range, or Offset k If it is not within the preset bias range, the MCU of the motor controller (2) feeds back a self-calibration failure flag to the upper computer (1). After receiving the self-calibration failure flag, the upper computer (1) reports a fault in the current sensor to be calibrated.

4. The current sensor self-calibration method for a motor controller according to claim 1, wherein: After restarting the motor controller (2), the MCU of the motor controller (2) reads the self-calibration state in the memory and makes a judgment. If the self-calibration state is not a self-calibration success flag, the NVMGain k =1, NVMOffset k = 0, then set the self-calibration state and NVMGain k 、NVMOffset k Send to the host computer (1), otherwise directly send the self-calibration status and NVMGain k 、NVMOffset k Send to the host computer (1); The host computer (1) receives the self-calibration status and NVMGain k 、NVMOffset k Finally, check whether the calibration data has been stored successfully.

5. The current sensor self-calibration method of a motor controller according to claim 4, characterized in that: The host computer (1) verifies whether the calibration data has been stored successfully by: judging whether the self-calibration state is a self-calibration success flag, and NVMGain k and Gain k The difference is less than 0.001, and NVMOffset k and Offset k The difference is less than 0.001; if so, the host computer (1) determines that the calibration data has been successfully stored, otherwise the host computer (1) determines that the calibration data has not been successfully stored and reports that the current sensor to be calibrated is faulty.

6. The current sensor self-calibration method for a motor controller according to any one of claims 1 to 5, characterized in that: Before the MCU of the motor controller (2) outputs a signal with a duty cycle of Duty to control the lower half bridge of the kth phase to be turned on and the upper half bridges of the remaining two phases to be turned on, the host computer (1) first controls the low voltage relay (4) to be closed to wake up the motor controller (2), and then controls the high voltage relay (5) to be closed to turn on the high voltage; The host computer (1) sends the nth phase current detection result BCurrI' n After being sent to the MCU of the motor controller (2), the high voltage relay (5) will be controlled to disconnect and reduce the high voltage.

7. The current sensor self-calibration method for a motor controller according to any one of claims 1 to 5, characterized in that: The upper computer (1) restarts the motor controller (2) by first controlling the low-voltage relay (4) to be disconnected and then controlling the low-voltage relay (4) to be closed.

8. The current sensor self-calibration method for a motor controller according to any one of claims 1 to 5, characterized in that: The k-th phase current sampling result SCurrI' k When the lower half bridge of the kth phase is turned on and the upper half bridges of the remaining two phases are turned on, the motor controller (2) continuously collects the current of the kth phase within 1 second through its own kth current sensor to be calibrated, and calculates the average value of the current of the kth phase within 1 second; The k-th phase current detection result BCurrI' k When the lower half bridge of the kth phase is turned on and the upper half bridges of the remaining two phases are turned on, the host computer (1) continuously detects for 1 second through the kth high-precision current sensor (3) and calculates the average value of the kth phase current within 1 second; The k-th phase current sampling result SCurrI' k ' is: when the upper half bridge of the kth phase is turned on and the lower half bridges of the remaining two phases are turned on, the motor controller (2) continuously collects the current of the kth phase within 1 second through its own kth current sensor to be calibrated, and calculates the average value of the current of the kth phase within 1 second; The k-th phase current detection result BCurrI' k ' is: when the upper half bridge of the kth phase is turned on and the lower half bridges of the remaining two phases are turned on, the host computer (1) continuously detects for 1 second through the kth high-precision current sensor (3) and calculates the average value of the kth phase current within 1 second.

9. A current sensor self-calibration system for a motor controller, comprising a high-voltage power supply, a high-voltage relay (5), a low-voltage power supply, a low-voltage relay (4), a motor controller (2), a host computer (1), a system load, and n high-precision current sensors (3), wherein the n high-precision current sensors (3) are respectively connected to the host computer (1) and transmit the currents on the corresponding n phase lines to the host computer (1); the motor controller (2) comprises an MCU, a memory, a driver chip, a three-phase bridge arm, n current sensors to be calibrated, and an AD sampling circuit; and is characterized in that: The MCU of the motor controller (2) and the host computer (1) are configured to execute the current sensor self-calibration method according to any one of claims 1 to 8.

10. A phase current calibration method for a motor controller, characterized in that: include: When the system load is working, the MCU of the motor controller (2) reads the NVMGain in the memory k 、NVMOffset k , and use the formula: I' k =NVMGain k *I k +NVMOffset k , calibrate and obtain the k-th phase current I' of the motor controller (2) k ; Among them, I k represents the k-th phase current collected by the k-th current sensor, the NVMGain k 、NVMOffset k The current sensor is calibrated by the current sensor self-calibration method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Calibration method and calibration system for magnetic collection type current sensor of driving motor controller

    CN112763962A

  • BMS current detection unit automatic calibration device and calibration method

    CN103713271A

  • Current sampling coefficient compensation method for permanent magnet synchronous motor controller

    CN110445430A