A bidirectional current sampling circuit and method

By switching the voltage sampling terminal and ground terminal at both ends of the sampling resistor, bidirectional current sampling is achieved, which solves the problems of increasing power loss and increasing number of ADC sampling pins in the prior art, and efficient current sampling is achieved.

CN118937766BActive Publication Date: 2025-05-02CHENGYI SEMICON (SUZHOU) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411078334.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2025-05-02
Estimated Expiration
2044-08-07

AI Technical Summary

Technical Problem

Existing bidirectional current sampling methods have problems with increasing power loss and increasing number of ADC sampling pins in high-power fast charging applications with USB Type-C ports.

Method used

Bidirectional current sampling is achieved by switching the voltage sampling terminal and ground terminal at both ends of the sampling resistor, using only a single sampling resistor and a single voltage sampling terminal, reducing power loss and saving the number of ADC sampling pins.

Benefits of technology

It effectively reduces power loss and saves the number of ADC sampling pins, makes full use of resources, and is suitable for high-power fast charging applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118937766B_ABST
    Figure CN118937766B_ABST
Patent Text Reader

Abstract

The present invention discloses a bidirectional current sampling circuit and method, wherein the bidirectional current sampling circuit comprises a sampling point switching module, a grounding switching module, a main control module and a sampling resistor; the main control module is used to generate a level control signal, and send it to the sampling point switching module and the grounding switching module respectively through the output end of the main control module; the sampling point switching module and the grounding switching module are used to control the voltage sampling end of the main control module and the grounding end of the main control module to switch and connect between the first end of the sampling resistor and the second end of the sampling resistor respectively according to the received level control signal; the main control module is also used to sample the voltage of the sampling resistor through the voltage sampling end in the target connection state, and obtain the current of the sampling resistor according to the sampled voltage. The present invention can realize bidirectional current sampling through a single sampling resistor and a single voltage sampling end, while effectively reducing power loss and saving the number of voltage sampling ends.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of current sampling, and in particular to a bidirectional current sampling circuit and method. Background Art

[0002] In modern electronic devices, current sampling is one of the important technical means to achieve power management, protection and control. Usually, digital display products will connect a sampling resistor in series with the power ground line of its circuit terminal and measure the voltage difference across the sampling resistor to calculate the current. However, this method has certain limitations when dealing with bidirectional current.

[0003] In order to achieve bidirectional current sampling, the prior art connects two sampling resistors in series on the power ground line of the circuit terminal, and uses the connection end of the two sampling resistors as the reference ground of the sampling benchmark. When the current direction changes, the voltage difference between the two ends of the two sampling resistors will change positively or negatively relative to the reference voltage. Specifically, when the current flows in one direction, the voltage difference on one sampling resistor is positive, and the voltage difference on the other sampling resistor is negative; when the current flows in the opposite direction, the situation is the opposite. At this time, the forward voltage is sampled by the microcontroller unit (MCU) to achieve bidirectional sampling of the current. However, the existing bidirectional current sampling method has the following significant defects in the high-power fast charging application of the USB Type-C port:

[0004] (1) In actual fast charging applications, the USB Type-C interface usually carries large currents and voltages due to its high power transmission capability. The existing bidirectional current sampling method requires two sampling resistors to be connected in series on the power ground line, which will introduce additional power loss. As the number of series resistors increases, the power loss will also increase significantly.

[0005] (2) The existing bidirectional current sampling method requires the MCU to provide two analog-to-digital converter (ADC) sampling pins, which are used to collect the voltage values ​​on the two sampling resistors respectively, resulting in an increase in the number of ADC sampling pins. Summary of the invention

[0006] The technical problem to be solved by the embodiments of the present invention is to provide a bidirectional current sampling circuit and method, which realizes bidirectional current sampling through a single sampling resistor and a single voltage sampling terminal, can effectively reduce power loss, and at the same time save the number of ADC sampling pins (i.e., voltage sampling terminals) and make full use of resources.

[0007] The first aspect of the present invention provides a bidirectional current sampling circuit, including a sampling point switching module, a ground switching module, a main control module and a sampling resistor;

[0008] The main control module is used to generate a level control signal, and send it to the sampling point switching module and the ground switching module respectively through the output end of the main control module;

[0009] The sampling point switching module is used to control the voltage sampling end of the main control module to switch the connection between the first end of the sampling resistor and the second end of the sampling resistor according to the received level control signal;

[0010] The ground switching module is used to control the ground terminal of the main control module to switch between the first end of the sampling resistor and the second end of the sampling resistor according to the received level control signal;

[0011] The main control module is also used to sample the voltage of the sampling resistor through the voltage sampling end in a target connection state, and obtain the current of the sampling resistor according to the sampled voltage; wherein the target connection state is a first target connection state or a second target connection state, the first target connection state is that the ground end of the main control module is connected to the first end of the sampling resistor, and the voltage sampling end is connected to the second end of the sampling resistor, and the second target connection state is that the ground end of the main control module is connected to the second end of the sampling resistor, and the voltage sampling end is connected to the first end of the sampling resistor.

[0012] Optionally, the ground switching module has at least one control terminal, one input terminal and two output terminals;

[0013] The control end of the ground switching module is connected to the output end of the main control module, the input end of the ground switching module is connected to the ground end of the main control module, the first output end of the ground switching module is connected to the first end of the sampling resistor, and the second output end of the ground switching module is connected to the second end of the sampling resistor.

[0014] Optionally, the ground switching module includes a first switch tube, a second switch tube and a third switch tube;

[0015] The control end of the first switch tube is the control end of the ground switching module, the output end of the first switch tube is the first output end of the ground switching module, and the input end of the first switch tube is the input end of the ground switching module;

[0016] The control end of the second switch tube is connected to the control end of the first switch tube, the output end of the second switch tube is connected to the second end of the sampling resistor, and the input end of the second switch tube is used to receive a first input voltage;

[0017] The control end of the third switch tube is connected to the input end of the second switch tube, the output end of the third switch tube is the second output end of the ground switching module, and the input end of the third switch tube is connected to the input end of the first switch tube.

[0018] Optionally, the bidirectional current sampling circuit further includes: a power supply transformer module;

[0019] The power supply transformer module is used to transform the power supply voltage to generate the first input voltage and the second input voltage; wherein the first input voltage is output from the first output end of the power supply transformer module to the input end of the second switch tube; and the second input voltage is output from the second output end of the power supply transformer module to the power supply end of the main control module.

[0020] Optionally, the sampling point switching module includes a multi-way switch;

[0021] The control end of the multi-way switch is connected to the output end of the main control module, the normally closed end of the multi-way switch is connected to the first end of the sampling resistor, the normally open end of the multi-way switch is connected to the second end of the sampling resistor, and the common end of the multi-way switch is connected to the voltage sampling end.

[0022] Optionally, the bidirectional current sampling circuit further includes: a first interface and a second interface;

[0023] The power supply end of the first interface is connected to the power supply end of the second interface via a connecting line; wherein the connecting line is used to provide a second input voltage for the main control module;

[0024] The ground terminal of the first interface is connected to the first end of the sampling resistor, and the second end of the sampling resistor is connected to the ground terminal of the second interface.

[0025] Optionally, the bidirectional current sampling circuit further includes a permanent grounding module;

[0026] A first end of the permanent grounding module is connected to a grounding end of the main control module, and a second end of the permanent grounding module is connected to a grounding end of the first interface.

[0027] Optionally, the first switch tube, the second switch tube and the third switch tube are all N-channel MOS tubes;

[0028] The control ends of the first switch tube, the second switch tube and the third switch tube are all gates of N-channel MOS tubes;

[0029] The input ends of the first switch tube, the second switch tube and the third switch tube are all drains of N-channel MOS tubes;

[0030] The output ends of the first switch tube, the second switch tube and the third switch tube are all sources of N-channel MOS tubes.

[0031] Optionally, when the level control signal output by the main control module is at a high level, the first switch tube and the second switch tube are turned on, the third switch tube is turned off, and the common end of the multi-way switch is connected to the normally open end, so that the ground end of the main control module is connected to the first end of the sampling resistor, and the voltage sampling end is connected to the second end of the sampling resistor.

[0032] When the level control signal output by the main control module is at a low level, the first switch tube and the second switch tube are disconnected, the third switch tube is turned on, and the common end of the multi-way switch is connected to the normally closed end, so that the ground end of the main control module is connected to the second end of the sampling resistor, and the voltage sampling end is connected to the first end of the sampling resistor.

[0033] A second aspect of the present invention provides a bidirectional current sampling method, which is applied to the bidirectional current sampling circuit described in any one of the first aspect embodiments, wherein the main control module is configured as follows:

[0034] Generate a level control signal, and send it to the sampling point switching module and the ground switching module respectively through the output end of the main control module;

[0035] In the first target connection state, if the sampling resistor is in a first current direction, the voltage of the sampling resistor is sampled through the voltage sampling end, and the current in the first current direction is obtained according to the sampled voltage; wherein the first current direction is from the second end of the sampling resistor to the first end of the sampling resistor;

[0036] In the second target connection state, if the sampling resistor is in the second current direction, the voltage of the sampling resistor is sampled through the voltage sampling end, and the current in the second current direction is obtained according to the sampled voltage; wherein the second current direction is from the first end of the sampling resistor to the second end of the sampling resistor.

[0037] Compared with the prior art, the embodiment of the present invention provides a bidirectional current sampling circuit and method, wherein the bidirectional current sampling circuit realizes bidirectional current sampling by switching the connection positions of the voltage sampling terminal and the ground terminal of the main control module at both ends of the sampling resistor. In addition, the present invention only uses one sampling resistor, which effectively reduces power loss; at the same time, only one voltage sampling terminal is used, which saves the number of ADC sampling pins (i.e., voltage sampling terminals) and makes full use of resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 is a structural schematic diagram of an optional embodiment of a bidirectional current sampling circuit provided by the present invention;

[0039] Figure 2 is a circuit schematic diagram of an optional embodiment of the bidirectional current sampling circuit provided by the present invention;

[0040] Figure 3 It is a structural schematic diagram of another optional embodiment of the bidirectional current sampling circuit provided by the present invention. DETAILED DESCRIPTION

[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this technical field without creative work are within the scope of protection of the present invention.

[0042] See also Figure 1 , is a structural schematic diagram of an optional embodiment of the bidirectional current sampling circuit provided by the present invention.

[0043] The embodiment of the present invention provides a bidirectional current sampling circuit, including a sampling point switching module 100, a ground switching module 200, a main control module 300 and a sampling resistor R1;

[0044] The main control module 300 is used to generate a level control signal, and send it to the sampling point switching module 100 and the ground switching module 200 respectively through the output terminal CON_S of the main control module 300;

[0045] The sampling point switching module 100 is used to control the voltage sampling terminal ADC_C of the main control module 300 to switch between the first end of the sampling resistor R1 and the second end of the sampling resistor R1 according to the received level control signal;

[0046] The ground switching module 200 is used to control the ground terminal GND1 of the main control module 300 to switch between the first end of the sampling resistor R1 and the second end of the sampling resistor R1 according to the received level control signal;

[0047] The main control module 300 is also used to sample the voltage of the sampling resistor R1 through the voltage sampling terminal ADC_C in a target connection state, and obtain the current of the sampling resistor R1 according to the sampled voltage; wherein the target connection state is a first target connection state or a second target connection state, the first target connection state is that the ground terminal GND1 of the main control module 300 is connected to the first end of the sampling resistor R1, and the voltage sampling terminal ADC_C is connected to the second end of the sampling resistor R1, and the second target connection state is that the ground terminal GND1 of the main control module 300 is connected to the second end of the sampling resistor R1, and the voltage sampling terminal ADC_C is connected to the first end of the sampling resistor R1.

[0048] Specifically, when the main control module 300 sends a specific level control signal, the sampling point switching module 100 and the ground switching module 200 will switch according to the received level control signal, change the connection state with the sampling resistor R1, and the voltage sampling terminal ADC_C can obtain valid voltage sampling data of the sampling resistor R1 only when the connection state is in the first target connection state or the second target connection state, and in other connection states, such as when the voltage sampling terminal ADC_C and the ground terminal GND1 are both connected to the same end of the sampling resistor R1, the voltage sampling terminal ADC_C will not be able to obtain valid voltage sampling data.

[0049] That is, if the level control signal causes the ground terminal GND1 of the main control module 300 to be connected to the first end of the sampling resistor R1, and the voltage sampling terminal ADC_C to be connected to the second end of the sampling resistor R1, effective voltage sampling is performed at this time, specifically, the voltage when the sampling resistor R1 is in the first current direction is collected; wherein the first current direction is from the second end of the sampling resistor R1 to the first end of the sampling resistor R1.

[0050] On the contrary, if the level control signal causes the ground terminal GND1 of the main control module 300 to be connected to the second end of the sampling resistor R1, and the voltage sampling terminal ADC_C to be connected to the first end of the sampling resistor R1, voltage sampling in the opposite direction is performed at this time. Specifically, the voltage when the sampling resistor R1 is in the first current direction is collected; wherein the second current direction is from the first end of the sampling resistor R1 to the second end of the sampling resistor R1; this ensures that the ground terminal GND1 and the voltage sampling terminal ADC_C of the main control module 300 are always connected to the two ends of the sampling resistor R1.

[0051] That is to say, when the voltage sampling terminal ADC_C is connected to the second end of the sampling resistor R1, the ground terminal GND1 of the main control module is connected to the first end of the sampling resistor R1, and the sampling resistor R1 is in the first current direction, the voltage of the sampling resistor R1 is sampled, and the current in the first current direction is obtained according to the sampled voltage.

[0052] When the voltage sampling terminal ADC_C is connected to the first end of the sampling resistor R1, the ground terminal GND1 of the main control module is connected to the second end of the sampling resistor R1, and the sampling resistor R1 is in the second current direction, the voltage of the sampling resistor R1 is sampled, and the current in the second current direction is obtained according to the sampled voltage.

[0053] The main control module 300 also generates a voltage V sampling Calculate the current I flowing through the sampling resistor R1 sampling , that is I sampling =V sampling / R1.

[0054] The bidirectional current sampling circuit provided in the embodiment of the present invention realizes bidirectional sampling of current by switching the connection positions of the voltage sampling terminal ADC_C and the ground terminal GND1 at both ends of the sampling resistor R1, that is, when the current direction changes, the forward voltage direction at both ends of the sampling resistor R1 will also change accordingly. In order to measure effective voltage data, by switching the connection positions of the voltage sampling terminal ADC_C and the ground terminal GND1 at both ends of the sampling resistor R1, the voltage data corresponding to the forward and reverse currents can be collected respectively. In addition, the embodiment of the present invention only uses a single sampling resistor (R1), which effectively reduces power loss. Moreover, only one ADC sampling pin, i.e., a single voltage sampling pin, needs to be provided, which saves the number of ADC sampling pins (i.e., voltage sampling terminals) and makes full use of resources.

[0055] As an optional solution of the above solution, the ground switching module 200 has at least one control terminal, one input terminal and two output terminals;

[0056] The control end of the ground switching module 200 is connected to the output end CON_S of the main control module 300, the input end of the ground switching module 200 is connected to the ground end GND1 of the main control module 300, the first output end of the ground switching module 200 is connected to the first end of the sampling resistor R1, and the second output end of the ground switching module 200 is connected to the second end of the sampling resistor R1.

[0057] It is worth noting that, in the embodiment of the present invention, only the port in the ground switching module 200 connected to the ground terminal GND1 of the main control module 300 is defined as the input terminal of the ground switching module 200, and other ports are defined in other ways according to the functions they have in specific implementations. In order to more clearly describe the technical solution provided by the embodiment of the present invention, some specific embodiments are provided below for reference:

[0058] Example 1: The grounding switch module 200 includes a multi-way switch (such as a single-pole double-throw switch); wherein the control end of the multi-way switch is the control end of the grounding switch module 200, the common end is the input end of the grounding switch module 200, the normally closed end is the first output end of the grounding switch module 200, and the normally open end is the second output end of the grounding switch module 200. In this case, the grounding switch module 200 has a control end, an input end, and two output ends.

[0059] Example 2: The grounding switching module 200 includes a first switch unit and a second switch unit; wherein, the control end of the first switch unit is connected to the first output end (outputting a first level control signal) of the main control module 300, the output end of the first switch unit is the first output end of the grounding switching module 200, and the input end of the first switch unit is the input end of the grounding switching module 200; the control end of the second switch unit is connected to the second output end (outputting a second level control signal) of the main control module 300, the output end of the second switch unit is the second output end of the grounding switching module 200, and the input end of the second switch unit is connected to the input end of the first switch unit; at this time, the grounding switching module 200 has two control ends, one input end and two output ends. Obviously, the main control module also has two corresponding output ends for connecting to the two control ends of the grounding switching module 200 respectively.

[0060] It should be noted that the first switch unit can be a switch tube or a single-pole single-throw switch, and the second switch unit can be a switch tube or a single-pole single-throw switch; for example, the first switch unit and the second switch unit are both N-channel MOS tubes, then the first level control signal and the second level control signal are opposite, so that the ground terminal and the voltage sampling terminal of the main control module are simultaneously connected to different ends of the sampling resistor, thereby realizing bidirectional current sampling. The embodiment of the present invention does not limit the specific content of the first level control signal and the second level control signal, it only needs to ensure that the ground terminal and the voltage sampling terminal of the main control module can be simultaneously connected to different ends of the sampling resistor, and other situations will not be repeated here.

[0061] Example 3: See Figure 2 , is a circuit schematic diagram of an optional embodiment of the bidirectional current sampling circuit provided by the present invention, wherein the ground switching module 200 includes a first switch tube U1, a second switch tube U2 and a third switch tube U3;

[0062] The control end of the first switch tube U1 is the control end of the ground switching module 200, the output end of the first switch tube U1 is the first output end of the ground switching module 200, and the input end of the first switch tube U1 is the input end of the ground switching module 200;

[0063] The control end of the second switch tube U2 is connected to the control end of the first switch tube U1, the output end of the second switch tube U2 is connected to the second end of the sampling resistor R1, and the input end of the second switch tube U2 is used to receive the first input voltage V1;

[0064] The control end of the third switch tube U3 is connected to the input end of the second switch tube U2 , the output end of the third switch tube U3 is the second output end of the ground switching module 200 , and the input end of the third switch tube U3 is connected to the input end of the first switch tube U1 .

[0065] In the embodiment of the present invention, in order to enable the ground terminal GND1 to switch and connect between the two ends of the sampling resistor R1 at a high speed to reduce the probability / time of floating ground, all the switch devices in the ground switching module 200 are switch tubes. In addition, in order to reduce the number of output terminals used by the main control module 300, three switch tubes are used for combined connection.

[0066] It should be noted that the ground switching module 200 is used to control the on-off state of the first switch tube U1, the second switch tube U2 and the third switch tube U3 according to the level control signal, so that the ground terminal GND1 of the main control module 300 is switched between the first end and the second end of the sampling resistor R1; wherein the on-off state of the third switch tube U3 is determined by the on-off state of the second switch tube U2 and the first input voltage V1.

[0067] Specifically, the main control module 300 outputs a level control signal through the output terminal CON_S to control the conduction and disconnection of the first switch tube U1 and the second switch tube U2. When the level control signal turns on the first switch tube U1, the ground terminal GND1 of the main control module 300 is connected to the first end of the sampling resistor R1; at the same time, the second switch tube U2 is also turned on. Since the conduction voltage drop is basically 0, the input terminal voltage of the second switch tube U2 is equal to the second terminal voltage of the sampling resistor R1. The control terminal of the third switch tube U3 is connected to the input terminal of the second switch tube U2, and the output terminal of the third switch tube U3 is connected to the second end of the sampling resistor R1, then the control terminal and the output terminal voltage of the third switch tube U3 are equal, therefore, the conduction condition of the third switch tube U3 is not met, and the third switch tube U3 is disconnected; at this time, the ground switching module 200 connects the ground terminal GND1 to the first end of the sampling resistor R1 through the conduction of the first switch tube U1.

[0068] When the level control signal disconnects the first switch tube U1 and the second switch tube U2, since the control end of the third switch tube U3 is connected to the input end of the second switch tube U2, and the input end of the second switch tube U2 receives the first input voltage V1 (a high voltage that can turn on the third switch tube U3), the voltage of the control end of the third switch tube U3 is the first input voltage V1, which satisfies the turn-on condition of the third switch tube U3, so that the third switch tube U3 is turned on; at this time, the ground switching module 200 connects the ground terminal GND1 to the second end of the sampling resistor R1 through the turn-on of the third switch tube U3. In the embodiment of the present invention, the input end of the second switch tube U2 is defined as the voltage access end of the ground switching module 200 according to its functional role when it is implemented.

[0069] It can be understood that the first switch tube U1, the second switch tube U2 and the third switch tube U3 can be commonly used triodes, MOS tubes, or other types of switching devices. The embodiment of the present invention does not make specific limitations and is determined when the embodiment of the present invention is applied to a specific product or technology.

[0070] Combination Figure 2 As shown, as an optional solution of the above solution, the first switch tube U1, the second switch tube U2 and the third switch tube U3 are all N-channel MOS tubes;

[0071] The control terminals of the first switch tube U1, the second switch tube U2 and the third switch tube U3 are all gates of N-channel MOS tubes;

[0072] The input ends of the first switch tube U1, the second switch tube U2 and the third switch tube U3 are all drains of N-channel MOS tubes;

[0073] The output ends of the first switch tube U1 , the second switch tube U2 and the third switch tube U3 are all sources of N-channel MOS tubes.

[0074] Specifically, in the embodiment of the present invention, the first switch tube U1, the second switch tube U2 and the third switch tube U3 are all N-channel MOS tubes; wherein, the N-channel MOS tube has a significant advantage in the speed of conduction and disconnection due to its low on-resistance and high efficiency electron mobility, meets the fast switching requirements of the bidirectional current sampling circuit provided in the embodiment of the present invention, and effectively reduces the power consumption of the switch tube when it is turned on.

[0075] When implementing it, Figure 2As shown, the circuit connection logic of the ground switching module 200 is as follows: ① The G terminal (gate) of the N-channel MOS tube U1 is connected to the output terminal CON_S of the main control module 300 (such as MCU), the D terminal (drain) of U1 is connected to the ground terminal GND1 of the MCU, and the S terminal (source) of U1 is connected to the a terminal of the sampling resistor R1; ② The G terminal (gate) of the N-channel MOS tube U2 is connected to the G terminal (gate) of U1, the S terminal (source) of U2 is connected to the b terminal of the sampling resistor R1, and the D terminal (drain) of U2 is used to receive the first input voltage V1; ③ The G terminal (gate) of the N-channel MOS tube U3 is connected to the D terminal (drain) of U2, the D terminal (drain) of U3 is connected to the D terminal (drain) of U1, and the S terminal (source) of U3 is connected to the b terminal of the sampling resistor R1.

[0076] Combination Figure 2 As shown, as an optional solution of the above solution, the sampling point switching module 100 includes a multi-way switch S1;

[0077] The control end of the multi-way switch S1 is connected to the output end CON_S of the main control module 300, the normally closed end of the multi-way switch S1 is connected to the first end of the sampling resistor R1, the normally open end of the multi-way switch S1 is connected to the second end of the sampling resistor R1, and the common end of the multi-way switch S1 is connected to the voltage sampling end ADC_C.

[0078] It should be noted that the sampling point switching module 100 is used to control the common end (pin 1) of the multi-way switch S1 to switch between the normally closed end (pin 2) and the normally open end (pin 3) according to the level control signal, so that the voltage sampling end ADC_C of the main control module 300 is switched between the first end and the second end of the sampling resistor R1.

[0079] Specifically, the main control module 300 outputs a level control signal through the output terminal CON_S to determine the working state of the multi-way switch S1. When the level control signal does not trigger the multi-way switch S1 to act, the multi-way switch S1 remains in a normally closed state, so that the first end of the sampling resistor R1 is connected to the voltage sampling terminal ADC_C; at this time, the main control module 300 will read the voltage data from the first end of the sampling resistor R1.

[0080] When the level control signal triggers the multi-way switch S1 to operate, the multi-way switch S1 switches to a normally open state, so that the second end of the sampling resistor R1 is connected to the voltage sampling end ADC_C; at this time, the main control module 300 will read the voltage data from the second end of the sampling resistor R1.

[0081] When implementing it, Figure 2As shown, the circuit connection logic of the sampling point switching module 100 is as follows: the sampling point switching module 100 includes a multi-way switch S1 (for example, a single-pole double-throw switch); the common end (pin 1) of the multi-way switch S1 is connected to the voltage sampling end ADC_C of the main control module 300 (MCU), the normally closed end (pin 2) and the normally open end (pin 3) are respectively connected to the two ends (end a and end b) of the sampling resistor R1, and the control end of the multi-way switch S1 is connected to the output end CON_S of the main control module 300 (MCU).

[0082] See also Figure 3 , is a structural schematic diagram of another optional embodiment of the bidirectional current sampling circuit provided by the present invention.

[0083] In an optional embodiment, the bidirectional current sampling circuit further includes: a power supply transformation module 400;

[0084] The power supply transformer module 400 is used to transform the power supply voltage to generate the first input voltage V1 and the second input voltage V2; wherein the first input voltage V1 is output from the first output end of the power supply transformer module 400 to the input end of the second switch tube U2; the second input voltage V2 is output from the second output end of the power supply transformer module 400 to the power supply end VDD of the main control module.

[0085] Specifically, the power supply transformer module 400 can convert the power supply voltage into different voltages required by the ground switching module 200 and the main control module 300. For example, the first input voltage V1 is used to provide input voltage for the input end of the second switch tube U2 in the ground switching module 200; the second input voltage V2 is used to provide working voltage for the main control module 300.

[0086] When implementing it, Figure 2 As shown, the circuit connection logic of the power supply transformer module 400 is as follows: the power supply transformer module 400 includes a low dropout regulator (LDO) and a resistor R2; the input terminal IN of the LDO is used to receive the power supply voltage, which can be provided through the connecting line VBUS1-VBUS2, and the LDO steps down the power supply voltage to a second input voltage V2, and outputs the second input voltage V2 to the power supply terminal VDD of the main control module 300 (such as MCU) through the second terminal of the power supply transformer module 400; the resistor R2 is connected in series to the output terminal OUT of the LDO, and the second input voltage V2 is further stepped down to the first input voltage V1, and is output to the input terminal of the second switch tube U2 in the ground switching module 200 through the first terminal of the power supply transformer module 400. It is worth noting that Figure 2 The GND2 in FIG. 1 is the ground terminal of the LDO and can be connected to the permanent ground module 700 in the following embodiment.

[0087] Combination Figure 3 As shown, in an optional embodiment, the bidirectional current sampling circuit further includes: a first interface 500 and a second interface 600;

[0088] The power supply terminal VBUS1 of the first interface 500 is connected to the power supply terminal VBUS2 of the second interface 600 via a connecting line; wherein the connecting line is used to provide a second input voltage for the main control module 300;

[0089] The ground terminal VSS1 of the first interface 500 is connected to the first end of the sampling resistor R1 , and the second end of the sampling resistor R1 is connected to the ground terminal VSS2 of the second interface 600 .

[0090] Specifically, by connecting the power supply terminal VBUS1 of the first interface 500 and the power supply terminal VBUS2 of the second interface 600, a stable power transmission path can be provided for the entire circuit. Obviously, the connection line VBUS1-VBUS2 can be used to provide a second input voltage for the main control module 300. At the same time, by connecting the ground terminal VSS1 of the first interface 500 and the ground terminal VSS2 of the second interface 600, a complete current loop can be formed. It is worth noting that Figure 2 CC1 and CC2 are respectively the communication end of the first interface 500 and the communication end of the second interface 600, and the connecting line CC1-CC2 is a signal line.

[0091] Combination Figure 3 As shown, in an optional embodiment, the bidirectional current sampling circuit further includes: a permanent grounding module 700;

[0092] A first end of the permanent grounding module 700 is connected to the grounding terminal GND1 of the main control module 300 , and a second end of the permanent grounding module 700 is connected to the grounding terminal of the first interface 500 .

[0093] In order to realize bidirectional current sampling, the ground terminal GND1 of the main control module 300 needs to be connected to either end (end a or end b) of the sampling resistor R1. When the ground terminal GND1 is powered on or switched between a and b, the main control module 300 may be in a floating state for a short time. Therefore, the present invention uses an auxiliary grounding circuit (permanent grounding module 700) to ensure that the ground terminal GND1 of the main control module 300 always maintains a reliable connection, realizes switching and continuous current, and avoids floating ground phenomenon.

[0094] When implementing it, Figure 2As shown, the circuit connection logic of the permanent grounding module 700 is as follows: the permanent grounding module 700 includes a resistor R3; the first end of the resistor R3 is connected to the ground terminal GND1 of the main control module 300 (MCU), and the second end of the resistor R3 is connected to the connecting line VSS1-R1; similarly, the second end of the resistor R3 can also be connected to the connecting line VSS2-R1.

[0095] As an optional solution of the above solution, when the level control signal output by the main control module 300 is at a high level, the first switch tube U1 and the second switch tube U2 are turned on, the third switch tube U3 is turned off, and the common end (pin 1) of the multi-way switch S1 is connected to the normally open end (pin 3), so that the ground end GND1 of the main control module 300 is connected to the first end of the sampling resistor R1, and the voltage sampling end ADC_C is connected to the second end of the sampling resistor R1.

[0096] When the level control signal output by the main control module 300 is at a low level, the first switch tube U1 and the second switch tube U2 are disconnected, the third switch tube U3 is turned on, and the common end (pin 1) of the multi-way switch S1 is connected to the normally closed end (pin 2), so that the ground end GND1 of the main control module 300 is connected to the second end of the sampling resistor R1, and the voltage sampling end ADC_C is connected to the first end of the sampling resistor R1.

[0097] It should be noted that the generation of the level control signal in the embodiment of the present invention includes but is not limited to any one of the following methods:

[0098] (1) The level control signal can be a preset waveform signal, which can be at least one of a pulse width modulation signal (PWM) and a square wave signal; by alternating the high and low levels of the preset waveform signal, the main control module 300 does not need to know the current direction passing through the sampling resistor R1 (there is always a specific level matching the current direction), so that the main control module 300 can obtain valid voltage sampling signals at intervals.

[0099] (2) By receiving other indication signals, the main control module 300 can be triggered to send a high level or a low level according to the indication.

[0100] (3) According to the value change of the current voltage sampling terminal ADC_C, the main control module 300 can be triggered to send a level control signal opposite to the current output level. For example, when the level control signal is at a high level at the current moment, the value of the voltage sampling terminal ADC_C is valid (positive value), but after the current direction changes, the value measured by the voltage sampling terminal ADC_C remains at 0 (or the minimum extreme value) within a preset time, and the main control module 300 changes the output level to a low level.

[0101] When implementing it, Figure 2 As shown, when the current direction is from end b to end a, and the level control signal output by the main control module 300 (MCU) through the output terminal CON_S is high, the common terminal (pin 1) of the control multi-way switch S1 is connected to the normally open terminal (pin 3), and the voltage sampling terminal ADC_C of the MCU is connected to the end b of the sampling resistor R1; at the same time, the high-level control signal also controls the G terminals (gates) of the two N-channel MOS tubes U1 and U2, so that U1 and U2 are turned on at a high level, and the ground terminal GND1 of the MCU is connected to the end a of the sampling resistor R1; because the D terminal (drain) of U2 is connected to the G terminal (gate) of the N-channel MOS tube U3, the G terminal and the S terminal of U3 are at the same level (low level for U3), and the state of U3 is cut off (disconnected). At this time, the voltage difference across the sampling resistor R1 is sampled and processed in the main control module 300 to obtain a current from end b to end a.

[0102] When the current direction is from end a to end b, and the level control signal output by the main control module 300 (MCU) through the output terminal CON_S is low, the common terminal (pin 1) of the control multi-way switch S1 is connected to the normally closed terminal (pin 2), and the voltage sampling terminal ADC_C of the MCU is connected to the end a of the sampling resistor R1; at the same time, the low-level control signal also controls the G terminals (gates) of the two N-channel MOS tubes U1 and U2, so that the G terminals of U1 and U2 are low level, the state is cut off (disconnected), and the input terminal of U2 is used to receive the first input voltage V1; because the G terminal of the N-channel MOS tube U3 is connected to the input terminal of U2, the voltage of the G terminal of U3 is consistent with the first input voltage V1, that is, when U2 is cut off, the G terminal of U3 is high level, and the state of U3 is on, which can realize the connection between the ground terminal GND1 of the MCU and the end b of the sampling resistor R1. At this time, the voltage difference between the two ends of the sampling resistor R1 is sampled and processed in the main control module 300 to obtain a current with a direction from end a to end b.

[0103] An embodiment of the present invention further provides a bidirectional current sampling method, which is applied to the bidirectional current sampling circuit described in any of the above embodiments, wherein the main control module is configured as follows:

[0104] Generate a level control signal, and send it to the sampling point switching module and the ground switching module respectively through the output end of the main control module;

[0105] In the first target connection state, if the sampling resistor is in a first current direction, the voltage of the sampling resistor is sampled through the voltage sampling end, and the current in the first current direction is obtained according to the sampled voltage; wherein the first current direction is from the second end of the sampling resistor to the first end of the sampling resistor;

[0106] In the second target connection state, if the sampling resistor is in the second current direction, the voltage of the sampling resistor is sampled through the voltage sampling end, and the current in the second current direction is obtained according to the sampled voltage; wherein the second current direction is from the first end of the sampling resistor to the second end of the sampling resistor.

[0107] The above is only an optional implementation mode of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A bidirectional current sampling circuit, characterized in that: It includes a sampling point switching module, a grounding switching module, a main control module, a sampling resistor, a permanent grounding module and a first interface; The main control module is used to generate a level control signal, and send it to the sampling point switching module and the ground switching module respectively through the output end of the main control module; wherein the level control signal includes: alternating high and low levels; The sampling point switching module is used to control the voltage sampling end of the main control module to switch the connection between the first end of the sampling resistor and the second end of the sampling resistor according to the received level control signal; The ground switching module is used to control the ground terminal of the main control module to switch between the first end of the sampling resistor and the second end of the sampling resistor according to the received level control signal; The main control module is also used to sample the voltage of the sampling resistor through the voltage sampling end in a target connection state, and obtain the current of the sampling resistor according to the sampled voltage; wherein the target connection state is a first target connection state or a second target connection state, the first target connection state is that the ground end of the main control module is connected to the first end of the sampling resistor, and the voltage sampling end is connected to the second end of the sampling resistor, and the second target connection state is that the ground end of the main control module is connected to the second end of the sampling resistor, and the voltage sampling end is connected to the first end of the sampling resistor; A first end of the permanent grounding module is connected to a grounding end of the main control module, and a second end of the permanent grounding module is connected to a grounding end of the first interface.

2. The bidirectional current sampling circuit according to claim 1, characterized in that: The ground switching module has at least one control terminal, one input terminal and two output terminals; The control end of the ground switching module is connected to the output end of the main control module, the input end of the ground switching module is connected to the ground end of the main control module, the first output end of the ground switching module is connected to the first end of the sampling resistor, and the second output end of the ground switching module is connected to the second end of the sampling resistor.

3. The bidirectional current sampling circuit according to claim 2, characterized in that: The ground switching module includes a first switch tube, a second switch tube and a third switch tube; The control end of the first switch tube is the control end of the ground switching module, the output end of the first switch tube is the first output end of the ground switching module, and the input end of the first switch tube is the input end of the ground switching module; The control end of the second switch tube is connected to the control end of the first switch tube, the output end of the second switch tube is connected to the second end of the sampling resistor, and the input end of the second switch tube is used to receive a first input voltage; The control end of the third switch tube is connected to the input end of the second switch tube, the output end of the third switch tube is the second output end of the ground switching module, and the input end of the third switch tube is connected to the input end of the first switch tube.

4. The bidirectional current sampling circuit according to claim 3, characterized in that: The bidirectional current sampling circuit further includes: a power supply transformer module; The power supply transformer module is used to transform the power supply voltage to generate the first input voltage and the second input voltage; wherein the first input voltage is output from the first output end of the power supply transformer module to the input end of the second switch tube; and the second input voltage is output from the second output end of the power supply transformer module to the power supply end of the main control module.

5. The bidirectional current sampling circuit according to claim 3, characterized in that: The sampling point switching module includes a multi-way switch; The control end of the multi-way switch is connected to the output end of the main control module, the normally closed end of the multi-way switch is connected to the first end of the sampling resistor, the normally open end of the multi-way switch is connected to the second end of the sampling resistor, and the common end of the multi-way switch is connected to the voltage sampling end.

6. The bidirectional current sampling circuit according to claim 1, characterized in that: The bidirectional current sampling circuit further includes: a second interface; The power supply end of the first interface is connected to the power supply end of the second interface via a connecting line; wherein the connecting line is used to provide a second input voltage for the main control module; The ground terminal of the first interface is connected to the first end of the sampling resistor, and the second end of the sampling resistor is connected to the ground terminal of the second interface.

7. A bidirectional current sampling circuit as claimed in claim 3, characterized in that: The first switch tube, the second switch tube and the third switch tube are all N-channel MOS tubes; The control ends of the first switch tube, the second switch tube and the third switch tube are all gates of N-channel MOS tubes; The input ends of the first switch tube, the second switch tube and the third switch tube are all drains of N-channel MOS tubes; The output ends of the first switch tube, the second switch tube and the third switch tube are all sources of N-channel MOS tubes.

8. The bidirectional current sampling circuit according to claim 5, characterized in that: When the level control signal output by the main control module is at a high level, the first switch tube and the second switch tube are turned on, the third switch tube is turned off, and the common end of the multi-way switch is connected to the normally open end, so that the ground end of the main control module is connected to the first end of the sampling resistor, and the voltage sampling end is connected to the second end of the sampling resistor; When the level control signal output by the main control module is at a low level, the first switch tube and the second switch tube are disconnected, the third switch tube is turned on, and the common end of the multi-way switch is connected to the normally closed end, so that the ground end of the main control module is connected to the second end of the sampling resistor, and the voltage sampling end is connected to the first end of the sampling resistor.

9. A bidirectional current sampling method, applied to the bidirectional current sampling circuit according to any one of claims 1 to 8, wherein the main control module is configured as follows: Generate a level control signal, and send it to the sampling point switching module and the ground switching module respectively through the output end of the main control module; wherein, The level control signal includes: alternating high and low levels; In the first target connection state, if the sampling resistor is in a first current direction, the voltage of the sampling resistor is sampled through the voltage sampling end, and the current in the first current direction is obtained according to the sampled voltage; wherein the first current direction is from the second end of the sampling resistor to the first end of the sampling resistor; In the second target connection state, if the sampling resistor is in the second current direction, the voltage of the sampling resistor is sampled through the voltage sampling end, and the current in the second current direction is obtained according to the sampled voltage; wherein the second current direction is from the first end of the sampling resistor to the second end of the sampling resistor.

Citation Information

Patent Citations

  • Current sensing module and power conversion apparatus and electronic apparatus using the same

    US20160344290A1