# Patent

## Title
Voltage detection method and circuit and associated switching power supply

## Abstract

In one embodiment, a method of detecting a voltage can include: (i) generating a first current according to a first voltage and a converting resistor; (ii) charging a detection capacitor by the first current during a first time period of a switching cycle of a switching power supply; (iii) charging the detection capacitor by a second current during a second time period of the switching cycle; (iv) detecting a voltage across the detection capacitor to obtain a detection voltage at an end time of the second time period, where the first time period includes a rising portion of a current flowing through the inductor, and the second time period includes a decreasing portion of the inductor current; and (v) determining a state of a present output voltage of the switching power supply according to the detection voltage.

## Background
RELATED APPLICATIONS
This application is a continuation of the following application, U.S. patent application Ser. No. 14/490,825, filed on Sep. 19, 2014, and which is hereby incorporated by reference as if it is set forth in full in this specification, and which also claims the benefit of Chinese Patent Application No. 201310441482.X, filed on Sep. 25, 2013, which is incorporated herein by reference in its entirety.


FIELD OF THE INVENTION
The present invention generally relates to power converter circuitry, and more particularly to voltage detection methods, circuits, and associated switching power supplies.
BACKGROUND
Switch mode power supplies can efficiently convert electrical power from a source to a load, or to several different loads, with each corresponding to a different output. The main transistor of a switching-mode supply can switch between on and off states at a given operating frequency, and voltage regulation can be achieved by varying the ratio of the on-to-off time of the main transistor. Switch mode power supplies may have relatively high power conversion efficiency, as compared to other types of power converters. Switch mode power supplies may also be substantially smaller and lighter than a linear supply due to the smaller transformer size and weight.
SUMMARY
In one embodiment, a method of detecting a voltage can include: (i) generating a first current according to a first voltage and a converting resistor; (ii) charging a detection capacitor by the first current during a first time period of a switching cycle of a switching power supply, where the first voltage includes an excitation voltage on an inductor of the switching power supply during the first time period; (iii) charging the detection capacitor by a second current during a second time period of the switching cycle, where the first and second currents flow in opposite directions; (iv) detecting a voltage across the detection capacitor to obtain a detection voltage at an end time of the second time period, where the first time period includes a rising portion of a current flowing through the inductor, and the second time period includes a decreasing portion of the inductor current; and (v) determining a state of a present output voltage of the switching power supply according to the detection voltage, where the converting resistor includes a proportion of a predetermined output voltage of the switching power supply and the second current.
In one embodiment, a voltage detection circuit can include: (i) a first current generating circuit configured to generate a first current according to a first voltage and a converting resistor, where the first voltage includes an excitation voltage on an inductor of a switching power supply during a first time period of a switching cycle of the switching power supply, and where the first time period includes a rising portion of a current flowing through the inductor; (ii) a second current source configured to output a second current, where the first and second currents flow in opposite directions; (iii) a first switch coupled between the first current generating circuit and a detection capacitor; (iv) a second switch coupled between the second current source and the detection capacitor, where the first switch is on and the second switch is off such that the first current charges the detection capacitor via the first switch during the first time period, and where the first switch is off and the second switch is on such that the second current discharges the detection capacitor via the second switch during a second time period of the switching cycle; and (v) where a voltage across the detection capacitor is detected to obtain a detection voltage at an end time of the second time period, the detection voltage being used to determine a state of a present output voltage of the switching power supply, where the second time period includes a decreasing portion of the inductor current, and where the converting resistor includes a proportion of a predetermined output voltage of the switching power supply and the second current.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is a schematic block diagram of a first example output voltage detection circuit of a switching power supply.
FIG. 2 is a schematic block diagram of a second example output voltage detection circuit of a switching power supply.
FIG. 3 is a schematic block diagram of a third example output voltage detection circuit of a switching power supply.
FIG. 4 is a flow diagram of a first example method of detecting a voltage, in accordance with embodiments of the present invention.
FIG. 5 is a waveform diagram of an example voltage detection, in accordance with embodiments of the present invention.
FIG. 6 is a flow diagram of a second example method of detecting a voltage, in accordance with embodiments of the present invention.
FIG. 7 is a flow diagram of a third example method of detecting a voltage, in accordance with embodiments of the present invention.
FIG. 8 is a flow diagram of a fourth example method of detecting a voltage, in accordance with embodiments of the present invention.
FIG. 9 is a waveform diagram of example voltage detection, in accordance with embodiments of the present invention.
FIG. 10 is a schematic block diagram of a first example voltage detection circuit, in accordance with embodiments of the present invention.
FIG. 11 is a schematic block diagram of a second example voltage detection circuit, in accordance with embodiments of the present invention.
FIG. 12 is a schematic block diagram of an example buck switching power supply with a voltage detection circuit, in accordance with embodiments of the present invention.



DETAILED DESCRIPTION
Reference may now be made in detail to particular embodiments of the invention, examples of which are illustrated in the accompanying drawings. While the invention may be described in conjunction with the preferred embodiments, it may be understood that they are not intended to limit the invention to these embodiments. On the contrary, the invention is intended to cover alternatives, modifications and equivalents that may be included within the spirit and scope of the invention as defined by the appended claims. Furthermore, in the following detailed description of the present invention, numerous specific details are set forth in order to provide a thorough understanding of the present invention. However, it may be readily apparent to one skilled in the art that the present invention may be practiced without these specific details. In other instances, well-known methods, procedures, processes, components, structures, and circuits have not been described in detail so as not to unnecessarily obscure aspects of the present invention.
Switching power supplies are widely used to supply voltage for electronic products by converting DC voltages to stable or adjustable DC voltages. When a switching power supply provides power to an electronic product, the electronic product may operate abnormally if a present output voltage of the switching power supply is lower than a suitable or required working voltage of the electronic product. Alternatively, the electronic product may be damaged if the present output voltage of the switching power supply is too high. Therefore, it is desirable for the present output voltage of the switching power supply to meet the required output voltage of the electronic product, where the required output voltage can be set to be the output voltage of the switching power supply.
In order to satisfy the above requirement, the present output voltage of the switching power supply may be detected. Also, a detection signal can be provided to a control terminal of the switching power supply for controlling the switching power supply. In this way, the present output voltage of the switching power supply can substantially be the predetermined output voltage in order to ensure normal operation of the electronic product.
Referring now to FIGS. 1-3, shown are schematic block diagrams of example output voltage detection circuits of switching power supplies. In these examples, output voltage detection approaches can include obtaining sense voltage Vo′ from output voltage Vout of the switching power supply by connecting resistor dividing circuit 101 at two output terminals of the switching power supply, and obtaining feedback voltage Vc by optical coupler 102 for a control circuit (see, e.g., FIG. 1). Also, output voltage VFB can be indirectly detected by auxiliary winding 201 coupled at the output terminal of the switching power supply, and by realizing primary control by providing voltage VFB to a control circuit at the primary-side (see, e.g., FIGS. 2 and 3). However, in these approaches, the detection circuit can be overly complicated with relatively high product costs due to the optical coupler, and when an optical coupler is not used, product costs can be still high due to an auxiliary winding with a relatively large volume. Further, the conversion efficiency can be relatively low due to power losses on the auxiliary winding.
In one embodiment, a method of detecting a voltage can include: (i) generating a first current according to a first voltage and a converting resistor; (ii) charging a detection capacitor by the first current during a first time period of a switching cycle of a switching power supply, where the first voltage includes an excitation voltage on an inductor of the switching power supply during the first time period; (iii) charging the detection capacitor by a second current during a second time period of the switching cycle, where the first and second currents flow in opposite directions; (iv) detecting a voltage across the detection capacitor to obtain a detection voltage at an end time of the second time period, where the first time period includes a rising portion of a current flowing through the inductor, and the second time period includes a decreasing portion of the inductor current; and (v) determining a state of a present output voltage of the switching power supply according to the detection voltage, where the converting resistor includes a proportion of a predetermined output voltage of the switching power supply and the second current.
Referring now to FIG. 4, shown is a flow diagram of a first example method of detecting a voltage, in accordance with embodiments of the present invention. At 401, a first current (e.g., I1) can be generate according to a first voltage (e.g., VL) and a converting resistor. During operation of the switching power supply, time periods T1 and T2 in each switching cycle can be determined by an inductor current of the switching power supply. For example, the switching cycle can be a switching cycle of the power switch(es) in the switching power supply.
In any such switching cycle, time period T1 can include a time portion when the inductor current rising, while time period T2 can include a time portion when the inductor current is decreasing. FIG. 5 shows a waveform diagram of an example voltage detection, in accordance with embodiments of the present invention. In this example, each switching cycle can include time period T1 in which the inductor current rises, and time period T2 in which the inductor current decreases.
Also referring to FIG. 9, in a switching power supply with a discontinuous operation mode, each switching cycle can includes three time periods: time period T1 in which the inductor current rises, time period T2 in which the inductor current decreases, and inductor current resonant time period T3. The distribution of time period T1 and time period T2 in this particular example can refer to FIG. 9. Particular embodiments are suitable for a switching power supply that operates in a critical operation mode (see, e.g., FIG. 5), a discontinuous (see, e.g., FIG. 9), or in any other suitable operation modes.
In this particular example, during time period T1, an excitation voltage on the inductor of the switching power supply can be recorded as voltage VL. FIG. 12 shows a buck switching power supply, and during time period T1, VL=Vin−Vo, where Vin can be an input voltage for the switching power supply, Vo can be a present output voltage, and the excitation voltage on the inductor in time period T1 can be recorded or otherwise determined as voltage VL. During time period T1, current I1 can be generated according to voltage VL and a converting resistor. For example, the converting resistor can be equal to a proportion of a predetermined output voltage of the switching power supply (e.g., a desired output voltage of the switching power supply) and predetermined current I2.
In one example, current I2 can be a substantially constant value, and may be provided by a current source (e.g., 1002 in FIG. 10). In 401 of FIG. 4, current I1 can be generated according to voltage VL and a converting resistor during time period T1 of the switching power supply. In the examples of FIGS. 5 and 9, waveforms of gate voltage VG of the power switch of a power stage circuit of the switching power supply, inductor current IL of the inductor, and excitation voltage VL of the inductor of the switching power supply in one switching cycle, as well as the distribution of time periods T1 and T2, are shown.
Referring back to FIG. 4, at 402, a detection capacitor can be charged by a first current (e.g., I1) during the first time period (e.g., T1) of each switching cycle. Detection capacitor C can be charged by current I1 from a start time of time period T1 of each switching cycle until an end time of T2. At 403, the detection capacitor can be charged by a second current (e.g., I2), which can be a predetermined current, during a second time period (e.g., T2) of each switching cycle. After 402, from a start time of time period T2 of each switching cycle to the end time, detection capacitor C can be charged by the predetermined second current. For example, a direction or polarity of the second current can be opposite to that of the first current that charges detection capacitor C at 402. Thus, the charge of detection capacitor C can be increasing during time period T1, and decreasing during time period T2.
At 404, a voltage across the detection capacitor can be detected to obtain a detection voltage at the end time of the second time period in each switching cycle. This detected voltage across detection capacitor C can be used to further determine a state of the present output voltage of the switching power supply. For example, it can be determined if the present output voltage of the switching power supply is greater than, less than, or equal to the predetermined output voltage. In this way, a control circuit can be used regulate the present switching power supply such that the present output voltage substantially equals the predetermined output voltage.
In order to determine the state of the present output voltage of the switching power supply according to the detection voltage, an example buck switching power supply, or power stage converter topology, can be used. According to the voltage-second balance principle, the positive voltage-second value equals the negative voltage-second value of the inductor during the steady state. Thus, the following voltage-second balance function in equation (1) during time periods T1 and T2 can be satisfied.

(Vin−Vo)·T1=Vo·T2  (1)

Dividing converting resistor R on both sides of equation (1), the voltage-second balance equation (1) can be converted to an ampere-second balance equation (2).




  
    
      
        
          
            
              
                V
                in
              
              -
              
                V
                o
              
            
            R
          
          ·
          
            T
            1
          
        
        =
        
          
            
              V
              o
            
            R
          
          ⁢
          
            T
            2
          
        
      
    
    
      
        (
        2
        )
      
    
  




From equation (2), during time period T1, charging detection capacitor C by current I1 has a value equal to




  
    
      
        V
        in
      
      -
      
        V
        o
      
    
    R
  
  ,




and during time period T2, charging detection capacitor C by current I2 has a value equal to





  
    V
    o
  
  R




and a direction opposite to current I1. Thus, a voltage (e.g., Vc(T1+T2)) across detection capacitor C at the end time of time period T2 according to the voltage-second balance can be as in equation (3).

Vc(T1+T2)=Vc(0)  (3)

For example Vc(0) is the voltage across detection capacitor C at the start time of a switching cycle (i.e., the initial voltage of detection capacitor C). Based on the above in this particular example, charging detection capacitor C by the current I1 during time period T1, and charging detection capacitor C by replacing current I1 with current I2 of the opposite direction during time period T2, the following equations (4), (5) and (6) can be obtained.




  
    
      
        
          
            I
            2
          
          <
          
            
              V
              o
            
            R
          
        
        ,
        
          
            V
            
              c
              ⁡
              
                (
                
                  
                    T
                    ⁢
                    
                      
                    
                    ⁢
                    1
                  
                  +
                  
                    T
                    ⁢
                    
                      
                    
                    ⁢
                    2
                  
                
                )
              
            
          
          >
          
            V
            co
          
        
      
    
    
      
        (
        4
        )
      
    
  
  
    
      
        
          
            I
            2
          
          =
          
            
              V
              o
            
            R
          
        
        ,
        
          
            V
            
              c
              ⁡
              
                (
                
                  
                    T
                    ⁢
                    
                      
                    
                    ⁢
                    1
                  
                  +
                  
                    T
                    ⁢
                    
                      
                    
                    ⁢
                    2
                  
                
                )
              
            
          
          =
          
            V
            co
          
        
      
    
    
      
        (
        5
        )
      
    
  
  
    
      
        
          
            I
            2
          
          >
          
            
              V
              o
            
            R
          
        
        ,
        
          
            V
            
              c
              ⁡
              
                (
                
                  
                    T
                    ⁢
                    
                      
                    
                    ⁢
                    1
                  
                  +
                  
                    T
                    ⁢
                    
                      
                    
                    ⁢
                    2
                  
                
                )
              
            
          
          <
          
            V
            co
          
        
      
    
    
      
        (
        6
        )
      
    
  




In this example, converting resistor R can be set as a proportion of a predetermined voltage (i.e., Voset) and predetermined current I2 of the switching power supply that can be




  R
  =
  
    
      
        V
        oset
      
      
        I
        2
      
    
    .
  




Also, current I1 can be a proportion of voltage VL and converting resistor R, that can be





  
    I
    1
  
  =
  
    
      
        V
        
          L
          ⁢
          
            
          
          ⁢
          1
        
      
      R
    
    =
    
      
        
          V
          
            L
            ⁢
            
              
            
            ⁢
            1
          
        
        
          V
          oset
        
      
      ·
      
        
          I
          2
        
        .
      
    
  




Thus, when Vc(T1+T2)>Vco, as





  
    
      I
      2
    
    =
    
      
        V
        oset
      
      R
    
  
  ,




so





  
    
      
        V
        oset
      
      R
    
    <
    
      
        V
        o
      
      R
    
  
  ,




present output voltage Vo can be detected as greater than the predetermined output voltage of the switching power supply. When Vc(T1+T2)=Vco, as





  
    
      I
      2
    
    =
    
      
        V
        oset
      
      R
    
  
  ,




so





  
    
      
        V
        oset
      
      R
    
    =
    
      
        V
        o
      
      R
    
  
  ,




present output voltage Vo can be detected as equal to the predetermined output voltage of the switching power supply. Also, when Vc(T1+T2)<Vco, as





  
    
      I
      2
    
    =
    
      
        V
        oset
      
      R
    
  
  ,




so





  
    
      
        V
        oset
      
      R
    
    >
    
      
        V
        o
      
      R
    
  
  ,




present output voltage Vo can be detected as less than the predetermined output voltage of the switching power supply.

Thus, detection capacitor C can be charged during time periods T1 and T2 of each switching cycle. Also, a voltage across detection capacitor C can be sampled at the end time of time period T2 as detection voltage Vc(T1+T2). The state of the present output voltage of the switching power supply can be determined according to detection voltage Vc(T1+T2). Finally, the output voltage of the switching power supply can be adaptively regulated according to the state of the present output voltage.
Detection voltage Vc(T1+T2) can be compared against initial voltage Vc(0) of detection capacitor C, to determine the state of the present output voltage of the switching power supply. In one particular example, the charging for detection capacitor C can be realized by a controllable switching power supply. Also, a circuit for comparing detection voltage Vc(T1+T2) against initial voltage Vc(0) of detection capacitor C can include comparator and/or other suitable circuitry. In this way, voltage detection can be done without an optical coupler or an auxiliary winding, thus potentially resulting in a simplified circuit design and lower product costs, as well as improved conversion efficiency of the switching power supply.
Referring now to FIG. 6, shown is a flow diagram of a second example method of detecting a voltage, in accordance with embodiments of the present invention. In this particular example, 605 can be included after 404. At 605, an initial voltage of the detection capacitor can be compared against the detection voltage, and a state (e.g., a relative state) of the present output voltage of the switching power supply can be determined according to the comparison result.
For example, when Vc(T1+T2)>Vco, as




  
    
      I
      2
    
    =
    
      
        V
        oset
      
      R
    
  
  ,




so





  
    
      
        V
        oset
      
      R
    
    <
    
      
        V
        o
      
      R
    
  
  ,




the present output voltage Vo can be detected as greater than the predetermined output voltage of the switching power supply. When Vc(T1+T2)=Vco, as





  
    
      I
      2
    
    =
    
      
        V
        oset
      
      R
    
  
  ,




so





  
    
      
        V
        oset
      
      R
    
    =
    
      
        V
        o
      
      R
    
  
  ,




the present output voltage Vo can be detected as equal to the predetermined output voltage of the switching power supply. Also, when Vc(T1+T2)<Vco, as





  
    
      I
      2
    
    =
    
      
        V
        oset
      
      R
    
  
  ,




so





  
    
      
        V
        oset
      
      R
    
    >
    
      
        V
        o
      
      R
    
  
  ,




the present output voltage Vo can be detected as less than the predetermined output voltage of the switching power supply. As discussed above, a comparator or other such comparison circuitry can be employed for the voltage comparison.

Referring now to FIG. 7, shown is a flow diagram of a third example method of detecting a voltage, in accordance with embodiments of the present invention. In this particular example, 706 can be further included after 605. At 706, the voltage across the detection capacitor can be reset during a third time period (e.g., T3) of each switching cycle. For example time period T3 can be a time period from the end time of time period T2 to the start time of time period T1 (of a next time period of a next switching cycle). As shown in FIG. 9, time period T3 can include a resonant time portion in which the inductor current resonates around zero after reaching zero, and until stable at zero, in a switching cycle.
After 706, the flow can return to execute corresponding control in a next switching cycle. In this particular example, after obtaining detection voltage Vc(T1+T2) at the end time of time period T2, the terminals of detection capacitor C can be shorted to reset the voltage across detection capacitor C. In this way, initial voltage Vc(0) of detection capacitor C can be reset at a start time of a switching cycle. For example during time period T3, two terminals of detection capacitor C can effectively be shorted by turning on switch Q3 (see, e.g., FIG. 11), which can be connected in parallel with detection capacitor C.
Referring now to FIG. 8, shown is a flow diagram of a fourth example method of detecting a voltage, in accordance with embodiments of the present invention. In this particular example, when one terminal of detection capacitor C may not be effectively grounded, the voltage across detection capacitor C can be reset to a predetermined reset voltage after 706. However, when one terminal of detection capacitor C can effectively be grounded, the voltage across detection capacitor C can be reset to zero after 706. At 805, the detection voltage can be compared against zero, to determine the state of the present output voltage of the switching power supply. After time period T2 and before a next switching cycle starts, detection capacitor C can be reset such that the initial voltage of detection capacitor C in each switching cycle is zero (i.e., Vc(0)=0), and thus the detection voltage can be compared against zero in this case.
For example, when Vc(T1+T2)>Vco, as




  
    
      I
      2
    
    =
    
      
        V
        oset
      
      R
    
  
  ,




so





  
    
      
        V
        oset
      
      R
    
    <
    
      
        V
        o
      
      R
    
  
  ,




the present output voltage Vo can be detected as greater than the predetermined output voltage of the switching power supply. When Vc(T1+T2)=Vco, as





  
    
      I
      2
    
    =
    
      
        V
        oset
      
      R
    
  
  ,




so





  
    
      
        V
        oset
      
      R
    
    =
    
      
        V
        o
      
      R
    
  
  ,




the present output voltage Vo can be detected as equal to the predetermined output voltage of the switching power supply. Also, when Vc(T1+T2)<Vco, as





  
    
      I
      2
    
    =
    
      
        V
        oset
      
      R
    
  
  ,




so





  
    
      
        V
        oset
      
      R
    
    >
    
      
        V
        o
      
      R
    
  
  ,




the present output voltage Vo can be detected as less than the predetermined output voltage of the switching power supply.

In this particular example, waveforms of gate voltage VG of the power switch, inductor current IL of the inductor, and excitation voltage VL of the inductor of the switching power supply in one switching cycle, as well as the distribution of time periods T1, T2, and T3 can be as shown in FIG. 9. Therefore, as the voltage across the detection capacitor is reset during time period T3, the initial voltage in any switching cycle can be the reset voltage for higher detection accuracy and stability of the switching power supply.
In one embodiment, a voltage detection circuit can include: (i) a first current generating circuit configured to generate a first current according to a first voltage and a converting resistor, where the first voltage includes an excitation voltage on an inductor of a switching power supply during a first time period of a switching cycle of the switching power supply, and where the first time period includes a rising portion of a current flowing through the inductor; (ii) a second current source configured to output a second current, where the first and second currents flow in opposite directions; (iii) a first switch coupled between the first current generating circuit and a detection capacitor; (iv) a second switch coupled between the second current source and the detection capacitor, where the first switch is on and the second switch is off such that the first current charges the detection capacitor via the first switch during the first time period, and where the first switch is off and the second switch is on such that the second current discharges the detection capacitor via the second switch during a second time period of the switching cycle; and (v) where a voltage across the detection capacitor is detected to obtain a detection voltage at an end time of the second time period, the detection voltage being used to determine a state of a present output voltage of the switching power supply, where the second time period includes a decreasing portion of the inductor current, and where the converting resistor includes a proportion of a predetermined output voltage of the switching power supply and the second current.
Referring now to FIG. 10, shown is a schematic block diagram of a first example voltage detection circuit, in accordance with embodiments of the present invention. In this particular example, the voltage detection circuit can include current generating circuit 1001, detection capacitor C, switches (e.g., transistors) Q1 and Q2, and current source 1002. For example, switch Q1 can connect between current generating circuit 1001 and detection capacitor C, and switch Q2 can connect between current source 1002 and detection capacitor C. Detection capacitor C can also have a grounded terminal in this case; however, this terminal can be connected to other nodes or voltage levels in other arrangements.
For example, current generating circuit 1001 can generate current I1 according to voltage VL and the converting resistor (e.g., R in FIG. 12), and current source 1002 can provide current I2. During time period T1 of each switching cycle, switch Q2 can be off, switch Q1 can be on, and current I1 can charge detection capacitor C via switch Q1. During time period T2 of each switching cycle, switch Q1 can be off, switch Q2 can be on, and current I2 (with the opposite direction of current I1) can discharge detection capacitor C via switch Q2.
At the end time of time period T2 of each switching cycle, voltage Vc(T1+T2) across detection capacitor C can be the detection voltage. A control circuit of the switching power supply can determine the state of the output voltage according to detection voltage Vc(T1+T2), and may adaptively regulate the output voltage of the switching power supply according to this relative state. For example, voltage VL can be the excitation voltage on the inductor of the switching power supply during time period T1 of each switching cycle. Also, converting resistor R can be a proportion of predetermined output voltage Voset of the switching power supply and current I2.
For example, time period T1 can be time portion with a rising inductor current of the switching power supply in each switching cycle, and time period T2 can be a time portion with a decreasing inductor current of the switching power supply in each switching cycle. Also, the switching cycle can be a switching cycle of a power switch or power stage circuit in the switching power supply. Detection capacitor C can be charged during time periods T1 and T2 of each switching cycle, and the voltage across detection capacitor C at the end time of time period T2 can be sampled as detection voltage Vc(T1+T2). Also, the state (e.g., relative state or voltage level) of the present output voltage of the switching power supply can be determined according to detection voltage Vc(T1+T2). The output voltage of the switching power supply can be adaptively regulated according to the detected state of the present output voltage.
In this example, detection voltage Vc(T1+T2) can be compared against initial voltage Vc(0) of detection capacitor C, to determine the state of the present output voltage of the switching power supply according to the comparison result. Also, the voltage detection circuit can include a comparison circuit that compares detection voltage Vc(T1+T2) against initial voltage Vc(0) of detection capacitor C, and outputs a comparison result to the control circuit of the switching power supply. The control circuit of the switching power supply can determine the state of the present output voltage of the switching power supply according to the comparison result.
For example, if the detection voltage is greater than the initial voltage of detection capacitor C, the present output voltage of the switching power supply can be determined to be greater than the predetermined output voltage. If the detection voltage can be equal to the initial voltage of detection capacitor C, the present output voltage of the switching power supply can be determined to be equal to the predetermined output voltage. If the detection voltage can be less than the initial voltage of detection capacitor C, the present output voltage of the switching power supply can be determined to be less than the predetermined output voltage.
Referring now to FIG. 11, shown is a schematic block diagram of a second example voltage detection circuit, in accordance with embodiments of the present invention. In this particular example, the voltage detection circuit can include switch Q3 coupled in parallel with detection capacitor C. During time period T3 of each switching cycle, both switches Q1 and Q2 are off, and switch Q3 can be on to effectively short out detection capacitor C. In this way, detection capacitor C can be discharged via switch Q3 such that the voltage of detection capacitor C is reset before the next switching cycle. For example, time period T3 can be the time portion from the end time of time period T2 to the start time of time period T1 of a next switching cycle.
As shown in FIG. 9, time period T3 can be a resonant time period in which the inductor current resonates around zero after reaching zero, and until being stable at zero in each switching cycle. When one terminal of detection capacitor C (the terminal not connected to switches Q1 and Q2) may not effectively be grounded, the voltage across detection capacitor C can be discharged via switch Q3 during time period T3, and the voltage can be reset to a predetermined reset voltage as the initial voltage of detection capacitor C.
In this case when detection capacitor C is discharged via switch Q3 during time period T3, and the voltage is reset to zero as the initial voltage of detection capacitor C, if initial voltage Vc(0) of detection capacitor C is zero, when Vc(T1+T2)>0, the present output voltage Vo can be detected as greater than the predetermined output voltage of the switching power supply. When Vc(T1+T2)=0, present output voltage Vo can be detected as equal to the predetermined output voltage of the switching power supply, and when Vc(T1+T2)<0, present output voltage Vo can be detected as less than the predetermined output voltage of the switching power supply;
Therefore, as the voltage across the detection capacitor is reset during time period T3, the initial voltage in any switching cycle can be the reset voltage for higher detection accuracy and stability of the switching power supply. Example waveforms of gate voltage VG of the power switch, inductor current IL of the inductor, and excitation voltage VL of the inductor of the switching power supply in one switching cycle, as well as the distribution of time periods T1, T2, and T3, can be as shown in FIG. 9.
Referring now to FIG. 12, shown is a schematic block diagram of an example buck switching power supply with a voltage detection circuit, in accordance with embodiments of the present invention. This example buck switching power supply can include control circuit 1201 with the voltage detection circuits as described herein. The power stage circuit can include a buck converter topology, or any other suitable topology (e.g., boost, buck-boost, flyback, SEPIC, Zeta, etc.). For example, the control circuit can determine the state of the output voltage according to the detection voltage, and may adaptively regulate the output voltage of the switching power supply by way of the power stage circuit, according to this detected state.
The embodiments were chosen and described in order to best explain the principles of the invention and its practical applications, to thereby enable others skilled in the art to best utilize the invention and various embodiments with modifications as are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the claims appended hereto and their equivalents.

## Claims

1. A method of detecting a voltage, the method comprising:
a) charging a detection capacitor by a first current during a first time period portion of a switching cycle of a switching power supply;
b) discharging said detection capacitor by a second current during a second time period of said switching cycle;
c) detecting a voltage across said detection capacitor to obtain a detection voltage at an end time of said second time period; and
d) determining a state of a present output voltage of said switching power supply according to said detection voltage;

wherein, the method further comprising resetting said voltage across said detection capacitor during a third time period, wherein said third time period comprises a time portion from said end time of said second time period to a start time of a next switching cycle.

2. The method of claim 1, wherein:
a) said present output voltage of said switching power supply is determined to be greater than said predetermined output voltage when said detection voltage is greater than an initial voltage of said detection capacitor at a beginning of said switching cycle;
b) said present output voltage of said switching power supply is determined to be equal to said predetermined output voltage when said detection voltage is equal to said initial voltage of detection capacitor; and
c) said present output voltage of said switching power supply is determined to be less than said predetermined output voltage when said detection voltage is less than said initial voltage of detection capacitor.

3. The method of claim 1, wherein said third time period comprises a resonant time period in which said inductor current resonates after reaching zero until stable at zero in said switching cycle.

4. The method of claim 1, wherein said second current comprises an output current of a current source.

5. The method of claim 1, wherein said first current is generated according to a first voltage and a converting resistor.

6. The method of claim 5, wherein said first voltage comprises an excitation voltage on an inductor of said switching power supply during said first time period.

7. The method of claim 5, wherein said converting resistor comprises a proportion of a predetermined output voltage of said switching power supply and said second current.

8. The method of claim 1, wherein said first time period comprises a rising portion of a current flowing through said inductor, and said second time period comprises a decreasing portion of said inductor current.

9. A voltage detection circuit, comprising:
a) a first current generating circuit configured to generate a first current charge a detection capacitor during a first time period of a switching cycle of said switching power supply;
b) a second current source configured to output generate a second current to discharge said detection capacitor during a second time period of said switching cycle of said switching power supply;
c) a first switch coupled between said first current generating circuit and a detection capacitor;
d) a second switch coupled between said second current source and said detection capacitor;
and e) wherein a voltage across said detection capacitor is detected to obtain a detection voltage at an end time of said second time period, said detection voltage being used to determine a state of a present output voltage of said switching power supply
wherein the voltage detection circuit further comprising a third switch coupled in parallel to said detection capacitor, wherein:
a) said first and second switches are off and said third switch is on such that said detection capacitor is discharged via said third switch to reset said voltage across said detection capacitor during a third time period of said switching cycle; and
b) said third time period comprises a time portion from said end time of said second time period to a start time of a next switching cycle.

10. The voltage detection circuit of claim 9, further comprising a comparison circuit configured to compare said detection voltage against an initial voltage of said detection capacitor, wherein:
a) said present output voltage of said switching power supply is determined to be greater than said predetermined output voltage when said detection voltage is greater than an initial voltage of said detection capacitor at a beginning of said switching cycle;
b) said present output voltage of said switching power supply is determined to be equal to said predetermined output voltage when said detection voltage is equal to said initial voltage of detection capacitor; and
c) said present output voltage of said switching power supply is determined to be less than said predetermined output voltage when said detection voltage is less than said initial voltage of detection capacitor.

11. The voltage detection circuit of claim 1, wherein said third time period comprises a resonant time period in which said inductor current resonates after reaching zero until stable at zero in said switching cycle.

12. A switching power supply, comprising:
a) the voltage detection circuit of claim 9;
b) a control circuit coupled to the voltage detection circuit; and
c) a power stage circuit coupled to the control circuit.

13. The switching power supply of claim 12, wherein said power stage circuit comprises a buck converter topology.

14. The voltage detection circuit of claim 9, wherein said first current is generated according to a first voltage and a converting resistor.

15. The voltage detection circuit of claim 14, wherein said first voltage comprises an excitation voltage on an inductor of said switching power supply during said first time period.

16. The voltage detection circuit of claim 14, wherein said converting resistor comprises a proportion of a predetermined output voltage of said switching power supply and said second current.

17. The voltage detection circuit of claim 9, wherein said first time period comprises a rising portion of a current flowing through said inductor, and said second time period comprises a decreasing portion of said inductor current.

18. The voltage detection circuit of claim 9, wherein said first switch is on and said second switch is off during said first time period of said switching cycle of said switching power supply, and said first switch is off and said second switch is on during said second time period of said switching cycle of said switching power supply.