Current sampling circuit and sampling method of motor controller

CN122983449APending Publication Date: 2026-10-27YIHONG TECH (JIANGSU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611271268.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-20
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0005]本申请提供一种电机控制器的电流采样电路及采样方法,旨在解决现有技术中在电池负极串联单一采样电阻导致的发热量大、成本高以及小电流采样精度低的问题

Benefits of technology

1、通过将传统的单一总采样电阻拆分为并联的双支路结构,使电机驱动的大电流不流经额外增加的采样电阻,大幅降低了采样电路的发热量和功率损耗,同时降低了采样电阻的功率选型要求和产品成本,采样电阻的成本可降低至传统方案的约三分之一,PCB占用面积可缩小至传统方案的约二分之一;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122983449A_ABST
    Figure CN122983449A_ABST
Patent Text Reader

Abstract

The application relates to a current sampling circuit and a sampling method of a motor controller. The current sampling circuit comprises a first sampling resistor for detecting a first current flowing through a motor drive loop; a second sampling resistor for detecting a second current flowing through a weak current circuit of the controller and an external power consumption device loop; a first signal conditioning circuit for collecting a voltage difference between the two ends of the first sampling resistor; and a second signal conditioning circuit for collecting a voltage difference between the two ends of the second sampling resistor. The current sampling method calculates the first current flowing through the motor drive loop through the voltage difference between the two ends of the first sampling resistor; calculates the second current flowing through the weak current circuit of the controller through the voltage difference between the two ends of the second sampling resistor; and superimposes the first current and the second current to obtain a real-time total charging and discharging current of a battery. The problems of large heat generation, high cost and low small current sampling precision caused by the single sampling resistor connected in series with the negative electrode of the battery in the prior art are effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of current sampling, and in particular to a current sampling circuit and sampling method for a motor controller. Background Technology

[0002] In electrically powered vehicles, the battery is the sole energy source, and accurate estimation of its remaining capacity is crucial for safe vehicle operation. To calculate the remaining battery energy, it is typically necessary to sample and integrate the battery's total charge and discharge current in real time.

[0003] The motor controller is the largest energy-consuming unit in a vehicle, consuming far more current than other electrical devices, typically more than ten times the current. In existing technology, to obtain the total charge and discharge current of the battery, a sampling resistor is usually connected in series at the negative terminal of the battery. All the charge and discharge current flows through this sampling resistor, and the total charge and discharge current is calculated by detecting the voltage difference across the resistor.

[0004] However, due to the large motor drive current, all the current flowing through the sampling resistor will cause the following problems: First, the sampling resistor will generate significant heat, resulting in additional power consumption and reduced system efficiency; Second, in order to withstand the large current, the sampling resistor needs to be selected with high power and large package specifications, which increases the product design cost and space occupation; Third, since the sampling resistor must meet the measurement requirements of large current, its resistance value is usually small, resulting in a very small voltage difference across the sampling resistor when measuring small charging current or current consumption of weak electrical equipment, which leads to insufficient resolution of ADC sampling and low sampling accuracy. Summary of the Invention

[0005] This application provides a current sampling circuit and sampling method for a motor controller, aiming to solve the problems of high heat generation, high cost, and low sampling accuracy of small current caused by connecting a single sampling resistor in series with the negative terminal of the battery in the prior art.

[0006] Firstly, the current sampling circuit for a motor controller provided in this application adopts the following technical solution: A current sampling circuit for a motor controller, used to collect the total charging and discharging current of a battery, includes: a first sampling resistor connected in series between the negative bus of the inverter bridge of the motor controller and the negative terminal of the battery, used to detect a first current flowing through the motor drive circuit; a second sampling resistor connected in series between the common negative terminal of the low-voltage circuit of the motor controller and the negative terminal of the battery, used to detect a second current flowing through the low-voltage circuit of the controller and the circuit of the external electrical equipment; wherein the common negative terminal of the low-voltage circuit is used to connect to the negative terminal of the controller power supply circuit of the motor controller and the negative terminal of the external electrical equipment and / or charger; a first signal conditioning circuit connected across the first sampling resistor, used to amplify the voltage difference across the first sampling resistor and output it to the first ADC port of the main control chip; a second signal conditioning circuit connected across the second sampling resistor, used to amplify the voltage difference across the second sampling resistor and output it to the second ADC port of the main control chip; the main control chip is configured to: calculate the first current and the second current respectively based on the voltage values ​​obtained from the first ADC port and the second ADC port, and superimpose the two to obtain the total charging and discharging current of the battery.

[0007] By adopting the above technical solution, the traditional single total sampling resistor is split into a parallel dual-branch sampling structure. The first sampling resistor only carries the motor drive current, and the second sampling resistor only carries the current of the controller's low-voltage circuit and external devices. Since the motor drive current does not flow through the second sampling resistor, the heat generation and power requirements of the second sampling resistor are significantly reduced, thereby reducing the additional heat generation of the overall circuit and the product cost. At the same time, the main control chip can obtain the total charging and discharging current of the battery by superimposing the two currents, realizing the battery capacity calculation function under low-cost conditions.

[0008] Preferably, both the first signal conditioning circuit and the second signal conditioning circuit employ differential amplifier circuits.

[0009] By adopting the above technical solution, the differential amplifier circuit can effectively extract the weak differential voltage signal across the sampling resistor, while suppressing common-mode interference and improving the accuracy and anti-interference capability of current sampling.

[0010] Preferably, the reference bias voltage of the second signal conditioning circuit is half of the power supply voltage, used for bidirectional symmetrical sampling of the second current; the reference bias voltage of the first signal conditioning circuit is one-third of the power supply voltage, used for asymmetrical sampling of the first current, so that the measurable current range in the discharge direction is greater than the measurable current range in the charging direction.

[0011] By adopting the above technical solution, different reference bias voltages are set for the two signal conditioning circuits, achieving a differentiated measurement strategy. The branch containing the second sampling resistor needs to simultaneously detect both discharge and charging currents (the current flows in reverse through the resistor during charging). Therefore, half the power supply voltage is used as the reference, making the measurable ranges symmetrical in both directions and accommodating the detection needs of both charging and discharging. The branch containing the first sampling resistor mainly carries the motor drive current, and the discharge current is much larger than the charging current during energy feedback. Therefore, one-third of the power supply voltage is used as the reference, allocating more of the ADC range to the discharge direction and fully utilizing the ADC's effective resolution. Through this asymmetrical design, under the same ADC capability, the sampling accuracy of the charging current in the second sampling branch can be improved by 2.5 times compared to the traditional solution.

[0012] Preferably, the amplification factor of the second signal conditioning circuit is greater than that of the first signal conditioning circuit.

[0013] By adopting the above technical solution, since the current in the branch where the second sampling resistor is located is much smaller than the current in the branch where the first sampling resistor is located, a larger amplification factor can be used to fully amplify the small voltage difference across the second sampling resistor, so that it matches the input voltage range of the ADC, thereby improving the sampling resolution and measurement accuracy of small currents.

[0014] Preferably, the first signal conditioning circuit includes a first operational amplifier, the non-inverting input and the inverting input of the first operational amplifier are respectively connected to the two ends of a first sampling resistor, the non-inverting input of the first operational amplifier is also connected to the power supply voltage terminal through a first bias resistor, and is connected to the common negative terminal of the weak current through a first grounding resistor; the output of the first operational amplifier is connected to the first ADC port through a first current limiting resistor; the second signal conditioning circuit includes a second operational amplifier, the non-inverting input and the inverting input of the second operational amplifier are respectively connected to the two ends of a second sampling resistor, the non-inverting input of the second operational amplifier is also connected to the power supply voltage terminal through a second bias resistor, and is connected to the common negative terminal of the weak current through a second grounding resistor; the output of the second operational amplifier is connected to the second ADC port through a second current limiting resistor.

[0015] By adopting the above technical solution, the non-inverting input terminal of the operational amplifier forms a voltage divider network through the bias resistor and the grounding resistor, providing a reference bias voltage for the differential amplifier circuit, so that the output voltage is at the set reference potential when there is no current, thereby realizing bidirectional current detection; the current limiting resistor at the output terminal protects the ADC port and prevents transient overvoltage from damaging the main control chip.

[0016] Preferably, the first signal conditioning circuit further includes a first filter capacitor connected between the first ADC port and the common negative terminal of the low voltage circuit; and / or, the second signal conditioning circuit further includes a second filter capacitor connected between the second ADC port and the common negative terminal of the low voltage circuit.

[0017] By adopting the above technical solution, the filter capacitor and the current limiting resistor form an RC low-pass filter network, which can filter out high-frequency noise and switching ripple in the operational amplifier output signal, enabling the ADC to acquire a smooth and stable voltage signal and improve the stability of the sampling results.

[0018] Preferably, the first sampling resistor and the second sampling resistor are connected in parallel with respect to the battery, the total discharge current of the battery is equal to the sum of the first current and the second current, and the total charging current of the battery is equal to the second current flowing in reverse through the second sampling resistor.

[0019] By adopting the above technical solution, based on Kirchhoff's current law, the sum of the currents in the two parallel sampling branches is the total discharge current of the battery. During charging, the charging current returns to the negative terminal of the battery only through the branch containing the second sampling resistor; therefore, the reverse value of the second current is the total charging current of the battery. This current relationship allows the main control chip to obtain the total charging and discharging current of the battery simply by performing an addition operation.

[0020] On the other hand, this application provides a current sampling method for a motor controller, implemented based on the above-mentioned current sampling circuit, including the following steps: S1: The voltage difference across the first sampling resistor is obtained through the first signal conditioning circuit, amplified, and then acquired by the first ADC port of the main control chip. The first current flowing through the motor drive circuit is calculated based on the voltage difference and the resistance value of the first sampling resistor. S2: The voltage difference across the second sampling resistor is obtained through the second signal conditioning circuit, amplified, and then acquired by the second ADC port of the main control chip. The second current flowing through the controller's weak current circuit and the external electrical equipment circuit is calculated based on the voltage difference and the resistance value of the second sampling resistor. S3: The current direction of each sampling branch is determined by comparing the acquired voltage of the first ADC port and the second ADC port with their respective reference bias voltages. S4: The first current and the second current are vector-superimposed to obtain the real-time total charging and discharging current of the battery.

[0021] By adopting the above technical solution, the total charging and discharging current of the battery is calculated by sampling the current of the two branches separately and performing vector superposition, avoiding the heat generation and cost problems caused by connecting a high-power sampling resistor in series with the negative terminal of the battery; by comparing with the reference bias voltage to determine the current direction, the automatic identification of charging and discharging states is realized.

[0022] Preferably, in step S3: when the acquisition voltage of the second ADC port is greater than the reference bias voltage of the second signal conditioning circuit, the direction of the second current is determined to be the discharge direction; when the acquisition voltage of the second ADC port is less than the reference bias voltage of the second signal conditioning circuit, the direction of the second current is determined to be the charging direction; when the acquisition voltage of the second ADC port is equal to the reference bias voltage of the second signal conditioning circuit, the second current is determined to be zero.

[0023] By adopting the above technical solution, with the reference bias voltage as the zero current reference point, the ADC collects a voltage higher than the reference point to indicate discharging and lower than the reference point to indicate charging, thus achieving accurate determination of the charging and discharging current direction. This enables the main control chip to distinguish between the charging and discharging states of the battery, providing accurate current direction information for subsequent calculation of the remaining battery energy.

[0024] Preferably, the method further includes the following steps: S5: performing time integration on the real-time total charge and discharge current to obtain the cumulative charge and discharge capacity of the battery; S6: calculating the remaining energy of the battery based on the cumulative charge and discharge capacity.

[0025] By adopting the above technical solution, the total charging and discharging current is integrated over time based on the ampere-hour integration method. The remaining battery energy can be estimated using the motor controller itself without the need for an additional battery management system, which reduces system costs and is particularly suitable for low-cost commuter vehicle applications.

[0026] In summary, the present invention has at least one of the following beneficial technical effects: 1. By splitting the traditional single total sampling resistor into a parallel dual-branch structure, the large current driven by the motor does not flow through the additional sampling resistor, which greatly reduces the heat generation and power loss of the sampling circuit. At the same time, it reduces the power selection requirements and product cost of the sampling resistor. The cost of the sampling resistor can be reduced to about one-third of the traditional solution, and the PCB area occupied can be reduced to about one-half of the traditional solution. 2. By setting different reference bias voltages and amplification factors for the two signal conditioning circuits, an asymmetric differentiated sampling strategy is achieved. Under the same ADC sampling capability, the sampling accuracy of the charging current can be improved by 2.5 times compared with the traditional solution. 3. Enables the motor controller to monitor the total charge and discharge current of the battery without adding an additional battery management system, thereby realizing the calculation function of the remaining battery energy. It is particularly suitable for low-cost, BMS-free electric-driven mobility vehicles. Attached Figure Description

[0027] Figure 1 This is a circuit diagram of the motor controller in an embodiment of this application; Figure 2This is a block diagram illustrating the principle of the main control chip acquiring the current signal in an embodiment of this application. Figure 3 This is a circuit schematic diagram of the first signal conditioning circuit in the embodiments of this application; Figure 4 This is a circuit diagram of the second signal conditioning circuit in the embodiments of this application.

[0028] The following labels are used in the attached diagram: 1. Battery; 11. Battery positive terminal; 12. Battery negative terminal; 13. Common negative terminal for low voltage; 14. Inverter bridge negative bus terminal; 2. Drive bridge arm; 3. Controller power supply circuit; 4. Main control chip; 5. Charger; 6. First sampling resistor; 7. Second sampling resistor; 8. First signal conditioning circuit; 81. First operational amplifier; 9. Second signal conditioning circuit; 91. Second operational amplifier; 10. Walking motor. Detailed Implementation

[0029] The following is in conjunction with the appendix Figures 1-4 The present invention will be described in further detail below.

[0030] This application discloses a current sampling circuit and sampling method for a motor controller, which is applicable to sampling the total charging and discharging current of battery 1 in an electrically driven personal transportation vehicle, thereby realizing the calculation of the remaining energy of battery 1.

[0031] On the one hand, refer to Figure 1 and Figure 2 The motor controller internally includes a drive bridge arm 2, a controller power supply circuit 3, and a main control chip 4. The positive terminal 11 of the battery is connected to the positive input terminal of the motor controller, and the negative terminal 12 of the battery is connected to the negative bus terminal 14 of the inverter bridge of the motor controller through a first sampling resistor 6, and at the same time connected to the common negative terminal 13 of the low voltage circuit of the motor controller through a second sampling resistor 7.

[0032] The inverter bridge negative bus terminal 14 is the lower end of the drive bridge arm 2 inside the motor controller, and is connected to the walking motor 10 through the drive bridge arm 2. The low-voltage common negative terminal 13 is the negative terminal of the controller power supply circuit 3 inside the motor controller, and the negative terminals of other external electrical equipment and chargers 5 are also connected to this low-voltage common negative terminal 13.

[0033] The first sampling resistor 6 and the second sampling resistor 7 are led out from the negative terminal 12 of the battery and connected to the negative bus terminal 14 of the inverter bridge and the common negative terminal 13 of the weak current, respectively. The two are connected in parallel with respect to the battery 1.

[0034] Under discharge conditions, the total discharge current of battery 1 flows out from the positive terminal 11 and splits into two paths: one path flows through the drive bridge arm 2 and the travel motor 10, finally returning to the negative terminal 12 of the battery via the negative bus terminal 14 of the inverter bridge and the first sampling resistor 6; this path's current is the first current I2. The other path flows through the controller power supply circuit 3 and other electrical equipment, finally returning to the negative terminal 12 of the battery via the common negative terminal 13 and the second sampling resistor 7; this path's current is the second current I1. The total discharge current Itotal of battery 1 is equal to the sum of the first current I2 and the second current I1.

[0035] During charging, the positive terminal of charger 5 is connected to the positive terminal 11 of the battery, and the negative terminal of charger 5 is connected to the common negative terminal 13. Charging current flows from the positive terminal of charger 5 into the positive terminal 11 of the battery, passes through the battery 1 and exits from the negative terminal 12, then through the second sampling resistor 7 to the common negative terminal 13, and finally returns to the negative terminal of charger 5. At this time, the direction of the second current I1 is opposite to that during discharge, i.e., it flows in the reverse direction through the second sampling resistor 7. Since the motor is not working during charging, the first current I2 is zero or close to zero, and the total charging current of battery 1 is essentially equal to the second current I1 flowing in the reverse direction through the second sampling resistor 7.

[0036] Since the second sampling resistor 7 only needs to withstand the current from the controller's low-voltage circuit, other electrical equipment, and charging current, the amplitude of these currents is much smaller than the motor drive current. Therefore, a sampling resistor with a relatively large resistance and low power can be selected. This achieves a larger sampling voltage difference to improve sampling accuracy while reducing cost and PCB footprint. The resistance of the second sampling resistor 7 is greater than that of the first sampling resistor 6, while the rated power of the second sampling resistor 7 is much smaller than that of the first sampling resistor 6. The specific resistance and power of the first sampling resistor 6 and the second sampling resistor 7 can be flexibly selected according to actual needs. For example, the resistance of the second sampling resistor 7 is 5mΩ and the rated power is 0.5W, while the resistance of the first sampling resistor 6 is 2mΩ and the rated power is 2W. This embodiment does not impose strict limitations.

[0037] Reference Figure 3 The first signal conditioning circuit 8 is a differential amplifier circuit corresponding to the first sampling resistor 6. The first signal conditioning circuit 8 includes a first operational amplifier 81, a first input resistor R10, a second input resistor R11, a first feedback resistor R14, a first bias resistor R12, a first grounding resistor R13, a first current limiting resistor R15, and a first filter capacitor C2.

[0038] The non-inverting input of the first operational amplifier 81 is connected to the end of the first sampling resistor 6 near the negative bus 14 of the inverter bridge via a first input resistor R10. The non-inverting input of the first operational amplifier 81 is also connected to the 5V power supply voltage terminal via a first bias resistor R12, and to the common negative terminal 13 of the low-voltage circuit via a first grounding resistor R13. R12 and R14 form a voltage divider network, providing a reference bias for the non-inverting input. The inverting input of the first operational amplifier 81 is connected to the end of the first sampling resistor 6 near the negative battery terminal 12 via a second input resistor R11. A first feedback resistor R14 is connected between the inverting input and the output of the first operational amplifier 81.

[0039] The output of the first operational amplifier 81 is connected to the first ADC port of the main control chip 4 through the first current-limiting resistor R15. The first filter capacitor C2 is connected between the first ADC port and the common negative terminal 13 of the weak current circuit. R15 and C2 form an RC low-pass filter network.

[0040] The equivalent amplification factor of this differential amplifier circuit is 10 times, and the reference bias voltage is 5 / 3≈1.667V. Combined with the 2mΩ resistance of the first sampling resistor 6, each ampere of current corresponds to a 2mV voltage difference across the sampling resistor R2, which becomes 20mV after 10x amplification. With a reference bias voltage of 1.667V and an ADC range of 0-5V, the current can be measured up to (5-1.667) / 0.02≈166A when battery 1 is discharging forward and up to 1.667 / 0.02≈83A when it is charging reversely, meaning the measurable current range is -83A to +166A.

[0041] Reference Figure 4 The second signal conditioning circuit 9 is the differential amplifier circuit corresponding to the second sampling resistor 7. The second signal conditioning circuit 9 includes a second operational amplifier 91, a third input resistor R4, a fourth input resistor R5, a second feedback resistor R8, a second bias resistor R7, a second grounding resistor R6, a second current limiting resistor R9, and a second filter capacitor C1.

[0042] The non-inverting input of the second operational amplifier 91 is connected to the end of the second sampling resistor 7 near the common negative terminal 13 via a third input resistor R4. The non-inverting input of the second operational amplifier 91 is also connected to the 5V power supply voltage terminal via a second bias resistor R7, and to the common negative terminal 13 via a second grounding resistor R6. The second bias resistor R7 and the second grounding resistor R6 form a voltage divider network to provide a reference bias voltage for the non-inverting input. The inverting input of the second operational amplifier 91 is connected to the end of the second sampling resistor 7 near the negative terminal 12 of the battery via a fourth input resistor R5. A second feedback resistor R8 is connected between the inverting input and the output of the second operational amplifier 91.

[0043] The output of the second operational amplifier 91 is connected to the second ADC port of the main control chip 4 through the second current-limiting resistor R9. The second filter capacitor C1 is connected between the second ADC port and the common negative terminal 13 of the weak current circuit. R9 and C1 form an RC low-pass filter network to filter out high-frequency noise in the signal, so that the ADC can acquire a smooth and stable voltage signal.

[0044] The differential amplifier circuit has an equivalent amplification factor of 50x and a reference bias voltage of 2.5V. Combined with the 5mΩ resistance of the second sampling resistor 7, each ampere of current corresponds to a 5mV voltage difference across the sampling resistor R1, which becomes 250mV after 50x amplification. Using 2.5V as the reference bias voltage, the main control chip 4ADC has a range of 0-5V. During forward discharge, it can measure up to (5-2.5) / 0.25=10A, and during reverse charging, it can measure up to 2.5 / 0.25=10A, meaning the measurable current range is ±10A.

[0045] On the other hand, this application discloses a current sampling method for a motor controller, which periodically collects the voltage values ​​of the first ADC port and the second ADC port through the main control chip 4, and calculates the total charging and discharging current of the battery 1 according to the following steps: The ADC port voltage range of the main control chip 4 is 0-5V.

[0046] Step S1: The main control chip 4 reads the voltage value V_ADC1 of the first ADC port and calculates the first current I2 according to the formula I2=(V_ADC1-V_ref1) / (G1×R2), where V_ref1 is the reference bias voltage of the first signal conditioning circuit 8 (1.667V), G1 is the amplification factor of the first signal conditioning circuit 8 (10 times), and R2 is the resistance value of the first sampling resistor 6 (2mΩ).

[0047] Step S2: The main control chip 4 reads the voltage value V_ADC2 of the second ADC port and calculates the second current I1 according to the formula I1=(V_ADC2-V_ref2) / (G2×R1), where V_ref2 is the reference bias voltage (2.5V) of the second signal conditioning circuit 9, G2 is the amplification factor (50 times) of the second signal conditioning circuit 9, and R1 is the resistance value (5mΩ) of the second sampling resistor 7.

[0048] Step S3: Determine the current direction based on the sign of the calculation result. When the calculation result is positive, the current direction is the discharge direction; when the calculation result is negative, the current direction is the charging direction. Specifically, for the second current I1, when V_ADC2 is greater than 2.5V, I1 is positive, and the second current direction is the discharge direction, indicating that the controller's low-voltage circuit and other electrical devices are consuming the battery 1's power; when V_ADC2 is less than 2.5V, I1 is negative, and the second current direction is the charging direction, indicating that the charger 5 is charging the battery 1; when V_ADC2 equals 2.5V, I1 is zero, indicating that no current flows through this branch.

[0049] Step S4: Vector superimpose the first current I2 and the second current I1 to obtain the real-time total charging and discharging current of battery 1, I_total = I1 + I2. Under discharging conditions, both I1 and I2 are positive, and I_total is positive, indicating that battery 1 is discharging; under charging conditions, I2 is zero or close to zero, I1 is negative, and I_total is negative, indicating that battery 1 is charging.

[0050] Step S5: The main control chip 4 performs time integration on the real-time total charge and discharge current I_total, i.e., Q = ∫I_total·dt, to obtain the cumulative charge and discharge capacity Q of battery 1.

[0051] Step S6: Calculate the remaining energy of battery 1 based on the cumulative charge and discharge capacity Q and the rated capacity of battery 1, that is, estimate the remaining energy of battery 1 using the ampere-hour integration method.

[0052] The advantages of this solution compared to the traditional solution are explained below through comparison.

[0053] In traditional solutions, if a single sampling resistor is connected in series with the negative terminal 12 of the battery to measure the total charging and discharging current, this sampling resistor needs to withstand the sum of the motor drive current and the current from other devices. Taking the system parameters of this embodiment as an example, if the sampling resistor in the traditional solution has the same 2mΩ resistance as the first sampling resistor 6, the power consumption of the sampling resistor is 30² × 0.002 = 1.8W under a rated motor drive current of 30A. When measuring the charging current (maximum 10A), the voltage difference across the sampling resistor is 10 × 0.002 = 20mV, which becomes 200mV after being amplified 10 times by the same amplification factor.

[0054] In this scheme, the second sampling resistor 7 only needs to withstand a maximum current of 10A. At 10A, its power consumption is 10² × 0.005 = 0.5W, so a 0.5W rated power resistor is sufficient. When measuring the charging current (maximum 10A), the voltage difference across R1 is 10 × 0.005 = 50mV, which becomes 2500mV after amplification by 50 times.

[0055] The comparison shows that, under the same ADC capability, the sampling voltage of the ADC in this solution is 2500mV for a charging current of 10A, while that of the traditional solution is 200mV. The sampling accuracy of this solution is 2.5 times that of the traditional solution (2500 / 200×(1 / 5) = 2.5 times). Furthermore, the additional second sampling resistor 7 in this solution has a rated power of only 0.5W, costs approximately one-third of the high-power sampling resistor in the traditional solution, and occupies approximately half the PCB area of ​​the traditional solution.

[0056] The implementation principle of the current sampling circuit in this embodiment is as follows: by splitting the current loop of the negative terminal 12 of the battery into a motor drive loop through the first sampling resistor 6 and a weak current and charging loop through the second sampling resistor 7, two parallel branches are formed. The current of the two branches is sampled independently, and then the main control chip 4 superimposes the two currents to obtain the total charging and discharging current of the battery 1.

[0057] This solution utilizes the existing first sampling resistor 6 and its first signal conditioning circuit 8 of the motor controller itself. Only an additional second sampling resistor 7 and its second signal conditioning circuit 9 are needed as a low-power sampling circuit to enable the motor controller to monitor the total charging and discharging current of the battery 1. The remaining energy of the battery 1 can be calculated without the need for an additional battery 1 management system. This solution is particularly suitable for low-cost electric-driven mobility vehicles that use lead-acid batteries 1 and do not have a smart BMS.

[0058] The embodiments described herein are preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Therefore, all equivalent changes made in accordance with the structure, shape, and principle of the present invention should be covered within the scope of protection of the present invention.

Claims

1. A current sampling circuit for a motor controller, used to collect the total charging and discharging current of a battery (1), characterized in that, include: The first sampling resistor (6) is connected in series between the negative bus terminal (14) of the inverter bridge of the motor controller and the negative terminal of the battery (1) to detect the first current flowing through the motor drive circuit. The second sampling resistor (7) is connected in series between the common negative terminal (13) of the motor controller and the negative terminal of the battery (1) to detect the second current flowing through the controller's weak current circuit and the external electrical equipment circuit; wherein, the common negative terminal (13) is used to connect the negative terminal of the controller power supply circuit (3) of the motor controller and the negative terminal of the external electrical equipment and / or charger (5); The first signal conditioning circuit (8) is connected to both ends of the first sampling resistor (6) and is used to amplify the voltage difference between the two ends of the first sampling resistor (6) and output it to the first ADC port of the main control chip (4). The second signal conditioning circuit (9) is connected to both ends of the second sampling resistor (7) and is used to amplify the voltage difference between the two ends of the second sampling resistor (7) and output it to the second ADC port of the main control chip (4). The main control chip (4) is configured to: calculate the first current and the second current according to the voltage values ​​obtained from the first ADC port and the second ADC port respectively, and then superimpose the two to obtain the total charging and discharging current of the battery (1).

2. The current sampling circuit according to claim 1, characterized in that, Both the first signal conditioning circuit (8) and the second signal conditioning circuit (9) use differential amplifier circuits.

3. The current sampling circuit according to claim 2, characterized in that, The reference bias voltage of the second signal conditioning circuit (9) is half of the power supply voltage, which is used to perform bidirectional symmetrical sampling of the second current. The reference bias voltage of the first signal conditioning circuit (8) is one-third of the power supply voltage, which is used to perform asymmetric sampling of the first current so that the measurable current range in the discharge direction is greater than the measurable current range in the charging direction.

4. The current sampling circuit according to claim 3, characterized in that, The amplification factor of the second signal conditioning circuit (9) is greater than that of the first signal conditioning circuit (8).

5. The current sampling circuit according to claim 2, characterized in that, The first signal conditioning circuit (8) includes a first operational amplifier (81). The non-inverting input terminal and the inverting input terminal of the first operational amplifier (81) are respectively connected to the two ends of the first sampling resistor (6). The non-inverting input terminal of the first operational amplifier (81) is also connected to the power supply voltage terminal through the first bias resistor and to the weak current common negative terminal (13) P- through the first grounding resistor. The output terminal of the first operational amplifier (81) is connected to the first ADC port through the first current limiting resistor. The second signal conditioning circuit (9) includes a second operational amplifier (91), the non-inverting input terminal and the inverting input terminal of the second operational amplifier (91) are respectively connected to the two ends of the second sampling resistor (7); the non-inverting input terminal of the second operational amplifier (91) is also connected to the power supply voltage terminal through the second bias resistor, and connected to the weak current common negative terminal (13) through the second grounding resistor; the output terminal of the second operational amplifier (91) is connected to the second ADC port through the second current limiting resistor.

6. The current sampling circuit according to claim 5, characterized in that, The first signal conditioning circuit (8) further includes a first filter capacitor connected between the first ADC port and the weak current common negative terminal (13); and / or, the second signal conditioning circuit (9) further includes a second filter capacitor connected between the second ADC port and the weak current common negative terminal (13).

7. The current sampling circuit according to claim 1, characterized in that, The first sampling resistor (6) and the second sampling resistor (7) are connected in parallel with respect to the battery (1). The total discharge current of the battery (1) is equal to the sum of the first current and the second current, and the total charging current of the battery (1) is equal to the second current flowing in reverse through the second sampling resistor (7).

8. A current sampling method for a motor controller, implemented based on the current sampling circuit of any one of claims 1 to 7, characterized in that, Includes the following steps: S1: The voltage difference across the first sampling resistor (6) is obtained through the first signal conditioning circuit (8), amplified, and then collected by the first ADC port of the main control chip (4). The first current flowing through the motor drive circuit is calculated based on the voltage difference and the resistance value of the first sampling resistor (6). S2: The voltage difference across the second sampling resistor (7) is obtained through the second signal conditioning circuit (9), amplified, and then collected by the second ADC port of the main control chip (4). The second current flowing through the controller's weak current circuit and the external electrical equipment circuit is calculated based on the voltage difference and the resistance value of the second sampling resistor (7). S3: Determine the current direction of each sampling branch based on the comparison between the sampled voltages of the first ADC port and the second ADC port and their respective reference bias voltages. S4: Vector superposition of the first current and the second current to obtain the real-time total charge and discharge current of battery (1).

9. The current sampling method according to claim 8, characterized in that, In step S3: When the acquisition voltage of the second ADC port is greater than the reference bias voltage of the second signal conditioning circuit (9), the direction of the second current is determined to be the discharge direction. When the acquisition voltage of the second ADC port is less than the reference bias voltage of the second signal conditioning circuit (9), the direction of the second current is determined to be the charging direction. When the acquisition voltage of the second ADC port is equal to the reference bias voltage of the second signal conditioning circuit (9), the second current is determined to be zero.

10. The current sampling method according to claim 8, characterized in that, It also includes the following steps: S5: Perform time integration on the real-time total charge and discharge current to obtain the cumulative charge and discharge capacity of battery (1); S6: Calculate the remaining energy of battery (1) based on the cumulative charge and discharge capacity.