Design TL431 and optocoupler feedback in four steps. Set the divider so that . Put a bias resistor across the LED so the TL431 always carries at least 1 mA. Keep the LED resistor small enough that, at the lowest CTR, the LED can still pull the controller's feedback pin all the way down. Then design the Type II network knowing that the LED path adds a gain that the network cannot go below. Take a 12 V output with a 3.3 kΩ pull-up to 5 V and a CTR between 0.3 and 1.0. The divider is 9.53 kΩ over 2.49 kΩ, the bias resistor 1 kΩ, and at most 1.70 kΩ (1.5 kΩ fitted). is then 0.66 to 2.2, and the crossover moves between 1.5 and 4.6 kHz with that CTR spread.
The idea in one picture
An off-line flyback measures its output on the secondary, but the PWM controller sits on the primary, behind the isolation barrier. The TL431 is the error amplifier: it compares a fraction of the output with its internal 2.495 V reference and sinks more current when the output is high. That current flows through the optocoupler's LED. Light crosses the barrier, and the phototransistor pulls the controller's feedback pin down against a pull-up resistor. A high output means more LED current, a lower feedback voltage and a smaller duty cycle.
The catch is that the LED's anode does not hang from a clean supply: it hangs from the output itself, through . So the LED current has two paths to follow the output. The slow lane goes through the TL431 and its compensation network. The fast lane goes straight through : if the output rises by 10 mV, the LED current rises by , whatever the TL431 does. Most of the surprises in this circuit come from that second path.
How do I set the output voltage with the TL431 divider?
The TL431 regulates when its REF pin sits at above its anode: 2.495 V typical for the TL431C (Texas Instruments, TL431, TL432 Adjustable Precision Shunt Regulator, SLVS543, Electrical Characteristics). With from the output to REF and from REF to the secondary ground,
The REF input current is 2 µA typical in the same table, so the second term is about 20 mV with a 10 kΩ upper resistor. Pick so the divider carries about 1 mA (here 2.49 kΩ). Much larger values make and its spread matter; much smaller ones waste power at no load. Then solve for and round to an E96 value.
How much bias current does the TL431 need?
The TL431 regulates only while its cathode current is above its minimum. The data sheet's Recommended Operating Conditions give a cathode current of at least 1 mA. At light load, or whenever the loop asks for little LED current, the LED alone may carry less than that. So a resistor across the LED supplies the difference:
With an LED forward drop near 1 V, that is 1 kΩ. The bias current flows through too, which matters for the next step.
The TL431 also needs some voltage across it. The same Recommended Operating Conditions ask for a cathode voltage of at least , so plan for V.
What is the largest LED resistor I can use?
The worst case is the lowest CTR (an old part, hot) at the point where the controller wants the smallest duty cycle. There the phototransistor must sink the most current, , which takes an LED current of . The LED path has of headroom, and carries both the LED and the bias current:
This follows C. Basso's treatment of the TL431 in Designing Control Loops for Linear and Switching Power Supplies. A larger than this and the loop runs out of authority at light load: the output rises because the opto cannot pull the feedback pin low enough.
What is the small-signal gain of the TL431 and optocoupler loop?
Write the TL431 with and in series from its cathode to REF: the Type II network. Its cathode then moves against the output as . The LED current is the difference between the output and the cathode, divided by . Add the collector side, where and the capacitance on the feedback pin make a pole. The transfer function from the output to the feedback pin is
Three things to read from it:
- The gain multiplies everything. The CTR here is the small-signal one, the slope of the collector current against the LED current at the operating point.
- The zero is at , not at as in an op-amp Type II. The fast lane adds the "1" that moves it.
- Above the zero the gain flattens at , which can never be less than . Even with , the fast lane alone sets a floor on the mid-band gain.
Where do the zero and the pole of the Type II go?
- The pole at the origin is the TL431's integrator (). It gives the loop its high DC gain, so the output holds its set point.
- The zero goes a few times below the crossover; a factor of three to five is common. It returns the phase the integrator took.
- The high-frequency pole is the optocoupler pole, . Here is the phototransistor's own capacitance, and a larger pull-up lowers its pole further. Put it above the crossover, usually near the ESR zero of the output capacitor or a decade below the switching frequency. A capacitor across the TL431, which would make the pole in an op-amp Type II, does nothing at high frequency here: the fast lane goes around it. Place the capacitor on the feedback pin instead.
Worked example: 12 V flyback, 3.3 kΩ pull-up, CTR 0.3 to 1.0
The power stage is the one in the flybackTl431 example (see below), so the numbers can be checked against the circuit. Assumptions:
| Input | Value | Where it comes from |
|---|---|---|
| Output | 12 V | spec |
| , | 2.495 V, 2 µA | TL431C typical, TI SLVS543 |
| Lowest cathode current | 1 mA | TI SLVS543, Recommended Operating Conditions |
| 2.5 V | TI SLVS543: cathode voltage at least | |
| LED | 1.0 V | Vishay TCET1100 data sheet (document 83503), Fig. 7: 1.005 V at 1 mA |
| CTR, small-signal | 0.3 to 1.0 | assumption: TCET1100 Fig. 13 (typical) gives 0.46 at 1 mA, and Fig. 8 lowers the CTR to 76 % at 75 °C; we allow for ageing and take 0.3. The upper end is near the curve's peak; a part from a higher CTR grade needs a higher one |
| Pull-up | 3.3 kΩ to 5 V, 4.7 nF on the feedback pin | design choice |
| Feedback pin | zero duty at 1 V, duty | the example's primary-side modulator |
| Plant, duty to output | 29.4 V per unit of duty, one pole at 133 Hz (full load, 24 Ω, 100 µF) | the example's discontinuous-mode flyback: |
| Target | crossover 1.5 kHz at the lowest CTR, zero at a fifth of it | design choice |
The CTR is used both for the DC bound and for the small-signal gain. That is a simplification: the slope of the CTR curve is not the same as .
Divider. kΩ carries 1.00 mA. kΩ; take 9.53 kΩ. Then V.
Bias. kΩ.
LED resistor. The collector must sink up to mA. At CTR 0.3 that takes 4.04 mA in the LED, plus 1.0 mA in . The headroom is V, so kΩ. Take 1.5 kΩ.
Fast-lane gain. (−3.6 dB) at the lowest CTR and (+6.8 dB) at the highest.
Compensation. From the feedback pin, the plant gain is . At 1.5 kHz that is 1.29 (+2.2 dB) at −85°, so the network must give 0.77 there. The opto pole is kHz. With the zero at 300 Hz, , so kΩ (1.54 kΩ) and nF (47 nF, a zero at 306 Hz).
| Result | Lowest CTR (0.3) | Highest CTR (1.0) |
|---|---|---|
| 0.66 | 2.2 | |
| Mid-band gain | 0.77 (−2.3 dB) | 2.56 (+8.1 dB) |
| Crossover | 1.50 kHz | 4.56 kHz |
| Phase margin | 75° | 64° |
| Opto pole lag at crossover | 8° | 24° |
The 3.3:1 spread of the CTR becomes a 3:1 spread of the crossover. Even with (and the zero still at a fifth of the crossover), the fast lane alone would cross at 1.3 kHz at the lowest CTR, so no choice of the Type II network can bring the crossover lower without changing . These margins use the simple model above. They leave out the TL431's own response, the opto's internal pole and the half-load plant, whose lower gain moves the crossover down.
What goes wrong in practice?
- The fast lane fixes a gain floor. You cannot make the mid-band gain smaller than . If the loop needs less gain than that at the crossover, at the highest CTR, the fast lane must go: feed the LED from a small Zener-regulated or RC-filtered supply instead of the output. Then alone sets the gain.
- The CTR spreads and ages. Data sheets give the CTR at one LED current, often over a wide range for the unbinned part, and the CTR falls with temperature and operating hours. Size at the end-of-life minimum, and check the margins at the highest CTR, cold. The TCET1100 data sheet gives no ageing curve, so the end-of-life factor is a design assumption.
- The opto pole moves with the pull-up. The phototransistor's pole falls as grows, and data sheets give it at one load resistance only. A pole you placed at 10 kHz may sit lower; measure it, or keep the crossover well under it.
- The TL431 starves. Without , a light load can leave the TL431 below 1 mA, where it stops regulating and the loop gain collapses.
- The cathode bottoms out. At high LED current the cathode can fall to . During a load step there is then no room left, and the loop saturates. Check at the highest LED current.
Try it in Voltecx
Open File › Open Example › Isolated › Flyback with TL431 and optocoupler (file.openExample with flybackTl431). It is a 12 V, 0.5 A flyback from 12 V: a 1:1 coupled inductor of 20 µH at 100 kHz, 100 µF on the output and a 24 Ω load, which halves (48 Ω) at 4 ms. Its secondary has its own ground sgnd, tied to the primary by 10 MΩ and a 2.2 nF Y capacitor. The loop closes through a TL431-class shuntRegulator (TL431C data-sheet values) and a TCET1100-class optocoupler, both placed as IC modules.
Its feedback is the network of this article, sized differently:
- divider 9.53 kΩ over 2.49 kΩ, for 12.06 V;
- 3 kΩ, with 1.5 kΩ across the LED (0.67 mA at 1 V; the LED current brings the TL431 above 1 mA);
- 2.7 kΩ and 27 nF, a zero at 480 Hz;
- 3.3 kΩ to 5 V with 4.7 nF, the opto pole at 10.3 kHz.
It is sized for the typical CTR curve, not the 0.3 minimum. Its design notes give a crossover near 2.5 kHz with about 65° of phase margin at full load, and near 1.7 kHz at half load. By the bound above, its 3 kΩ needs a CTR of at least 0.55 to pull the feedback pin to 1 V.
- Run the simulation (
simulation.run). The output holds 12.06 V at full and half load, in both solvers. Watchv(out)andv(fb)across the load step: when the load drops, the LED current increases and the feedback pin falls, so the duty cycle falls. - Run
circuit.problemswith"run": true. It reportsshunt.lowCurrentwhen a shunt regulator carries less than 1 mA for more than a fifth of the second half of the run. DeleteRbiasand run it again to see the warning. - Read the model's parameters and their data-sheet sources with
ic.describe({"name":"optocoupler"}). The optocoupler'sctrScalescales its whole CTR curve, for another bin or for the lower CTR at end of life. Place one with a lower CTR withic.placeand"params": {"ctrScale": 0.5}. - To measure a loop gain in a switching circuit, use Analysis › Loop Gain (
analysis.loopGain): it breaks the loop at a control signal you name and reports the crossover and the margins. See loop gain and phase margin in simulation.
From a script:
powercraft-cli run \
--cmd file.openExample --params '{"name":"flybackTl431"}' \
--cmd simulation.run --params '{}' \
--cmd scope.measure --params '{"signals":["v(out)","v(sgnd)","i(Rled)"],"t0":"3.5m","t1":"4m"}'
For an isolated flyback designed from a spec, automatic design sizes the same TL431 and optocoupler network. It tries each CTR bin of the TCET1100 family and checks the margins at the bin's highest CTR, its lowest and its lowest after ageing (by default, half the CTR is left at end of life).
Frequently asked questions
Why does my TL431 loop have more gain than I designed?
Almost always it is the fast lane. The LED is fed from the output through , so the gain never drops below , whatever you choose. At the highest CTR this floor can put the crossover several times higher than planned.
What value should the resistor across the optocoupler LED have?
About , near 1 kΩ for an LED drop of 1 V. It keeps the TL431 at or above the 1 mA its data sheet recommends when the LED itself needs little current.
Can I put the compensation pole capacitor across the TL431?
It will not make the high-frequency pole you expect. The fast lane carries the output ripple to the LED around the TL431, so the pole must come after the opto: a capacitor from the feedback pin to ground, with the pull-up resistor and the phototransistor's own capacitance.
Which CTR should I design with?
Size at the lowest CTR at end of life and at the highest temperature. Check the phase margin at the highest CTR, cold. Use the small-signal CTR (the slope of the curve at the operating LED current) for the loop gain, not the ratio printed in the data sheet's table.
Sources
- Texas Instruments, TL431, TL432 Adjustable Precision Shunt Regulator, data sheet SLVS543 (Voltecx's model uses revision S, May 2024): Recommended Operating Conditions and Electrical Characteristics, TL431C.
- C. Basso, Designing Control Loops for Linear and Switching Power Supplies: A Tutorial Guide, Artech House, 2012.
- C. Basso, "The TL431 in the Control of Switching Power Supplies", ON Semiconductor seminar, 2009.
- Vishay Semiconductors, TCET1100, TCET1100G Optocoupler, Phototransistor Output, High Temperature, document 83503: Fig. 7, Fig. 8 and Fig. 13.