Constant current control circuit, flyback switching power supply and constant current control method

CN122678451APending Publication Date: 2026-09-01SHENZHEN LIXIN SEMICON CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611151505.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-31
Publication Date
2026-09-01

AI Technical Summary

Technical Problem

[0003]然而,在电机驱动等感性负载场景下,启动时等效阻抗极小,输出电压上升极为缓慢

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122678451A_ABST
    Figure CN122678451A_ABST
Patent Text Reader

Abstract

The application discloses a constant current control circuit, a flyback switching power supply and a constant current control method. The constant current control circuit comprises a feedback sampling circuit, a constant current regulating circuit, a switch selection circuit, a constant current threshold selection circuit and a PWM modulation and driving circuit. The feedback sampling circuit is used for sampling the output voltage of the auxiliary winding of the flyback circuit and outputting a feedback sampling voltage value. The constant current regulating circuit is used for periodically accumulating the deviation between the target current value and the actual current value represented by the voltage value at the first input end, and outputting an error threshold voltage. The first input end of the PWM modulation and driving circuit is connected with the output end of the constant current regulating circuit, the second input end is connected with a real-time detection signal representing the instantaneous value of the primary side current, and the output end is connected with the controlled end of the power switch tube in the flyback circuit. The PWM modulation and driving circuit is used for outputting a turn-off control signal to turn off the power switch tube when the real-time detection signal is greater than or equal to the error threshold voltage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of flyback switching power supply technology, and particularly to a constant current control circuit, a flyback switching power supply, and a constant current control method. Background Technology

[0002] Flyback switching power supplies are widely used in low-to-medium power constant current output applications, such as battery chargers and some LED lighting drivers. In existing constant current control schemes, the system typically sets only a single constant current reference value, and the controller stabilizes the output current at this reference value by adjusting the on-time of the power switching transistor. Simultaneously, to protect the system in the event of an output short circuit, the chip usually has a fixed short-circuit protection shielding time. If the output voltage does not reach the short-circuit protection threshold within this time, protection is triggered and the power transistor is turned off.

[0003] However, in inductive load scenarios such as motor drives, the equivalent impedance is extremely small during startup, and the output voltage rises very slowly. Because the output current is limited to the rated constant current value during the startup phase, the output voltage often cannot rise above the short-circuit protection threshold within the short-circuit protection shielding time, causing the system to frequently trigger the short-circuit protection falsely and repeatedly restart, ultimately failing to start normally.

[0004] Therefore, how to improve the startup success rate under inductive loads while ensuring constant current accuracy is a technical problem that urgently needs to be solved in this field. Summary of the Invention

[0005] This invention proposes a constant current control circuit for use in flyback circuits; the constant current control circuit includes: a feedback sampling circuit, a constant current adjustment circuit, a switch selection circuit, a constant current threshold selection circuit, and a PWM modulation and driving circuit; The feedback sampling circuit is used to sample the output voltage of the auxiliary winding of the flyback circuit and output the feedback sampling voltage value. The first input terminal of the switch selection circuit is connected to a first constant current reference voltage, its second input terminal is connected to a second constant current reference voltage, and its output terminal is connected to the first input terminal of the constant current adjustment circuit; the first constant current reference voltage is greater than the second constant current reference voltage. The first input terminal of the constant current threshold selection circuit is connected to the output terminal of the feedback sampling circuit, and its output terminal is connected to the controlled terminal of the switch selection circuit. The constant current threshold selection circuit is used to control the switch selection circuit to conduct the path between its first input terminal and its output terminal when the feedback sampling voltage value is less than the fast start threshold voltage; and to output a voltage switching command to the controlled terminal of the switch selection circuit when the feedback sampling voltage value is greater than or equal to the fast start threshold voltage, so that the switch selection circuit switches the path between the second input terminal and the output terminal of the switch selection circuit. The second input terminal of the constant current regulating circuit is connected to a detection voltage signal that represents the peak value of the primary current. The constant current regulating circuit is used to periodically accumulate the deviation between the target current value represented by the voltage value at its first input terminal and the actual current value represented by the voltage value at its second input terminal, and output an error threshold voltage that represents the result of the accumulated deviation. The first input terminal of the PWM modulation and driving circuit is connected to the output terminal of the constant current regulation circuit, the second input terminal is connected to a real-time detection signal representing the instantaneous value of the primary current, and the output terminal is connected to the controlled terminal of the power switch in the flyback circuit. The PWM modulation and driving circuit is used to output a turn-off control signal to turn off the power switch when the real-time detection signal is greater than or equal to the error threshold voltage.

[0006] Optionally, it also includes: a demagnetization detection circuit; The input terminal of the demagnetization detection circuit is connected to the feedback sampling voltage value. The demagnetization detection circuit is used to output a first detection signal when the feedback sampling voltage value is less than the demagnetization threshold voltage, and to output a second detection signal when the feedback sampling voltage value is greater than or equal to the demagnetization threshold voltage. The constant current regulation circuit includes: a sampling controlled switch, a conduction reset circuit, a first capacitor, a second capacitor, a charging current converter, and a discharging current converter; The first terminal of the sampling controlled switch is connected to the detection voltage signal, its second terminal is connected to the first terminal of the first capacitor and the first terminal of the conduction reset circuit, the second terminal of the conduction reset circuit is connected to the input terminal of the discharge current converter, and its third terminal is grounded. The input terminal of the charging current converter is connected to the output terminal of the switch selection circuit, and its output terminal is connected to the output terminal of the discharging current converter and the first terminal of the second capacitor; the second terminal of the first capacitor and the second terminal of the second capacitor are grounded; the first terminal of the second capacitor is also connected to the first input terminal of the PWM modulation and drive circuit. The conduction reset circuit is used to conduct the path between the first terminal of the first capacitor and the input terminal of the discharge current converter when the second detection signal is received; and to conduct the path between the input terminal of the discharge current converter and ground when the first detection signal is received.

[0007] The controlled terminal of the sampling controlled switch is connected to a sampling control signal. The sampling control signal is used to control the sampling controlled switch to be turned on for a short time before the turn-off edge of the drive signal output by the PWM modulation and drive circuit, so as to sample and hold the peak value of the detected voltage signal on the first capacitor. The charging current converter is used to generate a charging current for the second capacitor based on the voltage at the output terminal of the switch selection circuit. The discharge current converter is used to generate a discharge current for the second capacitor based on the voltage value at the first terminal of the first capacitor and the voltage value at the first terminal of the second capacitor.

[0008] Optionally, the conduction reset circuit includes: a first controlled switch and a second controlled switch; The first terminal of the first controlled switch is connected to the first terminal of the first capacitor, and the second terminal is connected to the input terminal of the discharge current converter and the first terminal of the second controlled switch; the second terminal of the second controlled switch is grounded. The controlled terminal of the first controlled switch is connected to the first output terminal of the demagnetization detection circuit, and is used to turn on when the second detection signal is received, so as to transfer the voltage of the first terminal of the first capacitor to the input terminal of the discharge current converter; and to turn off when the first detection signal is received. The controlled terminal of the second controlled switch is connected to the second output terminal of the demagnetization detection circuit, and is used to turn on when the first detection signal is received to reset the input terminal of the discharge current converter to ground; and to turn off when the second detection signal is received.

[0009] Optionally, the demagnetization detection circuit is further configured to output the valley detection signal when the feedback sampling voltage value is within a preset valley voltage range and the duration is longer than a preset duration; The PWM modulation and driving circuit includes: Comparator, RS flip-flop and driver circuit; The non-inverting input of the comparator is connected to the real-time detection signal, its inverting input is connected to the first terminal of the second capacitor, and its output is connected to the first input of the RS flip-flop; the second input of the RS flip-flop is connected to the valley detection signal output by the demagnetization detection circuit, and its output is connected to the input of the driving circuit. The comparator is configured to output a shutdown control signal when the real-time detection signal is greater than or equal to the error threshold voltage. The RS trigger is used to reset according to the shutdown control signal and set according to the valley detection signal to output a pulse width modulation signal; The output terminal of the driving circuit serves as the output terminal of the PWM modulation and driving circuit, and is used to connect to the controlled terminal of the power switch. The driving circuit is used to drive the power switch to turn on or off according to the pulse width modulation signal.

[0010] Optionally, the comparator is an operational amplifier.

[0011] Optionally, the PWM modulation and driving circuit further includes an OR gate; The first input of the OR gate is connected to the output of the comparator, and its output is connected to the first input of the RS flip-flop. The constant current control circuit includes: a voltage protection circuit; The first input terminal of the voltage protection circuit is connected to the feedback sampled voltage value, and the output terminal is connected to the second input terminal of the OR gate. The voltage protection circuit is configured to output a high-level protection trigger signal to the second input terminal of the OR gate when the feedback sampling voltage value is greater than or equal to a preset overvoltage protection threshold; and to output the high-level protection trigger signal to the second input terminal of the OR gate when the feedback sampling voltage value is less than a preset short-circuit protection threshold and the duration is greater than or equal to a preset short-circuit protection shielding time.

[0012] Optionally, the fast-start threshold voltage is configured as a feedback sampling voltage value corresponding to the lowest operating output voltage of the flyback circuit.

[0013] Optionally, the constant current control circuit may further include: an input voltage compensation circuit; The first input terminal of the input voltage compensation circuit is connected to the auxiliary winding of the flyback circuit, and is used to generate a compensation current characterizing the input voltage according to the voltage of the auxiliary winding. Its output terminal is connected to the second input terminal of the constant current regulation circuit. The input voltage compensation circuit is used to superimpose the compensation current onto the detection voltage signal characterizing the primary current to compensate for the current detection deviation caused by the power switch turn-off delay due to input voltage changes. The output terminal of the input voltage compensation circuit is used to output a compensated detection voltage signal superimposed with the compensation current to the second input terminal of the constant current regulation circuit, as a characterization signal of the actual current value.

[0014] This invention also proposes a flyback switching power supply, comprising: As described in the constant current control circuit; A transformer includes a primary winding, a secondary winding, and an auxiliary winding; A power switching transistor, the control terminal of which is connected to the output terminal of the PWM modulation and drive circuit of the constant current control circuit, and the first terminal of which is connected to the primary winding; A current sensing resistor is connected in series between the second terminal of the power switch and ground to generate a detection voltage signal characterizing the primary current. An output rectifier and filter circuit, connected to the secondary winding, is used to provide a constant output current to the load.

[0015] This invention also proposes a constant current control method for use in flyback switching power supplies. The constant current control method includes: The output voltage of the auxiliary winding of the flyback switching power supply is sampled to obtain the feedback sampling voltage value; The feedback sampling voltage value is compared with the fast start threshold voltage. When the feedback sampling voltage value is less than the fast start threshold voltage, a first constant current reference voltage is selected as the target reference voltage. When the feedback sampling voltage value is greater than or equal to the fast start threshold voltage, a second constant current reference voltage is selected as the target reference voltage. Wherein, the first constant current reference voltage is greater than the second constant current reference voltage. Acquire a detection voltage signal that characterizes the peak value of the primary side current, and periodically accumulate the deviation between the target current value represented by the target reference voltage and the actual current value represented by the detection voltage signal to generate an error threshold voltage. The real-time detection signal representing the instantaneous value of the primary current is compared with the error threshold voltage. When the real-time detection signal is greater than or equal to the error threshold voltage, a shutdown control signal is output to shut down the power switch. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.

[0017] Figure 1 This is a schematic diagram of an embodiment of the constant current control circuit of the present invention; Figure 2 This is a schematic diagram of another embodiment of the constant current control circuit of the present invention; Figure 3 This is a schematic diagram of another embodiment of the constant current control circuit of the present invention; Figure 4 A schematic diagram of a primary-side feedback (PSR) flyback switching power supply system applying the present invention; Figure 5 A schematic diagram of a secondary-side feedback (SSR) flyback switching power supply system applying the present invention; Figure 6 This is a detailed implementation block diagram of an embodiment of the constant current control circuit of the present invention; Figure 7 This is a schematic diagram of the structure of a constant current adjustment circuit according to another embodiment of the constant current control circuit of the present invention; Figure 8 This is a first constant current control timing waveform diagram of an embodiment of the constant current control circuit of the present invention; Figure 9This is a second constant current control timing waveform diagram of an embodiment of the constant current control circuit of the present invention; Figure 10 This is a third constant current control timing waveform diagram of an embodiment of the constant current control circuit of the present invention; Figure 11 This is a fourth constant current control timing waveform diagram of an embodiment of the constant current control circuit of the present invention; Figure 12 This is a fifth constant current control timing waveform diagram of an embodiment of the constant current control circuit of the present invention; Figure 13 The sixth constant current control timing waveform diagram is shown in one embodiment of the constant current control circuit of the present invention.

[0018] Explanation of icon numbers: C1, first capacitor; C2, second capacitor; Lp, primary winding; Ls, secondary winding; La, auxiliary winding; R1, first resistor; R2, second resistor.

[0019] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0021] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indication will also change accordingly.

[0022] In this invention, unless otherwise explicitly specified and limited, the terms "connection," "fixed," etc., should be interpreted broadly. For example, "fixed" can mean a fixed connection, a detachable connection, or an integral part; it can mean a mechanical connection or an electrical connection; it can mean a direct connection or an indirect connection through an intermediate medium; it can mean the internal communication of two components or the interaction between two components, unless otherwise explicitly limited. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0023] Furthermore, in this invention, descriptions involving "first," "second," etc., are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. Additionally, the technical solutions of the various embodiments can be combined with each other, but only on the basis of being achievable by those skilled in the art. When the combination of technical solutions is contradictory or impossible to implement, such a combination of technical solutions should be considered non-existent and not within the scope of protection claimed by this invention.

[0024] This invention proposes a constant current control circuit for use in flyback circuits; such as Figure 1 As shown, the constant current control circuit includes: a feedback sampling circuit, a constant current adjustment circuit, a switch selection circuit, a constant current threshold selection circuit, and a PWM modulation and driving circuit; The feedback sampling circuit is used to sample the output voltage of the auxiliary winding of the flyback circuit and output the feedback sampling voltage value. The first input terminal of the switch selection circuit is connected to a first constant current reference voltage, its second input terminal is connected to a second constant current reference voltage, and its output terminal is connected to the first input terminal of the constant current adjustment circuit; the first constant current reference voltage is greater than the second constant current reference voltage. The first input terminal of the constant current threshold selection circuit is connected to the output terminal of the feedback sampling circuit, and its output terminal is connected to the controlled terminal of the switch selection circuit. The constant current threshold selection circuit is used to control the switch selection circuit to conduct the path between its first input terminal and its output terminal when the feedback sampling voltage value is less than the fast start threshold voltage; and to output a voltage switching command to the controlled terminal of the switch selection circuit when the feedback sampling voltage value is greater than or equal to the fast start threshold voltage, so that the switch selection circuit switches the path between the second input terminal and the output terminal of the switch selection circuit. The second input terminal of the constant current regulating circuit is connected to a detection voltage signal that represents the peak value of the primary current. The constant current regulating circuit is used to periodically accumulate the deviation between the target current value represented by the voltage value at its first input terminal and the actual current value represented by the voltage value at its second input terminal, and output an error threshold voltage that represents the result of the accumulated deviation. The first input terminal of the PWM modulation and driving circuit is connected to the output terminal of the constant current regulation circuit, the second input terminal is connected to a real-time detection signal representing the instantaneous value of the primary current, and the output terminal is connected to the controlled terminal of the power switch in the flyback circuit. The PWM modulation and driving circuit is used to output a turn-off control signal to turn off the power switch when the real-time detection signal is greater than or equal to the error threshold voltage.

[0025] It should be noted that the constant current control circuit provided by this invention can be applied to flyback switching power supplies. This constant current control circuit is connected to external components such as transformers, power switching transistors, and current sensing resistors via external pins, together forming a complete switching power supply system. The following example illustrates the functional implementation of the constant current control circuit in the form of an integrated circuit.

[0026] Figure 4 This invention illustrates a primary-side feedback (PSR) flyback switching power supply system. Figure 5 This paper illustrates a secondary-side feedback (SSR) flyback switching power supply system applying the present invention. The two systems share the same basic power stage structure, differing only in the method of obtaining the output voltage feedback signal—the primary-side feedback method obtains the feedback signal directly from the auxiliary winding, eliminating the need for an optocoupler and voltage reference chip; the secondary-side feedback method samples directly from the output terminal and transmits it to the chip via optocoupler isolation. The primary-side feedback system will be used as an example for the following explanation.

[0027] Taking a primary-side feedback flyback switching power supply system as an example, the system includes an input rectifier and filter circuit, a transformer, a power switching transistor, a current sensing resistor, and an output rectifier and filter circuit. The transformer includes a primary winding, a secondary winding, and an auxiliary winding. The drain of the power switching transistor is connected to the primary winding, the source is grounded via the current sensing resistor, and the gate is controlled by the drive signal of the constant current control circuit. One end of the auxiliary winding is grounded via a first resistor R1 and a second resistor R2 connected in series. The voltage divider node between the first and second resistors is connected to the feedback input terminal of the constant current control circuit.

[0028] In a flyback switching power supply, the voltage waveform on the auxiliary winding reflects the operating state of the system output. When the power switch is on, the transformer is in the magnetization stage, and the voltage on the auxiliary winding cannot reflect the output voltage information. When the power switch is off, the transformer enters the demagnetization stage, and the auxiliary winding induces a positive voltage proportional to the output voltage. Based on this, the feedback sampling circuit samples the output voltage of the auxiliary winding during the transformer demagnetization period to obtain the feedback sampling voltage value. This value has a linear relationship with the system output voltage, determined by the voltage division ratio of the first resistor R1 and the second resistor R2, as well as the transformer turns ratio, enabling real-time and accurate characterization of the output voltage magnitude. Simultaneously, a current sensing resistor is connected in series between the source of the power switch and ground to convert the primary current signal into a voltage signal. The constant current control circuit acquires this signal in real-time through the current sensing pin. The signal comprises two forms: one is a detection voltage signal characterizing the peak value of the primary current, acquired by the sample-and-hold circuit in each switching cycle, used for deviation accumulation calculation in the constant current regulation circuit; the other is a real-time detection signal characterizing the instantaneous value of the primary current, which is a continuously rising ramp voltage signal used for real-time decision-making by the PWM comparator. These two forms serve different control purposes, but both originate from the voltage across the same current sensing resistor.

[0029] In existing constant current control schemes, the system typically sets only a single constant current reference value, using this value as the target for control in both the startup and steady-state phases. This architecture has significant drawbacks in heavy-load startup scenarios such as inductive loads—a very large current is required for the output voltage to rise rapidly during startup, but the single reference value limits the startup current, resulting in a slow output voltage rise. This fails to reach the short-circuit protection threshold within the short-circuit protection shielding time, causing the system to falsely trigger short-circuit protection and repeatedly restart. Based on this understanding, this invention sets two constant current reference voltages of different magnitudes in the constant current control circuit and introduces a mode switching mechanism, enabling the system to automatically select the appropriate reference value based on the current stage of the output voltage. Specifically, the first input terminal of the switch selection circuit is connected to the first constant current reference voltage, and the second input terminal is connected to the second constant current reference voltage, with the first constant current reference voltage being greater than the second. Its output terminal is connected to the first input terminal of the constant current adjustment circuit. The first input terminal of the constant current threshold selection circuit is connected to the output terminal of the feedback sampling circuit to receive the feedback sampling voltage value, and its output terminal is connected to the controlled terminal of the switch selection circuit. A fast-start threshold voltage is pre-stored in this circuit. When the feedback sampling voltage value is less than the fast-start threshold voltage, it indicates that the output voltage is still at a low level and the system is still in the startup phase. At this time, the constant current threshold selection circuit controls the switch selection circuit to open the path between its first input and output terminals, that is, outputting a larger first constant current reference voltage to the first input terminal of the constant current regulation circuit, and the system enters the fast-start mode. When the feedback sampling voltage value reaches or exceeds the fast-start threshold voltage, it indicates that the output voltage has risen to the preset switching point. At this time, the constant current threshold selection circuit outputs a switching command to the controlled terminal of the switch selection circuit, causing the switch selection circuit to switch the path between its second input and output terminals, that is, outputting a smaller second constant current reference voltage to the first input terminal of the constant current regulation circuit, and the system switches from the fast-start mode to the normal constant current mode. Through this mechanism, the system quickly establishes the output voltage with a large current during the startup phase, effectively shortening the startup time and ensuring that the output voltage reaches above the safety threshold within the short-circuit protection shielding time; after the output voltage reaches the preset value, it automatically switches to the normal constant current value and enters steady-state regulation.

[0030] Figure 6 A block diagram illustrating a specific implementation of the constant current control circuit of the present invention is shown below. Figure 2 The internal structure and working principle of the constant current regulation circuit and the PWM modulation and drive circuit are explained in detail.

[0031] The constant current regulating circuit is the core module for achieving high-precision constant current control in this invention. Its first input terminal is connected to the output terminal of the switch selection circuit, receiving the selected target reference voltage. Its second input terminal is connected to a detection voltage signal representing the peak value of the primary current. The basic function of the constant current regulating circuit is to periodically accumulate the deviation between the target current value represented by the voltage value at its first input terminal and the actual current value represented by the voltage value at its second input terminal, and output an error threshold voltage representing the accumulated deviation. "Periodic accumulation" means that within each switching cycle, the constant current regulating circuit converts the deviation between the target value and the actual value into a corresponding physical quantity and accumulates it—when the target value is greater than the actual value, the accumulated amount increases; when the target value is less than the actual value, the accumulated amount decreases. This accumulated amount is output in voltage form, which is the error threshold voltage. In a specific implementation, the constant current regulating circuit can achieve the above accumulation function through a charging current source, a discharging current source, and an integrating capacitor: the charging current source generates a charging current based on the target reference voltage, the discharging current source generates a discharging current based on the detected peak value of the primary current, and the voltage on the integrating capacitor is the result of the accumulated charge and discharge. More specifically, the charging current continuously charges the integrating capacitor throughout the entire switching cycle, and the amount of charge represents the target value; the discharging current only discharges the integrating capacitor during the transformer demagnetization phase, and the amount of discharge represents the actual value. The net charge on the integrating capacitor reflects the cumulative deviation between the target value and the actual value. The constant current regulation circuit responds to this deviation in the following direction: if the actual value is too large, the discharge amount is too large, the net charge on the integrating capacitor decreases, and the error threshold voltage decreases; if the actual value is too small, the discharge amount is too small, the net charge on the integrating capacitor increases, and the error threshold voltage rises. This integrated voltage is output as the error threshold voltage to the PWM modulation and drive circuit to determine the turn-off time of the power switch.

[0032] The aforementioned charge balancing process naturally forms a negative feedback control loop. The level of the error threshold voltage directly determines the conduction time of the power switch in each cycle—the higher the threshold voltage, the longer the conduction time and the more energy transferred; the lower the threshold voltage, the shorter the conduction time and the less energy transferred. When the output current is too high, the detection voltage signal representing the peak value of the primary current is too high, corresponding to more discharge charge, reducing the net charge on the integrating capacitor, lowering the error threshold voltage, and causing the PWM modulation and drive circuit to advance the turn-off time of the power switch, shortening the conduction time, reducing the energy transferred by the transformer, and causing the output current to drop. Conversely, when the output current is too low, the error threshold voltage rises, the conduction time lengthens, and the output current rises. After several switching cycles of negative feedback adjustment, the system reaches a dynamic equilibrium state, at which point the amount of charge charged into the integrating capacitor in each cycle is exactly equal to the amount of charge discharged. In this equilibrium state, the output current is locked at a constant value determined by the target reference voltage, the current sensing resistor, and the transformer turns ratio, independent of parameters such as the input voltage, switching frequency, and transformer inductance. Figure 8 The timing waveforms of the above negative feedback regulation process are shown. From Figure 8 As can be seen, when the peak primary current (Vcs1) is high, the error threshold voltage (Vcomp) automatically decreases, causing the power switch to turn off earlier and shortening the conduction time; when the peak primary current is low, Vcomp automatically increases, extending the conduction time. After multiple cycles of negative feedback regulation, the system eventually enters a steady state, and the output current remains constant. This characteristic ensures that the present invention can achieve high-precision constant current output under different input voltages and different load conditions.

[0033] The first input of the PWM modulation and driving circuit is connected to the output of the constant current regulation circuit to receive the error threshold voltage; its second input is connected to a real-time detection signal representing the instantaneous value of the primary current; and its output is connected to the controlled terminal of the power switch. The function of the PWM modulation and driving circuit is to convert the error threshold voltage output by the constant current regulation circuit into specific power switch on / off actions. In a specific implementation, the PWM modulation and driving circuit may include a comparator, an RS flip-flop, and a driving circuit. The comparator compares the real-time rising primary current detection signal with the error threshold voltage. When the real-time detection signal reaches or exceeds the error threshold voltage, the comparator flips and outputs a turn-off control signal. The RS flip-flop outputs a pulse width modulation signal based on the set signal (starting a new cycle) and the turn-off control signal (ending the current cycle). The driving circuit amplifies this pulse width modulation signal and drives the power switch to turn on or off. Through this mechanism, the error threshold voltage output by the constant current regulation circuit precisely controls the on-time of the power switch in each cycle—the higher the error threshold voltage, the higher the peak value of the primary current can rise, the longer the on-time, and the more energy transferred; conversely, the lower the error threshold voltage, the less energy is transferred. Thus, the constant current regulation circuit, PWM modulation and drive circuit, and power stage constitute a complete closed-loop control system, realizing precise regulation of the output current.

[0034] During a complete startup process, the components of this invention work together as follows: After the system is powered on, the output voltage is zero, the feedback sampling voltage value is much smaller than the fast start threshold voltage, the constant current threshold selection circuit controls the switch selection circuit to send a larger first constant current reference voltage to the constant current regulation circuit, and the system starts up with a current much larger than the rated value.

[0035] Figure 9 The waveforms of the fast startup sequence are shown. From Figure 9 As can be seen, during the fast start-up phase (T_ST_SPD), the system charges the output capacitor with a large output current (IOUT_MAX), causing the output voltage (VOUT) to rise rapidly. When the feedback sampling voltage reaches the fast start-up threshold voltage (VCC_SEL), the system switches to normal constant current mode, and the output current smoothly transitions to its rated value. The constant current regulation circuit accumulates deviations based on this large reference value, outputting a high error threshold voltage. The PWM modulation and drive circuit uses this to control the power switch to maintain a longer conduction time in each cycle, allowing the transformer to transfer a larger amount of energy, resulting in a rapid rise in the output voltage.

[0036] Figure 10 The output voltage (VOUT) and output current (IOUT) waveforms of the present invention during actual startup are further illustrated. From Figure 10As can be seen, in fast-start mode, the output voltage (VOUT) rises at an extremely rapid rate, and the output current (IOUT) maintains a high fast-start current value in the initial stage of startup. Once the output voltage reaches the fast-start threshold, the system smoothly switches to constant current mode, and the output current stabilizes at the rated value. The entire startup process is completed smoothly without triggering any protection. Due to the large startup current, the output voltage can safely exceed the short-circuit protection threshold within the short-circuit protection shielding time, effectively avoiding the problem of repeated restarts caused by false triggering of short-circuit protection due to a slow output voltage rise, thus ensuring successful startup under heavy load conditions such as inductive loads.

[0037] In contrast. Figure 11 The waveform of startup failure of a traditional constant current control scheme under the same inductive load conditions is shown. Figure 11 As can be seen, because the traditional solution uses the same rated constant current value (IOUT) during the startup and steady-state phases, the output voltage (VOUT) rises extremely slowly. When the short-circuit protection shielding time (T_SCP_BLK) is exhausted, the output voltage still has not reached the short-circuit protection threshold (V_SCP), causing the system to falsely trigger short-circuit protection and repeatedly restart, ultimately failing to start successfully. This invention effectively overcomes this defect through a fast-start mode. When the output voltage rises to the voltage value corresponding to the fast-start threshold voltage, the feedback sampling voltage value reaches the fast-start threshold voltage. The constant current threshold selection circuit triggers the switch selection circuit to switch to a smaller second constant current reference voltage, and the system switches from fast-start mode to normal constant current mode. The constant current regulation circuit then uses this smaller reference value for fine adjustment, and the output current smoothly transitions to the rated constant current value.

[0038] In summary, this invention, through a dual-reference voltage switching selection mechanism, enables the system to rapidly establish an output voltage with a current far exceeding the rated value during the startup phase. This solves the startup failure problem caused by insufficient startup current and slow output voltage rise under heavy load conditions such as inductive loads. After the output voltage reaches a preset threshold, it automatically switches to normal constant current mode, allowing the system to enter high-precision steady-state constant current regulation. At the same time, based on the constant current regulation mechanism of periodic deviation accumulation, the steady-state output current is determined only by the target reference voltage, the external current sensing resistor, and the transformer turns ratio, and is not affected by changes in input voltage, switching frequency, or transformer parameters, thus achieving high-precision constant current output.

[0039] In the first embodiment, as Figure 2 As shown, the constant current control circuit further includes a demagnetization detection circuit; The input terminal of the demagnetization detection circuit is connected to the feedback sampling voltage value. The demagnetization detection circuit is used to output a first detection signal when the feedback sampling voltage value is less than the demagnetization threshold voltage, and to output a second detection signal when the feedback sampling voltage value is greater than or equal to the demagnetization threshold voltage. The constant current regulation circuit includes: a sampling controlled switch, a conduction reset circuit, a first capacitor C1 and a second capacitor C2, a charging current converter and a discharging current converter; The first terminal of the sampling controlled switch is connected to the detection voltage signal, its second terminal is connected to the first terminal of the first capacitor C1 and the first terminal of the conduction reset circuit, the second terminal of the conduction reset circuit is connected to the input terminal of the discharge current converter, and its third terminal is grounded. The input terminal of the charging current converter is connected to the output terminal of the switch selection circuit, and its output terminal is connected to the output terminal of the discharging current converter and the first terminal of the second capacitor C2; the second terminal of the first capacitor C1 and the second terminal of the second capacitor C2 are grounded; the first terminal of the second capacitor C2 is also connected to the first input terminal of the PWM modulation and drive circuit. The conduction reset circuit is used to conduct the path between the first terminal of the first capacitor C1 and the input terminal of the discharge current converter when the second detection signal is received; and to conduct the path between the input terminal of the discharge current converter and ground when the first detection signal is received.

[0040] The controlled terminal of the sampling controlled switch is connected to a sampling control signal. The sampling control signal is used to control the sampling controlled switch to be turned on for a short time before the turn-off edge of the drive signal output by the PWM modulation and drive circuit, so as to sample and hold the peak value of the detected voltage signal on the first capacitor C1. The charging current converter is used to generate a charging current for the second capacitor C2 based on the voltage at the output terminal of the switch selection circuit. The discharge current converter is used to generate a discharge current for the second capacitor C2 based on the voltage value at the first terminal of the first capacitor C1 and the voltage value at the first terminal of the second capacitor C2.

[0041] It should be noted that in the intermittent operation mode of a flyback switching power supply, the transformer undergoes three stages in each switching cycle: magnetization, demagnetization, and dead zone. The demagnetization stage is the only period during which the transformer transfers energy to the secondary winding—after the power switch is turned off, the energy stored in the core is released to the load via the secondary winding, and the auxiliary winding induces a positive voltage proportional to the output voltage during this period. Therefore, accurately identifying the start and end times of the demagnetization stage is crucial for the constant current control circuit to obtain correct output voltage information and calculate the energy transferred in each cycle. Based on this, the constant current control circuit includes a demagnetization detection circuit, whose input is connected to a feedback sampling voltage value. The demagnetization detection circuit internally stores a demagnetization threshold voltage, which is used to distinguish whether the transformer is in the demagnetization stage or not. When the feedback sampling voltage value is less than the demagnetization threshold voltage, it indicates that the transformer is in the non-demagnetization stage (including the power switch conduction and magnetization stage and the dead zone stage), and the demagnetization detection circuit outputs a first detection signal; when the feedback sampling voltage value is greater than or equal to the demagnetization threshold voltage, it indicates that the transformer is in the demagnetization stage, and the demagnetization detection circuit outputs a second detection signal. The first detection signal and the second detection signal are logically complementary control signals, which are used to control the on / off state of different switches inside the constant current regulation circuit, so as to achieve selective transmission and periodic reset of the primary current peak signal.

[0042] In the constant current regulation circuit, in order to obtain the peak value information of the primary side current in each switching cycle to achieve precise charge accumulation control, a sampling controlled switch, a first capacitor C1, a conduction reset circuit, a second capacitor C2, a charging current converter, and a discharging current converter are set up.

[0043] Figure 7 This paper illustrates a specific implementation of the aforementioned constant current regulation circuit (particularly the constant current error amplification function). The following section combines... Figure 7 The connection relationships and working principles of each component are explained in detail.

[0044] The first terminal of the sampling controlled switch is connected to a detection voltage signal representing the peak value of the primary-side current. This detection voltage signal originates from a current-sensing resistor connected in series with the source of the power switch and increases linearly with the rise of the primary-side current in each switching cycle. The controlled terminal of the sampling controlled switch is connected to a sampling control signal, the timing of which is precisely configured such that—for a very short period (e.g., tens to hundreds of nanoseconds) before the power switch's turn-off edge arrives, the sampling control signal briefly turns on the sampling controlled switch, allowing the detection voltage signal at this moment to be transmitted to its downstream end. Since this moment coincides with the instant the primary-side current reaches its peak value, the sampling controlled switch samples this peak voltage and holds it across the first capacitor C1 after turning on. After the sampling control signal goes low, the sampling controlled switch turns off, and the first capacitor C1 holds this peak voltage until it is refreshed in the next cycle. Through this mechanism, the voltage at the first terminal of the first capacitor C1 is updated to the peak value of the primary-side current in each switching cycle.

[0045] The first terminal of the first capacitor C1 is also connected to the first terminal of the on-reset circuit. The second terminal of the on-reset circuit is connected to the input terminal of the discharge current converter, and the third terminal of the on-reset circuit is grounded. The on-reset circuit is used to control the on / off state of different internal paths according to the detection signal output by the demagnetization detection circuit. When the on-reset circuit receives the second detection signal (i.e., the transformer is in the demagnetization stage), it opens the path between the first terminal of the first capacitor C1 and the input terminal of the discharge current converter, so that the peak voltage held on the first capacitor C1 is transferred to the input terminal of the discharge current converter, which generates the corresponding discharge current. When the on-reset circuit receives the first detection signal (i.e., the transformer is in the non-demagnetization stage), it opens the path between the input terminal of the discharge current converter and ground, resets the input terminal to ground potential, clears the residual charge of the previous cycle, and ensures that the discharge current converter starts working from zero state at the beginning of the next cycle. The presence of the on-reset circuit ensures that the peak voltage signal is transmitted to the discharge current converter only during the effective demagnetization window period, while the input of the discharge current converter is kept at ground potential during the remaining time period. This guarantees that the discharge current is generated only during the demagnetization phase, which directly corresponds to the physical fact that energy is transferred only during the demagnetization phase in the flyback converter—the discharge charge accumulates only during the demagnetization phase, which is completely consistent with the physical process that the energy transfer is zero during the non-demagnetization phase. This makes the change in charge on the integrating capacitor accurately reflect the actual energy transferred in each cycle.

[0046] The coordinated operation of the first capacitor C1 and the on-reset circuit enables a "sample-hold-window transfer" function for the primary current peak signal: the sampling controlled switch briefly turns on before the off edge, capturing the peak voltage on the first capacitor C1; the on-reset circuit transfers this peak voltage to the subsequent discharge current converter during the demagnetizing phase, and resets the input terminal of the subsequent stage to ground during the non-demagnetizing phase. This timing coordination ensures that the discharge current converter operates only within the effective window period of energy transfer, thereby making the discharge charge on the integrating capacitor accurately reflect the energy actually transferred to the secondary side in each cycle.

[0047] The input of the charging current converter is connected to the output of the switch selection circuit, receiving the selected target reference voltage. Its output is connected to the first terminal of the second capacitor C2. The charging current converter converts this target reference voltage into a corresponding charging current, with the charging current being proportional to the target reference voltage. Since the target reference voltage represents the desired output current value of the system, the magnitude of the charging current directly reflects the target current value. The charging current continuously charges the second capacitor C2 throughout the entire switching cycle.

[0048] The input terminal of the discharge current converter is connected to the second terminal of the turn-on reset circuit, receiving the peak voltage transmitted through the demagnetization window (i.e., the voltage at the first terminal of the first capacitor C1). Its output terminal is similarly connected to the first terminal of the second capacitor C2. The discharge current converter converts this peak voltage into a corresponding discharge current, with the conversion relationship being that the discharge current is proportional to the peak voltage. Since the peak voltage represents the actual peak value of the primary current in this cycle, and the peak value of the primary current determines the energy stored in the transformer and the energy transferred to the secondary side during the demagnetization phase, the magnitude of the discharge current directly reflects the actual current value. The discharge current discharges the second capacitor C2 only during the demagnetization phase (i.e., during the effective period of the second detection signal).

[0049] The second terminal of the first capacitor C1 and the second terminal of the second capacitor C2 are both grounded. The first terminal of the second capacitor C2 is connected to the output terminal of the charging current converter, the output terminal of the discharging current converter, and the first input terminal of the PWM modulation and drive circuit.

[0050] The above circuit structure collectively realizes the function of "periodic accumulation based on the deviation between the target current value and the actual current value" as defined in this invention. The physical process is as follows: In each switching cycle, the charging current converter continuously charges the second capacitor C2 with the charging current generated based on the target reference voltage throughout the entire switching cycle. The charging amount is the product of the charging current and the switching cycle time, representing the target value. The discharging current converter discharges the second capacitor C2 only during the demagnetizing phase with the discharging current generated based on the peak value of the primary current. The discharging amount is the product of the discharging current and the demagnetizing time, representing the actual value. The change in net charge on the second capacitor C2 is the charging amount minus the discharging amount—when the target value is greater than the actual value, the net charge increases, and the voltage at the first terminal of the second capacitor C2 rises; when the target value is less than the actual value, the net charge decreases, and the voltage drops; when the target value equals the actual value, the voltage remains stable. This voltage is output as an error threshold voltage to the PWM modulation and drive circuit, used to compare with the real-time detection signal characterizing the instantaneous value of the primary current to determine the turn-off time of the power switch.

[0051] The aforementioned charge-discharge balance process, together with the PWM modulation circuit, constitutes a complete negative feedback control loop. When the output current is too high, the peak value of the primary current is too high, the discharge current is too high, more charge is released during the demagnetization phase, the net charge on the second capacitor C2 decreases, the error threshold voltage drops, the PWM modulation and drive circuit turns off the power switch earlier, the conduction time is shortened, and the output current falls back. Conversely, when the output current is too low, the error threshold voltage rises, the conduction time is prolonged, and the output current rises. When the system reaches steady state, the amount of charge added to the second capacitor C2 in each cycle is exactly equal to the amount of charge released, and the output current is locked at a constant value determined by the target reference voltage, the current sensing resistor, and the transformer turns ratio.

[0052] In summary, the demagnetization detection circuit provides accurate energy transfer window information for the constant current regulation circuit by identifying the demagnetization stage of the transformer; the sampling controlled switch captures the peak value of the primary current before the turn-off edge, providing the constant current regulation circuit with an accurate representation of the actual current; the charging current converter and discharging current converter convert the target reference voltage and the actual peak voltage into charging and discharging currents, respectively, realizing periodic charge accumulation of the target and actual values ​​on the second capacitor C2; the on-reset circuit ensures that the peak signal only participates in discharge accumulation during the effective demagnetization window period and resets the relevant nodes outside the window period. The coordinated operation of the above modules constitutes a complete periodic energy measurement and accumulation mechanism, providing a reliable physical basis for high-precision constant current control.

[0053] In one example, such as Figure 3 As shown, the conduction reset circuit includes: a first controlled switch and a second controlled switch; The first terminal of the first controlled switch is connected to the first terminal of the first capacitor C1, and the second terminal is connected to the input terminal of the discharge current converter and the first terminal of the second controlled switch; the second terminal of the second controlled switch is grounded. The controlled terminal of the first controlled switch is connected to the first output terminal of the demagnetization detection circuit, and is used to turn on when the second detection signal is received, so as to transfer the voltage of the first terminal of the first capacitor C1 to the input terminal of the discharge current converter; and to turn off when the first detection signal is received. The controlled terminal of the second controlled switch is connected to the second output terminal of the demagnetization detection circuit, and is used to turn on when the first detection signal is received to reset the input terminal of the discharge current converter to ground; and to turn off when the second detection signal is received.

[0054] It should be explained that the function of the turn-on reset circuit is to transfer the sampled and held peak voltage of the primary current to the discharge current converter during the demagnetization phase, and to reset the input of the discharge current converter to ground potential during the non-demagnetization phase. To achieve this function, the turn-on reset circuit specifically includes a first controlled switch and a second controlled switch.

[0055] A controlled switch is a switching element whose on / off state is controlled by an external control signal; in this embodiment, it is specifically a transistor switch (such as a MOSFET switch). The controlled switch has a first terminal, a second terminal, and a controlled terminal—when the control signal received by the controlled terminal is at an active level, the first terminal and the second terminal are in a low-impedance on-state; when the control signal is at an inactive level, the first terminal and the second terminal are in a high-impedance off-state. In this embodiment, the first controlled switch is a high-level on-type switch, meaning it turns on when it receives a high-level control signal; the second controlled switch is also a high-level on-type switch.

[0056] The conduction and cutoff of the first and second controlled switches are controlled by the first and second detection signals output by the demagnetization detection circuit, and their conduction logic is complementary. Specifically, when the demagnetization detection circuit determines that the transformer is in the demagnetization stage, it outputs the second detection signal (valid high level). At this time, the controlled terminal of the first controlled switch receives the second detection signal and conducts, connecting the first terminal of the first capacitor C1 with the input terminal of the discharge current converter. This allows the peak voltage of the primary current held on the first capacitor C1 to be transmitted to the input terminal of the discharge current converter, enabling the discharge current converter to generate the corresponding discharge current. Simultaneously, the second detection signal output by the demagnetization detection circuit, when controlling the second controlled switch, is inverted and applied to its controlled terminal, causing the second controlled switch to be in the off state during the demagnetization stage. That is, the second detection signal output by the demagnetization detection circuit contains two complementary outputs: one is a high-level valid signal sent to the first controlled switch to make it conduct, and the other is a low-level signal after inversion sent to the second controlled switch to make it turn off. This ensures that the input of the discharge current converter is not short-circuited to ground during this stage, and that the peak voltage signal can act normally on the discharge current converter.

[0057] When the demagnetization detection circuit determines that the transformer is in the non-demagnetization stage, it outputs the first detection signal (valid high level). At this time, the controlled terminal of the first controlled switch does not receive the second detection signal and is turned off, cutting off the path between the first capacitor C1 and the input terminal of the discharge current converter, preventing the peak voltage signal from being transmitted to the discharge current converter during this stage; the controlled terminal of the second controlled switch receives the first detection signal and is turned on, connecting the path between the input terminal of the discharge current converter and ground, forcing the input terminal of the discharge current converter to be reset to ground potential, clearing all residual charge from the previous cycle, and ensuring that the discharge current converter starts working from zero state in the next cycle. It should be noted that after the demagnetization stage ends, the peak voltage stored on the first capacitor C1 is still maintained (because the sampling controlled switch is turned off, the first capacitor C1 has no discharge path), but since the first controlled switch is turned off, this voltage is isolated on the side of the first capacitor C1 and will not affect the discharge current converter. The second controlled switch turns on and grounds the input terminal of the discharge current converter, so the discharge current is zero. However, the voltage on the first capacitor C1 is not affected because the first controlled switch turns off and isolates the first capacitor C1 from the subsequent stage.

[0058] The complementary conduction relationship of the two controlled switches ensures that the discharge current converter receives a valid peak voltage signal only during the demagnetization phase, and its input is maintained at a defined ground potential during the non-demagnetization phase. The physical significance of this design is that in a flyback converter, energy is transferred from the transformer to the secondary output only during the demagnetization phase; therefore, the discharge current, representing the "actual energy transferred," should also be generated only during the demagnetization phase. During the non-demagnetization phase (including the power transistor conduction and magnetization phase and the dead zone phase), the transformer does not transfer energy to the secondary side, so the discharge current should be zero. Through the complementary conduction control of the first and second controlled switches, the input signal of the discharge current converter is limited to the demagnetization window period, ensuring that the discharge charge on the second capacitor C2 accurately corresponds to the energy actually transferred to the secondary side in each switching cycle.

[0059] Furthermore, the reset operation of the second controlled switch during the non-demagnetization phase also plays the following important roles: preventing the accumulation of residual charge from the previous cycle due to factors such as parasitic capacitance or leakage current at the input of the discharge current converter, and avoiding the superposition of this residual charge with the effective signal of the next cycle, which would cause integration errors. By forcibly resetting the input of the discharge current converter to ground potential during the non-demagnetization phase of each cycle, it is ensured that the discharge accumulation process of each cycle starts from the same zero initial state, thereby guaranteeing the consistency and accuracy of charge accumulation cycle by cycle.

[0060] In summary, the first and second controlled switches complementarily conduct under the control of the demagnetization detection signal. During the demagnetization phase, the peak voltage signal is transmitted to the discharge current converter to achieve energy-related discharge accumulation. During the non-demagnetization phase, the input terminal of the discharge current converter is reset to ground to clear residual charge and ensure that the discharge current is zero. This ensures that the change in net charge on the second capacitor C2 accurately reflects the actual energy transferred in each cycle. This circuit structure is simple and reliable. It not only accurately realizes the selective transmission of the peak signal during the demagnetization window, but also eliminates the cumulative error caused by parasitic effects through periodic reset, providing a reliable underlying physical implementation for high-precision charge balance control of the constant current regulation circuit.

[0061] In the second embodiment, the demagnetization detection circuit is further configured to output the valley detection signal when the feedback sampling voltage value is within a preset valley voltage range and the duration is longer than a preset duration; The PWM modulation and driving circuit includes: Comparator, RS flip-flop and driver circuit; The non-inverting input of the comparator is connected to the real-time detection signal, its inverting input is connected to the first terminal of the second capacitor C2, and its output is connected to the first input of the RS flip-flop; the second input of the RS flip-flop is connected to the valley detection signal output by the demagnetization detection circuit, and its output is connected to the input of the driving circuit. The comparator is configured to output a shutdown control signal when the real-time detection signal is greater than or equal to the error threshold voltage. The RS trigger is used to reset according to the shutdown control signal and set according to the valley detection signal to output a pulse width modulation signal; The output terminal of the driving circuit serves as the output terminal of the PWM modulation and driving circuit, and is used to connect to the controlled terminal of the power switch. The driving circuit is used to drive the power switch to turn on or off according to the pulse width modulation signal.

[0062] It should be noted that in the discontinuous operation mode of a flyback switching power supply, after the power switch is turned off, the transformer enters the demagnetizing stage, and the energy stored in the core is released through the secondary winding. When the demagnetizing process ends, the secondary current drops to zero, and the secondary rectifier diodes turn off naturally. At this time, the transformer's magnetizing inductance and the power switch's output capacitance (including parasitic capacitance) begin to resonate, forming a high-frequency sinusoidal ringing waveform with gradually decaying amplitude on the auxiliary winding. This ringing waveform is superimposed on the DC bias voltage of the auxiliary winding, and its valley position corresponds to the maximum negative offset of the ringing waveform. Turning on the power switch at the bottom of the ringing valley can achieve zero-voltage or low-voltage turn-on, significantly reducing switching losses and improving system efficiency. This technique is called valley turn-on or quasi-resonant control.

[0063] In addition to outputting the first and second detection signals for controlling the conduction reset circuit, the demagnetization detection circuit also detects the ringing valley. After the demagnetization phase ends, the voltage on the auxiliary winding enters a ringing state. This ringing signal, superimposed on the DC level, exhibits alternating positive and negative decaying oscillations, with its valley being the point of maximum negative offset in the ringing waveform. When the feedback sampling voltage value enters a preset valley voltage range (corresponding to the voltage interval near the negative valley of the ringing waveform) and remains within this range for a duration exceeding a preset time, the demagnetization detection circuit determines that the ringing waveform has reached the valley position and outputs a valley detection signal. The demagnetization detection circuit internally has a preset valley voltage range, corresponding to the voltage interval near the valley of the ringing waveform. After the demagnetization phase ends, the demagnetization detection circuit continuously monitors the feedback sampling voltage value. When this value enters the preset valley voltage range and remains within this range for a duration exceeding a preset time, the demagnetization detection circuit determines that the ringing waveform has reached the valley position and outputs a valley detection signal. The preset duration is set to avoid false triggering caused by noise interference or non-ideal characteristics of the ringing waveform—the valley of the ringing waveform has a certain width, not an infinitely narrow instant, and the duration judgment can ensure that the detected valley is real and reliable. The valley detection signal is a high-level pulse, used to trigger the power switch to start a new switching cycle.

[0064] Based on the obtained error threshold voltage, the PWM modulation and driving circuit is responsible for converting this voltage into a specific switching action. The PWM modulation and driving circuit includes a comparator, an RS flip-flop, and a driving circuit.

[0065] The non-inverting input of the comparator is connected to a real-time detection signal representing the instantaneous value of the primary current. This signal rises linearly from zero in each switching cycle, and its slope is related to the input voltage and the primary inductance of the transformer. The inverting input of the comparator is connected to the first terminal of the second capacitor C2, receiving the error threshold voltage output by the constant current regulation circuit. The output of the comparator is connected to the first input (reset terminal R) of the RS flip-flop. The function of the comparator is to compare the real-time rising current detection signal with the error threshold voltage—when the real-time detection signal is less than the error threshold voltage, the comparator outputs a low level and does not generate any switching action; when the real-time detection signal rises to equal or exceed the error threshold voltage, the comparator flips and outputs a high-level turn-off control signal. This turn-off control signal is sent to the reset terminal of the RS flip-flop, requesting the end of the current switching cycle.

[0066] An RS flip-flop is a bistable storage unit with a first input R (reset), a second input S (set), and an output Q. Its logic function is as follows: when the S input receives a valid set signal, the Q output is high; when the R input receives a valid reset signal, the Q output is low; when both the S and R inputs are invalid, the Q output remains unchanged from its previous state. In this embodiment, the S input of the RS flip-flop receives the valley detection signal output from the demagnetization detection circuit as the set signal, and the R input receives the turn-off control signal output from the comparator as the reset signal. The output Q of the RS flip-flop is connected to the input of the drive circuit.

[0067] The driver circuit receives the pulse width modulation signal output from the RS flip-flop. Its function is to amplify the logic level signal to provide sufficient driving capability to drive the gate capacitance of the power switch. The output of the driver circuit serves as the output of the entire PWM modulation and driving circuit, and is connected to the controlled terminal (gate) of the power switch.

[0068] The following is a complete description of the operation of the PWM modulation and drive circuit. When the demagnetization detection circuit detects the ringing valley and outputs a valley detection signal, the RS flip-flop is set, and the Q terminal outputs a high level. The drive circuit amplifies this high level and drives the power switch to turn on, starting a switching cycle. After the power switch turns on, the primary current rises linearly from zero, and the real-time detection signal at the non-inverting input of the comparator rises linearly accordingly. During the rise, as long as the real-time detection signal has not reached the error threshold voltage, the comparator outputs a low level, the RS flip-flop remains set, and the power switch remains on. When the real-time detection signal rises to equal or exceed the error threshold voltage, the comparator flips, its output changes from low to high, the RS flip-flop is reset, and the Q terminal changes from high to low. The drive circuit amplifies this low level and drives the power switch to turn off, ending the current switching cycle. After this, the transformer enters the demagnetization stage, and after demagnetization, it enters the ringing stage. The demagnetization detection circuit detects the ringing valley again and outputs a valley detection signal, the RS flip-flop is set again, and the next switching cycle begins. The above process is repeated in each switching cycle, realizing the valley-level conduction and peak-level shutdown control of the power switch.

[0069] In this process, the level of the error threshold voltage directly determines the conduction time of the power switch in each cycle. When the error threshold voltage is high, the real-time detection signal needs a longer rise time to reach the threshold, resulting in a longer conduction time, a higher peak primary current, and more energy stored in the transformer. When the error threshold voltage is low, the conduction time is shorter, and less energy is transferred. The PWM modulation and drive circuit uses this mechanism to convert the voltage signal output by the constant current regulation circuit into specific conduction time control, realizing the conversion from "analog voltage command" to "switching time command," and completing the final step of the entire negative feedback control loop.

[0070] The use of valley detection signals ensures that the power switch turns on at the lowest point of the ringing waveform. At this time, the drain voltage of the power switch is at the lowest point of the ringing waveform, minimizing voltage stress during switching and significantly reducing switching losses. Simultaneously, the lower switching voltage stress also helps improve the system's electromagnetic compatibility (EMC) performance. Furthermore, valley conduction control allows the system's operating frequency to naturally vary with load and input voltage—higher ringing and switching frequencies under light load or high input voltage, and lower ringing and switching frequencies under heavy load or low input voltage. This frequency jitter characteristic helps disperse harmonic energy at the switching frequency, further improving the system's EMC performance.

[0071] In summary, the demagnetization detection circuit, while performing demagnetization detection, outputs a valley detection signal by monitoring the valley position of the ringing waveform after demagnetization, providing a set trigger for the RS flip-flop in the PWM modulation and drive circuit. The comparator in the PWM modulation and drive circuit compares the real-time current signal with the error threshold voltage and outputs a reset trigger. The RS flip-flop alternates between set and reset, generating a pulse width modulation signal with a controlled duty cycle. After power amplification, the drive circuit drives the power switch, realizing cycle-by-cycle control that turns on at the bottom of the ringing valley and turns off when the current reaches the threshold, reducing switching losses, improving system efficiency, and providing a reliable execution channel for the negative feedback control of the constant current regulation circuit.

[0072] In one example, the comparator is an operational amplifier.

[0073] It should be noted that in the PWM modulation and driving circuit, the comparator is used to compare the real-time rising primary-side current detection signal with the error threshold voltage output by the constant current regulation circuit, and outputs a shutdown control signal when the real-time detection signal reaches the error threshold voltage. This comparator can be implemented using various circuit structures, as long as it meets the requirements of high speed, low latency, and high accuracy.

[0074] In a preferred embodiment, the comparator is implemented using an operational amplifier. An operational amplifier is a differential amplifier device with high open-loop gain, high input impedance, and low output impedance. When configured for open-loop operation (i.e., without a negative feedback network), its output level depends on the polarity of the voltage difference between the non-inverting and inverting inputs—when the voltage at the non-inverting input is higher than that at the inverting input, the output is at a positive saturation level (high level); when the voltage at the non-inverting input is lower than that at the inverting input, the output is at a negative saturation level (low level). This characteristic allows the operational amplifier to be used as a high-speed voltage comparator in open-loop mode.

[0075] In this embodiment, the non-inverting input of the operational amplifier is connected to a real-time detection signal representing the instantaneous value of the primary-side current, and the inverting input is connected to the first terminal of the second capacitor C2 to receive the error threshold voltage. When the real-time detection signal is lower than the error threshold voltage, the operational amplifier outputs a low level, indicating that the power switch can continue to be turned on; when the real-time detection signal rises to equal to or exceeds the error threshold voltage, the operational amplifier outputs a high-level turn-off control signal to the reset terminal of the RS flip-flop, resetting the RS flip-flop and turning off the power switch. Using an operational amplifier to implement the comparator has advantages such as low input bias current, low input offset voltage, and fast response speed, ensuring accurate monitoring and timely response of the primary-side current by the PWM modulation and drive circuit. In addition, since the gain-bandwidth product and slew rate of the operational amplifier can be flexibly selected according to the actual application requirements, designers can choose different types of operational amplifiers according to the switching frequency and accuracy requirements of the system to meet the needs of different application scenarios from low frequency to high frequency, providing good design flexibility.

[0076] In the third embodiment, the PWM modulation and driving circuit further includes an OR gate; The first input of the OR gate is connected to the output of the comparator, and its output is connected to the first input of the RS flip-flop. The constant current control circuit includes: a voltage protection circuit; The first input terminal of the voltage protection circuit is connected to the feedback sampled voltage value, and the output terminal is connected to the second input terminal of the OR gate. The voltage protection circuit is configured to output a high-level protection trigger signal to the second input terminal of the OR gate when the feedback sampling voltage value is greater than or equal to a preset overvoltage protection threshold; and to output the high-level protection trigger signal to the second input terminal of the OR gate when the feedback sampling voltage value is less than a preset short-circuit protection threshold and the duration is greater than or equal to a preset short-circuit protection shielding time.

[0077] It should be explained that the voltage protection circuit and OR gate are used to quickly respond to and shut down the power switch when an abnormal condition occurs at the output, protecting the system from damage.

[0078] The first input of the voltage protection circuit is connected to a feedback sampling voltage value to monitor the status of the system output voltage. The voltage protection circuit internally presets two voltage thresholds: an overvoltage protection threshold and a short-circuit protection threshold, with the overvoltage protection threshold being higher than the short-circuit protection threshold. The overvoltage protection threshold corresponds to the critical point where the system output voltage exceeds the safe upper limit, while the short-circuit protection threshold corresponds to the critical point where the system output voltage is severely low (e.g., due to a short circuit or overload at the output). The output of the voltage protection circuit is connected to the second input of an OR gate.

[0079] When the system output voltage rises abnormally, the feedback sampling voltage value also rises. The voltage protection circuit compares the feedback sampling voltage value with the overvoltage protection threshold. When the feedback sampling voltage value is greater than or equal to the overvoltage protection threshold, the voltage protection circuit determines that the system is in an output overvoltage state and immediately outputs a high-level protection trigger signal from its output terminal to the second input terminal of the OR gate. Overvoltage states are usually caused by sudden load changes, feedback loop malfunctions, etc. If not handled in time, the output load components may be damaged due to excessive voltage. The voltage protection circuit responds to overvoltage extremely quickly, outputting the protection trigger signal within the current switching cycle of detecting the overvoltage.

[0080] When a short circuit or severe overload occurs at the system output, the output voltage is pulled down to a value far below normal, and the feedback sampling voltage value subsequently drops to an extremely low level. The voltage protection circuit compares the feedback sampling voltage value with the short-circuit protection threshold—when the feedback sampling voltage value is less than the short-circuit protection threshold, the voltage protection circuit starts a timer. The short-circuit protection threshold is set much lower than the feedback voltage value during normal operation, so short-circuit protection will not be triggered during normal operation. Considering that the output voltage rises from zero during the system startup phase, if the short-circuit protection responds instantly without delay, it will be falsely triggered every time the system starts up because the output voltage has not yet been established. Therefore, the voltage protection circuit has a short-circuit protection shielding time, the length of which is configured to be greater than the maximum time required for the system to complete startup under the worst load conditions (such as inductive load). During the shielding time, even if the feedback sampling voltage value remains below the short-circuit protection threshold, the voltage protection circuit will not output a protection trigger signal, thus providing a sufficient buffer window for system startup. If the timer's count reaches or exceeds the preset short-circuit protection shielding time, and the feedback sampling voltage value is still lower than the short-circuit protection threshold, the voltage protection circuit determines that the system has indeed experienced an output short-circuit or overload fault. It then outputs a high-level protection trigger signal from its output terminal to the second input terminal of the OR gate. This mechanism ensures timely system protection when a real short-circuit fault occurs, while avoiding accidental triggering of short-circuit protection during startup due to the output voltage not yet being established. It should be noted that because the constant current control circuit of this invention rapidly establishes the output voltage with a large current during the startup phase (see the aforementioned fast-start mode), the output voltage can exceed the short-circuit protection threshold within a time much shorter than the short-circuit protection shielding time. Therefore, even under heavy load conditions such as inductive loads, the system can complete startup before the shielding time expires without triggering short-circuit protection.

[0081] An OR gate is a basic unit in digital logic circuits that implements the "logical OR" operation. It has a first input, a second input, and an output. The output is high when any input is high, and low only when all inputs are low. In this embodiment, the first input of the OR gate is connected to the output of a comparator to receive a normal PWM shutdown control signal; the second input is connected to the output of a voltage protection circuit to receive a protection trigger signal; and the output is connected to the reset terminal of an RS flip-flop.

[0082] Through the above connection, the OR gate combines the two shutdown trigger sources. Under normal operating conditions, both the shutdown control signal output by the comparator and the protection trigger signal output by the voltage protection circuit are low. The OR gate outputs a low level, without resetting the RS flip-flop, and the power switch turns on and off according to the normal PWM timing. When the power switch's on-time reaches the duration required by the constant current regulation circuit, the comparator flips and outputs a high-level shutdown control signal to the first input of the OR gate. The OR gate then outputs a high-level reset signal to the reset terminal of the RS flip-flop, resetting the RS flip-flop and turning off the power switch, completing one normal PWM cycle. When an output overvoltage or short-circuit fault occurs, the voltage protection circuit outputs a high-level protection trigger signal to the second input of the OR gate. The OR gate also outputs a high-level reset signal to the reset terminal of the RS flip-flop, resetting the RS flip-flop and turning off the power switch.

[0083] The two trigger sources are combined via an OR gate and share the same reset path. This design avoids the need for separate shutdown logic circuits for the two protection functions, simplifying the circuit structure. Simultaneously, since the reset signal output from the OR gate uniformly acts on the reset terminal of the RS flip-flop, normal PWM shutdown and fault protection shutdown have the same priority in the control logic—the power switch is turned off as long as either condition is met. This priority design ensures the determinism of the protection action: whether it's the end of a normal PWM cycle or the occurrence of an abnormal fault, the power switch can be turned off in time without failure due to signal conflicts.

[0084] In summary, the voltage protection circuit monitors the feedback sampling voltage value and triggers protection immediately when there is an output overvoltage, and triggers protection after an output short circuit or overload lasting longer than the shielding time. The OR gate performs a logical OR operation between the normal shutdown control signal output by the comparator and the protection trigger signal output by the voltage protection circuit, and then outputs the result to the reset terminal of the RS flip-flop. Under normal operating conditions, the OR gate transmits the comparator's shutdown control signal to achieve normal PWM cycle control; under abnormal conditions, the OR gate responds to the trigger signal of the voltage protection circuit, forcibly shutting down the power switch, ensuring timely and effective protection of the system in the event of overvoltage or short circuit faults. Through the above circuit structure, this invention achieves high-precision constant current control while also ensuring system safety and reliability.

[0085] In the fourth embodiment, as described above, the fast-start threshold voltage is a preset voltage value in the constant current threshold selection circuit, used to determine whether the system is currently in the startup phase or has entered a steady state. The constant current threshold selection circuit compares the feedback sampled voltage value with the fast-start threshold voltage, and controls the switch selection circuit to select either the first constant current reference voltage or the second constant current reference voltage as the target reference voltage to output to the constant current regulation circuit based on the comparison result. Therefore, the setting value of the fast-start threshold voltage directly determines when the system switches from the fast-start mode to the normal constant current mode. If the threshold is set too low, the system may prematurely exit the fast-start mode before the output voltage reaches the required load value, resulting in insufficient startup, and under heavy load conditions, it may still trigger short-circuit protection due to insufficient output voltage; if the threshold is set too high, the system may remain in the fast-start mode even when the output voltage exceeds the actual load requirement, resulting in overcharging of the output capacitor and current overshoot when switching to the constant current mode.

[0086] For the reasons mentioned above, the configuration of the fast-start threshold voltage must follow specific design guidelines. In a preferred embodiment, the fast-start threshold voltage is configured as a feedback sampling voltage value corresponding to the minimum operating output voltage of the flyback circuit. The minimum operating output voltage refers to the minimum voltage value required by the load adapted to the switching power supply system during normal operation. Taking LED strip lighting applications as an example: the same power supply solution typically needs to adapt to different numbers of LED strings—when the number of LED strings is large, the required voltage of the load is higher (close to the rated output voltage); when the number of LED strings is small, the required voltage of the load is correspondingly lower. In practical applications, customers may reduce the number of LED strings to a lower proportion of the standard configuration, at which point the required voltage of the load will correspondingly decrease to the minimum operating voltage value.

[0087] Because there is a definite linear proportional relationship between the feedback sampling voltage value and the system output voltage (VFB1=k×Vout, where k is a constant determined by the voltage division ratio of the first resistor R1 and the second resistor R2 [R2 / (R1+R2)] and the turns ratio of the auxiliary winding to the primary winding (Na / Np), when the fast-start threshold voltage is configured to the feedback sampling voltage value corresponding to the minimum operating output voltage, the system triggers mode switching the instant the output voltage rises to this minimum operating voltage value. At this time, the voltage on the output capacitor reaches the minimum voltage value actually required by the load, and there is neither "undercharging" (the capacitor voltage is lower than the load requirement, and the system has not fully established the output voltage) nor "overcharging" (the capacitor voltage is higher than the load requirement, and the excess charge needs to be released after switching). Therefore, there is no step jump between the current released by the output capacitor to the load at the moment of switching and the steady-state operating current, and the current waveform remains continuous and smooth before and after the switching point, without producing current spikes.

[0088] Figure 12 The startup waveform is shown when the fast-start threshold voltage is configured correctly. From Figure 12 As can be seen, when the feedback sampling voltage (VFB1) rises to the fast-start threshold voltage (VCC_SEL), the system immediately switches from fast-start mode to constant current mode. The waveforms of the output voltage (VOUT) and output current (IOUT) transition smoothly before and after the switching point without any overshoot. This indicates that the output capacitor is charged to the voltage required by the load at the moment of switching, and there is no excess charge release.

[0089] In contrast. Figure 13 The startup waveform is shown when the fast-start threshold voltage is improperly configured. From Figure 13 As can be seen, when the fast-start threshold voltage (VCC_SEL) is set too high, the system does not exit fast-start mode even when the output voltage far exceeds the actual load requirement, and the output capacitor continues to be charged by a large current. When the feedback sampling voltage (VFB1) finally reaches VCC_SEL, the output capacitor has accumulated a charge far exceeding the load requirement. This excess charge is released to the load at the moment of switching, forming a severe current spike (overshoot), which causes the LED to burn out or its lifespan to be greatly reduced. This invention effectively eliminates this overshoot risk by configuring the fast-start threshold voltage to the feedback sampling voltage value corresponding to the lowest operating output voltage.

[0090] From the perspective of energy conservation, the physical significance of this configuration is as follows: During the fast start-up phase, the system rapidly charges the output capacitor with a large current, causing the capacitor voltage to rise quickly. When the capacitor voltage reaches the minimum value required by the load, the system immediately switches the charging current to a smaller constant current value, which corresponds to the holding current required by the load at the minimum operating voltage. Since the capacitor voltage is exactly equal to the load's required voltage at the switching moment, the energy stored in the capacitor is exactly equal to the energy required by the load at the minimum operating voltage. There is no abrupt change in the energy storage state of the capacitor before and after the switching, so no excess charge is released to the load, resulting in an overshoot current.

[0091] This fast-start threshold voltage configuration, combined with the aforementioned dual-reference switching mechanism, enables the system to achieve a smooth startup transition across a wide range of load applications. For different load configurations (e.g., different numbers of LED strings), the system's minimum operating output voltage may vary. In practical applications, designers can set the fast-start threshold voltage to a feedback sampling voltage value corresponding to the minimum operating voltage by using internal laser trimming or external resistor configuration, based on the specific load's operating voltage range. This allows the same power supply solution to adapt to different load configurations, maintaining a high startup success rate while eliminating the risk of current overshoot.

[0092] In the fifth embodiment, the constant current control circuit further includes: an input voltage compensation circuit; The first input terminal of the input voltage compensation circuit is connected to the auxiliary winding of the flyback circuit, and is used to generate a compensation current characterizing the input voltage according to the voltage of the auxiliary winding. Its output terminal is connected to the second input terminal of the constant current regulation circuit. The input voltage compensation circuit is used to superimpose the compensation current onto the detection voltage signal characterizing the primary current to compensate for the current detection deviation caused by the power switch turn-off delay due to input voltage changes. The output terminal of the input voltage compensation circuit is used to output a compensated detection voltage signal superimposed with the compensation current to the second input terminal of the constant current regulation circuit, as a characterization signal of the actual current value.

[0093] It should be noted that in the aforementioned embodiments, the detection voltage signal representing the peak value of the primary current connected to the second input terminal of the constant current regulation circuit originates from the voltage across the current sensing resistor. However, in actual switching power supply systems, there is an inherent propagation delay between the current detection signal reaching the comparison threshold and the power switch actually starting to turn off. This delay arises from the superposition of multiple factors, including the comparator's response time, the RS flip-flop's toggling time, the propagation delay of the drive circuit, and the power switch's own turn-off delay. When the primary current rises rapidly, this propagation delay causes the actual turn-off time of the power switch to lag behind the moment the detection circuit issues the turn-off command, resulting in the peak value of the primary current at the actual turn-off being higher than the current value corresponding to the threshold set by the detection circuit, i.e., an "overshoot" phenomenon.

[0094] The current overshoot caused by the aforementioned delay is directly related to the input voltage. The rise slope of the primary current is determined by both the input voltage and the primary inductance of the transformer—the higher the input voltage, the steeper the rise slope of the primary current. Within a fixed propagation delay time, the steeper the rise slope, the greater the increment of the actual current exceeding the set threshold. Therefore, without compensation measures, the actual output current of the system under high input voltage conditions will be higher than that under low input voltage conditions, resulting in a significant deviation in constant current accuracy across the entire voltage range.

[0095] To address the aforementioned issues, an input voltage compensation circuit is also included in the constant current control circuit. The first input terminal of the input voltage compensation circuit is connected to the auxiliary winding of the flyback circuit, generating a compensation current characterizing the input voltage based on the voltage of the auxiliary winding. Its output terminal is connected to the second input terminal of the constant current regulating circuit. The input voltage compensation circuit superimposes the compensation current onto the detection voltage signal characterizing the primary current, and outputs the compensated detection voltage signal, superimposed with the compensation current, to the second input terminal of the constant current regulating circuit as a characterization signal of the actual current value.

[0096] During the conduction period of the power switch, the voltage on the auxiliary winding and the input voltage satisfy the following relationship: Vaux = Vin × (Na / Np), where Vaux is the auxiliary winding voltage, Vin is the input voltage, Na is the number of turns in the auxiliary winding, and Np is the number of turns in the primary winding. It is evident that the auxiliary winding voltage is proportional to the input voltage; therefore, input voltage information can be indirectly obtained by detecting the auxiliary winding voltage. The input voltage compensation circuit samples the auxiliary winding voltage and converts it into a compensation current Icmp proportional to the input voltage. This compensation current Icmp acts on the second input terminal of the constant current regulation circuit through an internal resistor network, superimposing an additional voltage ΔV onto the detected voltage signal. This makes the effective detection voltage Vcs' input to the constant current regulation circuit and the PWM modulation and drive circuit the sum of the original detection voltage Vcs and the compensation voltage ΔV: Vcs' = Vcs + ΔV.

[0097] The relationship between the compensation voltage ΔV and the input voltage Vin is: ΔV = γ × Vin, where γ is a constant determined by the turns ratio of the auxiliary winding and the primary winding, the conversion coefficient of the compensation circuit, etc. The direction of this compensation voltage is positive, meaning that the superimposed voltage makes the effective detection voltage higher than the original detection voltage. Its physical effect is as follows: Under high input voltage conditions, although the original current detection voltage Vcs is still at a low level, due to the superimposed large compensation voltage ΔV, the effective detection voltage Vcs' reaches the error threshold voltage earlier, thus triggering the comparator to flip earlier and offsetting the "late turn-off" effect caused by the transmission delay; while under low input voltage conditions, the compensation voltage ΔV is smaller, and the effective detection voltage Vcs' is basically the same as the original detection voltage Vcs, therefore it will not have a significant impact on normal control.

[0098] Through the aforementioned compensation mechanism, when the input voltage changes, the peak value of the primary current when the power switch is actually turned off can remain basically constant, without significant drifting with the rise and fall of the input voltage. Combined with the aforementioned charge balance constant current control mechanism, the input voltage compensation circuit eliminates the influence of input voltage changes on current detection accuracy at the detection signal level, enabling the system to maintain consistent constant current accuracy across the entire voltage range and ensuring consistent product performance under different power supply conditions.

[0099] This invention also proposes a flyback switching power supply, comprising: The constant current control circuit; A transformer includes a primary winding, a secondary winding, and an auxiliary winding; A power switching transistor, the control terminal of which is connected to the output terminal of the PWM modulation and drive circuit of the constant current control circuit, and the first terminal of which is connected to the primary winding; A current sensing resistor is connected in series between the second terminal of the power switch and ground to generate a detection voltage signal characterizing the primary current. An output rectifier and filter circuit, connected to the secondary winding, is used to provide a constant output current to the load.

[0100] It should be noted that the transformer is the core component for energy transfer, comprising a primary winding, a secondary winding, and an auxiliary winding. The primary winding is connected to the input DC bus and receives the excitation of the input voltage; the secondary winding, after rectification and filtering, is connected to the load and provides output current to the load; the auxiliary winding provides the operating voltage and feedback signal for the constant current control circuit. Electrical isolation is achieved between the primary and secondary windings through magnetic core coupling, and the auxiliary winding, also coupled to both the primary and secondary windings through magnetic core coupling, is used to obtain electrical signals reflecting the system's operating status.

[0101] The power switch is connected in series between the primary winding and ground. Its control terminal (gate) is connected to the output of the PWM modulation and drive circuit of the constant current control circuit, and its first terminal (drain) is connected to the primary winding. The power switch is controlled by the drive signal output from the constant current control circuit. When turned on, it allows the primary current to flow and stores energy in the transformer core. When turned off, it forces the energy stored in the core to be released to the load through the secondary winding. The switching frequency and conduction time of the power switch are determined by the PWM modulation signal output from the constant current control circuit and the drive circuit, thus achieving precise control over the amount of energy transferred.

[0102] A current-sensing resistor is connected in series between the second terminal (source) of the power switch and ground. When the power switch is turned on, the primary current flows through this resistor, generating a voltage drop proportional to the current. This voltage drop is captured by the constant current control circuit through the current sensing pin, serving as a detection voltage signal characterizing the primary current. The constant current control circuit internally processes the detection voltage signal (including superimposing the input voltage to compensate for the current, peak sampling, and comparison with the error threshold voltage), which is used for constant current regulation calculations and PWM comparison decisions. Since this resistor is located entirely on the primary side of the transformer, accurate detection of the primary current can be achieved without crossing the isolation boundary, reducing the complexity of the system design and saving costs.

[0103] The output rectifier and filter circuit is connected to the secondary winding and is used to rectify the high-frequency AC pulses output from the secondary winding into a DC output. In a typical implementation, the output rectifier and filter circuit includes a rectifier diode and an output capacitor. The anode of the rectifier diode is connected to one end of the secondary winding, and the cathode is connected to the anode of the output capacitor and the positive terminal of the load; the cathode of the output capacitor and the other end of the secondary winding are connected to the negative terminal of the load and system ground. When the power switch is off and the transformer is in the demagnetizing stage, the induced voltage on the secondary winding forward-biases the rectifier diode, and current flows through the rectifier diode to charge the output capacitor and supply power to the load; when the power switch is on, the voltage on the secondary winding reverses, the rectifier diode is reverse-biased and cut off, and the load is powered by the charge stored in the output capacitor. The capacitance of the output capacitor is configured to ensure that the output voltage ripple meets the load requirements, while providing sufficient dynamic response time for the constant current control circuit's adjustment process. Through the above rectification and filtering process, the pulsating energy output from the secondary winding is smoothed into a constant DC output current required by the load.

[0104] After power-on, the constant current control circuit starts working by obtaining the startup voltage through the auxiliary winding. It monitors the output voltage status in real time through the feedback input pin and acquires the primary current signal in real time through the current detection pin. The constant current control circuit generates a pulse width modulation signal according to the constant current control method described in the preceding embodiments, driving the power switch to perform high-frequency switching action, transferring energy from the input terminal to the output terminal in a controlled manner, ultimately establishing a constant output current. The value of this constant output current is jointly determined by the target reference voltage selected internally by the constant current control circuit, the resistance value of the external current detection resistor, and the turns ratio of the transformer's primary and secondary windings, and is unaffected by input voltage fluctuations, load changes, and transformer parameter dispersion. When load changes cause output voltage fluctuations, the constant current control circuit automatically adjusts the conduction time of the power switch through its internal negative feedback adjustment mechanism, allowing the output current to quickly recover to the set value, thereby maintaining a high-precision constant current output across the entire load range.

[0105] This invention also proposes a constant current control method for flyback switching power supplies, comprising: The output voltage of the auxiliary winding of the flyback switching power supply is sampled to obtain the feedback sampling voltage value; The feedback sampling voltage value is compared with the fast start threshold voltage. When the feedback sampling voltage value is less than the fast start threshold voltage, a first constant current reference voltage is selected as the target reference voltage. When the feedback sampling voltage value is greater than or equal to the fast start threshold voltage, a second constant current reference voltage is selected as the target reference voltage. Wherein, the first constant current reference voltage is greater than the second constant current reference voltage. Acquire a detection voltage signal that characterizes the peak value of the primary side current, and periodically accumulate the deviation between the target current value represented by the target reference voltage and the actual current value represented by the detection voltage signal to generate an error threshold voltage. The real-time detection signal representing the instantaneous value of the primary current is compared with the error threshold voltage. When the real-time detection signal is greater than or equal to the error threshold voltage, a shutdown control signal is output to shut down the power switch.

[0106] It should be noted that, corresponding to the hardware architecture of the aforementioned constant current control circuit, this method makes full use of the dual-reference switching capability of the switch selection circuit and the charge balance accumulation characteristic of the constant current regulation circuit, and achieves precise control of the output current through a time-sequential process.

[0107] During system operation, the output voltage of the auxiliary winding of the flyback switching power supply is first sampled to obtain a feedback sampling voltage value. Since the auxiliary winding voltage is proportional to the system output voltage during the transformer demagnetization stage, this feedback sampling voltage value can characterize the level of the system output voltage in real time, providing a basis for subsequent mode switching judgments.

[0108] Subsequently, the feedback sampling voltage value is compared with the fast-start threshold voltage, and a target reference voltage is selected based on the comparison result. When the feedback sampling voltage value is less than the fast-start threshold voltage, it indicates that the system output voltage is still at a low level and is still in the startup ramp-up phase. At this time, the first constant current reference voltage is selected as the target reference voltage. When the feedback sampling voltage value reaches or exceeds the fast-start threshold voltage, it indicates that the system output voltage has risen to the preset switching point, and the startup phase is basically completed. At this time, the second constant current reference voltage is selected as the target reference voltage. The first constant current reference voltage is greater than the second constant current reference voltage. Therefore, a larger reference voltage is selected during the startup phase to allow the system to operate at a larger target current value, and the output voltage is established quickly. After entering steady state, the reference voltage is switched to a smaller one to allow the system to operate at the rated current value.

[0109] In addition to obtaining the target reference voltage, it is also necessary to acquire a detection voltage signal that characterizes the peak value of the primary current. This detection voltage signal originates from the current sensing resistor connected in series with the source of the power switch. The peak value of the primary current can be obtained by sampling the detection voltage before the turn-off edge of the power switch in each switching cycle.

[0110] Next, the deviation between the target current value represented by the target reference voltage and the actual current value represented by the detected voltage signal is periodically accumulated to generate an error threshold voltage. The physical essence of this accumulation process is as follows: within each switching cycle, the target current value is converted into the corresponding charging amount (accumulated continuously throughout the switching cycle), and the actual current value is converted into the corresponding discharging amount (accumulated only during the transformer demagnetization phase). The difference between the two is the net accumulated deviation within that cycle. This net accumulated deviation is output in voltage form, which is the error threshold voltage—the error threshold voltage rises when the target value is greater than the actual value, falls when the target value is less than the actual value, and remains stable when the target value equals the actual value.

[0111] Finally, the real-time detection signal representing the instantaneous value of the primary current is compared with the error threshold voltage. The real-time detection signal rises linearly from zero in each switching cycle. When the real-time detection signal is less than the error threshold voltage, the power switch remains on; when the real-time detection signal rises to equal or exceed the error threshold voltage, a turn-off control signal is output, turning off the power switch and ending the current switching cycle. Through this comparison, the level of the error threshold voltage is converted into the length of the power switch's on-time—the higher the error threshold voltage, the longer the on-time, and the more energy the transformer transfers; the lower the error threshold voltage, the shorter the on-time, and the less energy transferred. Thus, the periodically accumulated deviation is converted into a cycle-by-cycle on-time adjustment, achieving closed-loop control of the output current.

[0112] During a complete startup process, the coordinated operation of the steps described above is as follows: After the system is powered on, the output voltage is zero, and the feedback sampling voltage value is much smaller than the fast-start threshold voltage. The method selects the first constant current reference voltage as the target reference voltage, and the system operates with a large target current value, causing the output voltage to rise rapidly. During this period, the method continuously accumulates the deviation between the target current value and the actual current value periodically, generating a high error threshold voltage. This requires the real-time detection signal to trigger the shutdown at a high peak value. The power switch maintains a long conduction time in each cycle, the transformer transfers a large amount of energy, and the output voltage is established rapidly. When the output voltage rises to the voltage value corresponding to the fast-start threshold voltage, the feedback sampling voltage value reaches the fast-start threshold voltage, and the method switches to select the second constant current reference voltage as the target reference voltage. The system switches from fast-start mode to normal constant current mode. After entering steady state, the method maintains a balance between the amount of charge charged and the amount of charge discharged in each cycle, locking the output current at a constant value determined by the target reference voltage, the current sensing resistor, and the transformer turns ratio.

[0113] Through the above steps, this method achieves rapid charging with a larger reference value during the startup phase, effectively avoiding false short-circuit protection triggering due to slow output voltage rise; after the output voltage reaches the preset value, it automatically switches to a smaller reference value, allowing the system to smoothly enter a constant current steady state; in the steady state phase, high-precision constant current output is achieved through cycle-by-cycle charge balance accumulation and PWM comparison. This method completely corresponds to the hardware operation process of the aforementioned constant current control circuit; both describe the same technical solution from different perspectives.

[0114] The above description is merely an optional embodiment of the present invention and does not limit the patent scope of the present invention. All equivalent structural transformations made using the contents of the present invention's specification and drawings under the inventive concept of the present invention, or direct / indirect applications in other related technical fields, are included within the patent protection scope of the present invention.

Claims

1. A constant current control circuit, characterized in that, Applications in flyback circuits; The constant current control circuit includes: a feedback sampling circuit, a constant current adjustment circuit, a switch selection circuit, a constant current threshold selection circuit, and a PWM modulation and drive circuit; The feedback sampling circuit is used to sample the output voltage of the auxiliary winding of the flyback circuit and output the feedback sampling voltage value. The first input terminal of the switch selection circuit is connected to the first constant current reference voltage, the second input terminal is connected to the second constant current reference voltage, and the output terminal is connected to the first input terminal of the constant current adjustment circuit; the first constant current reference voltage is greater than the second constant current reference voltage. The first input terminal of the constant current threshold selection circuit is connected to the output terminal of the feedback sampling circuit, and its output terminal is connected to the controlled terminal of the switch selection circuit. The constant current threshold selection circuit is used to control the switch selection circuit to conduct the path between its first input terminal and its output terminal when the feedback sampling voltage value is less than the fast start threshold voltage; and to output a voltage switching command to the controlled terminal of the switch selection circuit when the feedback sampling voltage value is greater than or equal to the fast start threshold voltage, so that the switch selection circuit switches to conduct the path between its second input terminal and the output terminal of the switch selection circuit. The second input terminal of the constant current regulation circuit is connected to a detection voltage signal that represents the peak value of the primary current. The constant current regulation circuit is used to periodically accumulate the deviation between the target current value represented by the voltage value at its first input terminal and the actual current value represented by the voltage value at its second input terminal, and output an error threshold voltage that represents the result of the accumulated deviation. The first input terminal of the PWM modulation and driving circuit is connected to the output terminal of the constant current regulation circuit. Its second input terminal is connected to the real-time detection signal that represents the instantaneous value of the primary current. Its output terminal is connected to the controlled terminal of the power switch in the flyback circuit. It is used to output a turn-off control signal to turn off the power switch when the real-time detection signal is greater than or equal to the error threshold voltage.

2. The constant current control circuit as described in claim 1, characterized in that, Also includes: Demagnetization detection circuit; The input terminal of the demagnetization detection circuit is connected to the feedback sampling voltage value. The demagnetization detection circuit is used to output a first detection signal when the feedback sampling voltage value is less than the demagnetization threshold voltage, and to output a second detection signal when the feedback sampling voltage value is greater than or equal to the demagnetization threshold voltage. The constant current regulation circuit includes: a sampling controlled switch, a conduction reset circuit, a first capacitor, a second capacitor, a charging current converter, and a discharging current converter; The first terminal of the sampling controlled switch is connected to the detection voltage signal, its second terminal is connected to the first terminal of the first capacitor and the first terminal of the conduction reset circuit, the second terminal of the conduction reset circuit is connected to the input terminal of the discharge current converter, and its third terminal is grounded. The input terminal of the charging current converter is connected to the output terminal of the switch selection circuit, and its output terminal is connected to the output terminal of the discharging current converter and the first terminal of the second capacitor; the second terminal of the first capacitor and the second terminal of the second capacitor are grounded; the first terminal of the second capacitor is also connected to the first input terminal of the PWM modulation and drive circuit. The controlled terminal of the sampling controlled switch is connected to a sampling control signal; The charging current converter is used to generate a charging current for the second capacitor based on the voltage at the output terminal of the switch selection circuit. The discharge current converter is used to generate a discharge current for the second capacitor based on the voltage value at the first terminal of the first capacitor and the voltage value at the first terminal of the second capacitor.

3. The constant current control circuit as described in claim 2, characterized in that, The conduction reset circuit includes: a first controlled switch and a second controlled switch; The first terminal of the first controlled switch is connected to the first terminal of the first capacitor, and the second terminal is connected to the input terminal of the discharge current converter and the first terminal of the second controlled switch; the second terminal of the second controlled switch is grounded. The controlled terminal of the first controlled switch is connected to the first output terminal of the demagnetization detection circuit, and is used to turn on when the second detection signal is received, so as to transfer the voltage of the first terminal of the first capacitor to the input terminal of the discharge current converter; and to turn off when the first detection signal is received. The controlled terminal of the second controlled switch is connected to the second output terminal of the demagnetization detection circuit, and is used to turn on when the first detection signal is received to reset the input terminal of the discharge current converter to ground; and to turn off when the second detection signal is received.

4. The constant current control circuit as described in claim 2, characterized in that, The demagnetization detection circuit is also used to output the valley detection signal when the feedback sampling voltage value is within a preset valley voltage range and the duration is longer than a preset duration; The PWM modulation and driving circuit includes: Comparator, RS flip-flop and driver circuit; The non-inverting input of the comparator is connected to the real-time detection signal, its inverting input is connected to the first terminal of the second capacitor, and its output is connected to the first input of the RS flip-flop; the second input of the RS flip-flop is connected to the valley detection signal output by the demagnetization detection circuit, and its output is connected to the input of the driving circuit. The comparator is configured to output a shutdown control signal when the real-time detection signal is greater than or equal to the error threshold voltage. The RS trigger is used to reset according to the shutdown control signal and set according to the valley detection signal to output a pulse width modulation signal; The output terminal of the driving circuit serves as the output terminal of the PWM modulation and driving circuit, and is used to connect to the controlled terminal of the power switch. The driving circuit is used to drive the power switch to turn on or off according to the pulse width modulation signal.

5. The constant current control circuit as described in claim 4, characterized in that, The comparator is an operational amplifier.

6. The constant current control circuit as described in claim 4, characterized in that, The PWM modulation and driving circuit also includes: an OR gate; The first input of the OR gate is connected to the output of the comparator, and its output is connected to the first input of the RS flip-flop. The constant current control circuit includes: a voltage protection circuit; The first input terminal of the voltage protection circuit is connected to the feedback sampled voltage value, and the output terminal is connected to the second input terminal of the OR gate. The voltage protection circuit is configured to output a high-level protection trigger signal to the second input terminal of the OR gate when the feedback sampling voltage value is greater than or equal to a preset overvoltage protection threshold; and to output the high-level protection trigger signal to the second input terminal of the OR gate when the feedback sampling voltage value is less than a preset short-circuit protection threshold and the duration is greater than or equal to a preset short-circuit protection shielding time.

7. The constant current control circuit as described in any one of claims 1 to 6, characterized in that, The fast-start threshold voltage is configured as a feedback sampling voltage value corresponding to the lowest operating output voltage of the flyback circuit.

8. The constant current control circuit as described in any one of claims 1 to 6, characterized in that, The constant current control circuit also includes: an input voltage compensation circuit; The first input terminal of the input voltage compensation circuit is connected to the auxiliary winding of the flyback circuit, and is used to generate a compensation current characterizing the input voltage according to the voltage of the auxiliary winding. Its output terminal is connected to the second input terminal of the constant current regulation circuit. The input voltage compensation circuit is used to superimpose the compensation current onto the detection voltage signal characterizing the primary current to compensate for the current detection deviation caused by the power switch turn-off delay due to input voltage changes. The output terminal of the input voltage compensation circuit is used to output a compensated detection voltage signal superimposed with the compensation current to the second input terminal of the constant current regulation circuit, as a characterization signal of the actual current value.

9. A flyback switching power supply, characterized in that, include: The constant current control circuit as described in any one of claims 1 to 8; A transformer includes a primary winding, a secondary winding, and an auxiliary winding; A power switching transistor, the control terminal of which is connected to the output terminal of the PWM modulation and drive circuit of the constant current control circuit, and the first terminal of which is connected to the primary winding; A current sensing resistor is connected in series between the second terminal of the power switch and ground to generate a detection voltage signal characterizing the primary current. An output rectifier and filter circuit, connected to the secondary winding, is used to provide a constant output current to the load.

10. A constant current control method applied to a flyback switching power supply, characterized in that, include: The output voltage of the auxiliary winding of the flyback switching power supply is sampled to obtain the feedback sampling voltage value; The feedback sampling voltage value is compared with the fast start threshold voltage. When the feedback sampling voltage value is less than the fast start threshold voltage, the first constant current reference voltage is selected as the target reference voltage. When the feedback sampling voltage value is greater than or equal to the fast start threshold voltage, a second constant current reference voltage is selected as the target reference voltage; wherein, the first constant current reference voltage is greater than the second constant current reference voltage; Acquire a detection voltage signal that characterizes the peak value of the primary side current, and periodically accumulate the deviation between the target current value represented by the target reference voltage and the actual current value represented by the detection voltage signal to generate an error threshold voltage. The real-time detection signal representing the instantaneous value of the primary current is compared with the error threshold voltage. When the real-time detection signal is greater than or equal to the error threshold voltage, a shutdown control signal is output to shut down the power switch.