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

Through the coordinated work of the upper computer and the motor controller, the high-precision current sensor is used to detect phase current and calculate calibration parameters, the problems of complex system and low accuracy during the calibration process of the current sensor of the motor controller are solved, and the automation and high-precision calibration of the current sensor are realized.

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

Patent Information

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

AI Technical Summary

Technical Problem

In the calibration process of current sensors, existing motor controllers have problems such as system complexity and low calibration accuracy, especially the matching problem of the current loop control PI parameters with different calibration hardware systems.

Method used

Through the coordinated work of the upper computer and the motor controller, a high-precision current sensor is used to detect the phase current, and the phase current is collected through the current sensor to be calibrated, and the gain calibration parameters and bias calibration parameters are calculated to simplify the calibration process and improve calibration accuracy.

Benefits of technology

The automatic calibration of current sensor is realized, the calibration process is simplified, the calibration accuracy is improved, the matching problem between the current loop PI control parameters and the system load is avoided, and the production efficiency of the motor controller is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119936769A_ABST
    Figure CN119936769A_ABST
Patent Text Reader

Abstract

The invention discloses a current sensor self-calibration method and system of a motor controller and a phase current calibration method, and the method comprises the steps: detecting a phase current through a high-precision current sensor, collecting the phase current through a to-be-calibrated current sensor, calculating a gain calibration parameter and a bias calibration parameter according to a detection result and a sampling result, and carrying out the calibration of the phase current. Meanwhile, the gain coefficient and the bias of the current sensor are calibrated, and the storage / reading process of a memory of the motor controller is verified in the calibration process. Therefore, the matching problem of the current loop PI control parameters and the system load can be solved, the precision after calibration is improved, and the quality of a motor controller product is ensured.
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 of a motor controller and a phase current calibration method. Background Art

[0002] In motor control technology, current closed-loop control is the basis for accurate torque output, and the sampling accuracy of the current sensor directly affects the performance of the current loop. However, due to the accuracy limitations of the current sensor itself and the deviation of the motor controller AD sampling circuit, there is usually a certain deviation between the motor controller current sampling result and the actual current value. Therefore, it is very necessary to calibrate the current sensor of the motor controller before applying it.

[0003] CN112763962A discloses a current calibration method in an electric vehicle motor drive control system, wherein a control unit in the motor drive control system obtains a current feedback value by using a current sampling circuit, and obtains a corresponding relationship table of input and output currents by inputting a calibration current into the current sampling circuit and collecting a corresponding current feedback value. The corresponding relationship table is applied in the control program to compensate the actual measured current and used as a current closed-loop feedback. However, the following problems still exist: (1) the motor controller current closed-loop control method is used, which is equivalent to introducing a closed-loop control system into a calibration system, making the system complicated, and there is a problem of matching the current loop control PI parameters with different calibration hardware systems; (2) the calibration is performed by using a table index (table lookup), and the calibration work of forming a table is complicated and the amount of calculation is large. 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 the motor controller of the present invention is completed by the cooperation of the host computer and the motor controller; 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 be turned 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 be turned 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 kth phase current through the kth high-precision current sensor and obtains the kth phase current detection result BCurrI' k, and then use the kth phase current detection result BCurrI' k Sent to the motor controller's 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, a signal with a duty cycle of Duty is output 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 kth phase current through the kth high-precision current sensor and obtains the kth phase current detection result BCurrI' k ', then the kth phase current detection result BCurrI' k 'Sent to the motor controller's 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 '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 .

[0011] If Gain k Within the preset gain range, and the Offset k Within the preset bias range, the MCU of the motor controller will feedback the self-calibration success flag and Gain to the upper computer. k 、Offset k , and the self-calibration success flag and Gain k 、Offset k Stored in memory, NVMGain k =Gain k 、NVMOffset k =Offset k And the self-calibration status is a sign of successful self-calibration.

[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 stored successfully, the current sensor self-calibration is completed.

[0013] 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, and the value of 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 dc Indicates the voltage of the high voltage power supply, I ref , R s , U dc All of them are known parameters. The preset gain range is: 0.97~1.03; the preset bias range is: -10A~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 it 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 fault 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 state in the memory and makes a judgment. If the self-calibration state is not a self-calibration success mark, NVMGain k =1, NVMOffset k = 0, and 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 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 a self-calibration success flag, and NVMGain k With Gain k The difference is less than 0.001, and NVMOffset k With 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. 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 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 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 ' 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 continuously collects the current for 1s through its kth current sensor to be calibrated, and calculates the average value of the kth phase current within 1s.

[0023] 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 continuously detects 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 the 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 perform 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 +

[0026] 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 by the above current sensor self-calibration method.

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

[0028] (1) The phase current is detected by a high-precision current sensor, and the phase current is collected by the current sensor to be calibrated. 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.

[0029] (2) The gain coefficient and offset of the current sensor are calibrated at the same time. During calibration, the gain coefficient and offset of the current sensor are substituted into the calculation, thereby improving the accuracy after calibration and avoiding the use of a large number of tables in the motor controller program.

[0030] (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 host computer operation and realizes the automation of current sensor calibration. It can be applied to the automated calibration process of current sensors when the motor controller is off the production line, thus improving the production cycle.

[0031] (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

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

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

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

[0035] The present invention will be further described in detail below in conjunction with the accompanying drawings.

[0036] like Figure 1 As shown, the current sensor self-calibration system of the motor controller in the 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 in the motor controller 2. The value of n can be 2 or 3, which is determined according to actual needs. Here, n=2 is taken as an example for explanation.

[0037] Two high-precision current sensors 3 are connected to the host computer 1 respectively, and the currents on the two phase lines (i.e., U phase and V phase) detected correspondingly are transmitted to the host computer 1. The current on the W phase can be calculated by the current on the U phase and the current on the V phase. The motor controller 2 includes an MCU, a memory (i.e., EEPROM), a driver chip, a three-phase bridge arm, two current sensors to be calibrated, and an AD sampling circuit. The MCU has an EEPROM storage / reading function. The host computer 1 communicates with the MCU through the CAN bus (i.e., CAN BUS). The MCU outputs a PWM control signal to the driver chip to control the driver chip to drive certain switch tubes of the three-phase bridge arm to turn on, so that the system load works. The two current sensors to be calibrated collect the currents of the two phase lines (i.e., U phase and V phase) respectively. The AD sampling circuit is connected to the MCU and the two current sensors to be calibrated, and the currents of the two phase lines (corresponding to the U phase current sampling result and the V phase current sampling result) are converted into analog-to-digital and then transmitted to the MCU for processing and judgment.

[0038] 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.

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

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

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

[0042] S13, sending a self-calibration enable signal (CurrSnsrAutoCaliEn=1) to the MCU, and then executing S14.

[0043] 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 by the first high-precision current sensor, and the average value is calculated to obtain the first phase current detection result BCurrI' 1 , then execute S15.

[0044] S15, the first phase current detection result BCurrI' 1 And the detection completion signal (BenchCurrADComplete=1) is sent to the MCU, and then S16 is executed.

[0045] 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 ', then execute S17.

[0046] S17, the first phase current detection result BCurrI' 1 'And the detection completion signal (BenchCurrADComplete=1) is sent to the MCU, and then S18 is executed.

[0047] 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 , then execute S19.

[0048] S19, the second phase current detection result BCurrI' 2 And a detection completion signal (BenchCurrADComplete=1) is sent to the MCU, and then S110 is executed.

[0049] S110, after receiving the start current sampling enable signal (BenchCurrADStart=1) fed back by the MCU for the fourth time, the second phase current (ie, V phase current) is continuously detected for 1s 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 execute S111.

[0050] S111, the second phase current detection result BCurrI' 2 'And the detection completion signal (BenchCurrADComplete=1) is sent to the MCU, and then S112 is executed.

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

[0052] S113, receive the self-calibration result (self-calibration success flag and Gain) fed back by MCU 1 、Offset 1 、Gain 2 、Offset 2 , or self-calibration failure flag), and determine whether the self-calibration is successful; if it is (that is, receiving CSAC=1 and Gain 1、Offset 1 、Gain 2 、Offset 2 If the Gain bit CSAC=1, it indicates that the self-calibration is successful, and the Gain bit CSAC=0 indicates that the self-calibration fails. 1 Indicates the gain calibration parameter of the first current sensor to be calibrated, Offset 1 Indicates the offset calibration parameters of the first current sensor to be calibrated, Gain 2 Indicates the gain calibration parameter of the second current sensor to be calibrated, Offset 2 Indicates the offset calibration parameters of the second current sensor to be calibrated.

[0053] S114, reporting a fault of the current sensor to be calibrated, and then ending. After reporting a 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.

[0054] 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.

[0055] S116, receive the self-calibration status NVMCSAC and NVMGain feedback from MCU 1 、NVMOffset 1 、NVMGain 2 、NVMOffset 2 Then execute S117.

[0056] S117, check whether the calibration data has been stored successfully, if yes, execute S119, otherwise execute S118. 1 Indicates the gain coefficient of the first current sensor to be calibrated, NVMOffset 1 Indicates the bias of the first current sensor to be calibrated, NVMGain 2 Indicates the gain coefficient of the second current sensor to be calibrated, NVMOffset 2 Indicates the bias of the second current sensor to be calibrated.

[0057] Specifically, the standard for the host computer 1 to successfully verify the calibration data is: the self-calibration state is the self-calibration success flag (ie, NVMCSAC=CSAC=1), and NVMGain 1 With Gain 1 The difference is less than 0.001, and NVMOffset 1 With Offset 1The difference is less than 0.001, and NVMGain 2 With Gain 2 The difference is less than 0.001, and NVMOffset 2 With Offset 2 The difference is less than 0.001.

[0058] S118, determining that the calibration data is not stored successfully, reporting a fault in the current sensor to be calibrated, and then ending. After reporting a fault in the current sensor to be calibrated, the motor controller can be intercepted to prevent the motor controller with a current sensor fault from leaving the factory.

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

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

[0061] S21, after receiving the automatic calibration enable signal (CurrSnsrAutoCaliEn=1) sent by the host computer 1, output 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 bridges 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, waiting for 2s (i.e. after the current stabilizes), and executing 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.

[0062] S22, feeding back the start current sampling enable signal (BenchCurrADStart=1) to the upper computer 1 for the first time, and at the same time 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.

[0063] S23, receiving the detection completion signal (BenchCurrADComplete=1) and the first phase current detection result BCurrI' sent by the host computer 1 1 After that, the current sampling is completed and the first phase current sampling result SCurrI' is obtained. 1 ; At the same time, record the first phase current detection result BCurrI' 1 And the first phase current sampling result SCurrI' 1, then execute S24. Among them, SCurrI' 1 The motor controller 2 continuously collects the current for 1 second through its first current sensor to be calibrated, and calculates the average value of the first phase current within 1 second.

[0064] 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 bridge 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 2s (i.e., after the current stabilizes), execute S25.

[0065] S25, feeding back the start current sampling enable signal (BenchCurrADStart=1) to the upper computer 1 for the second time, and at the same time 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.

[0066] S26, receiving the detection completion signal (BenchCurrADComplete=1) and the first phase current detection result BCurrI' sent by the host computer 1 1 'After that, the current sampling is completed and the first phase current sampling result SCurrI is obtained' 1 '; Simultaneously record the first phase current detection result BCurrI' 1 'And the first phase current sampling result SCurrI' 1 ', 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 first current sensor to be calibrated continuously collecting data for 1s and calculating it.

[0067] 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 bridge 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.

[0068] S28, feeding back the start current sampling enable signal (BenchCurrADStart=1) to the upper computer 1 for the third time, and at the same time 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.

[0069] S29, receiving the detection completion signal (BenchCurrADComplete=1) and the second phase current detection result BCurrI' sent by the host computer 1 2After that, the current sampling is completed and the second phase current sampling result SCurrI' is obtained. 2 ; At the same time, record the second phase current detection result BCurrI' 2 And the second phase current sampling result SCurrI' 2 , then execute S210. Wherein, SCurrI' 2 The motor controller 2 continuously collects the current for 1 second through its second current sensor to be calibrated, and calculates the average value of the second phase current within 1 second.

[0070] 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.

[0071] S211, the fourth time the current sampling enable signal (BenchCurrADStart=1) is fed back to the upper computer 1, and at the same time, the second phase current (ie, V phase current) is continuously collected for 1 s through its own second current sensor to be calibrated, and then S212 is executed.

[0072] S212, receiving the detection completion signal (BenchCurrADComplete=1) and the second phase current detection result BCurrI' sent by the host computer 1 2 'After that, the current sampling is completed and the second phase current sampling result SCurrI is obtained' 2 '; Simultaneously record the second phase current detection result BCurrI' 2 'And the second phase current sampling result SCurrI' 2 ', then execute S213. Among them, SCurrI' 2 'The motor controller 2 continuously collects the current for 1 second through its own second current sensor to be calibrated, and calculates the average value of the second phase current within 1 second.

[0073] S213, using the formula: Calculate Gain 1 、Offset 1 、Gain 2 、Offset 2 , then execute S214.

[0074] S214, determine whether to gain 1 、Gain 2 are all within the preset gain range, and the Offset 1 、Offset2 If both are within the preset bias range, then S215 is executed, otherwise S216 is executed. As an example, the preset gain range is: 0.97 ~ 1.03, and the preset bias range is: -10A ~ 10A.

[0075] S215, feedback the self-calibration success flag (CSAC=1) and Gain to the upper computer 1 1 、Offset 1 、Gain 2 、Offset 2 , and set the self-calibration success flag (CSAC=1) and Gain 1 、Offset 1 、Gain 2 、Offset 2 Stored in EEPROM, NVMGain 1 =Gain 1 、NVMOffset 1 =Offset 1 、NVMGain 2 =Gain 2 、NVMOffset 2 =Offset 2 And the self-calibration state is the self-calibration success flag (ie, NVMCSAC=1), and then S217 is executed.

[0076] S216, feeding back the self-calibration failure flag (CSAC=0) to the upper computer 1, and then ending.

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

[0078] S218, determine whether the self-calibration state NVMCSAC is a self-calibration success flag (ie, whether NVMCSAC=1), if yes, execute S220, otherwise execute S219. The default initial value of NVMCSAC is 2.

[0079] S219, use NVMGain 1 =1, NVMOffset 1 =0,NVMGain 2 =1, NVMOffset 2 =0, then execute S220.

[0080] S220, set the self-calibration state NVMCSAC and NVMGain 1 、NVMOffset 1 、NVMGain2 、NVMOffset 2 Send to host computer 1 and then end.

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

[0082] When the system load is working, the MCU of motor controller 2 reads the NVMGain in the EEPROM 1 、NVMOffset 1 、NVMGain 2 、NVMOffset 2 , and use the formula: I' 1 =NVMGain 1 *I 1 +NVMOffset 1 , I' 2 =NVMGain 2 *I 2 +NVMOffset 2 The first phase current (ie, U phase current) I' of the motor controller 2 is obtained by calibration 1 and the second phase current (i.e., the V phase current I' 2 ); where I 1 It represents the first phase current collected by the first current sensor (i.e. the first phase current before calibration), I 2 Indicates the second phase current collected by the second current sensor (i.e. the second phase current before calibration), NVMGain 1 、NVMOffset 1 、NVMGain 2 、NVMOffset 2 It is calibrated by the aforementioned current sensor self-calibration method.

[0083] In addition, if n=3, three high-precision current sensors 3 are respectively connected to the host computer 1, and the currents on the three phase lines (i.e., U phase, V phase, and W phase) detected correspondingly 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, and the gain coefficient NVMGain of the third current sensor to be calibrated will also be considered when verifying the calibration data. 3 and offset NVMOffset 3 The steps executed by the MCU in the motor controller 2 will increase the calculation of the gain calibration parameter Gain of the third current sensor to be calibrated. 3 and offset calibration parameters Offset 3The 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.

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

Claims

1. A method for self-calibration of a current sensor of a motor controller, which is accomplished by cooperation between 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 is stable, the motor controller (2) collects the kth phase current through its own kth current sensor to be calibrated, and obtains the kth 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, a signal with a duty cycle of Duty is output 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 is stable, the motor controller (2) collects the kth phase current through its own kth current sensor to be calibrated, and obtains the kth 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 the Offset k If the motor controller (2) is within the preset bias range, the MCU of the motor controller (2) will feedback the self-calibration success flag and Gain to the upper computer (1). k 、Offset k , and the self-calibration success flag and Gain k 、Offset k Stored in memory, NVMGain k =Gain k 、NVMOffset k =Offset k And the self-calibration state is a self-calibration success mark; After the motor controller (2) is restarted, when the upper computer (1) verifies that the calibration data has been successfully stored, the current sensor self-calibration is completed; Wherein, k is any integer from 1 to n, n is equal to the total number of phases in which the current sensors to be calibrated are set 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 the motor controller according to claim 1, characterized in that: 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 bias range is: -10A~10A.

3. The current sensor self-calibration method of the motor controller according to claim 1, characterized in that: 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), and 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 of the motor controller according to claim 1, characterized in that: After the motor controller (2) is restarted, 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 mark, NVMGain is enabled. k =1, NVMOffset k = 0, and 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 the motor controller according to claim 4, characterized in that: The host computer (1) verifies whether the calibration data has been successfully stored by: judging whether the self-calibration state is a self-calibration success flag, and NVMGain k With Gain k The difference is less than 0.001, and NVMOffset k With 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 of 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 of 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 of 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 data for 1 second through its kth current sensor to be calibrated, and calculates the average value of the kth phase current 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 current of the kth phase 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 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) to 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 the characteristics are: 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

  • BMS current detection unit automatic calibration device and calibration method

    CN103713271A

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

    CN110445430A

  • Three-phase current sensor error correction system and method based on fixed point sampling

    CN111239661A

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

    CN112763962A

  • Motor driving circuit, system and method

    CN116599422A