Battery charging and discharging control circuit and motor control circuit

By designing independent charging modules and discharge modules, the heating and computing power distribution problems of the main control chip caused by the continuous conduction of switching elements are solved, and efficient battery charging and discharging control is achieved, energy consumption is reduced and the chip's computing power is improved.

CN120127780APending Publication Date: 2025-06-10苏州洛之芯电子科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411312099.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

In the prior art, the continuous conduction of switching elements leads to severe heat generation and increases energy consumption. At the same time, the computing power distribution of the main control chip in realizing core functions is affected.

Method used

A battery charge and discharge control circuit is designed, including a charging module, a discharge module and a charge and discharge control module. The charging module is connected to an external charging power supply during charging, and the power is supplied by the discharge module during discharging, which independently controls the charging and discharge process of the battery and reduces the on-time of the switching element.

Benefits of technology

It effectively reduces the heating of switching elements, reduces energy consumption, and optimizes the computing power distribution of the main control chip, realizing efficient charging and discharging control of the battery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120127780A_ABST
    Figure CN120127780A_ABST
Patent Text Reader

Abstract

The invention provides a battery charging and discharging control circuit and a motor control circuit, and belongs to the technical field of battery charging and discharging control. The battery charging and discharging control circuit comprises a charging module, a discharging module and a charging and discharging control module, when the battery is charged, the charging and discharging control module is externally connected with a charging power supply through the charging module; the charging and discharging control module controls the charging module to charge the battery under the condition that the power supply supplies power; when the battery is discharged, the battery supplies power to the charging and discharging control module through the discharging module so as to control the battery to be discharged through the discharging module. The problems that in the prior art, due to the fact that a switch element is continuously turned on, heating of the switch element is serious, energy consumption is increased, and calculation power distribution of a main control chip on the aspect of achieving a core function is affected are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of battery charge and discharge control, and particularly relates to a battery charge and discharge control circuit and a motor control circuit. Background Art

[0002] The lithium-ion power battery of new energy vehicles (i.e., lithium battery) is generally defined as a device for storing energy. During the working process, the output of energy to the vehicle load is the discharge process, and the reception of energy from external devices is the charging process. Usually, both the discharge process and the charging process of the lithium battery are realized by an external control circuit. Therefore, an effective charge and discharge control circuit and control method are particularly important.

[0003] Common lithium battery charge and discharge control schemes include a linear power supply scheme and a half-port charge and discharge control scheme. During the charge and discharge process of the linear power supply scheme, with a switching element as the core device, the on-off of multiple switching elements is controlled through open-loop or closed-loop control according to the control method, changing the magnitude and direction of the current in the circuit, so as to realize the charge and discharge control of the lithium battery. However, the switching element is continuously conducting, and the current flows through the switching element for a long time, resulting in serious heating of the switching element, and then serious heating of the overall circuit, increasing energy consumption.

[0004] During the charge and discharge process of the half-port charge and discharge control scheme, through a main control chip such as an MCU with monitoring and programming functions, the charge and discharge circuits are controlled by monitoring the charge and discharge current, voltage conditions, etc. of the charging port and the discharge port. However, this control method requires ensuring that the main control chip continuously collects the states of the charging port and the discharge port, and determines the control of the charge and discharge process through the analysis of the collected data. For electrical equipment using an embedded system, the data collection, analysis, and control processes consume the computing resources of the main control chip, affecting the computing power allocation of the main control chip in realizing the core functions. Summary of the Invention

[0005] The present invention provides a battery charge and discharge control circuit and a motor control circuit to solve the problems in the prior art that the switching element is continuously conducting, resulting in serious heating of the switching element, increasing energy consumption, and affecting the computing power allocation of the main control chip in realizing the core functions.

[0006] In a first aspect, the present invention provides a battery charge and discharge control circuit, including a charging module, a discharging module, and a charge and discharge control module; when the battery is charging, the charge and discharge control module externally connects a charging power supply through the charging module; when the charge and discharge control module is powered by a power supply, it controls the charging module to charge the battery; when the battery is discharging, the battery powers the charge and discharge control module through the discharging module to control the battery to discharge through the discharging module.

[0007] Optionally, the charging module includes a first diode D1; the cathode of the first diode D1 is electrically connected to the discharging module and the charge-discharge control module; the anode of the first diode D1 is electrically connected to the positive terminal of the charging terminal, one end of a first sampling resistor RS1, and one end of a first resistor R1; the end of the first sampling resistor RS1 far from the positive terminal of the charging terminal is electrically connected to the drain of a first MOS transistor Q1; the source of the first MOS transistor Q1 is electrically connected to the source of a second MOS transistor Q2, and the gate is electrically connected to the gate of the second MOS transistor Q2; the source of the second MOS transistor Q2 is electrically connected to the charge-discharge control module, and the drain is electrically connected to the positive electrode of the battery and the discharging module; the negative electrode of the battery is electrically connected to the negative terminal of the charging terminal and grounded.

[0008] Optionally, the charge-discharge control module includes a first resistor R1, a triode Q3, a microcontroller, and a three-terminal voltage regulator U1; one end of a second resistor R2 and the pin V_CHARGE1 of the microcontroller are electrically connected to the end of the first resistor R1 far from the first diode D1; the end of the second resistor R2 far from the first resistor R1 is grounded; the microcontroller collects the voltage across the second resistor R2 through the pin V_CHARGE1; one end of a third resistor R3 is electrically connected to the drain of the first MOS transistor Q1; one end of a fourth resistor R4 and the pin V_CHARGE2 of the microcontroller are electrically connected to the end of the third resistor R3 far from the first MOS transistor Q1; the end of the fourth resistor R4 far from the third resistor R3 is grounded; the microcontroller collects the voltage across the fourth resistor R4 through the pin V_CHARGE2;

[0009] The collector of the triode Q3 is electrically connected to the gate of the first MOS transistor Q1, the base is electrically connected to the pin CHARGE of the microcontroller through a fifth resistor R5, and the emitter is electrically connected to the base of the triode Q3 through a sixth resistor R6 and grounded; the microcontroller outputs a high level or a low level to the triode Q3 through the pin CHARGE;

[0010] The input terminal of the three-terminal voltage regulator U1 is electrically connected to the positive electrode of an electrolytic capacitor E1, and is electrically connected to the cathode of the first diode D1 through a fourteenth resistor R14, the output terminal is electrically connected to the discharging module, and the common terminal is electrically connected to the negative electrode of the electrolytic capacitor E1 and grounded.

[0011] Optionally, the discharge module includes a third MOS transistor Q4 and a fourth MOS transistor Q5; the source electrode of the third MOS transistor Q4 is electrically connected to the positive electrode of the battery, the drain electrode is electrically connected to the cathode of the first diode D1, and the gate electrode is electrically connected to the positive electrode of the battery and the source electrode of the fourth MOS transistor Q5 through an eleventh resistor R11 and a twelfth resistor R12 respectively; the gate electrode of the fourth MOS transistor Q5 is electrically connected to the pin POWER_ON of the microcontroller through a ninth resistor R9, and the drain electrode is electrically connected to the gate electrode of the fourth MOS transistor Q5 and grounded through a tenth resistor R10; the microcontroller outputs a low level or a high level to the fourth MOS transistor Q5 through the pin POWER_ON.

[0012] The source electrode of the fourth MOS transistor Q5 is electrically connected to the anode of a third diode D3; the cathode of the third diode D3 is electrically connected to a key SW and the cathode of a fourth diode D4; one end of the key SW away from the third diode D3 is grounded; the anode of the fourth diode D4 is electrically connected to the pin AD_KEY of the microcontroller, one end of a thirteenth resistor R13, and one end of a third capacitor C3; the other end of the thirteenth resistor R13 away from the fourth diode D4 is electrically connected to the output terminal of the three-terminal voltage regulator U1; the other end of the third capacitor C3 away from the fourth diode D4 is grounded; after the key SW is pressed, the microcontroller is powered on and receives a low level through the pin AD_KEY, so as to output a high level to the fourth MOS transistor Q5 through the pin POWER_ON.

[0013] Optionally, a first capacitor C1 is electrically connected to the pin V_CHARGE1 of the microcontroller; the other end of the first capacitor C1 away from the microcontroller is grounded.

[0014] Optionally, a second capacitor C2 is electrically connected to the pin V_CHARGE2 of the microcontroller; the other end of the second capacitor C2 away from the microcontroller is grounded.

[0015] Optionally, an eighth resistor R8 is electrically connected to the collector of the triode Q3; the other end of the eighth resistor R8 away from the triode Q3 is electrically connected to one end of a seventh resistor R7; both ends of the seventh resistor R7 are respectively electrically connected to the gate electrode and the source electrode of the first MOS transistor Q1.

[0016] Optionally, one end of a fourth capacitor C4 and one end of a fifth capacitor C5 are respectively electrically connected to the input terminal and the output terminal of the three-terminal voltage regulator U1; the other ends of the fourth capacitor C4 and the fifth capacitor C5 away from the three-terminal voltage regulator U1 are both grounded.

[0017] In a second aspect, the present invention provides a motor control circuit based on the battery charge and discharge control circuit described in the first aspect, including a motor; the positive electrode of the motor is electrically connected to the cathode of a fifth diode D5 and the positive electrode of the battery, and the negative electrode is electrically connected to the drain of a fifth MOS transistor Q6 and the anode of the fifth diode D5;

[0018] The gate of the fifth MOS transistor Q6 is electrically connected to one end of a fifteenth resistor R15 and one end of a second sampling resistor RS2; the end of the fifteenth resistor R15 remote from the fifth MOS transistor Q6 is electrically connected to the pin Brush_DR of the microcontroller; the microcontroller outputs a low level or a high level to the fifth MOS transistor Q6 through the pin Brush_DR; the source of the fifth MOS transistor Q6 is electrically connected to one end of a sixteenth resistor R16, one end of a seventeenth resistor R17 and one end of the second sampling resistor RS2; the end of the sixteenth resistor R16 remote from the source of the fifth MOS transistor Q6 is electrically connected to the gate of the fifth MOS transistor Q6; the end of the seventeenth resistor R17 remote from the fifth MOS transistor Q6 is electrically connected to one end of a sixth capacitor C6 and one end of an eighteenth resistor R18; the end of the second sampling resistor RS2 remote from the fifth MOS transistor Q6 is grounded; the end of the sixth capacitor C6 remote from the seventeenth resistor R17 is grounded; the end of the eighteenth resistor R18 remote from the seventeenth resistor R17 is electrically connected to the non-inverting input terminal of an operational amplifier in the microprocessor; the inverting input terminal of the operational amplifier is electrically connected to one end of a nineteenth resistor R19 and one end of a twentieth resistor R20; the end of the nineteenth resistor R19 remote from the operational amplifier is electrically connected to the end of the sixth capacitor C6 remote from the seventeenth resistor R17; the end of the twentieth resistor R20 remote from the inverting input terminal of the operational amplifier is electrically connected to the output terminal of the operational amplifier; the output terminal of the operational amplifier is electrically connected to the non-inverting input terminal of a comparator in the microprocessor, and the positive power supply terminal is electrically connected to the output terminal of a three-terminal voltage regulator U1; the inverting input terminal of the comparator is connected to a reference voltage VREF, and the output terminal outputs a high level to the microprocessor to output a low level to the fifth MOS transistor Q6 through the pin Brush_DR to stop the motor; the positive power supply terminal of the comparator is electrically connected to the output terminal of the three-terminal voltage regulator U1.

[0019] The present invention provides a battery charge and discharge control circuit and a motor control circuit. The battery charge and discharge control circuit includes a charging module, a discharging module, and a charge and discharge control module. When the battery is charging, the charge and discharge control module externally connects a charging power source through the charging module. When there is power supply, the charge and discharge control module controls the charging module to charge the battery. When the battery is discharging, the battery powers the charge and discharge control module through the discharging module to control the battery to discharge through the discharging module. The present invention solves the problems in the prior art that the switching element is continuously conducting, resulting in serious heating of the switching element, increased energy consumption, and affecting the computing power distribution of the main control chip in realizing the core functions. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0021] Figure 1 It is a schematic circuit diagram of the battery charge and discharge control circuit provided by the embodiment of the present invention;

[0022] Figure 2 It is a schematic circuit diagram of the power supply circuit of the MCU provided by the embodiment of the present invention;

[0023] Figure 3 It is a schematic circuit diagram of the motor control circuit provided by the embodiment of the present invention;

[0024] Figure 4 It is a schematic circuit diagram of the motor protection circuit provided by the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0025] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments of the present invention belong to the scope of protection of the present invention.

[0026] Embodiment 1

[0027] This embodiment provides a battery charge and discharge control circuit, including a charging module, a discharging module, and a charge and discharge control module. When the battery is charging, the charge and discharge control module externally connects a charging power source through the charging module. When there is power supply, the charge and discharge control module controls the charging module to charge the battery. When the battery is discharging, the battery powers the charge and discharge control module through the discharging module to control the battery to discharge through the discharging module.

[0028] Exemplarily, as Figure 1 shown, the charging module includes a first diode D1; the cathode of the first diode D1 is electrically connected to the discharging module and the charge-discharge control module; the anode of the first diode D1 is electrically connected to the positive electrode of the charging terminal, one end of a first sampling resistor RS1, and one end of a first resistor R1; the end of the first sampling resistor RS1 far from the positive electrode of the charging terminal is electrically connected to the drain of a first MOS transistor Q1; the source of the first MOS transistor Q1 is electrically connected to the source of a second MOS transistor Q2, and the gate is electrically connected to the gate of the second MOS transistor Q2; the source of the second MOS transistor Q2 is electrically connected to the charge-discharge control module, and the drain is electrically connected to the positive electrode of the battery BAT and the discharging module; the negative electrode of the battery BAT is electrically connected to the negative electrode of the charging terminal and grounded.

[0029] As Figure 2 shown, the charge-discharge control module includes a first resistor R1, a triode Q3, a microcontroller (MCU), and a three-terminal voltage regulator U1; the end of the first resistor R1 far from the first diode D1 is electrically connected to one end of a second resistor R2 and the pin V_CHARGE1 of the microcontroller; the end of the second resistor R2 far from the first resistor R1 is grounded; the microcontroller collects the voltage across the second resistor R2 through the pin V_CHARGE1; the pin V_CHARGE1 of the microcontroller is electrically connected to a first capacitor C1; the end of the first capacitor C1 far from the microcontroller is grounded, and the first capacitor C1 is used to reduce the interference and glitches of the voltage collected by the pin V_CHARGE1. In this embodiment, the model of the microcontroller (MCU) is OB38A08A1W16OP.

[0030] One end of a third resistor R3 is electrically connected to the drain of the first MOS transistor Q1; the end of the third resistor R3 far from the first MOS transistor Q1 is electrically connected to one end of a fourth resistor R4 and the pin V_CHARGE2 of the microcontroller; the end of the fourth resistor R4 far from the third resistor R3 is grounded; the microcontroller collects the voltage across the fourth resistor R4 through the pin V_CHARGE2; the pin V_CHARGE2 of the microcontroller is electrically connected to a second capacitor C2; the end of the second capacitor C2 far from the microcontroller is grounded, and the second capacitor C2 is used to reduce the interference and glitches of the voltage collected by the pin V_CHARGE2.

[0031] The collector of the triode Q3 is electrically connected to the gate of the first MOS transistor Q1. The base is electrically connected to the pin CHARGE of the microcontroller through the fifth resistor R5. The emitter is electrically connected to the base of the triode Q3 through the sixth resistor R6 and grounded. The microcontroller outputs a high level or a low level to the triode Q3 through the pin CHARGE. The fifth resistor R5 is a current-limiting resistor, which is used to reduce the base current of the triode Q3, avoid damage to the triode Q3, and at the same time play a role in filtering signal interference. The sixth resistor R6 is a pull-down resistor, which keeps the triode Q3 in the cut-off state when the MCU is powered on, preventing the triode Q3 from being mis-conducted.

[0032] The collector of the triode Q3 is electrically connected to an eighth resistor R8. One end of the eighth resistor R8 far from the triode Q3 is electrically connected to one end of a seventh resistor R7. Both ends of the seventh resistor R7 are respectively electrically connected to the gate and the source of the first MOS transistor Q1. Both the seventh resistor R7 and the eighth resistor R8 are voltage-dividing resistors, so that the VGS (gate-source) voltage of the first MOS transistor Q1 and the second MOS transistor Q2 does not exceed the requirements of the specification, avoiding damage to the first MOS transistor Q1.

[0033] The input terminal of the three-terminal voltage regulator U1 is electrically connected to the positive electrode of the electrolytic capacitor E1, and is electrically connected to the cathode of the first diode D1 through the fourteenth resistor R14. The output terminal is electrically connected to the discharge module, and the common terminal is electrically connected to the negative electrode of the electrolytic capacitor E1 and grounded. The input terminal and the output terminal of the three-terminal voltage regulator U1 are respectively electrically connected to one end of a fourth capacitor C4 and one end of a fifth capacitor C5. The ends of the fourth capacitor C4 and the fifth capacitor C5 far from the three-terminal voltage regulator U1 are both grounded. The fourteenth resistor R14 is a current-limiting resistor, which is used to reduce the input current of the subsequent three-terminal voltage regulator U1. The electrolytic capacitor E1 plays an energy storage role, providing electrical energy for the subsequent three-terminal voltage regulator U1 and the MCU at the moment of power-off. The fourth capacitor C4 and the fifth capacitor C5 both play a filtering role, filtering out the high-frequency components and spikes of the output voltage. In this embodiment, the model of the three-terminal voltage regulator U1 is CJ78L05, and the output is +5V.

[0034] The discharge module includes a third MOS transistor Q4 and a fourth MOS transistor Q5; the source of the third MOS transistor Q4 is electrically connected to the positive electrode of the battery BAT, the drain is electrically connected to the cathode of the first diode D1, and the gate is electrically connected to the positive electrode of the battery BAT and the source of the fourth MOS transistor Q5 through the eleventh resistor R11 and the twelfth resistor R12 respectively; the gate of the fourth MOS transistor Q5 is electrically connected to the pin POWER_ON of the microcontroller through the ninth resistor R9, and the drain is electrically connected to the gate of the fourth MOS transistor Q5 through the tenth resistor R10 and grounded; the microcontroller outputs a low level or a high level to the fourth MOS transistor Q5 through the pin POWER_ON. The ninth resistor R9 is a current-limiting resistor, which reduces the gate current of the fourth MOS transistor Q5, avoids damage to the fourth MOS transistor Q5, and at the same time plays a role in filtering signal interference; the tenth resistor R10 is a pull-down resistor, which keeps the fourth MOS transistor Q5 in the cut-off state when the MCU is powered on, preventing the fourth MOS transistor Q5 from being mis-conducted; the eleventh resistor R11 and the twelfth resistor R12 are both voltage-dividing resistors, so that the VGS (gate-source) voltage of the third MOS transistor Q4 does not exceed the requirements of the specification, avoiding damage to the third MOS transistor Q4.

[0035] The source of the fourth MOS transistor Q5 is electrically connected to the anode of the third diode D3; the cathode of the third diode D3 is electrically connected to the key SW and the cathode of the fourth diode D4; one end of the key SW away from the third diode D3 is grounded; the anode of the fourth diode D4 is electrically connected to the pin AD_KEY of the microcontroller, one end of the thirteenth resistor R13 and one end of the third capacitor C3; one end of the thirteenth resistor R13 away from the fourth diode D4 is electrically connected to the output terminal of the three-terminal voltage regulator U1; one end of the third capacitor C3 away from the fourth diode D4 is grounded; after the key SW is pressed, the microcontroller is powered on and receives a low level through the pin AD_KEY, so as to output a high level to the fourth MOS transistor Q5 through the pin POWER_ON. The third diode D3 plays an anti-backflow role, preventing the MCU supply voltage VDD from flowing back through the fourth diode D4 when the key SW is pressed to the fourth MOS transistor Q5; the fourth diode D4 also plays an anti-backflow role, preventing the positive voltage BAT+ of the battery BAT from flowing back through the eleventh resistor R11, the twelfth resistor R12 and the third diode D3 to the MCU supply voltage VDD when the key SW is pressed; the thirteenth resistor R13 is a current-limiting resistor, which reduces the current passing through the key SW when the key SW is pressed; the third capacitor C3 is a filtering capacitor, which filters out the waveform jitter of the key SW at the moment of pressing and bouncing.

[0036] As Figure 1 and Figure 2As shown, when the battery BAT is in the charging state and the DC charger is charging, it is connected to PP+ through the first diode D1. PP+ is stepped down to the supply voltage VDD of the MCU through the three-terminal voltage regulator U1 to supply power to the MCU. After the MCU is powered on, it controls the CHARGE pin to output a high level, causing the triode Q3 to conduct, and the first MOS transistor Q1 and the second MOS transistor Q2 to conduct. The DC charger charges the battery BAT. At the same time, the MCU outputs a low level through the POWER_ON pin, causing the fourth MOS transistor Q5 and the third MOS transistor Q4 to cut off.

[0037] The V_CHARGE1 pin of the MCU can obtain the voltage across the second resistor R2 for overvoltage and undervoltage detection of the DC charger. When overvoltage or undervoltage occurs, the MCU outputs a low level through the CHARGE pin, causing the triode Q3, the first MOS transistor Q1, and the second MOS transistor Q2 to cut off, and the DC charger is prohibited from charging the battery BAT.

[0038] The V_CHARGE2 pin of the MCU can obtain the voltage across the fourth resistor R4. The voltages on the V_CHARGE1 and V_CHARGE2 pins can be used to calculate the voltage across the first sampling resistor RS1. The ratio of the voltage across the first sampling resistor RS1 to the resistance value of the first sampling resistor is used as the current flowing through the first sampling resistor RS1 (i.e., charging current detection). When overcurrent charging occurs, the MCU outputs a low level through the CHARGE pin, causing the triode Q3, the first MOS transistor Q1, and the second MOS transistor Q2 to cut off, and the DC charger is prohibited from charging the battery BAT.

[0039] When the battery BAT is in the discharging state and the button SW is not pressed, the third MOS transistor Q4 is cut off and the MCU is not powered on, realizing the low-power function. When the button SW is pressed, the third MOS transistor Q4 conducts, and the positive pole BAT+ of the battery BAT voltage is connected to PP+ through the second diode D2. PP+ is stepped down to the supply voltage VDD of the MCU through the three-terminal voltage regulator U1 to supply power to the MCU.

[0040] After the MCU is powered on, it outputs a high level through the POWER_ON pin, causing the fourth MOS transistor Q5 and the third MOS transistor Q4 to conduct. The positive pole BAT+ of the battery BAT voltage is connected to PP+ through the second diode D2. PP+ is stepped down to the supply voltage VDD of the MCU through the three-terminal voltage regulator U1 to supply power to the MCU. After the button SW is pressed and released, the takeover level is used to keep the third MOS transistor Q4 in the conducting state.

[0041] The first diode D1 functions to prevent reverse current injection. When the battery BAT discharges, it prevents the positive voltage BAT+ of the battery BAT from being reversely injected into the positive terminal C+ of the DC charger through the third MOS transistor Q4 and the second diode D2. The second diode D2 also functions to prevent reverse current injection. When the battery BAT charges, it prevents the positive terminal C+ of the DC charger from being reversely injected into the third MOS transistor Q4 through the first diode D1.

[0042] In summary, for the battery BAT charge and discharge control circuit provided in this embodiment, the charge control and discharge control of the battery BAT are completely independent, and the charge and discharge control logic is clear. When the battery BAT charges, the power supply of the MCU is completely provided by the DC charger and does not consume the power of the battery. When the battery BAT discharges, when the button SW is not pressed, it has the advantage of low power consumption and does not consume the power of the battery.

[0043] Embodiment 2

[0044] As Figure 3 and Figure 4 shown, this embodiment provides a motor control circuit based on the battery charge and discharge control circuit described in Embodiment 1, including a motor. The positive electrode of the motor is electrically connected to the cathode of a fifth diode D5 and the positive electrode of the battery BAT, and the negative electrode is electrically connected to the drain of a fifth MOS transistor Q6 and the anode of the fifth diode D5.

[0045] One end of a fifteenth resistor R15 and one end of a second sampling resistor RS2 are electrically connected to the gate of a fifth MOS transistor Q6; the end of the fifteenth resistor R15 remote from the fifth MOS transistor Q6 is electrically connected to a pin Brush_DR of a microcontroller; the microcontroller outputs a low level or a high level to the fifth MOS transistor Q6 through the pin Brush_DR; one end of a sixteenth resistor R16, one end of a seventeenth resistor R17 and one end of the second sampling resistor RS2 are electrically connected to the source of the fifth MOS transistor Q6; the end of the sixteenth resistor R16 remote from the source of the fifth MOS transistor Q6 is electrically connected to the gate of the fifth MOS transistor Q6; one end of a sixth capacitor C6 and one end of an eighteenth resistor R18 are electrically connected to the end of the seventeenth resistor R17 remote from the fifth MOS transistor Q6; the end of the second sampling resistor RS2 remote from the fifth MOS transistor Q6 is grounded; the end of the sixth capacitor C6 remote from the seventeenth resistor R17 is grounded; the end of the eighteenth resistor R18 remote from the seventeenth resistor R17 is electrically connected to the non-inverting input terminal of an operational amplifier in a microprocessor; one end of a nineteenth resistor R19 and one end of a twentieth resistor R20 are electrically connected to the inverting input terminal of the operational amplifier; the end of the nineteenth resistor R19 remote from the operational amplifier is electrically connected to the end of the sixth capacitor C6 remote from the seventeenth resistor R17; the end of the twentieth resistor R20 remote from the inverting input terminal of the operational amplifier is electrically connected to the output terminal of the operational amplifier; the output terminal of the operational amplifier is electrically connected to the non-inverting input terminal of a comparator in the microprocessor, and the positive power supply terminal is electrically connected to the output terminal of a three-terminal voltage regulator U1; a reference voltage VREF is connected to the inverting input terminal of the comparator, and the output terminal outputs a high level to the microprocessor to output a low level to the fifth MOS transistor Q6 through the pin Brush_DR to stop the motor; the positive power supply terminal of the comparator is electrically connected to the output terminal of the three-terminal voltage regulator U1.

[0046] In this embodiment, the fifth MOS transistor Q6 is a high-power MOS transistor. Pins 1-3 of the fifth MOS transistor Q6 are all source electrodes, pin 4 is the gate, and pins 5-8 are all drain electrodes.

[0047] After the MCU is powered on, it outputs a PWM signal through the pin Brush_DR to control the fifth MOS transistor Q6 to conduct, and the motor runs. The motor is an inductive load and must be controlled using a PWM signal. The PWM signal linearly rises from 0-100% duty cycle, which can prevent the motor from rushing to the maximum speed as soon as it starts and prevent overshoot.

[0048] The fifteenth resistor R15 is a current-limiting resistor, which reduces the gate current of the fifth MOS transistor Q6, protects the fifth MOS transistor Q6, and also plays a role in filtering signal interference; the sixteenth resistor R16 is a pull-down resistor, which keeps the fifth MOS transistor Q6 in a cut-off state when the MCU is powered on to prevent the fifth MOS transistor Q6 from being mis-conducted.

[0049] The fifth diode D5 functions as a freewheeling diode. Since the motor is an inductive load, when the motor stops running, the current on the motor cannot change abruptly, and this diode is required to provide freewheeling action to release the energy on the motor to BAT+ of the battery BAT.

[0050] When the motor is running normally, a voltage difference will be formed across both ends of the second sampling resistor RS2, and the current flowing through the motor can be calculated by back-calculation.

[0051] The seventeenth resistor R17 and the sixth capacitor C6 form a first-order low-pass filter to filter out high-frequency components.

[0052] As Figure 3 shown, both ends of the sixth capacitor C6, the network Brush_FO and GND, are connected to Figure 4 the same network in (the PCB needs differential routing). After passing through the operational amplifier inside the MCU, the voltage signal across both ends of the second sampling resistor RS2 is amplified and then connected to the non-inverting input terminal of the comparator inside the MCU, and compared with the reference voltage VREF at the inverting input terminal of the comparator. When it is greater than the reference voltage VREF, the output terminal FO of the comparator outputs a high level (i.e., an overcurrent event is issued). The ADC (analog-to-digital converter) inside the MCU is connected to the network of the comparator output terminal FO. After receiving the high level, the microcontroller pin Brush_DR outputs a low level and the motor stops.

[0053] The eighteenth resistor R18 and the nineteenth resistor R19 are the pre-circuits of the operational amplifier, and together with the twentieth resistor R20 inside the MCU, they determine the amplification factor.

[0054] Both the operational amplifier and the comparator are built-in inside the MCU, no external components are required, the circuit connection is convenient, and there are few peripheral components. Since the comparator is used to detect overcurrent protection, the response speed is fast and the protection is reliable.

[0055] The present invention has been described in detail above in combination with specific embodiments and exemplary examples, but these descriptions should not be construed as limiting the present invention. Those skilled in the art understand that without departing from the spirit and scope of the present invention, various equivalent substitutions, modifications or improvements can be made to the technical solutions and their implementation manners of the present invention, and all of these fall within the scope of the present invention. The protection scope of the present invention is subject to the appended claims.

Claims

1. A battery charge and discharge control circuit, characterized in that: It includes a charging module, a discharging module and a charging and discharging control module; when the battery is charging, the charging and discharging control module is connected to an external charging power source through the charging module; when the battery is powered by the power source, the charging and discharging control module controls the charging module to charge the battery; when the battery is discharging, the battery supplies power to the charging and discharging control module through the discharging module to control the battery to discharge through the discharging module.

2. The battery charge and discharge control circuit according to claim 1, characterized in that: The charging module includes a first diode D1; the cathode of the first diode D1 is electrically connected to the discharging module and the charging and discharging control module; the anode of the first diode D1 is electrically connected to the positive electrode of the charging terminal, one end of the first sampling resistor RS1 and one end of the first resistor R1; the end of the first sampling resistor RS1 away from the positive electrode of the charging terminal is electrically connected to the drain of the first MOS tube Q1; the source of the first MOS tube Q1 is electrically connected to the source of the second MOS tube Q2, and the gate is electrically connected to the gate of the second MOS tube Q2; the source of the second MOS tube Q2 is electrically connected to the charging and discharging control module, and the drain is electrically connected to the positive electrode of the battery and the discharging module; the negative electrode of the battery is electrically connected to the negative electrode of the charging terminal and grounded.

3. The battery charge and discharge control circuit according to claim 2, characterized in that: The charge and discharge control module includes a first resistor R1, a transistor Q3, a microcontroller and a three-terminal regulator U1; one end of the first resistor R1 away from the first diode D1 is electrically connected to one end of the second resistor R2 and the pin V_CHARGE1 of the microcontroller; one end of the second resistor R2 away from the first resistor R1 is grounded; the microcontroller collects the voltage across the second resistor R2 through the pin V_CHARGE1; the drain of the first MOS tube Q1 is electrically connected to one end of the third resistor R3; one end of the third resistor R3 away from the first MOS tube Q1 is electrically connected to one end of the fourth resistor R4 and the pin V_CHARGE2 of the microcontroller; one end of the fourth resistor R4 away from the third resistor R3 is grounded; the microcontroller collects the voltage across the fourth resistor R4 through the pin V_CHARGE2; The collector of the transistor Q3 is electrically connected to the gate of the first MOS transistor Q1, the base is electrically connected to the pin CHARGE of the microcontroller through the fifth resistor R5, and the emitter is electrically connected to the base of the transistor Q3 through the sixth resistor R6 and grounded; the microcontroller outputs a high level or a low level to the transistor Q3 through the pin CHARGE; The input end of the three-terminal regulator U1 is electrically connected to the positive electrode of the electrolytic capacitor E1 and is electrically connected to the cathode of the first diode D1 through the fourteenth resistor R14. The output end is electrically connected to the discharge module. The common end is electrically connected to the negative electrode of the electrolytic capacitor E1 and is grounded.

4. The battery charge and discharge control circuit according to claim 3, characterized in that: The discharge module includes a third MOS tube Q4 and a fourth MOS tube Q5; the source of the third MOS tube Q4 is electrically connected to the positive electrode of the battery, the drain is electrically connected to the cathode of the first diode D1, and the gate is electrically connected to the positive electrode of the battery and the source of the fourth MOS tube Q5 through the eleventh resistor R11 and the twelfth resistor R12 respectively; the gate of the fourth MOS tube Q5 is electrically connected to the pin POWER_ON of the microcontroller through the ninth resistor R9, and the drain is electrically connected to the gate of the fourth MOS tube Q5 through the tenth resistor R10 and is grounded; the microcontroller outputs a low level or a high level to the fourth MOS tube Q5 through the pin POWER_ON; The source of the fourth MOS tube Q5 is electrically connected to the anode of the third diode D3; the cathode of the third diode D3 is electrically connected to the key SW and the cathode of the fourth diode D4; the end of the key SW away from the third diode D3 is grounded; the anode of the fourth diode D4 is electrically connected to the pin AD_KEY of the microcontroller, one end of the thirteenth resistor R13 and one end of the third capacitor C3; the end of the thirteenth resistor R13 away from the fourth diode D4 is electrically connected to the output end of the three-terminal regulator U1; the end of the third capacitor C3 away from the fourth diode D4 is grounded; after pressing the key SW, the microcontroller is powered on and receives a low level through the pin AD_KEY to output a high level to the fourth MOS tube Q5 through the pin POWER_ON.

5. The battery charge and discharge control circuit according to claim 3, characterized in that: The pin V_CHARGE1 of the microcontroller is electrically connected to a first capacitor C1; one end of the first capacitor C1 away from the microcontroller is grounded.

6. The battery charge and discharge control circuit according to claim 3, characterized in that: The pin V_CHARGE2 of the microcontroller is electrically connected to a second capacitor C2; one end of the second capacitor C2 away from the microcontroller is grounded.

7. The battery charge and discharge control circuit according to claim 3, characterized in that: The collector of the transistor Q3 is electrically connected to an eighth resistor R8; one end of the eighth resistor R8 away from the transistor Q3 is electrically connected to one end of a seventh resistor R7; and both ends of the seventh resistor R7 are electrically connected to the gate and source of the first MOS transistor Q1, respectively.

8. The battery charge and discharge control circuit according to claim 3, characterized in that: The input end and the output end of the three-terminal regulator U1 are electrically connected to one end of a fourth capacitor C4 and one end of a fifth capacitor C5 respectively; one end of the fourth capacitor C4 and the fifth capacitor C5 away from the three-terminal regulator U1 are both grounded.

9. A motor control circuit based on the battery charge and discharge control circuit according to any one of claims 3 to 8, characterized in that: It includes a motor; the positive electrode of the motor is electrically connected to the cathode of the fifth diode D5 and the positive electrode of the battery, and the negative electrode is electrically connected to the drain of the fifth MOS tube Q6 and the anode of the fifth diode D5; The gate of the fifth MOS transistor Q6 is electrically connected to one end of the fifteenth resistor R15 and one end of the second sampling resistor RS2; one end of the fifteenth resistor R15 away from the fifth MOS transistor Q6 is electrically connected to the pin Brush_DR of the microcontroller; the microcontroller outputs a low level or a high level to the fifth MOS transistor Q6 through the pin Brush_DR; the source of the fifth MOS transistor Q6 is electrically connected to one end of the sixteenth resistor R16, one end of the seventeenth resistor R17 and one end of the second sampling resistor RS2; one end of the sixteenth resistor R16 away from the source of the fifth MOS transistor Q6 is electrically connected to the gate of the fifth MOS transistor Q6; one end of the seventeenth resistor R17 away from the fifth MOS transistor Q6 is electrically connected to one end of the sixth capacitor C6 and one end of the eighteenth resistor R18; one end of the second sampling resistor RS2 away from the fifth MOS transistor Q6 is grounded; one end of the sixth capacitor C6 away from the seventeenth resistor R17 is grounded; One end of the eighteenth resistor R18 away from the seventeenth resistor R17 is electrically connected to the non-inverting input end of the operational amplifier in the microprocessor; the inverting input end of the operational amplifier is electrically connected to one end of the nineteenth resistor R19 and one end of the twentieth resistor R20; one end of the nineteenth resistor R19 away from the operational amplifier is electrically connected to one end of the sixth capacitor C6 away from the seventeenth resistor R17; one end of the twentieth resistor R20 away from the inverting input end of the operational amplifier is electrically connected to the output end of the operational amplifier; the output end of the operational amplifier is electrically connected to the non-inverting input end of the comparator in the microprocessor, and the positive power supply end is electrically connected to the output end of the three-terminal regulator U1; the inverting input end of the comparator is connected to the reference voltage VREF, and the output end outputs a high level to the microprocessor, so as to output a low level to the fifth MOS tube Q6 through the pin Brush_DR to stop the motor; the positive power supply end of the comparator is electrically connected to the output end of the three-terminal regulator U1.