Current sampling circuit and photovoltaic controller
By placing the sampling and amplification circuit at the front end of the inductor output measurement in the photovoltaic controller, and combining the voltage divider filtering circuit and microcontroller protection measures, the accuracy and safety of the photovoltaic controller in current sampling is solved, and higher current sampling accuracy and safety are achieved.
Patent Information
- Application Number
- CN202411859737.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-03-28
AI Technical Summary
Existing photovoltaic controllers have accuracy and safety issues in current sampling, especially under conditions such as overcharge, overdischarge, abnormal temperatures of lithium batteries, which may lead to inductor saturation, MOS tube damage and inrush current risks.
By placing the sampling and amplification circuit at the front end of the inductor output measurement of the circuit to be tested, the inductor current is collected and gain amplified in real time, and the voltage divider filter circuit is used to output real-time and mean current sampling signals. The microcontroller compares the charging overcurrent signal with the preset threshold and controls the on-off of the main control switch to achieve overcurrent protection.
It improves the accuracy and safety of current sampling, avoids the risk of inductance saturation and MOS tube damage, and enhances the controllability and stability of current sampling.
Smart Images

Figure CN119716209A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of photovoltaic power generation technology, and in particular to a current sampling circuit and a photovoltaic controller. Background Art
[0002] Photovoltaic controllers generally track the maximum power point by measuring the voltage and current on the output side, and the voltage and current sampling is usually placed at the back end of the output capacitor of the buck converter circuit (BUCK circuit). Since the inductor current of the buck converter circuit is a triangular wave, the control chip can only sample at a single point in a single control cycle, which reduces the accuracy of current sampling.
[0003] In addition, the battery end (BAT end) of the photovoltaic controller must be connected to the battery to charge the battery. The battery is generally a lithium battery. Under conditions such as overcharge, overdischarge, high or low temperature, the lithium battery protection board will be disconnected. The electrical equipment is connected to the lithium battery port or the load port of the controller. At this time, the load is at risk of impact surge current or short circuit, causing the output voltage to drop rapidly. The sampling circuit is on the back side of the output capacitor. Since overcurrent detection and protection cannot be performed, the inductor is saturated when the current rises to a certain value, aggravating the increase of the inductor current. There is a risk of burning out the MOS tube of the BUCK circuit and damaging the equipment, reducing the safety and controllability of current sampling. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide a current sampling circuit and a photovoltaic controller, which can collect and gain-amplify the inductor current of the circuit to be tested in real time by placing the sampling amplifier circuit at the output of the inductor in the circuit to be tested, that is, at the front end of the output capacitor of the circuit to be tested, and output the operational amplifier output signal. The operational amplifier output signal is branched, voltage-divided and filtered by the voltage divider filter circuit, and a real-time current sampling signal and a mean current sampling signal are output, thereby improving the accuracy of current sampling. The microcontroller compares the charging overcurrent signal with the preset signal threshold to control the on and off of the main control switch in the circuit to be tested according to the comparison result, thereby improving the safety and controllability of current sampling.
[0005] Based on the above purpose, in a first aspect of the present application, a current sampling circuit is provided, wherein the current sampling circuit includes a sampling amplifier circuit, a voltage divider filter circuit and a microcontroller:
[0006] The sampling and amplifying circuit is connected to the circuit to be tested; the sampling and amplifying circuit is respectively connected to the voltage-dividing and filtering circuit and the microcontroller; the voltage-dividing and filtering circuit is connected to the microcontroller;
[0007] The sampling and amplifying circuit is used to receive the enabling control signal sent by the microcontroller, collect and gain-amplify the inductor current of the circuit to be tested in real time, output the operational amplifier output signal, and send the operational amplifier output signal to the voltage divider filter circuit;
[0008] The voltage divider filter circuit is used to divide the output signal of the operational amplifier, output a charging overcurrent signal and a current sampling signal, divide the voltage and filter the current sampling signal, output a real-time current sampling signal and an average current sampling signal, and send the charging overcurrent signal, the real-time current sampling signal and the average current sampling signal to the microcontroller;
[0009] The microcontroller is used to output an enable control signal in response to detecting that the circuit under test meets the charging condition, and send the enable control signal to the sampling and amplifying circuit; receive the real-time current sampling signal and the average current sampling signal to perform current sampling on the circuit under test; compare whether the charging overcurrent signal is greater than a preset signal threshold, so as to control the on and off of the main control switch in the circuit under test based on the comparison result.
[0010] In a second aspect of the present application, a photovoltaic controller is provided, wherein the photovoltaic controller includes the current sampling circuit as described in the first aspect.
[0011] From the above description, it can be seen that the current sampling circuit provided in the embodiment of the present application collects and gain-amplifies the inductor current of the circuit to be tested in real time by placing the sampling amplifier circuit at the output of the inductor in the circuit to be tested, that is, at the front end of the output capacitor of the circuit to be tested, outputs the operational amplifier output signal, and divides, divides and filters the operational amplifier output signal by the voltage divider filter circuit, outputs the real-time current sampling signal and the mean current sampling signal, and compares the charging overcurrent signal with the preset signal threshold by the microcontroller to control the on and off of the main control switch in the circuit to be tested according to the comparison result.
[0012] Compared with the circuit in the prior art in which the sampling of voltage and current is usually placed at the rear end of the output capacitor of the buck conversion circuit, the accuracy of current sampling as well as the safety and controllability of current sampling are improved.
[0013] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0015] Figure 1 One of the structural schematic diagrams of an exemplary current sampling circuit according to an embodiment of the present application is shown;
[0016] Figure 2 A second structural schematic diagram of an exemplary current sampling circuit according to an embodiment of the present application is shown;
[0017] Figure 3 A third structural schematic diagram of an exemplary current sampling circuit according to an embodiment of the present application is shown;
[0018] Figure 4 A schematic diagram of a curve of an exemplary current sampling signal according to an embodiment of the present application is shown;
[0019] Figure 5 A curve diagram of an exemplary charging overcurrent signal according to an embodiment of the present application is shown;
[0020] Figure 6 A curve diagram of the wave-by-wave current limiting protection of an exemplary charging overcurrent signal according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0021] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0022] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be the usual meanings understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in the embodiments of the present application do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0023] Research has found that photovoltaic controllers generally track the maximum power point by measuring the voltage and current on the output side, and the voltage and current sampling is usually placed at the back end of the output capacitor of the buck converter circuit (BUCK circuit). The triangular wave of the inductor current of the buck converter circuit can achieve a stable average current output after being filtered by the output capacitor, thereby tracking the maximum power point. However, since the inductor current of the buck converter circuit is a triangular wave, the control chip can only sample at a single point within a single control cycle, which reduces the accuracy of current sampling.
[0024] In addition, the battery terminal (BAT terminal) of the photovoltaic controller must be connected to a battery to charge the battery. Since the battery is always connected to the BAT terminal, there will be no large voltage fluctuations at the BAT terminal.
[0025] At present, storage batteries generally use lithium batteries. When the lithium battery is overcharged, over-discharged, or the temperature is too high or too low, the lithium battery protection board will be disconnected. The electrical equipment is connected to the lithium battery port or the load port of the controller. In this case, the photovoltaic panel connected to the input end of the photovoltaic controller will directly convert energy to power the electrical equipment or load.
[0026] In another case, when the lithium battery is overcharged, over-discharged, or the temperature is too high or too low, the photovoltaic controller will not work based on the battery, but the output side of the photovoltaic panel will directly power the load. At this time, the load is at risk of impact surge current or short circuit, causing the output voltage to drop rapidly. Since the input voltage remains unchanged at this time, according to the principle of conservation of energy, the inductor in the BUCK circuit and the output current on the MOS tube will rise rapidly to quickly charge the output capacitor that reduces the voltage. The sampling circuit is on the back side of the output capacitor and cannot perform overcurrent detection and protection. If the current continues to rise, it will saturate the inductor when it exceeds a certain value, aggravating the increase in the inductor current until it is out of control. There is a risk of burning out the MOS tube of the BUCK circuit and damaging the equipment, reducing the safety and controllability of current sampling.
[0027] Based on this, an embodiment of the present application provides a current sampling circuit, which collects and gain-amplifies the inductor current of the circuit to be tested in real time by placing a sampling amplifier circuit at the output of the inductor in the circuit to be tested, that is, at the front end of the output capacitor of the circuit to be tested, and outputs an operational amplifier output signal. The operational amplifier output signal is branched, voltage-divided and filtered by a voltage divider filter circuit, and a real-time current sampling signal and a mean current sampling signal are output, thereby improving the accuracy of current sampling. The microcontroller compares the charging overcurrent signal with a preset signal threshold to control the on and off of the main control switch in the circuit to be tested according to the comparison result, thereby improving the safety and controllability of current sampling.
[0028] Figure 1One of the structural schematic diagrams of an exemplary current sampling circuit according to an embodiment of the present application is shown.
[0029] The current sampling circuit provided in the embodiment of the present application can be applied to a photovoltaic controller; wherein the photovoltaic controller is a device that controls the charging and discharging of a battery in a photovoltaic power generation system, and the photovoltaic charging and discharging controller is usually provided with a photovoltaic port (PV port), a battery port (BAT port) and a load port (LOAD port), wherein the photovoltaic port is connected to a photovoltaic panel for energy input; the battery port is connected to a battery for charging the battery or supplying power to a load; and the load port is connected to a load for supplying power to electrical equipment.
[0030] like Figure 1 As shown in , the current sampling circuit 10 may include a sampling and amplifying circuit 110 , a voltage dividing and filtering circuit 120 and a microcontroller 130 .
[0031] The sampling and amplifying circuit 110 is connected to the circuit to be tested 20 ; the sampling and amplifying circuit 110 is respectively connected to the voltage-dividing and filtering circuit 120 and the microcontroller 130 ; the voltage-dividing and filtering circuit 120 is connected to the microcontroller 130 .
[0032] Among them, the sampling and amplifying circuit 110 is used to receive the enable control signal sent by the microcontroller, collect and gain amplify the inductor current of the circuit under test 20 in real time, output the operational amplifier output signal, and send the operational amplifier output signal to the voltage divider filter circuit 120.
[0033] In the embodiment of the present application, the circuit to be tested 20 generally refers to a buck conversion circuit (ie, a BUCK circuit), which can be understood as a common direct current-to-direct current (DC-DC) converter for converting a higher input voltage into a lower output voltage.
[0034] Among them, the circuit to be tested 20 may include a main control switch (MOSFET, MOS switch) for controlling the on and off of current; an inductor (L) for storing energy and releasing energy when the switch is turned off; a diode (D) for providing a freewheeling path when the switch is turned off; a capacitor (C) for smoothing the output voltage; and a load (R) for connecting to an electrical device at the output end.
[0035] Here, in the circuit to be tested 20, when the MOS switch is turned on, the input voltage is directly added to the inductor, and the inductor begins to store energy. At this time, the current flows from the input power supply to the inductor and then to the load; when the MOS switch is turned off, the current in the inductor cannot change instantaneously, so the inductor will try to keep the current flowing, and the inductor continues to supply power to the load through the diode, and at the same time charges the capacitor to maintain the stability of the output voltage.
[0036] Figure 2 A second structural schematic diagram of an exemplary current sampling circuit according to an embodiment of the present application is shown.
[0037] Further, such as Figure 2 As shown in , the sampling and amplifying circuit 110 includes a sampling resistor RS1, a differential mode filter 111 and an operational amplifier U2.
[0038] In the embodiment of the present application, the sampling resistor RS1 includes a current input terminal (L_I_IN) for indicating that the current enters the corresponding port; and a current output terminal (L_I_OUT) for indicating that the current enters and exits the corresponding port.
[0039] The operational amplifier U2 includes a first pin (IN-) for receiving an inverting input of a signal; a second pin (IN+) for receiving a non-inverting input of a signal; a third pin (OUT) for outputting a gain-amplified signal; a fourth pin (EN) for receiving an enable control signal; a fifth pin (REF) for inputting a reference voltage; a sixth pin (VS) for receiving an external positive power supply (VCC) input; and a seventh pin (GND) for grounding (AGND).
[0040] like Figure 2 As shown in the figure, the sampling resistor RS1 is connected in series with the inductor in the circuit to be tested 20; the current input terminal (L_I_IN) and the current output terminal (L_I_OUT) of the sampling resistor RS1 are connected to the first end and the second end of the differential mode filter 111; the third end and the fourth end of the differential mode filter 111 are respectively connected to the first pin (IN-) and the second pin (IN+) of the operational amplifier U2; the third pin (OUT) of the operational amplifier U2 is connected to the voltage divider filter circuit 120; the fourth pin (EN) of the operational amplifier U2 is connected to the fourth pin of the microcontroller 130; the sixth pin (VS) of the operational amplifier U2 is connected to the external positive power supply (VCC); the seventh pin (GND) of the operational amplifier U2 is grounded (AGND).
[0041] Here, since the microcontroller 130 is generally a common negative electrode, the sampling resistor RS1 is placed at the high-side positive electrode of the operational amplifier U2, and the operational amplifier U2 is generally a high-precision current detection amplifier with a wide common-mode voltage range; wherein, since the sampling resistor RS1 is at the high-side positive electrode, the power supply signal and voltage signal of the current sampling circuit 10 are both low-voltage signals.
[0042] The sampling resistor RS1 is used to collect the inductor current of the inductor in real time and convert the inductor current into a corresponding voltage signal.
[0043] In the embodiment of the present application, the sampling resistor RS1 can be a current sampling resistor, or an alloy resistor or a shunt, which is usually placed at the output of the inductor of the circuit to be tested 20, that is, at the front end of the output capacitor of the circuit to be tested 20. The sampling resistor RS1 can collect the rapidly rising inductor current in the circuit to be tested 20 and the current signal flowing through the MOS switch in each sampling period to perform real-time current sampling on the circuit to be tested 20.
[0044] The differential mode filter 111 is used to filter the voltage signal to attenuate the differential noise in the voltage signal, so as to improve the accuracy of current sampling.
[0045] The differential mode filter 111 includes a sixth resistor R6, a seventh resistor R7 and a first capacitor C1. When the operational amplifier U2 is damaged, the current limiting of the sixth resistor R6 and the seventh resistor R7 is used to protect the low voltage power supply signal of the current sampling circuit 10 and the microcontroller 130.
[0046] like Figure 2 As shown in the figure, the first end of the sixth resistor R6 and the first end of the seventh resistor R7 are respectively connected to the current input end (L_I_IN) and the current output end (L_I_OUT) of the sampling resistor RS1; the second end of the seventh resistor R7 and the second end of the first capacitor C1 are respectively connected to the first pin (IN-) of the operational amplifier U2; the second end of the sixth resistor R6 and the first end of the first capacitor C1 are respectively connected to the second pin (IN+) of the operational amplifier U2.
[0047] The operational amplifier U2 is used to receive the enable control signal sent by the microcontroller to control whether the sampling amplifier circuit performs current sampling; amplify the voltage signal, output the operational amplifier output signal, and send the operational amplifier output signal to the voltage divider filter circuit 120.
[0048] The operational amplifier U2 is used to amplify the voltage signal sent by the sampling resistor RS1 according to a preset multiple.
[0049] The operational amplifier U2 receives the enable control signal (PWR_SAVE signal) sent by the microcontroller 130. When there is energy input to the photovoltaic port (PV port) of the photovoltaic controller, the PWR_SAVE signal will be set high to control the operational amplifier U2 to perform current sampling; when there is no energy input to the photovoltaic port of the photovoltaic controller, the PWR_SAVE signal will be set low to control the operational amplifier U2 to stop current sampling, so as to reduce the power consumption of the current sampling circuit 10 and save the energy consumption of the photovoltaic controller.
[0050] Figure 3A third structural schematic diagram of an exemplary current sampling circuit according to an embodiment of the present application is shown.
[0051] Further, such as Figure 3 As shown in , the current sampling circuit 10 may further include a bias voltage circuit 140 .
[0052] The bias voltage circuit 140 is connected to the sampling and amplifying circuit 110 .
[0053] The bias voltage circuit 140 is used to provide a bias voltage for the operational amplifier U2 in the sampling and amplifying circuit 110 when the inductor current is a preset value, so as to avoid the problems of small current sampling blind area and negative current detection existing in the sampling and amplifying circuit 110.
[0054] Here, the preset value is usually set to 0; the bias voltage is generally set in a voltage range that is greater than the offset voltage of the operational amplifier U2 itself.
[0055] like Figure 2 As shown in , the bias voltage circuit 140 includes a fifth resistor R5 and an eighth resistor R8.
[0056] Among them, the first end of the fifth resistor R5 and the first end of the eighth resistor R8 are respectively connected to the fifth pin (REF) of the operational amplifier U2; the second end of the fifth resistor R5 is connected to the external positive power supply (VCC); the second end of the eighth resistor R8 is grounded (AGND).
[0057] Further, such as Figure 2 As shown in , the voltage-dividing and filtering circuit 120 includes a protection circuit 121 , a voltage-dividing circuit 122 , a first filtering circuit 123 , and a second filtering circuit 124 .
[0058] Among them, the protection circuit 121 is connected to the sampling and amplifying circuit 110; the voltage divider circuit 122 is respectively connected to the protection circuit 121 and the third pin of the microcontroller 130; the voltage divider circuit 122 is respectively connected to the first filter circuit 123 and the second filter circuit 124; the first filter circuit 123 and the second filter circuit 124 are respectively connected to the first pin and the second pin of the microcontroller 130.
[0059] The protection circuit 121 is used to clamp the voltage of the sampling and amplifying circuit 110 to protect the current sampling circuit 10 when the operational amplifier U2 in the sampling and amplifying circuit 110 is damaged, and to split the operational amplifier output signal to output a charging overcurrent signal (I_CHG_OVER signal) and a current sampling signal, and to send the charging overcurrent signal to the third pin of the microcontroller 130 to perform wave-by-wave current limiting protection on the current sampling circuit 10, and to send the current sampling signal to the voltage divider circuit 122.
[0060] Further, such as Figure 2 As shown in , the protection circuit includes a fourth resistor R4, a first diode D1 and a third capacitor C3.
[0061] Among them, the first end of the fourth resistor R4 is connected to the third pin of the operational amplifier U2 in the sampling and amplifying circuit 110; the second end of the fourth resistor R4, the first end of the first diode D1 and the first end of the third capacitor C3 are respectively connected to the first end of the voltage divider circuit 122; the second end of the first diode D1 is connected to the external positive power supply (VCC); the third end of the first diode D1 is grounded; and the second end of the third capacitor C3 is grounded (AGND).
[0062] When the operational amplifier U2 is damaged, the fourth resistor R4 is used to limit the current in the current sampling circuit 10; the first diode D1 is used to clamp the voltage of the current sampling circuit 10 according to the body voltage interval corresponding to the second end of the first diode D1.
[0063] The third capacitor C3 is used to decouple the current sampling circuit 10. Specifically, the third capacitor C3 is used to reduce the power supply noise of the current sampling circuit 10 and provide a stable local power supply voltage, so as to maintain the stability and reliability of the current sampling circuit 10 by filtering high-frequency noise and providing transient current.
[0064] Furthermore, the voltage divider circuit 122 is used to divide the current sampling signal, output a first voltage divider signal and a second voltage divider signal, and send the first voltage divider signal and the second voltage divider signal to the first filter circuit 123 and the second filter circuit 124 respectively, so that when the operational amplifier U2 is damaged, the current sampling signal input to the microcontroller 130 is within a safe voltage range.
[0065] like Figure 2 As shown in FIG. 1 , the voltage divider circuit 122 includes a first resistor R1 and a third resistor R3 .
[0066] Among them, the first end of the third resistor R3 is connected to the protection circuit 121; the first end of the first resistor R1 is connected to the first filter circuit 123; the second end of the third resistor R3 is connected to the second filter circuit 124; the second end of the first resistor R1 is grounded (AGND).
[0067] The first resistor R1 and the third resistor R3 divide the current sampling signal so that when the operational amplifier U2 is damaged, the first divided voltage signal and the second divided voltage signal output by the voltage divider circuit 122 are lower than the voltage of the external positive power supply (VCC), so that the current sampling signal input to the microcontroller 130 is within a safe voltage range.
[0068] Furthermore, the first filtering circuit 123 is used to filter the first voltage-divided signal, output a real-time current sampling signal, and send the real-time current sampling signal to the first pin of the microcontroller 130 .
[0069] like Figure 2 As shown in FIG, the first filtering circuit 123 includes a second resistor R2 and a second capacitor C2.
[0070] The first end of the second resistor R2 is connected to the voltage divider circuit 122; the second end of the second resistor R2 and the first end of the second capacitor C2 are respectively connected to the first pin of the microcontroller 130; and the second end of the second capacitor C2 is grounded (AGND).
[0071] Here, the first voltage-divided signal passes through the second resistor R2 and the second capacitor C2, reduces the noise on the power line and provides a stable local power supply voltage, improves the stability and reliability of the first filter circuit 123, outputs a real-time current sampling signal (I_CHG_REAL signal), and sends the real-time current sampling signal to the first pin of the microcontroller 130 for real-time current sampling; wherein the resistance value of the second resistor R2 and the capacitance value of the second capacitor C2 are usually within a smaller numerical range.
[0072] Furthermore, the second filtering circuit 124 is used to filter the second voltage-divided signal, output a mean current sampling signal, and send the mean current sampling signal to the second pin 130 of the microcontroller.
[0073] like Figure 2 As shown in , the second filtering circuit 124 includes a ninth resistor R9 and a fourth capacitor C4.
[0074] The first end of the ninth resistor R9 is connected to the voltage divider circuit 122; the second end of the ninth resistor R9 and the first end of the fourth capacitor C4 are respectively connected to the second pin of the microcontroller 130; the second end of the fourth capacitor C4 is grounded (AGND).
[0075] Here, the second voltage-divided signal passes through the second resistor R2 and the second capacitor C2 to reduce high-frequency noise and transient noise on the power line, improve the stability and reliability of the second filter circuit 124, output the average current sampling signal (I_CHG_AVR signal), and send the average current sampling signal to the second pin of the microcontroller 130 for effective value current sampling; wherein, the resistance value of the ninth resistor R9 and the capacitance value of the fourth capacitor C4 are usually within a larger numerical range.
[0076] Further, such as Figure 2 As shown in , the first pin and the second pin of the microcontroller 130 are respectively connected to the voltage divider filter circuit 120 .
[0077] The first pin of the microcontroller 130 is used to receive the real-time current sampling signal to perform real-time current sampling on the circuit under test; the second pin of the microcontroller 130 is used to receive the average current sampling signal to perform average current sampling on the circuit under test 20.
[0078] Here, the real-time current sampling signal (I_CHG_REAL) can be used for real-time charging current sampling of the photovoltaic controller; the average current sampling signal (I_CHG_AVR) can be used for charging current display and current loop control of maximum power point tracking (MPPT).
[0079] In the embodiment of the present application, since the maximum power point tracking controller based on the DSP digital signal processor usually lacks a visual display module and an interactive operation interface module, the microcontroller 130 usually selects a single-chip microcomputer chip based on the ARM (Advanced RISC Machines) architecture. The ARM chip has a strong transaction management function and can be used to provide support for interactive interfaces and applications. Its advantages are mainly reflected in the control aspect. Although the speed and data processing capabilities of the ARM chip are not outstanding compared with some processors, the ARM chip has a richer external interface, is more standardized and versatile, and has lower power consumption.
[0080] In this way, by using a low-cost ARM chip as the microcontroller 130 and setting a current sampling pin and a comparator input pin in the microcontroller 130 (ARM chip), the DSP digital signal processor can accurately sample the signal and perform wave-by-wave current limiting protection on the current sampling circuit 10.
[0081] Exemplarily, the identification of the second pin and the third pin of the microcontroller 130 can be represented by "PAx / ADC_INx"; wherein, "PA2" indicates that it is the xth pin of port "A", and port A can be a general input and output (GPIO) port, which can be configured as input or output for general digital signal processing; "ADC_INx" indicates that the pin can be configured as the xth analog input channel of an analog-to-digital converter (ADC) for converting analog signals into digital signals.
[0082] When the microcontroller 130 determines the real-time current sampling signal corresponding to the current sampling cycle, that is, when determining the real-time current compensation signal of the current sampling cycle, the microcontroller 130 determines the sampling compensation value based on the difference between the real-time current sampling signal of the previous sampling cycle and the mean current sampling signal, and adds the sampling compensation value to the real-time current sampling signal of the current sampling cycle to determine the real-time current compensation signal, so as to achieve accurate constant current output sampling of the circuit to be tested.
[0083] In this way, the real-time current compensation signal is used for the current sampling circuit 10 to perform precise constant current output, and the real-time current loop control of the current sampling circuit 10 is realized, thereby improving the sampling accuracy of the current sampling circuit 10 and the real-time performance of the sampling current.
[0084] The expression of the sampling compensation value is as follows.
[0085] △I=I___-I___P.
[0086] Among them, △I represents the sampling compensation value of the current sampling cycle, I_CHG_REAL_P represents the real-time current sampling signal of the previous sampling cycle; I_CHG_AVR_P represents the average current sampling signal of the previous sampling cycle.
[0087] Furthermore, the expression of the real-time current compensation signal is as follows.
[0088] I_REAL=△I+I_CHG_REAL.
[0089] Among them, I_REAL represents the real-time current compensation signal of the current sampling period; I_CHG_REAL represents the real-time current sampling signal of the current sampling period; △I represents the sampling compensation value of the current sampling period.
[0090] Figure 4 A curve diagram of an exemplary current sampling signal according to an embodiment of the present application is shown.
[0091] Specifically, Figure 4As shown in , the PWMH signal is the actual control signal sent by the microcontroller 130, which is used to control the on and off of the main control switch of the circuit under test 20; I_CHG_AVR represents the average current sampling signal. Since the I_CHG_AVR signal is an average signal, the numerical performance in each sampling cycle is relatively stable; I_CHG_REAL signal represents the real-time current sampling signal. The I_CHG_REAL signal is affected by the PWMH signal. When the PWMH signal is at a high level, the I_CHG_REAL signal gradually increases, and when the PWMH signal is at a low level, the I_CHG_REAL signal gradually decreases. The I_CHG_REAL signal has a difference (△I) with respect to the stable I_CHG_AVR signal, and the difference is used as the sampling compensation value when the current sampling circuit 10 performs real-time current sampling.
[0092] It should be noted that since the inductor current of the circuit to be tested 20 collected by the sampling resistor RS1 is a triangular wave output by the inductor in the circuit to be tested 20, and the microcontroller 130 can only sample at a single point in a single sampling cycle, it is impossible to implement multiple configurations such as the DSP digital signal processor to perform average value sampling. Therefore, it is difficult to collect accurate average value current by directly using the microcontroller 130.
[0093] In an embodiment of the present application, the operational amplifier output signal of the operational amplifier U2 can be separated into a current sampling signal. The current sampling signal is filtered by the second filtering circuit, and the output mean current sampling mean is sent to the second pin of the microcontroller 130 to perform average current sampling, thereby improving the current sampling accuracy and achieving the effect of difference compensation between the displayed charging current and the precise constant current output.
[0094] In addition, since the circuit to be tested 20 is usually a buck converter circuit (BUCK circuit), the inductor current of the BUCK circuit will produce a change in the control duty cycle when it is in a discontinuous or continuous state and when the input voltage is different, and the slope of the triangular wave of the inductor current is different, so that the sampling compensation value is different in each sampling cycle. The sampling compensation value is dynamically assigned to the real-time current sampling signal of the constant current output, thereby improving the accuracy and fast response speed of the current sampling circuit 10, and solving the problem of frequent oscillations caused by the control variable and feedback variable of the PID control loop being out of sync due to the longer filtering delay time of the first filtering circuit when the mean sampling current signal is used for constant current control of the photovoltaic controller.
[0095] On the other hand, the maximum power calculation of the photovoltaic controller is performed using the mean current sampling signal filtered by the second filter circuit 124, which ensures the accuracy of the sampling current and solves the problem of inaccurate triangular wave sampling of the inductor output of the circuit to be tested.
[0096] Further, such as Figure 2As shown in , the third pin of the microcontroller 130 is connected to the voltage divider filter circuit for receiving the charging overcurrent signal.
[0097] The third pin of the microcontroller 130 is provided with a comparator, and the comparator is used to compare the charging overcurrent signal (I_CHG_OVER) with a preset signal threshold (I_LIMIT), and output a level signal (COMP1) corresponding to the comparison result.
[0098] In an embodiment of the present application, the third pin of the microcontroller 130 is provided with a fast, low-power rail-to-rail analog comparator, and the third pin of the microcontroller 130 serves as the negative input of the comparator, and the positive input of the comparator is configured as an internal reference voltage. Therefore, the setting of the preset signal threshold corresponds to the value of the internal reference voltage.
[0099] Exemplarily, the identification of the third pin of the microcontroller 130 can be represented by "PB3 / COMP2_INM"; "PB3" indicates that it is the third pin of port "B", and port B can be a general input and output (GPIO) port, which can be configured as input or output for general digital signal processing; "COMP2_INM" represents the positive input terminal of comparator No. 2 to receive the charging overcurrent signal.
[0100] Further, such as Figure 2 As shown in , the fourth pin of the microcontroller 130 is connected to the fourth pin of the operational amplifier U2 in the sampling and amplifying circuit 110 .
[0101] The microcontroller 130 is used to output an enable control signal (PWR_SAVE) in response to detecting that the circuit under test 20 meets the charging condition, and send the enable control signal to the fourth pin of the operational amplifier U2 in the sampling and amplifying circuit 110 .
[0102] In the embodiment of the present application, the charging condition may include detecting that there is a PV input at a PV terminal in the circuit to be tested.
[0103] The microcontroller 130 is used to perform an AND logic operation on the sampling control signal (PWMH1) of the microcontroller 130 itself that is expected to control the circuit under test 20 and the level signal (COMP1), and based on the operation result, output the actual control signal (PWMH) that actually controls the on and off of the main control switch of the circuit under test 20, and send it to the fourth pin (EN) of the operational amplifier U2 in the sampling and amplifying circuit 110, so as to control whether the sampling and amplifying circuit 110 performs current sampling.
[0104] Here, the software configured in the microcontroller 130 can perform event response blocking. When the charging overcurrent signal approaches a preset signal threshold, a high-level signal is output to block the actual control signal. It can also be set to output a low-level signal to control the actual control signal, or the output of the level signal can be inverted.
[0105] Exemplarily, the identification of the fourth pin of the microcontroller 130 can be represented by "PD2 / TIME3_ETR / TIM1_CH1N"; wherein, "PD2" indicates that it is the second pin of port "D", and port D can be a general purpose input and output (GPIO) port, which can be configured as input or output for general digital signal processing; "TIME3_ETR" indicates that the pin can be configured as an external trigger input of "Timer 3" and allows an external signal to start, stop or reset the timer, or serve as a clock source for the timer; "TIM1_CH1N" represents the inverting input of "Channel 1" of "Timer 1", which is typically used in comparison and capture modes.
[0106] Specifically, the microcontroller 130 performs a logic operation on the sampling control signal and the level signal to obtain an operation result. For example, the signal value of the high bit of the setting signal is 1, and the signal value of the low bit of the setting signal is 1. At this time, based on the operation result, an example of outputting the actual control signal is shown in the following table.
[0107] Sampling control signal (PWH1) Level signal (COMP1) Actual control signal (PWH) 0 0 0 1 0 0 0 1 0 1 1 1
[0108] Figure 5 A curve diagram of an exemplary charging overcurrent signal according to an embodiment of the present application is shown.
[0109] like Figure 5 As shown in , when the circuit to be tested 20 meets the charging condition, the main control switch in the circuit to be tested 20 is turned on, the inductor current of the circuit to be tested 20 increases, and the charging overcurrent signal I_CHG_OVER rises. When the I_CHG_OVER signal is less than the preset signal threshold value I_LIMIT, the level signal COMP1 output by the comparator is high. At this time, the sampling control signal (PWMH1) of the microcontroller 130 and the comparator output signal COMP1 are high level and perform a logic operation. Based on the operation result, the actual control signal (PWMH) is obtained to control the main control switch in the circuit to be tested 20 to be turned on or off through the actual control signal (PWMH). At this time, the actual control signal (PWMH) controls the main control switch in the circuit to be tested 20 to be turned on, and the current sampling circuit 10 is in a normal working state.
[0110] Figure 6 A curve diagram of the wave-by-wave current limiting protection of an exemplary charging overcurrent signal according to an embodiment of the present application is shown.
[0111] like Figure 6 As shown in , when the circuit under test 20 meets the charging condition, the main control switch in the circuit under test 20 is turned on, the inductor current increases, the inductor current of the circuit under test 20 increases, and the charging overcurrent signal I_CHG_OVER rises. When the I_CHG_OVER signal is greater than or equal to the preset signal threshold value I_LIMIT, the comparator will output the level signal COMP1 as a low level. At this time, the sampling control signal (PWMH1) of the microcontroller 130 and the comparator output signal COMP1 are high levels and perform an AND logic operation. Based on the operation result, the actual control signal (PWMH) is obtained as a low level. Further, since the actual control signal PWMH is low, the main control switch in the circuit under test 20 is controlled to be disconnected, so that the inductor current of the circuit under test 20 begins to decrease, causing the charging overcurrent signal I_CHG_OVER to decrease. Until the I_CHG_OVER signal is less than the preset signal threshold value I_LIMIT, the COMP1 signal output by the comparator is reset to a high level, thereby realizing the wave-by-wave current limiting protection of the current sampling circuit 10.
[0112] In summary, the current sampling circuit provided in the present application can be widely used in application fields such as photovoltaic power generation. By collecting the average current sampling signal of the circuit to be tested, it can be used for MPPT maximum power point tracking to improve the photovoltaic utilization rate, and through the compensation of precise constant current output, it can realize accurate sampling of the real-time current of the circuit to be tested, thereby protecting the lithium battery from overcharging and extending the service life of the lithium battery.
[0113] Furthermore, by collecting the charging overcurrent signal of the circuit to be tested and comparing it with the preset signal threshold set by the comparator, and the microcontroller controlling the on and off of the main control switch in the circuit to be tested based on the comparison result, the wave-by-wave current limiting protection of the current sampling circuit is realized to ensure that the output side of the battery is protected when encountering impact loads and short circuits, thereby improving equipment reliability.
[0114] In addition, since each component of the current sampling circuit adopts a low-power enabling design, the battery life of the device can be extended and the endurance of the device can be improved; a simple circuit structure and low-cost ARM chips and other components are used to reduce manufacturing costs, which is conducive to promotion and application. Therefore, the current sampling circuit provided in this application can play an important role in the field of photovoltaic power generation.
[0115] The current sampling circuit provided in the embodiment of the present application collects and gain-amplifies the inductor current of the circuit to be tested in real time by placing the sampling amplifier circuit at the output of the inductor in the circuit to be tested, that is, at the front end of the output capacitor of the circuit to be tested, and outputs an operational amplifier output signal. The operational amplifier output signal is divided, divided and filtered by a voltage divider filter circuit to output a real-time current sampling signal and a mean current sampling signal, thereby improving the accuracy of current sampling. The microcontroller compares the charging overcurrent signal with a preset signal threshold to control the on and off of the main control switch in the circuit to be tested according to the comparison result, thereby improving the safety and controllability of current sampling.
[0116] The photovoltaic controller provided in the embodiment of the present application includes the above-mentioned current sampling circuit.
[0117] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0118] Based on the same technical concept, the present application also provides a photovoltaic controller, which includes the current sampling circuit described in any of the above embodiments.
[0119] For the convenience of description, the above device is described in terms of functions divided into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0120] The device of the above embodiment is used to implement the corresponding method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0121] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
[0122] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.
[0123] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0124] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.
Claims
1. A current sampling circuit, characterized in that: The current sampling circuit includes a sampling amplifier circuit, a voltage divider filter circuit and a microcontroller: The sampling and amplifying circuit is connected to the circuit to be tested; the sampling and amplifying circuit is respectively connected to the voltage-dividing and filtering circuit and the microcontroller; the voltage-dividing and filtering circuit is connected to the microcontroller; The sampling and amplifying circuit is used to receive the enabling control signal sent by the microcontroller, collect and gain-amplify the inductor current of the circuit to be tested in real time, output the operational amplifier output signal, and send the operational amplifier output signal to the voltage divider filter circuit; The voltage divider filter circuit is used to divide the output signal of the operational amplifier, output a charging overcurrent signal and a current sampling signal, divide the voltage and filter the current sampling signal, output a real-time current sampling signal and an average current sampling signal, and send the charging overcurrent signal, the real-time current sampling signal and the average current sampling signal to the microcontroller; The microcontroller is used to output an enable control signal in response to detecting that the circuit to be tested meets the charging condition, and send the enable control signal to the sampling and amplifying circuit; receive the real-time current sampling signal and the average current sampling signal to perform current sampling on the circuit to be tested; Compare whether the charging overcurrent signal is greater than a preset signal threshold, and control the on and off of the main control switch in the circuit to be tested based on the comparison result.
2. The circuit according to claim 1, characterized in that The current sampling circuit also includes a bias voltage circuit: The bias voltage circuit is connected to the sampling and amplifying circuit; The bias voltage circuit is used to provide a bias voltage for the operational amplifier in the sampling and amplifying circuit when the inductor current is a preset value, so as to avoid the problems of small current sampling blind area and negative current detection in the sampling and amplifying circuit.
3. The circuit according to claim 2, characterized in that The bias voltage circuit includes a fifth resistor and an eighth resistor: The first end of the fifth resistor and the first end of the eighth resistor are respectively connected to the fifth pin of the operational amplifier; the second end of the fifth resistor is connected to an external positive power supply; and the second end of the eighth resistor is grounded.
4. The circuit according to claim 1, characterized in that The sampling and amplifying circuit includes a sampling resistor, a differential mode filter and an operational amplifier: The sampling resistor is connected in series with the inductor in the circuit to be tested; the current input terminal and the current output terminal of the sampling resistor are connected to the first terminal and the second terminal of the differential mode filter; the third terminal and the fourth terminal of the differential mode filter are respectively connected to the first pin and the second pin of the operational amplifier; the third pin of the operational amplifier is connected to the voltage divider filter circuit; the fourth pin of the operational amplifier is connected to the fourth pin of the microcontroller; the sixth pin of the operational amplifier is connected to an external positive power supply; the seventh pin of the operational amplifier is grounded; The sampling resistor is used to collect the inductor current of the inductor in real time and convert the inductor current into a corresponding voltage signal; The differential mode filter is used to filter the voltage signal to attenuate the differential noise in the voltage signal; The operational amplifier is used to receive an enable control signal sent by the microcontroller to control whether the sampling amplifier circuit performs current sampling; The voltage signal is gain-amplified, an operational amplifier output signal is output, and the operational amplifier output signal is sent to the voltage divider filter circuit.
5. The circuit according to claim 4, characterized in that The differential mode filter comprises a sixth resistor, a seventh resistor and a first capacitor: The first end of the sixth resistor and the first end of the seventh resistor are respectively connected to the current input end and the current output end of the sampling resistor; the second end of the seventh resistor and the second end of the first capacitor are respectively connected to the first pin of the operational amplifier; the second end of the sixth resistor and the first end of the first capacitor are respectively connected to the second pin of the operational amplifier.
6. The circuit according to claim 1, characterized in that The voltage divider filter circuit includes a protection circuit, a voltage divider circuit, a first filter circuit and a second filter circuit: The protection circuit is connected to the sampling and amplifying circuit; the voltage divider circuit is respectively connected to the protection circuit and the third pin of the microcontroller; the voltage divider circuit is respectively connected to the first filter circuit and the second filter circuit; the first filter circuit and the second filter circuit are respectively connected to the first pin and the second pin of the microcontroller; The protection circuit is used to clamp the voltage of the sampling and amplifying circuit to protect the current sampling circuit when the operational amplifier in the sampling and amplifying circuit is damaged, and to split the output signal of the operational amplifier to output a charging overcurrent signal and a current sampling signal, and to send the charging overcurrent signal to the third pin of the microcontroller, and to send the current sampling signal to the voltage divider circuit; The voltage divider circuit is used to divide the current sampling signal, output a first voltage divider signal and a second voltage divider signal, and send the first voltage divider signal and the second voltage divider signal to the first filter circuit and the second filter circuit respectively, so that when the operational amplifier is damaged, the current sampling signal input to the microcontroller is within a safe voltage range; The first filtering circuit is used to filter the first voltage-divided signal, output a real-time current sampling signal, and send the real-time current sampling signal to the first pin of the microcontroller; The second filtering circuit is used for filtering the second voltage-divided signal, outputting a mean current sampling signal, and sending the mean current sampling signal to the second pin of the microcontroller.
7. The circuit according to claim 6, characterized in that The protection circuit includes a fourth resistor, a first diode and a third capacitor: The first end of the fourth resistor is connected to the third pin of the operational amplifier in the sampling and amplifying circuit; the second end of the fourth resistor, the first end of the first diode and the first end of the third capacitor are respectively connected to the first end of the voltage divider circuit; the second end of the first diode is connected to the external positive power supply; the third end of the first diode is grounded; the second end of the third capacitor is grounded; The fourth resistor is used to limit the current in the current sampling circuit; the first diode is used to clamp the voltage of the current sampling circuit according to the body voltage range corresponding to the second end of the first diode when the operational amplifier is damaged; the third capacitor is used to decouple the current sampling circuit.
8. The circuit according to claim 6, characterized in that The voltage divider circuit includes a first resistor and a third resistor: The first end of the third resistor is connected to the protection circuit; the first end of the first resistor is connected to the first filtering circuit; the second end of the third resistor is connected to the second filtering circuit; and the second end of the first resistor is grounded.
9. The circuit according to claim 6, characterized in that The first filtering circuit includes a second resistor and a second capacitor: The first end of the second resistor is connected to the voltage divider circuit; the second end of the second resistor and the first end of the second capacitor are respectively connected to the first pin of the microcontroller; and the second end of the second capacitor is grounded.
10. The circuit according to claim 6, characterized in that The second filtering circuit includes a ninth resistor and a fourth capacitor: The first end of the ninth resistor is connected to the voltage divider circuit; the second end of the ninth resistor and the first end of the fourth capacitor are respectively connected to the second pin of the microcontroller; and the second end of the fourth capacitor is grounded.
11. The circuit according to claim 1, characterized in that The first pin and the second pin of the microcontroller are respectively connected to the voltage divider filter circuit; The first pin of the microcontroller is used to receive the real-time current sampling signal to perform real-time current sampling on the circuit to be tested; The second pin of the microcontroller is used to receive the mean current sampling signal to perform mean current sampling on the circuit to be tested; The microcontroller is used to determine a sampling compensation value based on the difference between the real-time current sampling signal and the mean current sampling signal of the previous sampling cycle, and add the sampling compensation value to the real-time current sampling signal of the current sampling cycle to determine the real-time current compensation signal, so as to achieve accurate constant current output sampling of the circuit to be tested.
12. The circuit according to claim 1, characterized in that The third pin of the microcontroller is connected to the voltage-dividing filter circuit for receiving the charging overcurrent signal; the fourth pin of the microcontroller is connected to the fourth pin of the operational amplifier in the sampling and amplifying circuit; The third pin of the microcontroller is provided with a comparator, and the comparator is used to compare the charging overcurrent signal with a preset signal threshold and output a level signal corresponding to the comparison result; The microcontroller is used to: in response to detecting that the circuit to be tested meets the charging condition, output an enable control signal, and send the enable control signal to the fourth pin of the operational amplifier in the sampling and amplification circuit; perform an AND logic operation on the microcontroller's own sampling control signal and the level signal, and output an actual control signal based on the operation result to control the on and off of the main control switch in the circuit to be tested.
13. A photovoltaic controller, characterized in that: The photovoltaic controller includes a current sampling circuit as described in any one of claims 1 to 12.
Citation Information
Cited By
Power supply feedback circuit and switching power supply
CN122159675A