Method and device for automatic calibration of bus current of motor controller

By acquiring and adjusting the sampling coefficients through an automatic calibration method, the problem of poor bus current consistency in the motor controller was solved, improving calibration efficiency and user experience.

CN115133833BActive Publication Date: 2026-03-20JIANGSU AIMA VEHICLE SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-29
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

The poor consistency of the actual effective resistance value of the bus current sampling resistor in the existing motor controller leads to a deviation between the calculated bus current and the actual current, affecting the user experience.

Method used

By acquiring the q-axis current, d-axis current, and bus current, the sampling coefficients are calculated and adjusted in calibration mode to ensure the accuracy of the bus current. An automatic calibration method is used to improve consistency.

Benefits of technology

It improves the efficiency of bus current calibration for motor controllers and enhances user experience, while resolving the issue of poor bus current consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115133833B_ABST
    Figure CN115133833B_ABST
Patent Text Reader

Abstract

The application provides a bus current automatic calibration method and device of a motor controller, which is applied to a motor controller, the motor controller comprises a motor driving circuit, an operational amplifier circuit and a sampling resistor, and comprises the following steps: obtaining a q-axis current, a d-axis current and a bus current; when the motor driving circuit drives the motor to operate, obtaining a first voltage drop of the sampling resistor after being amplified by the operational amplifier circuit; calculating a first sampling coefficient according to the first voltage drop and the bus current; calculating a real-time bus current according to the first sampling coefficient and a real-time operational amplifier sampling voltage; through the automatic calibration of the motor controller, the problem of poor consistency of the bus current is solved, and the calibration efficiency and user experience of the motor controller are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of electronic control of two-wheel electric vehicles, in particular to a bus current automatic calibration method and device of a motor controller. BACKGROUND

[0002] At present, motor drivers generally use plug-in constantan wire in bus current sampling resistance. Due to the low precision of constantan wire itself, and in the welding process, the constantan wire terminal is not inserted to the desired position or the solder pad is stacked with tin, etc., which leads to poor consistency of the actual effective resistance value of the sampling resistance, and further leads to that the current sampling amplification coefficient K of each controller is not the same.

[0003] A constant amplification coefficient K is generally used in the market, and then the bus current is calculated according to the product of the amplification coefficient K and the operational amplifier sampling voltage. The bus current calculated in this way has deviation from the actual current. This deviation leads to that the maximum torque output by the controllers of the same model is not the same, thereby causing poor user experience. SUMMARY

[0004] Therefore, the purpose of the present application is to provide a bus current automatic calibration method and device of a motor controller, which solves the problem of poor consistency of bus current by automatic calibration of the motor controller, and improves the calibration efficiency and user experience of the motor controller.

[0005] In a first aspect, the present application provides a bus current automatic calibration method of a motor controller, applied to a motor controller, wherein the motor controller comprises a motor drive circuit, an operational amplifier circuit and a sampling resistance; and the method comprises:

[0006] obtaining q-axis current, d-axis current and bus current;

[0007] when the motor drive circuit drives the motor to operate, obtaining the first voltage drop of the sampling resistance amplified by the operational amplifier circuit;

[0008] calculating a first sampling coefficient according to the first voltage drop and the bus current;

[0009] calculating real-time bus current according to the first sampling coefficient and real-time operational amplifier sampling voltage.

[0010] Further, obtaining q-axis current, d-axis current and bus current comprises:

[0011] when the q-axis current reaches a first preset current value and the d-axis current reaches a second preset current value, entering a calibration mode, and obtaining the bus current through a current meter.

[0012] Further, obtaining q-axis current, d-axis current and bus current comprises:

[0013] receiving a calibration instruction sent by the user terminal, and entering a calibration mode according to the calibration instruction;

[0014] invoking the q-axis current, the d-axis current and the bus current by a vector control algorithm, and taking the bus current as a reference constant during calibration.

[0015] Further, the method further comprises:

[0016] When the calibration is completed, if the q-axis current reaches the first preset current value again and the d-axis current reaches the second preset current value again, the automatic calibration is not triggered again.

[0017] Further, the method further comprises:

[0018] When the calibration is completed, if the q-axis current reaches the first preset current value again and the d-axis current reaches the second preset current value again, a second voltage drop of the sampling resistor amplified by the operational amplifier circuit is obtained.

[0019] According to the second voltage drop and the bus current, a second sampling coefficient is calculated.

[0020] It is judged whether the second sampling coefficient meets a first preset condition or not.

[0021] If yes, the second sampling coefficient is not assigned to the first sampling coefficient.

[0022] If no, a third sampling coefficient, a fourth sampling coefficient and a fifth sampling coefficient are continuously obtained.

[0023] According to the third sampling coefficient, the fourth sampling coefficient and the fifth sampling coefficient, a sampling coefficient sum is calculated.

[0024] The sampling coefficient sum is averaged to obtain an average value.

[0025] It is judged whether the average value meets a second preset condition or not.

[0026] If yes, the first sampling coefficient remains unchanged.

[0027] If no, the average value is assigned to the first sampling coefficient.

[0028] Further, the first preset condition is that the second sampling coefficient is greater than or equal to 0.9*K1 and less than or equal to 1.1*K1.

[0029] The second preset condition is that the average value is greater than or equal to 0.9*K1 and less than or equal to 1.1*K1; wherein K1 is the first sampling coefficient.

[0030] Further, a first sampling coefficient is calculated according to the first voltage drop and the bus current, including:

[0031] The first sampling coefficient is calculated according to the following formula:

[0032] K1=U 1采 / I C

[0033] Wherein, K1 is the first sampling coefficient, U 1采 is the first voltage drop, I C is the bus current.

[0034] In a second aspect, an embodiment of the present application provides a bus current automatic calibration device of a motor controller, applied to a motor controller, the motor controller comprising a motor driving circuit, an operational amplifier circuit, a sampling resistor and an MCU; the device comprising:

[0035] The motor driving circuit is configured to drive the motor to operate.

[0036] The MCU is configured to acquire a q-axis current, a d-axis current and a bus current; when the motor driving circuit drives the motor to operate, acquire a first voltage drop of the sampling resistor after being amplified by the operational amplifier circuit; calculate a first sampling coefficient according to the first voltage drop and the bus current; and calculate a real-time bus current according to the first sampling coefficient and a real-time operational amplifier sampling voltage.

[0037] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory and a processor, the memory storing a computer program executable on the processor, and the processor implements the method described above when executing the computer program.

[0038] In a fourth aspect, an embodiment of the present application provides a computer readable medium having non-volatile program code executable by a processor, and the program code causes the processor to execute the method described above.

[0039] Embodiments of the present application provide a bus current automatic calibration method and device of a motor controller, applied to a motor controller, the motor controller comprising a motor driving circuit, an operational amplifier circuit and a sampling resistor, including: acquiring a q-axis current, a d-axis current and a bus current; when the motor driving circuit drives the motor to operate, acquiring a first voltage drop of the sampling resistor after being amplified by the operational amplifier circuit; calculating a first sampling coefficient according to the first voltage drop and the bus current; and calculating a real-time bus current according to the first sampling coefficient and a real-time operational amplifier sampling voltage; through the automatic calibration of the motor controller, the problem of poor consistency of the bus current is solved, and the calibration efficiency and user experience of the motor controller are improved.

[0040] Other features and advantages of the present application will be set forth in the descriptions that follow, and in part will be apparent from the description or can be learned by practice of the application. The purposes and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.

[0041] In order to make the above objectives, features and advantages of the present application more apparent, the following will describe a preferred embodiment in detail, and the accompanying drawings will be referred to, as follows. BRIEF DESCRIPTION OF DRAWINGS

[0042] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings needed to be used in the specific embodiments or the prior art description. Obviously, the drawings described below are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.

[0043] Figure 1 The bus current automatic calibration method flow chart of the motor controller provided by the embodiment one of the present application;

[0044] Figure 2 The bus current automatic calibration device schematic diagram of the motor controller provided by the embodiment two of the present application;

[0045] Figure 3 The bus current automatic calibration system schematic diagram of the motor controller provided by the embodiment three of the present application. DETAILED DESCRIPTION

[0046] In order to make the objectives, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the present application will be described in detail below with reference to the drawings. Obviously, the described embodiments are some embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the protection scope of the present application.

[0047] In order to facilitate the understanding of the present embodiment, the present embodiment will be described in detail as follows.

[0048] Embodiment one:

[0049] Figure 1 The bus current automatic calibration method flow chart of the motor controller provided by the embodiment one of the present application.

[0050] With reference to Figure 1 , applied to a motor controller, the motor controller includes a motor drive circuit, an operational amplifier circuit and a sampling resistor; the method includes the following steps:

[0051] Step S101, obtaining the q-axis current, the d-axis current and the bus current;

[0052] Step S102, when the motor driving circuit drives the motor to operate, obtaining the first voltage drop of the sampling resistor amplified by the operational amplifier circuit;

[0053] Step S103, calculating the first sampling coefficient according to the first voltage drop and the bus current;

[0054] Step S104, calculating the real-time bus current according to the first sampling coefficient and the real-time operational amplifier sampling voltage.

[0055] In the embodiment, when the q-axis current and the d-axis current are fixed, the bus current flowing through the bus is I C ; when the motor driving circuit drives the motor to operate, obtaining the first voltage drop of the sampling resistor amplified by the operational amplifier circuit; calculating the first sampling coefficient according to the first voltage drop and the bus current; calculating the real-time bus current according to the first sampling coefficient and the real-time operational amplifier sampling voltage; through the above method, the automatic calibration of the amplification coefficient of each motor controller is realized, thereby avoiding the problem of poor consistency of the actual effective resistance value of the sampling resistor due to the low precision of the constantan wire itself, and the constantan wire pad terminal not being inserted to the expected position or the pad being tinned in the welding process.

[0056] Further, step S103 comprises:

[0057] The first sampling coefficient is calculated according to formula (1):

[0058] K1 = U 1采 / I C (1)

[0059] Wherein, K1 is the first sampling coefficient, U 1采 is the first voltage drop, and I C is the bus current.

[0060] Further, step S101 comprises:

[0061] Step S201, when the q-axis current reaches the first preset current value and the d-axis current reaches the second preset current value, entering the calibration mode, and obtaining the bus current through the current meter.

[0062] Specifically, during the working process of the motor controller, when the q-axis current I Q first reaches the first preset current value, and the d-axis current I D first reaches the second preset current value (the q-axis current and the d-axis current are two variables used to control the motor driving waveform in the FOC algorithm of the motor controller), that is, I Q =a, I D= b (a, b are constants), the motor controller automatically enters the calibration mode. Since the battery voltage is fixed, the motor drive circuit is fixed, and the motor model is fixed, when I Q = a, I D = b, the current flowing through the bus is a fixed value I C , the bus current I C is directly measured by the current meter and has been written in the MCU register as a reference constant during calibration.

[0063] The motor drive circuit drives the motor to run, and the MCU inside the motor controller reads the first voltage drop U 1采 of the sampling resistor amplified by the operational amplifier circuit, then calculates K1 through formula (1), and stores K1 in the register as the first sampling coefficient of the bus current unique to the motor controller; In the subsequent algorithm, the real-time bus current is calculated by bus current = K1 * op-amp sampling voltage. After calibration is completed, the motor controller stops working and automatically exits the calibration mode.

[0064] Further, step S101 includes the following steps:

[0065] Step S301, receiving the calibration instruction sent by the user terminal, and entering the calibration mode according to the calibration instruction;

[0066] Step S302, calling the q-axis current, d-axis current and bus current through the vector control algorithm, and taking the bus current as the reference constant during calibration.

[0067] Specifically, the user terminal sends a calibration instruction according to the product protocol, triggering the motor controller to enter the calibration mode according to the calibration instruction; the motor controller calls the vector control (Field-oriented Control, FOC) algorithm, and calls the preset fixed I Q , I D (I Q = a, I D = b, where a, b are constants, since the battery voltage is fixed, the motor drive circuit is fixed, and the motor model is fixed, the same I Q , I D is given, the bus current flowing through the bus is a fixed value I C , I C is directly measured by the current meter and has been written in the MCU register as a reference constant during calibration);

[0068] The motor drive circuit drives the motor to run, and the bus current is stabilized at I C , the MCU inside the motor controller reads the first voltage drop U 1采K1=Ibus / Iop, then K1 is calculated by formula (1), and K1 is stored in the register and used as the first sampling coefficient of the bus current unique to the motor controller; in the subsequent algorithm, the real-time bus current is calculated by bus current=K1*op-amp sampling voltage. After calibration is completed, the motor controller stops working and automatically exits the calibration mode.

[0069] Further, the method further comprises the following steps:

[0070] Step S401, when the calibration is completed, if the q-axis current reaches the first preset current value again and the d-axis current reaches the second preset current value again, automatic calibration is not triggered again.

[0071] Specifically, during the working process of the motor controller, when the q-axis current I Q firstly reaches the first preset current value, and the d-axis current I D firstly reaches the second preset current value, that is, I Q =a, I D =b (a and b are constants), the motor controller automatically enters the calibration mode; the current flowing through the bus is a fixed value I C , and the bus current I C is directly measured by the current meter.

[0072] The motor driving circuit drives the motor to run, and the MCU in the motor controller reads the first voltage drop U 1采 of the sampling resistor amplified by the op-amp circuit, then K1 is calculated by formula (1), and K1 is stored in the register and used as the first sampling coefficient of the bus current unique to the motor controller;

[0073] After automatic calibration is completed, when the q-axis current reaches the first preset current value again and the d-axis current reaches the second preset current value again, that is, I Q =a, I D =b, automatic calibration is not triggered again.

[0074] In the subsequent algorithm, the real-time bus current is calculated by bus current=K1*op-amp sampling voltage.

[0075] Further, the method further comprises the following steps:

[0076] Step S501, when the calibration is completed, if the q-axis current reaches the first preset current value again and the d-axis current reaches the second preset current value again, the second voltage drop of the sampling resistor amplified by the op-amp circuit is obtained.

[0077] Step S502, a second sampling coefficient is calculated according to the second voltage drop and the bus current.

[0078] Step S503, judging whether the second sampling coefficient meets the first preset condition; if yes, executing step S504; if not, executing step S505;

[0079] Step S504, not assigning the second sampling coefficient to the first sampling coefficient;

[0080] Step S505, continuously acquiring the third sampling coefficient, the fourth sampling coefficient and the fifth sampling coefficient;

[0081] Step S506, calculating the sampling coefficient sum according to the third sampling coefficient, the fourth sampling coefficient and the fifth sampling coefficient;

[0082] Step S507, averaging the sampling coefficient sum to obtain the average value;

[0083] Step S508, judging whether the average value meets the second preset condition; if yes, executing step S509; if not, executing step S510;

[0084] Step S509, keeping the first sampling coefficient unchanged;

[0085] Step S510, assigning the average value to the first sampling coefficient.

[0086] Further, the first preset condition is that the second sampling coefficient is greater than or equal to 0.9*K1 and less than or equal to 1.1*K1;

[0087] The second preset condition is that the average value is greater than or equal to 0.9*K1 and less than or equal to 1.1*K1; wherein, K1 is the first sampling coefficient.

[0088] Specifically, during the working process of the motor controller, when the q-axis current I Q first reaches the first preset current value, the d-axis current I D first reaches the second preset current value, that is, I Q =a, I D =b (a and b are constants), the motor controller automatically enters the calibration mode; the current flowing through the bus is a fixed value I C , and the bus current I C is directly measured by the current meter.

[0089] The MCU inside the motor controller reads the first voltage drop U 1采 of the sampling resistor amplified by the operational amplifier circuit, then calculates K1 through formula (1), and stores K1 in the register as the first sampling coefficient of the bus current unique to the motor controller;

[0090] In the subsequent algorithm, the real-time bus current is calculated through bus current=K1*op-amp sampling voltage.

[0091] After the automatic calibration is completed, when the q-axis current reaches the first preset current value again and the d-axis current reaches the second preset current value again, that is, I Q =a, I D =b, the MCU inside the motor controller reads the second voltage drop U of the sampling resistor amplified by the operational amplifier circuit 2采 , and then calculates K2=U 2采 / I C , calculates K2, if K2 meets the first preset condition, K2 is not assigned to K1, otherwise, repeat the above steps, after the calibration condition is met, calibrate continuously three times, and the calibration coefficients are the third sampling coefficient K3, the fourth sampling coefficient K4 and the fifth sampling coefficient K5, calculate the sampling coefficient sum according to the third sampling coefficient K3, the fourth sampling coefficient K4 and the fifth sampling coefficient K5, and average the sampling coefficient sum to obtain the average value K 均 ; judge whether K 均 meets the second preset condition, if it meets, K1 remains unchanged, if it does not meet, K 均 is assigned to K1.

[0092] During the working process of the motor controller, the steps after the automatic calibration are repeatedly completed, so as to avoid the resistance deviation of the sampling resistor caused by the temperature, humidity or service life of the use environment, so as to cause the problem of inaccurate bus current sampling.

[0093] Embodiment two

[0094] Figure 2 The bus current automatic calibration device of the motor controller provided for the embodiment two of the application is shown in the figure.

[0095] Referring to Figure 2 , the device is applied to a motor controller, and the motor controller includes a motor driving circuit, an operational amplifier circuit, a sampling resistor and an MCU; the device includes:

[0096] The motor driving circuit is used for driving the motor to operate.

[0097] The MCU is used for acquiring the q-axis current, the d-axis current and the bus current; when the motor driving circuit drives the motor to operate, the first voltage drop of the sampling resistor amplified by the operational amplifier circuit is acquired; the first sampling coefficient is calculated according to the first voltage drop and the bus current; and the real-time bus current is calculated according to the first sampling coefficient and the real-time operational sampling voltage.

[0098] In Figure 2 , the storage battery, the motor controller and the motor are connected, the negative electrode of the storage battery is disconnected first; the motor controller is programmed (I Q =a, I D= b value is fixed, a and b are constants); connect the negative pole of the battery, and after the motor is running stably, measure the bus current I flowing through the bus by using the current probe of the oscilloscope C , and I C is taken as a calibration reference constant and used as a parameter called by a vector control algorithm in the motor controller (since the battery voltage is fixed, the motor drive circuit is fixed, and the motor model is fixed, the same I Q and I D are given, the bus current flowing through the bus is a fixed value, so the same project only needs to be calibrated once, and I C is taken as the calibration constant of the project).

[0099] In the motor control process, when the three-phase drive signals are completely the same (in this application, I Q = a, I D = b value is fixed, a and b are constants are taken as examples for description), and the motor of the same model, the battery of the same model, and the controller of the same model, the current flowing through the bus should be a fixed value I C , I C is obtained by using the ammeter, and is taken as a calibration constant; subsequently, the voltage drop of the sampling resistor after being amplified by the operational amplifier is read by the MCU of the motor controller, so that K1 is calculated by formula (1), and is taken as the bus current amplification coefficient unique to the controller.

[0100] Example Three

[0101] Figure 3 A bus current automatic calibration system of a motor controller provided by Example Three of the application is shown in the figure.

[0102] Referring to Figure 3 , the system comprises a motor controller, a user terminal, a 485 communication device, a battery, and a motor.

[0103] The user terminal is an upper computer equipped with a 485 communication protocol supporting the motor controller, can send a pre-set calibration command according to the protocol, so that the motor controller enters an automatic calibration mode; the motor can be a permanent magnet synchronous motor; and the battery is a battery matched with the motor controller and the motor.

[0104] The embodiment of the application provides a bus current automatic calibration method and device of a motor controller, which is applied to the motor controller, the motor controller comprises a motor driving circuit, an operational amplifier circuit and a sampling resistor, and the method comprises the following steps: obtaining a q-axis current, a d-axis current and a bus current; when the motor driving circuit drives the motor to operate, obtaining a first voltage drop of the sampling resistor amplified by the operational amplifier circuit; calculating a first sampling coefficient according to the first voltage drop and the bus current; calculating a real-time bus current according to the first sampling coefficient and a real-time operational amplifier sampling voltage; through the automatic calibration of the motor controller, the problem of poor consistency of the bus current is solved, and the calibration efficiency of the motor controller and user experience are improved.

[0105] The embodiment of the application further provides an electronic device, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, and the processor implements the steps of the bus current automatic calibration method of the motor controller provided by the above embodiment when executing the computer program.

[0106] The embodiment of the application further provides a computer readable medium with non-volatile program codes executable by a processor, and the computer readable medium stores a computer program, and the computer program executes the steps of the bus current automatic calibration method of the motor controller provided by the above embodiment when running on the processor.

[0107] The computer program product provided by the embodiment of the application comprises a computer readable storage medium storing program codes, and the program codes comprise instructions for executing the method described in the foregoing method embodiment, and specific implementation can be referred to the method embodiment, and will not be repeated here.

[0108] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the foregoing method embodiment, and will not be repeated here.

[0109] In addition, in the description of the embodiment of the application, unless otherwise explicitly specified and limited, the terms "mounting", "connection" and "connection" should be understood in a broad sense, for example, can be fixed connection, can also be detachable connection, or integral connection; can be mechanical connection, can also be electrical connection; can be directly connected, can also be indirectly connected through an intermediate medium, can be the communication inside two elements. For those skilled in the art, the specific meaning of the above terms in the application can be understood according to the specific circumstances.

[0110] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the present application that essentially contribute to the prior art or the parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0111] In the description of the present application, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer" and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application. In addition, the terms "first", "second", "third" are only for the purpose of description, and cannot be understood as indicating or implying relative importance.

[0112] Finally, it should be noted that: the above-described embodiments are only specific embodiments of the present application, which are used to illustrate the technical solutions of the present application, and are not limited thereto, the protection scope of the present application is not limited thereto, although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art within the technical range disclosed by the present application can modify or easily think of changes to the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to part of the technical features; and these modifications, changes or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for automatic calibration of bus current in a motor controller, characterized in that, The method is applied to a motor controller, which includes a motor drive circuit, an operational amplifier circuit, and a sampling resistor; the method includes: Obtain the q-axis current, d-axis current, and bus current; When the motor drive circuit drives the motor to run, the first voltage drop of the sampling resistor after being amplified by the operational amplifier circuit is obtained. Calculate the first sampling coefficient based on the first voltage drop and the bus current; The real-time bus current is calculated based on the first sampling coefficient and the real-time operational amplifier sampling voltage. The method further includes: Once calibration is complete, if the q-axis current reaches the first preset current value again and the d-axis current reaches the second preset current value again, then the second voltage drop of the sampling resistor after amplification by the operational amplifier circuit is obtained. Calculate the second sampling coefficient based on the second voltage drop and the bus current; Determine whether the second sampling coefficient satisfies the first preset condition; If the condition is met, then the second sampling coefficient will not be assigned to the first sampling coefficient; If the conditions are not met, continue to obtain the third, fourth, and fifth sampling coefficients; Calculate the sampling coefficient sum based on the third sampling coefficient, the fourth sampling coefficient, and the fifth sampling coefficient; The average value is obtained by averaging the sampling coefficients. Determine whether the average value meets the second preset condition; If this condition is met, the first sampling coefficient remains unchanged; If the condition is not met, the average value is assigned to the first sampling coefficient.

2. The automatic calibration method for bus current of the motor controller according to claim 1, characterized in that, Obtain the q-axis current, d-axis current, and bus current, including: When the q-axis current reaches the first preset current value and the d-axis current reaches the second preset current value, the calibration mode is entered, and the bus current is obtained through the ammeter.

3. The automatic bus current calibration method for a motor controller according to claim 1, characterized in that, Obtain the q-axis current, d-axis current, and bus current, including: Receive calibration instructions sent by the user terminal and enter calibration mode according to the calibration instructions; The q-axis current, d-axis current, and bus current are invoked through a vector control algorithm, and the bus current is used as a reference constant during calibration.

4. The automatic bus current calibration method for a motor controller according to claim 1, characterized in that, The method further includes: Once calibration is complete, if the q-axis current reaches the first preset current value again and the d-axis current reaches the second preset current value again, automatic calibration will not be triggered again.

5. The automatic calibration method for bus current of a motor controller according to claim 1, characterized in that, The first preset condition is that the second sampling coefficient is greater than or equal to 0.9*K1 and less than or equal to 1.1*K1; The second preset condition is that the average value is greater than or equal to 0.9*K1 and less than or equal to 1.1*K1; where K1 is the first sampling coefficient.

6. The automatic bus current calibration method for a motor controller according to claim 1, characterized in that, Based on the first voltage drop and the bus current, the first sampling coefficient is calculated, including: The first sampling coefficient is calculated according to the following formula: K1=U 1采 / AND C Where K1 is the first sampling coefficient, U 1采 For the first voltage drop, I C The bus current is denoted as .

7. An automatic bus current calibration device for a motor controller, characterized in that, The device is applied to a motor controller, which includes a motor drive circuit, an operational amplifier circuit, a sampling resistor, and an MCU; the device includes: The motor drive circuit is used to drive the motor to operate; The MCU is used to acquire the q-axis current, d-axis current, and bus current; when the motor drive circuit drives the motor to run, it acquires the first voltage drop of the sampling resistor after amplification by the operational amplifier circuit; it calculates the first sampling coefficient based on the first voltage drop and the bus current; and it calculates the real-time bus current based on the first sampling coefficient and the real-time operational amplifier sampling voltage. The device further includes: Once calibration is complete, if the q-axis current reaches the first preset current value again and the d-axis current reaches the second preset current value again, then the second voltage drop of the sampling resistor after amplification by the operational amplifier circuit is obtained. Calculate the second sampling coefficient based on the second voltage drop and the bus current; Determine whether the second sampling coefficient satisfies the first preset condition; If the condition is met, then the second sampling coefficient will not be assigned to the first sampling coefficient; If the conditions are not met, continue to obtain the third, fourth, and fifth sampling coefficients; Calculate the sampling coefficient sum based on the third sampling coefficient, the fourth sampling coefficient, and the fifth sampling coefficient; The average value is obtained by averaging the sampling coefficients. Determine whether the average value meets the second preset condition; If this condition is met, the first sampling coefficient remains unchanged; If the condition is not met, the average value is assigned to the first sampling coefficient.

8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the method described in any one of claims 1 to 6.

9. A computer-readable medium having processor-executable non-volatile program code, characterized in that, The program code causes the processor to execute the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • PMSM phase current reconstruction method based on sine curve fitting observer

    CN114142774A

  • Electrical quantity meter, current-sampling calibration circuit and method of calibration

    WO2018170775A1