Its data could not be read. The original bytes are preserved; edits in this session will not overwrite them. Download the original before resetting, or import a valid notebook through Agent handoff.
Chapter 00 · Electronics / power LED drivers
Course architecture
Learning objective. Separate teaching models, datasheet designs and measured evidence, and set up the D1 design thread.
AI disclosure: This course was fully AI-generated. Its numbers come from the course's own models, which are listed in chapter 19 with their limits.
This course teaches how to drive high-power LEDs: why they need current rather than voltage control, how linear and switching constant-current drivers work, how dimming interacts with perception and flicker, how a microcontroller can control or supervise a driver, and how heat, faults and layout limit the design. It is written for an electronics graduate. Basic switching-converter ideas are derived where they are needed; the buck converter course covers them in more depth. Allow roughly 42–57 hours plus bench time, including the optional boost-protection extension in chapter 20.
The D1 design thread
One design runs through the course: D1, a 24 V work lamp. Three white high-power LEDs on a metal-core board are driven at 700 mA by a floating hysteretic buck from a 24 V adapter. A CH32V003-class microcontroller provides PWM dimming from a button and reduces the current when an NTC at the LED solder points gets hot. A second example, E2, is a boost driver that runs ten LEDs at 350 mA from 9–16 V.
Figure 1. D1 as energy and control paths. The driver regulates current by itself; the MCU only dims it and folds it back when hot.
D1's values are a teaching design. The LED model used throughout is deliberately simple: each LED has a knee voltage of 2.75 V at 25 °C, a dynamic resistance of 0.65 Ω and a knee temperature coefficient of −2 mV/K. That gives 3.21 V at 700 mA, typical of a 3 W-class white LED; real parts must be taken from their datasheets and binning tables.
Evidence
What it is
What it can establish
Teaching model
The course's calculations and tools
Mechanisms, trade-offs and orders of magnitude
Datasheet design
Parts chosen with tolerances and derating
That a specific design is plausible on paper
Measured lamp
Current, light, temperature and fault tests
Actual behaviour of one build under stated conditions
How to study
Each chapter gives theory, a worked example and an exercise with a worked answer or review criteria. Predict before you calculate, and calculate before you open a tool. Write your reasoning in the chapter notebook (stored locally; export it to keep it).
Study block
Produce before moving on
Self-check
Chapters 0–2
LED model, string arrangement and its sensitivity to temperature
What happens to current if you drive the string at a fixed voltage?
Chapters 3–9
Topology choice, driver calculations and an accuracy budget
Do you know the average current, ripple and frequency at both input extremes?
Chapters 10–13
Dimming map, control scheme and thermal chain
Is the dimmest level visible, and is the hottest junction within its rating?
Chapters 14–17
Protection, layout, measurement plan and review
What happens if the MCU hangs or an LED connector bounces?
Deliverable 0: write a notebook entry with your target lamp (light output, supply, size), the instruments you have (oscilloscope, current probe, thermometer, light meter), and the three topics you trust yourself least to judge.
Notebook
Notes are saved in this browser. Export them before clearing browser data.
Learning objective. Model an LED by knee voltage, dynamic resistance and temperature coefficient, and explain why LEDs need current drive.
An LED is a diode whose recombining carriers emit light. For a driver designer four properties matter: the steep current–voltage law, the temperature dependence of that law, how light depends on current and temperature, and how much of the input power becomes heat.
The current–voltage law
Near its operating point an LED's current rises roughly exponentially with voltage, flattened at high current by series resistance. A useful engineering model replaces the curve near the operating point by a knee voltage and a dynamic resistance:
Figure 2. The piecewise-linear model is accurate only near its operating point. Heating shifts the whole curve to lower voltage.
With the course model, one LED needs 2.98 V at 350 mA, 3.21 V at 700 mA and 3.40 V at 1 A at 25 °C. A 0.1 V change in voltage changes the current by \(0.1/0.65\approx150\) mA, more than 20% of the operating current.
Why voltage drive fails
Datasheets bin LEDs by forward voltage because production spread is large: a bin can be 0.1–0.2 V wide per LED. The knee also falls with temperature, typically by 1.5–4 mV/K for white InGaN LEDs. Suppose a three-LED string is driven at a fixed 9.62 V, chosen to give 700 mA at 25 °C. When the junctions warm to 65 °C the knees drop by \(3\times40\times2\) mV = 0.24 V, and the current rises by \(0.24/(3\times0.65)=123\) mA, to about 820 mA (+18%). More current means more heat and a further drop in voltage: positive thermal feedback. If each of the three LEDs differs by 0.1 V between the high and low bins, the string difference is 0.3 V and the fixed-voltage current difference is about 154 mA. A 0.15 V difference for the whole string gives 77 mA. Fixed-voltage drive makes the current an accident of binning and temperature, which is why LED drivers regulate current.
Light and current
Light output rises with current, but less than proportionally at high current density (efficiency “droop”), and falls as the junction warms. The course uses an illustrative model in which relative flux scales as \(I^{0.9}\) and falls by 0.3% per kelvin above 25 °C; datasheets give the actual curves. The white point also shifts with current and temperature. That is one reason PWM dimming, which keeps the current fixed while varying on-time, preserves colour better than reducing the current.
Where the power goes
The fraction of electrical power that leaves as light (wall-plug efficiency) is often 30–50% for white power LEDs, falling with current and temperature. The rest is heat at the junction. The course uses a heat fraction of 0.65. A 3.2 V, 700 mA LED therefore puts about 1.5 W of heat into a die a millimetre across. Heat, not electrical rating, usually sets the current you can use.
Reverse voltage and ESD
LEDs are not designed to block reverse voltage; datasheets often give a small reverse-voltage test condition rather than a rating, and some include a protection diode. Do not rely on an LED to block reverse polarity or a negative transient. ESD can damage LED dies; long LED cables need the same ESD thinking as any external connector.
Exercise 1 · Sensitivity of a voltage-driven string
A string of three model LEDs is supplied from a fixed 9.62 V through 0.5 Ω of wiring. Find the current at 25 °C and at 65 °C junction temperature. Then repeat with a 2 Ω series resistor and a supply raised to give 700 mA at 25 °C. What did the resistor buy, and at what cost?
Worked solution
With 0.5 Ω: at 25 °C, \(I=(9.62-8.25)/(1.95+0.5)=0.559\) A (the wiring already lowers it); at 65 °C the knees fall by 0.24 V, so \(I=(9.62-8.01)/2.45=0.657\) A, +18%. With 2 Ω the supply must be \(8.25+0.7\times3.95=11.02\) V. At 65 °C, \(I=(11.02-8.01)/3.95=0.762\) A, +9%. The resistor halves the sensitivity but dissipates \(0.7^2\times2=0.98\) W, about 15% of the LED power. A current regulator greatly reduces the sensitivity. A switching driver can also reduce the loss; a linear current regulator still dissipates its voltage headroom times current.
Notebook
Notes are saved in this browser. Export them before clearing browser data.
Learning objective. Predict current sharing in series and parallel strings, including thermal feedback and ballast trade-offs.
A driver supplies one current. How LEDs are arranged decides whether each LED gets that current.
Series strings
In a series string every LED carries the same current, whatever its forward voltage. The string voltage is the sum of the LED voltages, so it inherits their spread and temperature coefficient: \(n\) times the per-LED values. Series strings are the default for power LEDs. Their costs are a higher voltage (the driver topology follows from it, chapter 4) and the fact that one open LED darkens the whole string. Some LEDs fail short; some designs add shunt protection devices across each LED so an open LED is bypassed.
Parallel strings and current hogging
Putting strings in parallel on one current source looks attractive: one driver, lower voltage. The current then divides according to the strings' voltage–current curves. With the linear model, two strings with dynamic resistance \(R=nr_d\) each and a knee difference \(\Delta V\) share a total current \(I\) as
Two three-LED strings with a 0.15 V offset (0.05 V per LED, well inside a typical bin) and a 1.4 A total split 738/662 mA: 11% imbalance before heating. The string that takes more current heats more, its voltage falls and it takes still more. With separate heatsinks of 8 K/W per string, Laboratory 1 finds 745/655 mA (13%) with junctions at 62 and 57 °C; with 16 K/W per string, 755/645 mA (16%) at 98 and 87 °C. Shared heatsinks reduce the temperature difference and therefore the feedback. Strings that are not thermally coupled and run near their limits can run away.
Ballast resistors
A resistor in series with each string adds to its dynamic resistance and reduces the imbalance. One ohm per string brings the 0.15 V offset down to 7% imbalance before heating, and about 8% with the 8 K/W heatsinks. It costs about 0.98 W, 7% of the LED power. Ballast is a trade between efficiency and sharing; a separate current regulator per string, even a small linear one, is often the better trade.
Arrays and failures
Matrix arrays (strings in parallel with cross-connections) let current redistribute when one LED opens, but they concentrate current in the LEDs next to the failure. A short in one LED of a series string raises the current only slightly with a current driver; in a parallel arrangement it steals current from its neighbours. Write down the failure mode you design for.
Exercise 2 · Share 1.4 A between two strings
Using Laboratory 1, find the imbalance for 0.15 V offset at 8 K/W per string with no ballast, then find the ballast that keeps the hot imbalance below 5%. Report the ballast loss as a fraction of LED power and compare with using two drivers.
Worked solution
No ballast: about 13% hot. The required ballast is a few ohms: with 3 Ω per string the cold imbalance is \(0.15/(1.95+3)/0.7\approx4.3\%\) and the tool's hot value is 4.54%, at a cost of 2.9 W, about 22% of the 13.2 W LED power. 2.5 Ω just misses (5.09%). Two drivers (or one driver per string with a shared input) avoid that loss entirely. Ballast is reasonable only for small offsets or low power.
Notebook
Notes are saved in this browser. Export them before clearing browser data.
Learning objective. Calculate dissipation, efficiency and dropout of a linear current regulator across its input range.
The simplest current driver puts a transistor in series with the LEDs and adjusts it so that the voltage across a sense resistor equals a reference.
Figure 3. A linear current sink. The pass transistor absorbs every volt the string does not need.
Operation and dissipation
The op-amp drives the gate until \(V_{R_s}=V_{set}\), so \(I=V_{set}/R_s\) whatever the string voltage, as long as the transistor has headroom. The pass device dissipates
For D1's string at 60 °C (9.41 V at 700 mA), a 0.2 V sense voltage and 0.5 V of headroom, regulation needs at least 10.1 V. From a 12 V supply the pass device dissipates 1.68 W and the efficiency is 78%. From 24 V it would dissipate 10 W at 39% efficiency: a linear regulator is the wrong tool there.
Input range is the real constraint
A linear regulator is attractive when the input is only slightly above the string voltage over its whole range: an LED string sized to a regulated rail, or a battery whose voltage tracks the string. Across a wide input range its worst case is at the highest input. Laboratory 2 sweeps the input: from 9 to 15 V the pass device's worst dissipation reaches 3.8 W at 15 V. With 40 K/W that is a 190 °C junction, impossible without a heatsink. Below about 10.1 V the regulator drops out and the LED current follows the input. Both ends need a decision.
Where linear wins
Linear drivers produce no switching noise, need no inductor and can respond quickly, which can make PWM dimming crisp; verify enable delay, op-amp settling and gate charge. They are ideal per-string regulators behind a switching pre-regulator, which can track the highest string voltage plus a small headroom (“headroom control”). Small constant-current ICs and two-transistor current sources use the same principle.
Stability and the sense resistor
The op-amp, the MOSFET's gate capacitance and the source-follower form a loop; a small gate resistor and a compensation capacitor from output to inverting input are usually needed. A low sense voltage saves power but makes op-amp offset a larger fraction of the reading (chapter 8). The sense resistor dissipates \(V_{set}I\) and needs a temperature coefficient matched to the accuracy target.
Exercise 3 · A linear driver from 12 V ±10 %
D1 is to run from a 12 V ±10% supply with the same string. Find the minimum regulating input, the pass dissipation at 13.2 V and the junction temperature with 40 K/W at 40 °C ambient. Does it regulate at 10.8 V? What would you change?
Worked solution
Minimum input is about 10.1 V, so 10.8 V still regulates with 0.7 V to spare. At 13.2 V the pass device dissipates \((13.2-9.41-0.2)\times0.7=2.5\) W; with 40 K/W at 40 °C the junction would be about 140 °C, too hot. Options: a heatsink or a larger package (for example 15 K/W gives about 78 °C); a smaller headroom design; fewer volts by adding a fourth LED to the string (raising its voltage to about 12.5 V, which then needs a higher input); or a buck. The best choice depends on whether the 12 V is regulated.
Notebook
Notes are saved in this browser. Export them before clearing browser data.
Learning objective. Choose an LED driver topology and control family from the string and input voltages.
A switching driver converts the input voltage to the string voltage with little loss, using an inductor whose current it regulates. The string voltage relative to the input decides the topology.
Topology
String voltage
Notes
Buck
Below the input
Continuous inductor current flows in the LEDs; simplest and most common
Floating buck
Below the input
Low-side switch; LEDs and sense resistor sit at the input rail; easy current sensing (D1)
Boost
Above the input
Pulsed diode current; needs an output capacitor; cannot limit a short or a low string (E2)
Buck-boost, SEPIC, Ćuk
Either side
For inputs that cross the string voltage, e.g. automotive and batteries
Flyback
Any, isolated
Mains LED drivers (chapter 16)
Control families
Hysteretic control switches when the sensed current crosses an upper or a lower threshold. It needs no compensation and responds within one switching cycle, but the frequency varies with input and string voltage, and comparator delays shift the average (chapter 5).
Peak current with constant off-time ends each on-time at a peak current and then stays off for a fixed time. The ripple is set by the string voltage and the off-time, so the average current does not depend on the input voltage, and the scheme is free of the sub-harmonic oscillation of fixed-frequency peak control (chapter 6).
Fixed-frequency peak or average current mode keeps the spectrum predictable for EMI. Peak control needs slope compensation above 50% duty and has an average-current error equal to half the ripple, which varies with input. Average-current control adds an error amplifier and a compensated loop; it is accurate but slower. A microcontroller can implement it (chapter 11).
Is an output capacitor needed?
In a buck the inductor current flows directly through the LEDs, so no output capacitor is required; the LED current ripple equals the inductor ripple. A small capacitor across the string reduces ripple strongly because the string's dynamic resistance is low (chapter 9). In a boost the diode current is pulsed, so the output capacitor is essential.
Choosing for D1
D1's string needs about 9.4 V at 700 mA from 24 V: a buck at roughly 40% duty. The floating buck puts the sense resistor at the input rail, where a simple high-side comparator can measure it, and uses a low-side switch that needs no bootstrap. Hysteretic control keeps the controller tiny. The cost is a frequency that moves with the input; the EMI and audible-noise consequences are checked in chapters 5 and 14.
Exercise 4 · Pick a topology
Choose a topology and control family for: (a) 1 A into one LED from a single Li-ion cell (3.0–4.2 V); (b) 20 LEDs at 150 mA from 24 V; (c) 3 LEDs at 1 A from a 12 V car supply (9–16 V, with transients). Justify each in two sentences.
Worked solution
(a) One LED needs about 3.2–3.4 V, crossing the cell voltage: a buck-boost, or a linear regulator if efficiency near the end of discharge is acceptable. (b) The string needs about 60 V from 24 V: a boost with OVP, or multiple shorter strings with a separate buck channel per string, each below 24 V at its cold, highest-forward-voltage corner (two ten-LED strings still need roughly 30 V each and cannot use buck channels from 24 V); constant off-time or fixed-frequency current mode. (c) The string needs about 10 V and the input can be below or above it: a buck-boost or SEPIC, with automotive transient protection on the input.
Notebook
Notes are saved in this browser. Export them before clearing browser data.
Learning objective. Derive frequency, ripple and average-current error of a floating hysteretic buck with comparator delay.
D1's driver is the classic floating buck with hysteretic control, the architecture of integrated drivers such as Diodes' ZXLD1350 and AL8860. Their datasheets describe a 100 mV mean sense threshold with about ±15% hysteresis, so \(I\approx0.1\ \text{V}/R_s\).
Figure 4. The floating buck. With the switch on, current rises through Rs, the LEDs, L and Q; with it off, the inductor freewheels through the diode back to the input, still through the LEDs and Rs.
Two intervals
With the switch on, the inductor sees the input minus the string and resistive drops; with it off, the inductor current flows through the diode back to the input and the inductor sees minus the string voltage and the diode drop:
The sense resistor stays in the current path in both intervals, so the comparator sees the inductor current continuously. That is the floating buck's advantage.
D1's numbers
With \(R_s=0.143\) Ω and thresholds of 115/85 mV the current swings between 804 and 594 mA, centred on 699 mA. With \(L=68\) µH, the string at 9.41 V and a 0.4 V diode, the ideal frequency at 24 V is 411 kHz.
Delay shifts the average
The comparator and the switch react after a delay \(t_d\). During that time the current keeps rising (on) or falling (off), so the peak overshoots the upper threshold by \(m_{on}t_d\) and the valley undershoots the lower one by \(m_{off}t_d\), where \(m\) are the slopes. The average moves by about
(neglecting resistive drops), and the frequency drops because each interval is longer. With a 50 ns delay at 24 V, Laboratory 3 gives an average of 701 mA (+0.19%), a ripple of 228 mA and a frequency of 379 kHz. With 200 ns the average is +0.8%, the ripple 280 mA and the frequency 308 kHz. At 12 V the up-slope is smaller than the down-slope, so the shift changes sign: −1.1% with 200 ns. The frequency at 12 V falls to about 120 kHz because the on-time grows as the input approaches the string voltage. At 30 V it rises to about 423 kHz.
What varies and what does not
The average current is set by two thresholds and a resistor, so it is nearly independent of input voltage and LED voltage: the strength of the scheme. The frequency is not: it changes about 3.5× over 12–30 V. A design must check the switch and diode losses at the highest frequency, the EMI spectrum across the whole range, and the minimum on-time of the driver at the highest input. A frequency that falls into the audible range at very low headroom can make the inductor sing.
Exercise 5 · D1 across its input range
Using Laboratory 3, tabulate the frequency, ripple and average current at 12, 24 and 30 V for 50 ns and 200 ns delay. Explain the sign change of the average error, and decide whether the variation matters for a work lamp.
Worked solution
With 50 ns: about 120, 379 and 423 kHz, ripple 220–233 mA, averages +0.08…+0.49% from the threshold midpoint. With 200 ns: about 108, 308 and 331 kHz, ripple 245–298 mA, averages from −1.1% at 12 V to +2.0% at 30 V. The error follows \(V_{in}-2V_{str}\): positive when the on-slope is the steeper one. A ±1% current variation is invisible in a work lamp; the frequency range matters more because it sets switching loss and EMI at the top and possible audible noise near the bottom.
Notebook
Notes are saved in this browser. Export them before clearing browser data.
Peak current control: constant off-time and fixed frequency
Learning objective. Compare constant off-time and fixed-frequency peak-current control for average-current accuracy and stability.
Many integrated LED controllers sense the switch current and end each on-time at a peak threshold. What they do next decides how the average current depends on the input.
Constant off-time
After the peak, the switch stays off for a fixed time \(t_{off}\). During it the inductor current falls by
The ripple depends on the string voltage, not the input, so the average current is independent of input voltage. For D1 with \(t_{off}=1.5\) µs and 68 µH, \(\Delta I\approx0.22\) A, so a 808 mA peak gives 700 mA average. The frequency is about 390 kHz at 24 V and about 120 kHz at 12 V. Because each cycle starts after a fixed off-time instead of a clock edge, there is no sub-harmonic oscillation at high duty. Controllers in the HV9910 family use this scheme, often with the off-time set by a single resistor.
Fixed-frequency peak control
With a clock instead, the off-interval is whatever remains of the period, and the ripple becomes \(\Delta I=(V_{in}-V_{str})D/(Lf)\). For D1 at 400 kHz the ripple is about 0.22 A at 24 V but about 0.08 A at 12 V, so a fixed peak threshold moves the average by about 70 mA (10%) between the two inputs. Above 50% duty (12 V input, D ≈ 0.8) the current loop also needs slope compensation to avoid sub-harmonic oscillation, exactly as in a converter's current-mode control. Fixed frequency is chosen for a predictable EMI spectrum and synchronisation, and the error is removed by an outer average-current loop.
Blanking and minimum on-time
The switch-current signal carries a spike at turn-on (diode recovery, capacitances). Controllers blank the comparator for a few hundred nanoseconds, which sets a minimum on-time. At the highest input and lowest string voltage the required on-time can fall below it; the controller then overshoots the peak or skips cycles, and the average current rises. Check \(t_{on}=D/f\) at the worst corner against the datasheet minimum.
Sensing location
A floating buck can sense the inductor current at the input rail all the time. A ground-referenced buck with a low-side switch senses only the switch current, during the on-time, which is what peak control needs. Average-current loops need the whole waveform or a sample at a known point (chapter 11).
Exercise 6 · Compare the two peak schemes for D1
For D1 at 12 V and 24 V, compute the ripple and the average current for (a) constant off-time 1.5 µs and (b) fixed 400 kHz, both with an 808 mA peak. Which one needs slope compensation, and at which input?
Worked solution
(a) Ripple ≈ 0.22 A at both inputs; average ≈ 698 mA at both. (b) At 24 V, D ≈ 0.40 and ripple ≈ (24 − 9.4) × 0.40 / (68 µH × 400 kHz) ≈ 0.22 A, average ≈ 700 mA; at 12 V, D ≈ 0.79 and ripple ≈ 0.08 A, average ≈ 770 mA. The fixed-frequency scheme needs slope compensation at 12 V, where the duty exceeds 50%. Constant off-time avoids both problems at the cost of a variable frequency.
Notebook
Notes are saved in this browser. Export them before clearing browser data.
Learning objective. Size a boost LED driver, locate its right-half-plane zero and bound its open-LED fault.
When the string voltage is above the input, a boost converter is the natural choice: backlights, automotive strings, battery lamps. E2 drives ten model LEDs at 350 mA from a 9–16 V supply.
Figure 5. A boost LED driver regulates the current in the sense resistor. The OVP divider is not optional.
Steady state
In continuous conduction the ideal boost gives \(V_o=V_{in}/(1-D)\). The inductor carries the input current, larger than the LED current:
At 60 °C E2's string needs 29.1 V plus 0.2 V across the sense resistor: 29.3 V. From 12 V, D = 0.59 and the inductor averages 0.85 A. With 33 µH at 400 kHz the ripple is 0.54 A peak-to-peak and the peak 1.12 A. A 4.7 µF output capacitor ripples by about 115 mV. Because the LED string's dynamic resistance is only \(10\times0.65=6.5\) Ω, that ripple drives about 16 mA of LED current ripple, 4.7% of the set current. The capacitor is sized for LED current ripple, not for voltage.
The right-half-plane zero
A boost transfers energy to the output only during the off-time. When the control loop increases duty to raise the current, the off-time first shrinks and the output current briefly falls before rising. In the small-signal model this is a right-half-plane zero:
\[
f_{RHP}=\frac{(1-D)^2V_o}{2\pi L\,I_o}.
\]
E2 has its RHP zero at 68 kHz at 12 V and 38 kHz at 9 V. A right-half-plane zero adds phase lag like a pole while raising gain like a zero, so the current loop's crossover must stay well below it at minimum input, typically a fifth or less. That makes boost LED drivers slower than bucks, which matters for PWM dimming (chapter 10) and for the response to input steps.
Open LED: the boost's defining fault
If the string opens (a broken wire, a failed LED, an unplugged lamp head), the current loop sees zero current and asks for more output. Without a separate voltage limit, the capacitor keeps charging. The normal peak inductor energy \(\tfrac12LI_{pk}^2\) is not the energy transferred per cycle in CCM: the valley energy remains, and the input also supplies energy during the off-time.
A useful conditional timescale follows from capacitor energy. If the net power into the capacitor stayed equal to E2's pre-fault output power, \(P_C=V_oI_o=10.25\) W, then
This is an explicitly assumed constant-power scenario, not a fault prediction. Current-limit action, maximum duty, changing inductor energy and pulse skipping can all change it. OVP normally reacts after its threshold is crossed; its propagation delay and the energy left in the inductor set the extra peak. Chapter 20 derives that peak after the last turn-off. Rate components above the worst threshold tolerance plus delay, residual-energy rise and parasitic ringing. TI's TPS92691 reference design illustrates separate open-load OVP and hysteresis; its numerical thresholds belong to that design.
Short and low-voltage strings
A boost cannot regulate a string whose voltage is below the input: the input reaches the output through the inductor and diode whether the switch moves or not. A shorted string or a string with too few LEDs therefore draws an uncontrolled current from the input. Input fuses, a series disconnect switch, or a SEPIC/buck-boost topology are the remedies, depending on how likely the fault is. At power-up the output capacitor charges to the input voltage through the diode before switching starts; with a long string that is harmless, but a short string could glow or be stressed.
Exercise 7 · E2 at its corners
Using Laboratory 4, tabulate D, peak inductor current, LED ripple and RHP-zero frequency for E2 at 9, 12 and 16 V. Choose a current-loop crossover for the whole range, and calculate the conditional time to reach 45 V if the pre-fault output power continued charging the capacitor. Explain which additional information is needed to predict the peak.
Worked solution
At 9 V: D ≈ 0.69, peak ≈ 1.37 A, LED ripple ≈ 19 mA, RHP zero ≈ 38 kHz. At 12 V: 0.59, 1.12 A, 16 mA, 68 kHz. At 16 V: 0.45, 0.92 A, 13 mA, 121 kHz. The worst case is 9 V, so a crossover around 5–8 kHz is a starting target requiring loop verification. The assumed capacitor power is 10.25 W at all three inputs, giving about 268 µs to 45 V in this scenario. An actual peak requires the OVP threshold tolerance, response delay, current at final turn-off, effective capacitance and controller fault behaviour; 268 µs is not an allowed comparator delay.
Notebook
Notes are saved in this browser. Export them before clearing browser data.
Learning objective. Build a current-accuracy budget and design Kelvin sensing.
A current driver is as accurate as its sense resistor, its reference and the circuit that compares them. A budget shows where the error comes from.
The sense resistor
The sense voltage trades accuracy against loss. D1's 100 mV threshold with 700 mA means \(R_s=0.143\) Ω dissipating 70 mW, which fits an 0805 or 1206 resistor with margin. A 50 mV threshold would halve the loss and double the relative effect of every offset. Use a resistor with a low temperature coefficient (100 ppm/K or better) and route Kelvin connections from its pads to the comparator so that the high-current copper does not add to the measured voltage. A 5 mm length of 0.5 mm, 35 µm copper is about 5 mΩ: 3.5% of D1's sense resistance.
High-side and low-side sensing
A floating buck senses at the input rail, so its comparator must work with its inputs near the supply; integrated drivers do this internally. A ground-referenced buck or a boost senses at ground, which is easy for an op-amp but only works if the LED return is the sense point. Ground-referenced sensing in a buck with a high-side switch sees the inductor current continuously; sensing the switch current sees it only during the on-time.
An accuracy budget
Source
Typical value
Effect on D1's current
Threshold / reference tolerance
±3 mV at 100 mV
±3%
Comparator offset (if discrete)
±2 mV
±2%
Sense resistor tolerance
±1%
±1%
Resistor and copper drift over 40 K
100 ppm/K
±0.4%
Comparator delay (chapter 5)
50–200 ns
−1.1 … +2.0% depending on input
The worst case is about ±6.4% plus the delay term; the root-sum-square of the listed bounds is 3.8%, but this is not a guaranteed bound or a confidence interval. A statistical prediction requires distributions, standard deviations and correlations; datasheet maxima are not standard deviations. For a work lamp that is invisible. For a panel of several lamps that must match, or for colour mixing, it is not, and per-unit calibration or a better reference is needed. Light output varies more with LED binning and temperature than with these current errors, so the accuracy requirement should come from the light, not from habit.
Dynamic errors
The comparator sees ripple, switching spikes and the delay. A small RC filter on the sense input removes spikes but adds delay, which chapter 5 showed shifts the average current. Blank rather than filter where the controller allows it.
Exercise 8 · Budget a matched pair
Two D1 lamps stand side by side and must match within 5% in current. Using the table, decide whether that is guaranteed. If not, propose the cheapest change and recompute.
Worked solution
Worst-case each lamp can be ±6.4% (plus delay), so two lamps can differ by about 13%: not guaranteed, although the statistical spread is smaller. The cheapest fix is often a tighter reference or threshold specification (a ±1% part removes 4% of the worst-case spread), or a one-time trim of the sense resistor or the dim level stored in the MCU. With a ±1% threshold and an integrated comparator (no separate offset), the first-order budget is about ±2.4% per lamp before delay. Exact ratio corners give a pair ratio of roughly 1.049 for ±1% threshold and ±1.4% resistance; very little margin remains below a 5% mismatch. Include the difference in delay errors, input voltage and temperature before claiming a guarantee. Calibrate at stated corners or allocate a tighter budget. Remember that LED binning may still make the light differ more than the current does.
Notebook
Notes are saved in this browser. Export them before clearing browser data.
Learning objective. Size a capacitor across an LED string from its dynamic resistance and judge its cost to dimming.
In a buck the inductor ripple flows through the LEDs unless a capacitor across the string bypasses it. The LED string is a low resistance, which changes the usual capacitor arithmetic.
The string as a resistor
For AC ripple the string looks like its dynamic resistance \(R_d=nr_d\) (1.95 Ω for D1's three LEDs) in series with its knee voltage. A capacitor C across the string forms a current divider with a pole at
With 4.7 µF, \(f_p=17.4\) kHz. D1's 228 mA triangle at 379 kHz is attenuated about 22× at its fundamental and more at its harmonics. Laboratory 3 gives about 9 mA of LED ripple instead of 228 mA. The capacitor must be rated for the ripple current, which is now almost all of the 228 mA triangle: about 66 mA RMS.
Does ripple matter?
At hundreds of kilohertz, ripple is invisible. It matters in three other ways. LED efficacy at the ripple peak is slightly lower than at the average, so heavy ripple wastes a little light. The peak current must stay within the LED's rating. And the inductor current ripple, not the LED ripple, sets the converter's losses and EMI. Without a capacitor, a 30% ripple is common and acceptable.
The capacitor's cost: dimming speed
The same time constant \(\tau=R_dC=9.2\) µs slows the LED current when PWM dimming switches the driver on and off. The current takes roughly two to three time constants to settle, which sets a minimum useful pulse and limits PWM frequency (chapter 10). When the driver stops, the capacitor discharges through the LEDs, which keep glowing until the voltage falls below their knee. A shunt dimming switch across the string (shorting it rather than stopping the converter) avoids the converter's start-up delay but needs a converter that tolerates the sudden drop in load voltage.
Ceramic capacitors and noise
Ceramic capacitors lose capacitance under DC bias and can be piezoelectric: driven at audio-frequency PWM-dimming rates, they hum. Choose voltage rating, dielectric and size with the DC bias curve, and keep PWM dimming above the audible range or use film or polymer capacitors where noise matters.
Exercise 9 · Choose C for D1
Choose a capacitor across D1's string that keeps LED ripple below 5% of 700 mA, and compute its RMS current and the dimming time constant. Then decide whether a 4 kHz PWM with a 1% minimum duty still works.
Worked solution
5% is 35 mA p-p from a 228 mA triangle: attenuation of about 6.5 at 379 kHz needs \(f_p\le58\) kHz, so \(C\ge1/(2\pi\times1.95\times58\,\text{kHz})\approx1.4\) µF; choose 2.2 µF after DC-bias derating at 10 V. Its RMS current is close to the triangle's 66 mA. The time constant is about 4.3 µs, so the current settles within about 10–13 µs. At 4 kHz a 1% pulse is 2.5 µs, shorter than the settling time: the dimmest levels would deliver less light than their duty suggests. Either accept a 3–4% minimum, lower the PWM frequency (watching flicker limits), or use hybrid dimming at the bottom.
Notebook
Notes are saved in this browser. Export them before clearing browser data.
Learning objective. Design a perceptual PWM dimming map within timer, minimum-pulse and flicker constraints.
Dimming looks like a duty-cycle problem. It is really a perception problem with timing and flicker constraints.
Analog and PWM dimming
Analog (constant-current-reduction) dimming lowers the current. It produces no flicker and no extra EMI, and LED efficacy improves at lower current. Its weaknesses are the colour shift with current and poor accuracy at low current, where offsets dominate (chapter 8): a 2 mV offset is 2% at full scale and 40% at 5% dimming.
PWM dimming switches the full current on and off. Colour and efficacy stay those of the set current, and the average light is proportional to duty if the pulses are clean. Its weaknesses are flicker and stroboscopic effects, and a minimum usable pulse set by the driver's delay and rise time.
Figure 6. The light is proportional to duty only when the pulse is long compared with the driver's delay, rise and fall.
Hybrid dimming uses PWM over most of the range and analog dimming (or a lower current setting) at the bottom, where PWM pulses become too short.
Perceived brightness is not linear
The eye responds roughly logarithmically to luminance. CIE 1976 lightness \(L^*\) is a standard approximation:
Equal steps in \(L^*\) look roughly equal; a step of about 1 in \(L^*\) is near the threshold of visibility for adjacent levels. A linear mapping from user level to duty wastes most of the levels on bright settings and leaves the bottom coarse. Mapping user levels to \(L^*\) (or a power law with exponent near 2.2) spreads them evenly in perception, but asks for very small duties at the bottom: level 1 of 256 on the \(L^*\) curve is 0.04% duty.
Resolution and the minimum pulse
A 48 MHz timer at 4 kHz has 12,000 counts per period (13.6 bits), enough to represent 0.04% duty. The driver is the limit. If its useful minimum pulse is 2 µs (0.8% duty at 4 kHz), Laboratory 5 shows that the 18 dimmest levels of a 256-step \(L^*\) map are dark, and the first lit level jumps straight to \(L^*\approx7.5\): a visible pop-on. At 20 kHz the minimum duty is 4% and 60 levels are dark, with the first lit level at \(L^*\approx24\). Clamping all low levels to the minimum pulse removes the dark band but makes 17 levels identical. Hybrid dimming, a lower PWM frequency, or a faster driver at the bottom of the range are the real fixes.
Flicker and IEEE 1789
Light modulation at low frequency can be seen directly; at higher frequencies it can still produce stroboscopic effects with moving objects and has been associated with discomfort. IEEE 1789-2015 gives recommended practice based on percent modulation \(100\,(L_{max}-L_{min})/(L_{max}+L_{min})\):
Frequency
Low-risk region
No-observable-effect region
below 90 Hz
modulation < 0.025 × f %
< 0.01 × f %
90 Hz to 1250 Hz (3 kHz for no effect)
modulation < 0.08 × f %
< 0.0333 × f %
above 1250 Hz (3 kHz)
no limit
no limit
Full-depth PWM has 100% modulation, so it is low-risk above 1.25 kHz and in the no-effect region above 3 kHz. At 500 Hz the low-risk limit is 40% and full PWM fails it. This is a recommended practice, not a regulation; product regulations in some regions use other metrics (for example \(P_{st}^{LM}\) and SVM). Treat it as a screening line.
Exercise 10 · Design D1's dimming map
D1 uses a 48 MHz timer and the driver's measured minimum useful pulse is 2 µs. Choose a PWM frequency, curve and number of levels so that (a) the flicker screen passes, (b) no two lit levels share a count, and (c) the dimmest lit level is below \(L^*=5\). If you cannot meet all three with PWM alone, describe a hybrid scheme.
Worked solution
At 4 kHz with 256 \(L^*\) levels the first lit level is \(L^*\approx7.5\): (c) fails. Lowering the frequency to 1.5 kHz keeps the low-risk screen (above 1250 Hz, though no longer the 3 kHz no-effect line) and makes 2 µs only 0.3% duty: the tool shows six dark levels, no repeated counts and a first lit level at \(L^*\approx2.7\). A hybrid scheme meets (c) at any frequency: below a chosen level, keep PWM at a fixed duty and lower the current (for example by changing the comparator threshold through the driver's ADJ input or a second sense resistor), then hand over to PWM above it. The handover must be matched so that light is continuous.
Notebook
Notes are saved in this browser. Export them before clearing browser data.
Learning objective. Choose an MCU control architecture and design a digital current loop that cannot overdrive the LEDs.
A small microcontroller can dim, sequence and protect a driver, or it can be the driver's controller. The second option is attractive and dangerous.
Three architectures
MCU supervises an analog driver. The driver regulates current by itself; the MCU drives its dim or enable input and reads temperature. A firmware fault can change the brightness but cannot remove the current limit. D1 uses this.
MCU closes the loop around a comparator. A hardware comparator ends each pulse at a peak current set by the MCU (through a DAC or a filtered PWM reference), and a timer sets the off-time. The current limit is still in hardware; the firmware only sets the level.
MCU is the whole controller. The ADC samples the current, firmware computes the duty and the timer applies it. Everything, including the current limit, depends on code timing.
A digital average-current loop
For a buck without an output capacitor, the inductor current follows the duty through a first-order plant:
For D1, \(R_{tot}\approx2.24\) Ω and the plant pole is at \(R_{tot}/(2\pi L)=5.3\) kHz. A PI controller whose zero cancels that pole gives a crossover \(f_c\) with \(K_p=2\pi f_cL/V_{in}\) and \(K_i=K_pR_{tot}/L\). For \(f_c=5\) kHz from 24 V: \(K_p\approx0.089\) per ampere and \(K_i\approx2900\) per ampere-second. For an ideal linear triangular waveform in steady continuous conduction, sampling at the middle of the on-time gives the cycle-average inductor current, provided the chosen sensor measures that current throughout the sample aperture. Settling, discontinuous conduction and transients invalidate that shortcut. With a 100 kHz update and a total delay of 1.5 periods (15 µs), the delay costs 27° at 5 kHz, leaving about 63° of phase margin. The input voltage appears in the gain, so either measure it and scale \(K_p\), or accept a crossover that halves at 12 V. A CH32V003-class part (48 MHz RISC-V, 10-bit ADC, an advanced timer) can run such a loop at tens of kilohertz, provided the ADC trigger, conversion and computation fit the period; write the timeline as in the buck course's chapter 11.
What happens when the code stops
If firmware hangs with the switch on, a buck connects the input to the LEDs through the inductor. D1's string would try to draw \((24-8.04)/2.24\approx7\) A, ten times its rating, within tens of microseconds. If it hangs with the switch off, the lamp goes dark, which is safe. Therefore:
keep a hardware current limit (comparator to timer break or driver enable) that does not depend on the code;
choose pin and timer idle states so that reset, brownout and debug halt leave the switch off;
use a watchdog, but remember it acts in milliseconds, not microseconds;
validate everything at low input voltage and limited supply current first.
Thermal foldback in firmware
Reading an NTC and lowering the dim level is a good firmware job: temperature changes in seconds. Filter the reading, add hysteresis so the light does not oscillate, and make the curve continuous so the user sees a gentle dimming rather than steps. Chapter 12 sizes it.
Exercise 11 · Make architecture 3 safe
You must implement D1's regulation entirely on the MCU (architecture 3). List the hardware you would add so that no firmware state can overcurrent the LEDs, and describe the test that proves it.
Worked solution
Add a comparator on the sense signal with a fixed reference (for example 1.3× the set current) that drives the timer's break input or a driver enable with a latch, so the switch turns off within a microsecond without software. Pull the gate low by default; choose timer idle states that are “off” in reset and debug halt. Optionally add a hardware timer that limits the maximum on-time each cycle. Test at reduced input voltage with a current-limited supply: run a firmware build that forces 100% duty, and record the LED current and the break signal with a current probe; repeat during reset, halted debug and brownout.
Notebook
Notes are saved in this browser. Export them before clearing browser data.
Learning objective. Calculate junction temperature through the thermal chain and design a thermal foldback.
LEDs fail by heat more than by anything else: light output and colour degrade with junction temperature, and lifetime falls steeply with it. Thermal design sets the current you can use.
Figure 7. Heat flows from each junction through its own resistance to the solder point, then through shared board, interface and heatsink resistances.
The chain
Only the heat fraction of the electrical power flows through the chain. For n LEDs on one heatsink:
For D1: three LEDs at 0.7 A and about 3.1 V (warm), heat fraction 0.65, so about 1.42 W of heat each. With \(R_{j\text{-}sp}=6\) K/W, 1 K/W of board spreading per LED, 0.5 K/W of interface and a 6 K/W heatsink, at 35 °C ambient Laboratory 6 gives a solder-point temperature of 64 °C and a junction of about 72 °C. The heatsink term dominates: \(3\times1.42\times6.5\approx28\) K.
Why the solder point
You cannot measure the junction directly in a product, but you can measure the solder point or the board next to the LED with an NTC. Datasheets specify thermal resistance from junction to solder point, so a board temperature plus the datasheet value gives the junction. Place the NTC close to the hottest LED, on the same copper.
Foldback
A foldback reduces current as the measured temperature rises: here, linearly from full current at 75 °C to 30% at 95 °C. At 50 °C ambient D1 folds back to 94% current and holds the junction at 85 °C instead of 87 °C; at 60 °C ambient it runs at 77% current with an 88 °C junction instead of 97 °C. The light falls to 64% instead of 78%. Foldback protects lifetime and the board; it costs light exactly when the room is hot. Size the heatsink so that foldback never acts in the normal ambient range and only protects against blocked airflow or misuse.
Lifetime
Manufacturers measure lumen maintenance under LM-80 conditions and extrapolate with TM-21, which limits how far the test duration may be projected. Lifetime figures such as \(L_{70}\) depend on current and junction (or solder-point) temperature, so they are a curve, not a number. A drop of 10–20 K in junction temperature can change the projected lifetime substantially; compare the manufacturer's data at your operating point.
Exercise 12 · Size D1's heatsink
With Laboratory 6, find the largest heatsink thermal resistance for which D1 does not fold back at 40 °C ambient, and the resulting junction temperature. Then compare the relative light at 60 °C ambient for 7.4, 6 and 3 K/W heatsinks. Explain why meeting the 40 °C requirement does not preserve full output at 60 °C.
Worked solution
Foldback starts at a 75 °C solder point. At 40 °C ambient the chain allows 35 K of rise from ambient to solder point; with about 4.25 W of heat, 1.4 K of board spreading and 0.5 K/W of interface, the heatsink can be up to about 7.4 K/W (solder point 74.7 °C, junction about 83 °C). The 6 K/W heatsink meets it with 6 K to spare (solder point 69 °C). At 60 °C ambient, the 7.4 K/W case has about 71% current and 59% relative flux. The 6 K/W case gives 77% current and 64% flux. A 3 K/W heatsink keeps the current at about 98% and the relative flux at about 80%, against 77% current and 64% flux with 6 K/W. A heatsink is cheaper than lost light.
Notebook
Notes are saved in this browser. Export them before clearing browser data.
Learning objective. Write a fault table for LED drivers, including hot-plug of a charged output capacitor.
Every LED driver must survive its load misbehaving, its supply misbehaving and its user plugging things in at the wrong moment. List the faults first; choose the protection second.
Faults at the LED side
Fault
Buck (D1)
Boost (E2)
Open string
Steady current stops; interrupted inductor energy and connector arcing still need a clamp or specified open-load path
Output voltage rises until OVP stops switching (chapter 7)
One LED shorted
String voltage drops; current regulation continues
Same, as long as the string stays above the input
Whole string shorted
Current still regulated, but check the minimum on-time at high input
Uncontrolled input-to-output current through L and D
Intermittent connector
Check interrupted inductor energy, arcing and reconnection; an output capacitor adds a surge (below)
Dangerous: the output capacitor sits at the OVP voltage
Ground fault on a long cable
Depends on which conductor touches the chassis
Same
The charged capacitor and the hot-plugged LED
A capacitor across an open LED connector charges to whatever voltage the driver can reach. When the LEDs are reconnected, it discharges into them through only their dynamic resistance. If D1 had a 2.2 µF capacitor across the string and the lamp head were unplugged, the floating buck would charge the capacitor toward the 24 V input. Reconnecting the head would then push about \((24-8.25)/1.95\approx8\) A through the LEDs for a few microseconds (\(\tau=R_dC\approx4.3\) µs), more than ten times their rating. For E2 sitting at a 45 V OVP threshold, reconnecting the string gives about 2.5 A for roughly 33 µs and dumps about 2.7 mJ into it. LED datasheets give pulse ratings; few allow this. Remedies: no output capacitor where it is not needed, an output disconnect switch, a discharge path when the load is open, or a connector that breaks the driver before the LEDs.
Faults at the supply side
D1 runs from a 24 V adapter through a barrel or terminal connector. Protect against reverse polarity (a series Schottky costs about 0.12 W at 0.3 A input; a P-MOSFET ideal diode costs less), hot-plug ringing of cable inductance with ceramic input capacitors (the buck course shows overshoot near twice the input), and adapters whose output exceeds their label at no load. Choose the driver's absolute maximum input with those transients in mind, and add a TVS whose clamping voltage is below that maximum.
Over-temperature
Thermal foldback (chapter 12) is the gentle response; a hard shutdown at a higher threshold is the backstop. Many integrated drivers include their own die over-temperature shutdown, which protects the driver, not the LEDs.
Failures of the controller
Chapter 11's rule bears repeating: an MCU, a firmware update or a debugger must never be able to remove the hardware current limit. For D1 the analog driver regulates on its own; the MCU can dim or disable it but cannot overdrive it.
Exercise 13 · Fault table for D1
Write a fault table for D1 with columns cause → electrical consequence → detection → limiting mechanism → recovery, covering: lamp head unplugged while on, reverse-connected adapter, adapter output 30 V at no load, NTC disconnected, MCU stuck with the dim output low, and one LED failed short.
Review criteria
Each row names a physical mechanism, not “firmware detects it”. Unplugged head: steady current stops, but the stored inductor energy needs a defined path when the connector opens. If an output capacitor is present, the reconnection spike also needs a remedy. Reverse adapter: blocked by the series diode or ideal-diode FET. 30 V at no load: the driver's absolute maximum must exceed it with margin, plus a TVS for transients. NTC open: reads as very cold (or very hot, depending on the circuit); choose the circuit so an open sensor causes foldback, not full current. MCU stuck: decide whether the dim pin's default is on or off and what the user sees. One LED short: current stays regulated; the remaining LEDs share the heat; light falls by a third.
Notebook
Notes are saved in this browser. Export them before clearing browser data.
Learning objective. Lay out an LED driver for low emissions with the switch node kept away from the LED head.
LED drivers switch fast and often sit next to long wires and large metal heatsinks. Both make layout an EMI decision.
The hot loop
In D1's floating buck, the current that switches abruptly flows in the loop formed by the input capacitor, the switch and the diode: when the switch turns off, its current transfers to the diode, and both connect to the input capacitor's terminals. The inductor and LED string carry continuous current and are not part of that loop. Place a ceramic input capacitor directly across the switch-plus-diode pair with a short return, exactly as in the buck course's chapter 14. In a boost the hot loop is switch, diode and output capacitor.
Keep the switch node small and away from metal
The switch node swings by the full input voltage in nanoseconds. Any capacitance from it to an external conductor carries common-mode current \(i=C\,dv/dt\). An LED on a metal-core board is a large capacitor: a few square centimetres of copper over 0.1 mm of dielectric to the aluminium base is on the order of 100–200 pF. If the switch node reached such a board, 24 V in 20 ns through 180 pF would push about 0.2 A pulses into the heatsink and the mounting structure. In D1 the LED string sits between the input rail and the inductor, both quiet nodes, so the LED head sees only ripple; keep it that way. Never route the switch node down the lamp cable.
Sensing and grounding
Route the sense resistor's Kelvin connections as a tight pair to the comparator inputs. Keep the dim and NTC signals from the MCU away from the switch node and the diode; a capacitive kick into the dim input appears as flicker. Give the MCU's ground a single, deliberate connection to the power return near the driver's ground pin.
Long LED cables
A cable to a lamp head is an antenna for whatever ripple it carries and a receiver for ESD. With a buck and continuous current, the cable carries DC plus ripple; a small capacitor at the driver end of the cable keeps high-frequency current local. Put ESD protection where the cable enters the board. Twisting the pair reduces both emission and pickup.
Frequency and spectrum
A hysteretic driver's frequency moves with input voltage, so its emissions sweep with it; fixed-frequency drivers concentrate energy in known harmonics; some integrated drivers add spread-spectrum dither. PWM dimming adds a second modulation at the dimming frequency, which can make inductors and ceramics audible if it falls below about 20 kHz.
Exercise 14 · Place D1
Sketch a placement for D1's driver board: input connector, TVS and reverse-polarity device, input ceramic, switch, diode, inductor, sense resistor, MCU, NTC connector and lamp cable. Mark the hot loop and the Kelvin pair.
Review criteria
The input ceramic sits across switch and diode with the shortest possible loop; the switch node copper is small and does not approach the lamp connector; the sense resistor's Kelvin pair goes straight to the controller; the lamp connector is fed from the quiet side (input rail and inductor); the MCU sits away from the switch node with its own decoupling; ESD protection is at the connectors.
Notebook
Notes are saved in this browser. Export them before clearing browser data.
Learning objective. Measure LED current, light, flicker and junction temperature with stated errors.
LED drivers are judged by light and temperature, which are harder to measure than voltage. Plan the measurements with their errors.
LED current
A current probe on the LED wire shows the average, ripple and dimming edges directly. A sense resistor read with an oscilloscope works if its common-mode voltage is within the probe's capability; D1's sense resistor sits at the 24 V rail, so use a differential probe or measure two channels relative to ground and subtract (with care about common-mode error). An RMS reading is not the average PWM current; a true-RMS meter may have separate DC and AC/AC+DC modes, so check its mode and specifications; measure average current with a DC ammeter of adequate bandwidth or compute it from the waveform.
Light
A lux meter gives relative light for comparisons at a fixed geometry; absolute flux needs an integrating sphere. For flicker, a photodiode with a transimpedance amplifier (gain chosen so the full-brightness signal is a volt or so) into an oscilloscope shows the waveform; compute percent modulation from the maximum and minimum, and the flicker index from the area above the mean divided by the total area. Shield the photodiode from mains-powered room light, which itself flickers at 100 Hz.
Junction temperature by the forward-voltage method
The LED itself is a thermometer. Calibrate first: at a small current (for example 1–5 mA), measure the forward voltage at two or more known temperatures in an oven or on a temperature-controlled plate; the slope is the knee coefficient, for example −2 mV/K per LED. Then run the lamp at its operating current until temperatures settle, switch quickly to the small current (within tens of microseconds, before the junction cools) and read the voltage. If a string reads 7.80 V at 5 mA when cold (25 °C) and 7.56 V hot, the three junctions average \(25+0.24/(3\times0.002)=65\) °C. This measures what no thermocouple can reach.
Board temperature and thermography
A thermocouple glued next to the LED gives the solder-point temperature that the datasheet's junction-to-solder-point resistance needs. A thermal camera reads apparent temperature through emissivity: bare aluminium and solder joints read low, white solder mask and LED lenses differ again. Use a matte reference patch of known emissivity, and record ambient, airflow and dwell time. Run until temperatures stop changing; a lamp that is “cool after a minute” may not be after an hour.
Exercise 15 · Plan D1's bench session
Write a test card that measures, at 24 V input and full brightness: LED current and ripple, input power and efficiency, solder-point temperature at equilibrium and junction temperature by the forward-voltage method. Include instruments, connections, timing and expected values from earlier chapters.
Review criteria
Expected values: about 700 mA average with 220–230 mA ripple and about 380 kHz; efficiency above 90% before input-protection losses; solder point near 64 °C and junction near 72 °C at 35 °C ambient with the chapter 12 heatsink. The card states the calibration of the forward-voltage method, the switch-over circuit and timing, the input supply's current limit, stop conditions and file names, and separates prediction from result.
Notebook
Notes are saved in this browser. Export them before clearing browser data.
Learning objective. Explain mains LED driver architectures, power factor, 100 Hz flicker and dimmer compatibility.
Most LED lamps run from the mains. The circuits differ from D1 mainly in isolation, power factor and the 100 Hz ripple that rectification brings.
Architectures
Non-isolated buck from the rectified 325 V bus drives a long string (often 100–200 V) in most screw-in lamps. Everything is at mains potential; the enclosure is the only barrier.
Isolated flyback with primary-side regulation estimates the output current from primary waveforms, avoiding an optocoupler. It suits luminaires with touchable metal or external LED modules.
Two-stage designs put an active power-factor-correction boost ahead of a DC-DC current stage, giving high power factor and low flicker at the cost of parts.
Power factor and harmonics
A capacitor-input rectifier draws narrow current pulses (the mains course simulates one). Lighting products above modest powers must meet harmonic-current limits, so larger drivers shape their input current with a PFC stage or a single-stage PFC flyback.
The 100 Hz problem
An ideal unity-power-factor input draws current proportional to line voltage, so its instantaneous power is proportional to the square of that voltage, but the LEDs need constant power. The difference flows into and out of the output capacitor at twice the line frequency. Unless that capacitor is large, the LED current carries a 100 Hz ripple: flicker that IEEE 1789's lines treat strictly (at 100 Hz the low-risk limit is 8% modulation). Large electrolytic capacitors are the usual answer, and their lifetime at the lamp's internal temperature then often decides the lamp's lifetime.
Phase-cut dimmers
Wall dimmers chop part of each half-cycle. A triac dimmer needs latching and holding current that a few-watt LED driver does not draw naturally, so “dimmable” LED drivers add bleeders and damping and must decode the phase angle into a current setting. Incompatibilities show up as flicker, shimmer and audible noise. The mains course's chapters 9–11 explain the triac side of the problem.
Exercise 16 · Read a lamp's flicker
A non-dimmable 9 W lamp shows 30% percent modulation at 100 Hz on a photodiode. Classify it against the IEEE 1789 lines and name two circuit causes and one fix for each.
Worked solution
At 100 Hz the low-risk limit is 0.08 × 100 = 8% and the no-effect limit 3.3%, so 30% is outside both. Causes: an undersized or aged output electrolytic in a single-stage PFC driver (fix: a larger or better capacitor, or a ripple-cancelling current regulator after it); a linear “AC direct” driver that switches LED segments with the line voltage (fix: a valley-fill or a second stage). Measure again at operating temperature; capacitor ESR and capacitance change with it.
Notebook
Notes are saved in this browser. Export them before clearing browser data.
Learning objective. Assemble gate deliverables and defend a driver design in an oral review.
You are ready to build when you can defend every number in D1: its current, its light, its temperature and its behaviour in faults. Use these gates; the notebook tracks them.
Gate
Deliverable
What a reviewer verifies
G0 requirements
Light output, supply, environment, dimming and lifetime targets
Each target has a number and a measurement method
G1 LED load model
Binning, string arrangement, voltage range over temperature
Worst-case string voltage at cold and hot corners
G2 driver topology
Topology and control choice with calculations
Frequency, ripple, average current and minimum on-time at the input extremes
G3 control and dimming
Dimming map, flicker screen, control architecture
Dimmest level, step smoothness, hardware current limit independent of code
G4 thermal design
Thermal chain and foldback
Junction temperature at maximum ambient; foldback not active in normal use
G5 protection
Fault table
Every row has a physical limiting mechanism
G6 CAD and layout
Schematic, layout, checks
Hot loop, Kelvin sensing, switch node away from the LED head
G7 prototype evidence
Test cards and records
Measured current, light, temperatures and fault responses
Oral examination
Why does a fixed-voltage supply make LED current depend on temperature and binning? Give the numbers for D1.
Why does a capacitor across a buck's LED string reduce ripple so strongly, and what does it cost?
What sets the average current of a hysteretic buck, and why does comparator delay shift it in a direction that depends on input voltage?
What happens to a boost LED driver when the string opens, and how fast must the protection act?
Why is level 1 of a perceptual dimming map dark on D1 at 20 kHz?
Where is D1's hottest junction at 60 °C ambient, and what does the foldback cost in light?
What can a hung MCU do to the LEDs in each control architecture?
What did your last measurement establish, and what did it leave open?
Final assignment: write a 4–8 page review of D1 or your own driver, attach tool exports and calculations, and ask a helper for the most consequential unsupported assumption. Decide the smallest experiment that would settle it.
Exercise 17 · Close G2 and G4 on paper
Assemble the G2 and G4 deliverables for D1 from chapters 5, 9 and 12. State the operating points, the numbers, the assumptions and the measurements that will replace them.
Review criteria
G2 lists the thresholds and sense resistor, inductor value and saturation current above the peak (about 815 mA plus margin), the frequency and ripple at 12/24/30 V, losses and minimum on-time at 30 V, and any capacitor across the string with its ripple current. G4 lists the heat per LED, each thermal resistance with its source, the junction at the maximum ambient, the foldback curve and the expected light. Each assumption names its replacement measurement (chapter 15).
Notebook
Notes are saved in this browser. Export them before clearing browser data.
Learning objective. Use an agent tutor while keeping evidence and permission boundaries.
The Agent handoff button downloads your notebook, progress and gate status with a tutor brief; Copy tutor brief gives a short prompt. Nothing is uploaded and no account is needed.
Name the chapter and exercise, give your attempt with units and assumptions, and ask for a check. A good helper asks one discriminating question, finds the first consequential gap and suggests the next small task, giving hints before solutions. Ask it to keep three columns: known, assumed and measured.
I am studying E05 in the power LED driver course (D1 design thread). Here are my hysteretic-buck calculations at 12, 24 and 30 V and my exported notebook. Check the delay analysis and units, then ask me to fix the first important mistake.
Exercise 18 · Teach it back
Explain to the helper, without the figures, how D1 turns a button press into a dimmer, cooler light: from the button through the MCU, the dim input, the driver's current regulation, the LED and the heatsink. Ask it to name one missing path.
Completion criterion
You can describe the button → MCU → dim map → PWM → driver enable path; the driver's own current regulation; the light versus current and temperature; the heat path to the NTC and the foldback loop back to the MCU; and the hardware limit that does not depend on the MCU.
Notebook
Notes are saved in this browser. Export them before clearing browser data.
Learning objective. Locate primary references and state the limits of every tool.
The derivations, examples, exercises, software and diagrams are original instructional material. Manufacturer documents give context and cross-checks. The original reference pass was on 2 November 2026. The TI boost-protection references added in chapter 20 were checked on 6 November 2026; record the exact revision you rely on.
All tools use a piecewise-linear LED (knee voltage, dynamic resistance, linear knee temperature coefficient), valid only near its operating point; real LEDs follow an exponential law at low current. The string tool assumes separate heatsinks and identical dynamic resistances. The linear-regulator tool models dropout with a fixed resistance. The hysteretic tool integrates ideal piecewise-linear currents with a fixed delay and conduction losses only; the boost tool is ideal CCM, with a separately labelled constant-capacitor-power fault timescale, not a controller simulation. The chapter 20 tool begins at final switch-off and solves the ideal unloaded boost L–C transient with a stiff input source; it excludes propagation delay and parasitic ringing. The dimming tool treats pulses as rectangular above the minimum pulse and applies the IEEE 1789 lines to full-depth modulation only. The thermal tool lumps each resistance and uses an illustrative flux model. None selects components or qualifies a product.
Notebook
Notes are saved in this browser. Export them before clearing browser data.
Learning objective. Distinguish OVP threshold, final turn-off and peak voltage using a boost fault energy ledger that includes input work.
This extension connects chapter 7's boost calculations to chapter 13's fault table. Its output is a defensible voltage budget for E2: distinguish the OVP threshold, voltage at the last switching event and final capacitor peak. Work through chapters 7 and 13 first.
Three instants, three voltages
When the LED string opens, define:
Threshold crossing: the divider first reaches the OVP comparator threshold, including reference and resistor tolerances.
Final turn-off: propagation, filtering and any extra PWM pulses have finished. Call the capacitor voltage \(V_0\) and the inductor current \(I_0\) here.
Current reaches zero: the diode stops conducting and the capacitor reaches its ideal peak \(V_{pk}\).
Stopping the switch does not instantly stop charging. The boost input is still connected to the output through the inductor and diode. TI, Working with Boost Converters, SNVA731, §5 explains this path and its consequences for shorts and inrush. The calculation below is an original derivation for an open output after switch-off, using that topology. A controller with a separate input/output disconnect needs its own circuit model.
Follow current and energy after turn-off
Assume a stiff input \(V_{in}\), ideal diode, constant \(L\) and effective \(C\), no load, and no further switching. Require \(V_0>V_{in}\) so the current initially decreases. While the diode conducts,
The familiar expression \(\sqrt{V_0^2+LI_0^2/C}\) would count only the initial inductor energy. It misses the input energy supplied while the current decays. Check the complete ledger:
Use these only up to the first current zero. The diode then blocks; extending the sine wave would invent reverse current through an ideal diode.
E2 at an explicitly assumed fault corner
Suppose E2 has \(V_{in}=12\) V, \(L=33\) µH and \(C=4.7\) µF effective at operating bias. At final turn-off, assume \(V_0=45\) V and \(I_0=1.4\) A. The 1.4 A is an assumed fault current, not the normal 12 V operating peak and not a selected controller's current limit.
Laboratory 7 gives \(V_{pk}=45.208\) V after 1.394 µs. The inductor initially stores 32.34 µJ; the input contributes another 11.72 µJ; the capacitor gains 44.06 µJ. Counting inductor energy alone would predict only 45.153 V. With effective capacitance reduced to 2.2 µF the peak becomes 45.442 V. A nominal capacitor value is not enough for this budget.
The small ideal overshoot here is not evidence that a 45 V part is acceptable. The initial 45 V was assumed at final turn-off. If a 45 V nominal OVP has +3% threshold error, it can first trip at 46.35 V. During an illustrative 10 µs delay with a constant 10.25 W of net capacitor charging, the voltage becomes
\[
V_0=\sqrt{46.35^2+2(10.25)(10\,\mu\mathrm{s})/(4.7\,\mu\mathrm{F})}
\approx46.82\ \mathrm V.
\]
The post-turn-off model must start there, with the current at that later instant. The constant power and 1.4 A values are separate explicit assumptions; a real switching simulation or measurement must establish both consistently. Add ringing separately: an ideal lumped L–C calculation does not capture switch-node parasitics. TI's TPS92691 reference design, TIDUC20A, §1.4.1 provides an example of selecting separate OVP and hysteresis levels below device limits.
What the protection record must establish
Record effective capacitance over voltage and temperature, maximum OVP threshold, maximum delay to the last pulse, current at that pulse, and the source of each number. Include the switch, diode, capacitor and sensing-pin limits. State how the fault clears: latched stop, hysteretic restart or another documented behaviour. A restart may produce repeated charging pulses, which this one-event model does not predict. Finally, plan an open-load test at stated input and load conditions that captures both output voltage and inductor current through the last pulse and subsequent decay.
Exercise 20 · Distinguish trip from peak
For the 12 V, 33 µH, 4.7 µF example, calculate the peak and the energy ledger from \(V_0=45\) V, \(I_0=1.4\) A. Repeat at 2.2 µF. Then use the +3% OVP corner and illustrative delay above, keeping \(I_0=1.4\) A as a stated assumption, to predict the new ideal peak. Explain why none of these results alone selects a voltage rating.
Worked answer and review criteria
At 4.7 µF: 45.208 V, 32.34 µJ from L plus 11.72 µJ from the input equals 44.06 µJ gained by C. At 2.2 µF: 45.442 V; the smaller capacitor produces greater voltage rise. With the tolerance/delay example, final turn-off is about 46.82 V and the ideal peak is about 47.02 V. An answer must distinguish comparator threshold from final-turn-off voltage, count input work, stop the waveform at zero current, and identify missing current-limit, delay, bias-capacitance and ringing evidence before selecting component ratings.
Notebook
Notes are saved in this browser. Export them before clearing browser data.
Learning objective. Build a peripheral, sampling and hardware-protection ledger for an MCU-controlled LED converter, separating generic calculations from verified device routes.
The new V007 lighting platform is a design-in-progress: a microcontroller owns switching, current regulation, dimming, sensing and fault handling, and exposes a management interface to an external host. USB, USB-PD and the user interface are outside this first power-board boundary. The user-selected application is a high-quality electronics desk light: three square modules arranged side by side, each described as 15 W and carrying nine power LEDs in a physical 3×3 arrangement, and a platform for studying the control hardware while reusing suitable owned components. Whether 15 W means module input power or LED electrical power is still open. A shared PD supply is a working proposal, not a settled requirement. It does not replace D1's floating hysteretic buck or change D1's teaching values.
The initial comparison is the Letki CH32V007E8R6 converter: a two-phase synchronous buck designed for a 3.3 V rail. Its architecture is a reference, not a qualified LED driver. Regulating LED current changes the controlled variable, fault definitions and useful sensing locations. Existing MOSFETs, drivers, inductors, shunts and regulators are candidates only after their values and limits fit the new operating envelope. The final circuit, exact peripheral routes and board ratings remain subject to the hardware project's datasheet audit and subsequent measurements.
Current candidate: nine LEDs in series from one boost stage
The circuit study has moved from several possible buck/string arrangements to one asynchronous boost with all nine power LEDs in series per square. Physical placement remains 3×3. The three-string alternatives are comparison studies, not the current schematic candidate. One series path removes parallel-string current balancing, but adds output-voltage and input-disconnection obligations. It has not yet been shown to be the cheapest complete implementation.
The candidate power path is input → TPS26600 eFuse → 47 µH inductor → Schottky diode → output capacitor and nine-LED string. A low-side MOSFET connects the inductor/diode junction to ground through a switch-current shunt. The MCU drives it through a UCC27517A gate driver. A separate LED-return shunt measures the controlled output current; these two currents are not interchangeable. The selected study components, operating points and assembly options remain subject to full pin, rating, thermal and layout review.
For a nominal study point, take 20 V input, nine LEDs at an assumed 3.0 V each, 450 mA LED current, 47 µH and 400 kHz. The ideal duty is \(1-20/27=0.2593\), and ideal input/inductor average current is \(27(0.45)/20=0.6075\) A. The ideal ripple is
so the ideal steady-state peak is about 0.745 A. If the planning model instead assumes 90% power-stage efficiency, mean input current becomes 0.675 A; combining that with ideal-duty ripple gives a mixed screening estimate of 0.813 A peak, not an exact lossy-converter waveform. At −20% inductance the same screening peak rises to about 0.847 A. Additional inductance reduction with bias/temperature and transient current remain outside this estimate.
LED power at that point is 12.15 W. With 90% estimated conversion efficiency and a separate 0.50 W auxiliary allowance, module input is 14.0 W. At an assumed 3.3 V per LED, the same 450 mA requires 15.35 W input. If 15 W is adopted as an input ceiling, the corresponding current ceiling at that high-voltage study point is about 439 mA. The 2.7/3.0/3.3 V study values are not manufacturer-guaranteed cold/hot limits. They demonstrate why a fixed current command and a power ceiling are separate constraints.
The LED feedback candidate uses 0.47 Ω and internal differential gain 8: 450 mA produces 211.5 mV across the shunt and 1.692 V nominal amplifier signal. The shunt dissipates about 95.2 mW. The switch shunt is separately 0.22 Ω. Its comparator threshold sets a switch/inductor peak ceiling during MOSFET conduction, not a 450 mA LED-current setpoint. Reference, shunt, comparator, amplifier and ADC errors need their own budgets.
Three actions that must not be confused
Stopping PWM stops additional commanded MOSFET pulses. It does not remove the input → inductor → diode → output path. An ordinary boost therefore cannot turn off an output short simply by holding its MOSFET off. Its output capacitor may also keep the LEDs illuminated after switching stops. TI's boost-converter application report, section 5 explains the pass-through short-circuit and inrush paths.
Disconnecting input opens the feed through the candidate eFuse. The TPS26600 documentation describes current limiting, controlled turn-on and shutdown. This is a separate action with its own threshold, response time, mode and thermal limits. It does not instantly discharge the downstream capacitors or remove energy already stored in the inductor.
Discharging output removes stored output energy through the LEDs, a bleeder or a designed discharge circuit. The candidate includes a 100 kΩ bleeder. A model counting only the two output capacitors misses another reservoir: after the eFuse opens, protected-input capacitor C8 can still supply charge through the inductor and diode.
The current conditional screen combines C8, C9 and C10 (three 4.7 µF capacitors at +10% initial tolerance) into one ideal 15.51 µF reservoir, initially at the static OVP study maximum of 36.259 V. With the bleeder at +1%, \(R=101\) kΩ, it gives
This predicts about 3.10 s to 5 V and 5.62 s to 1 V, with 10.2 mJ initially stored in the ideal combined reservoir. It assumes the input is isolated, the MOSFET is off, inductor current has already reached zero, no interface backfeeds the rails and no firmware restart occurs. It ignores LED/divider loading, temperature dependence, added capacitance and parasitics; treating the capacitors as one reservoir also omits residual charge trapped on C8 by the diode. The starting voltage is a conditional static OVP estimate, not a proven clamp: overshoot and remaining inductor energy require separate bounds. These times therefore are not guaranteed discharge timeouts.
With input still connected, the diode path can sustain the output near the input voltage: none of these decay times applies to PWM-only inhibition. Firmware should latch the fault, request input isolation and validate the measured VLED_SNS voltage before a deliberate restart; a fixed delay alone is not evidence of discharge. Measure VLED and VIN_PROTECTED at open load and cold/hot conditions, confirming that the MCU stays powered and no external interface replenishes either rail. A bleeder is not fast fault isolation, and reconnecting LEDs to a charged capacitor remains a separate transient.
Trace each fault in its actual circuit state:
Event
Immediate candidate response
What still needs a bound
Excess switch current while on
MCU CMP1 output contributes to driver inhibit and timer break
Minimum/maximum trip and last-pulse current
Open LED and rising output
Independent TLV3201 comparator contributes to driver inhibit and timer break
OVP threshold, total delay, residual inductor/input energy and peak voltage
Output short with MOSFET off
Input current can still flow through inductor and diode
eFuse current limit/trip, stored-capacitor energy and passive-path ratings
Commanded darkness
PWM inhibition and an explicit input-enable policy
Residual light, output discharge and restart current
The candidate combines CMP1 overcurrent OR independent TLV3201 output OVP in an external OR gate. The result reaches both the gate driver's inverting inhibit input and the MCU's external TIM1 BKIN pin. The UCC27517A dual-input arrangement permits this independent inhibit. A separate AND gate combines the switching PWM with the eFuse's pulled-up FLT_N-derived permission signal. Calling that net “ready” does not establish a power-good timing guarantee: startup, ramp and fault-state behaviour require the eFuse truth table and measurements.
The current circuit does not directly connect output OVP to the eFuse shutdown input. Output OVP inhibits switching; the MCU has a separate input-enable command. Distinguish this from a hardwired OVP-triggered input disconnect. The externally combined fault resolves the internal timer's single-source selection issue, but reset, brownout, logic-rail absence, latch/rearm and spurious comparator edges still require a coherent truth table.
The hardware protection budget currently screens switch-current trip at roughly 1.40–1.67 A, with explicitly omitted bias/noise/ground and some temperature effects. At 21 V and 37.6 µH, an assumed 500 ns total stop delay adds about 0.279 A, giving approximately 1.95 A from the upper static trip. This is not a proven delay bound or an output-short bound: when the MOSFET is off, the low-side switch shunt cannot sense the passive diode-path short current. Chapter 20's open-load energy ledger applies after the final pulse; the input remains connected until an input disconnect actually acts.
A clean ERC result for this candidate says that the schematic's declared pin rules pass. It does not close the numerical budgets, establish a complete pin/footprint audit, produce routed PCB evidence or qualify protection. Those remain separate design and bench gates.
Start with decisions that affect the circuit
Write the LED string's minimum and maximum forward voltage over bin, current and temperature; nominal and maximum allowed current; input range; target light output; heatsink arrangement; and dimming range. Keep electrical watts, optical watts and lumens separate. A design can regulate current accurately and still make poor room lighting through glare, unsuitable colour rendering, excessive temperature or objectionable temporal modulation.
Choose which experiments the PCB must support, then decide what to populate. A second power channel can investigate independent strings or interleaving. These are different experiments: interleaving shares one load and needs current sharing; independent channels require separate current feedback and setpoints. Spare timer channels alone do not prove that two complete loops fit the ADC, analogue routing or CPU budget.
Use a resource ledger before drawing the schematic:
Resource
Design question
Evidence to retain
Timer and gate driver
Which channel, polarity, update event and reset state drive each switch?
Datasheet pin table, timer mapping and driver truth table
ADC
What signal is valid at the sampling instant? When is its result available?
Trigger route, acquisition/conversion time and timing diagram
Internal op-amp
Does its input range, gain, bandwidth and output swing fit this shunt?
Electrical limits and analogue-multiplexer configuration
Comparator and break
Can a fault stop the actual driven outputs without an interrupt?
Full signal route, latch/reset behaviour and delay budget
Reference
What sets current accuracy when the MCU supply moves?
Reference tolerances and calibration method
Management bus
Which pins remain available beside switching and debug?
One simultaneous pin allocation, with pull-ups and voltage domains
The hardware project checked WCH's CH32V00X reference manual V1.5 during this design study: ADC_IN9 provides an internal op-amp sampling path; regular ADC conversions support DMA, while injected conversions do not. The timer BKIN_CFG field selects IO, CMP1, CMP2 or OPA as its source. It is not an automatic OR of independent overcurrent, overvoltage and driver-fault signals. A design needing simultaneous shutdown causes must explicitly combine them in a supported path. The differential PGA has gain choices 4/8/16 with PA4 as its negative input; a second current channel must account for the shared analogue resource and settling time. These manual findings are not measured protection performance. Use the exact package pin audit and the WCH CH32V007 documentation before assigning the routes.
A capability in the family block diagram is not a verified connection on the selected package. Internal op-amps may save parts but consume pins or analogue routes needed elsewhere. Do not publish a register-level recipe until these routes have been checked for the exact device and revision.
Separate the control and protection time scales
The fast regulation path is timer → power stage → sensor → ADC → control calculation → timer preload. The protection path is sensor → comparator → timer break or driver inhibit. Telemetry is a third, slower path. A host command changes a bounded current request; it does not write arbitrary live PWM values into the power stage.
The hardware trip is a ceiling, not the normal current controller. Define the maximum normal peak, the minimum trip threshold, the maximum trip threshold and the extra current accumulated before the switch actually turns off. For comparison with the preceding buck teaching architecture, a hard-short buck output gives the initial screening estimate below. The current boost candidate has the same slope during switch-on, but the equation does not bound its passive diode-path output-short current when the switch is off:
This assumes the inductor has not saturated, ignores resistance and treats the input as fixed. If the result approaches saturation, the assumed inductance cannot be trusted and the calculation is not an upper bound. Include current-amplifier delay, filter lag, comparator delay, timer response and gate turn-off in \(t_{stop,max}\). Blanking is also part of the blind interval. A slow ADC or watchdog cannot substitute for this path.
For an illustrative 12 V input, 47 µH minimum inductance, 1.0 A maximum trip and 1 µs total delay, the estimate is 1.255 A. At 3 µs it is 1.766 A. These are teaching assumptions, not selected V007 component values. A parts list needs an inductor's guaranteed saturation characteristic and a justified delay bound before either number becomes a design claim.
Make the ADC sample mean what the controller assumes
For an ideal triangular inductor current in steady continuous conduction, the midpoint of either linear ramp equals the cycle-average current. This does not hold automatically during startup, pulse skipping, discontinuous conduction or a transient. It also does not mean that a switched shunt measures continuously: the shunt location determines when current is visible. In the boost candidate, LED current is not the triangular inductor current. The output capacitor supplies the LED during switch-on, while the separate switch shunt sees current only when the MOSFET conducts. Sample and filter each path according to the variable it actually measures.
Draw the sampling aperture inside a quiet interval, after switching-edge ringing and amplifier settling. Include acquisition time, rather than marking only the trigger edge. A moving duty changes the quiet interval. If a minimum on-time leaves no valid sample window, reject or alter that operating mode; do not feed an invalid sample to the integrator. Microchip's ADC timing discussion for digital power illustrates why a sample taken on the wrong side of a switching event can represent the wrong circuit state. Its peripheral implementation is not a V007 configuration guide.
Consider a deliberately assumed timing example: 100 kHz switching, a sample aperture centred at 2.5 µs, result ready at 3.2 µs, calculation and register write finished at 5.0 µs, and the new duty latched at 10 µs. The sample-to-actuation delay is 7.5 µs, not just the 1.8 µs computation interval. At 5 kHz, that delay alone contributes
\[
\phi_d=-360^\circ f_c t_d=-13.5^\circ.
\]
The plant, hold behaviour, filters and controller add their own phase; this calculation is not a complete phase-margin prediction. If the write misses the latch event, actuation moves to 20 µs and the delay becomes 17.5 µs, giving −31.5°. A GPIO timing marker around computation, observed alongside PWM and a sample marker, makes the deadline testable. Repeat under the maximum communication load, rather than testing only an idle main loop.
A staged current controller
First establish sensor polarity and scaling with switching disabled. Then test bounded open-loop pulses into a suitable dummy load at limited energy. Only after the current signal and fault path are credible should the digital loop be enabled.
A simple discrete PI implementation makes its assumptions visible:
Update \(x_k\) by \(K_iT_s e_k\) only when that update does not drive further into saturation, or implement another explicit anti-windup rule. Choose \(d_{ff}\) from the intended operating point, and bound it as carefully as the feedback term. For a buck, a first estimate is \(V_{LED}/V_{in}\); for the boost candidate it is \(1-V_{in}/V_{LED}\), only within its step-up operating region. Both neglect semiconductor drops and transient behaviour. Do not reuse chapter 11's buck plant or PI gains for the boost: its output capacitor, discontinuous diode current and boost dynamics require a new loop model. Neither feed-forward nor saturation replaces the hardware trip.
Ramp the current request during startup. Define what the integrator does while disabled, during PWM dimming, after an ADC fault and after a hardware trip. Restarting with a stale saturated integrator can create a current burst. Distinguish a host timeout from a sensor failure: loss of commands can retain a bounded previous brightness, while invalid current feedback should inhibit switching. The chosen policies belong in the interface contract.
Current measurement is a circuit, not an ADC channel
For a shunt \(R_s\), amplifier gain \(G\), ADC reference \(V_{ref}\) and \(N\) bits,
\[
I=\frac{V_{ref}}{G R_s}\frac{code}{2^N-1}.
\]
Write separate terms for shunt tolerance and temperature coefficient, gain error, input offset, ADC gain/offset, reference drift, noise and sampling bias. Offset becomes especially important at low brightness. Calibrating at one current does not establish the low-current error or hot performance.
As an arithmetic example, assume 50 mΩ, gain 20 and a 3.3 V 12-bit ADC: the scale is 1 V/A, so one code is about 0.806 mA. At 700 mA the shunt dissipates 24.5 mW. These figures do not establish accuracy: a 1 mV input offset alone corresponds to 20 mA. The assumed ADC and amplifier are a generic example, not a claim about the V007 configuration.
Compare the internal op-amp and an external current amplifier with the same input stimulus and sample timing. Record offset, settling, clipping and temperature. Solder links can select a path, but do not connect two amplifier outputs together. Keep the high-speed protection path connected to a valid source in every documented assembly option. Long flying leads are poor substitutes for a Kelvin pair or a controlled analogue return.
Exercise 21 · Audit one switching period
Use the assumed 100 kHz timeline above. Calculate the nominal and missed-deadline delay phase at 5 kHz. Calculate the short-circuit peak for 1 µs and 3 µs using the stated 12 V, 47 µH and 1.0 A values. Draw one complete sensor-to-gate protection path, and list every value that still needs a datasheet bound or measurement before calling it a V007 implementation.
Worked answer and review criteria
The delays are 7.5 µs and 17.5 µs, contributing −13.5° and −31.5°. The screening peaks are 1.255 A and 1.766 A. A correct answer includes filter and amplifier delay, acquisition aperture, timer latch event, comparator routing, gate-driver response and inductor minimum/saturation behaviour. It distinguishes generic teaching arithmetic from an exact package pin map and from bench evidence. It does not claim that the computed delay phase is the complete loop phase margin.
Notebook
Notes are saved in this browser. Export them before clearing browser data.
Learning objective. Plan schematic, layout and bring-up evidence for a digitally controlled domestic light, including dimming, thermal sensing and host-loss behaviour.
A useful learning board must support repeatable measurements, but a domestic light must also behave predictably when nobody is watching a scope. Use the same design record for both purposes. Keep proposed operating limits, calculated bounds, CAD checks and measured results in separate fields.
The three-module desk-light brief
Each square module has nine power LEDs arranged physically as 3×3; the complete three-module light therefore has 27 emitters. This supersedes the earlier 36-LED/6×6 concept. The square modules should form a usable light field across an electronics workbench, not just three bright spots. Record the mounting height, illuminated work area, diffuser/optic geometry and the positions at which illuminance is measured. Check shadows from hands and tools, glare seen from a seated position, reflections from solder and screens, and colour rendering relevant to component markings. Select a colour temperature and rendering target explicitly; “white LED” does not specify either. Numerical illuminance, colour and flicker targets remain design requirements to be chosen and verified, not results inferred from watts.
Keep a per-module electrical ledger and a whole-light ledger. If 15 W is input power, three modules draw 45 W before any separately powered host/hub overhead. If 15 W is LED electrical power, three modules need 45 W at the LEDs; at an illustrative 90% conversion efficiency that is 50 W input, again before separate overhead. This assumed efficiency is not a converter result. USB-PD contract, cable, connector and distribution limits need margin for the final interpretation and operating conditions. Do not infer a 45 W supply requirement from the phrase “three 15 W modules.”
A 3×3 matrix is a mechanical arrangement, not a current-sharing scheme. The current candidate connects all nine LEDs in series and uses one boost stage; three strings of three belongs to the earlier alternative study. Neither arrangement is physically qualified. Define the series/parallel wiring: parallel strings need a justified balancing method or independent regulation. Identical placement does not guarantee equal forward voltage or temperature. Independent channels can support balance adjustment, but the shared ADC and analogue resources still need the audit in chapter 21. A single nine-LED string can be electrically simple while requiring a boost above the assumed input voltage; it must also remain controllable at the lowest hot-string voltage and highest input.
Translate the circuit into reviewable CAD
Create one design-data source for parts, nets and placement. Independently transcribe critical pin expectations from the manufacturers' pin tables; comparing a generated netlist with itself is not a pin audit. Show the MCU, power stage, bias supply, sensing, protection, connectors and debug path as readable schematic blocks. Name nets by function, especially PWM, current sense, fault and reference signals.
Before copper, review a placement image with the intended current loops marked. Put gate drivers beside their MOSFETs, decoupling at the supplied pins, Kelvin routes at the shunt terminals and the analogue reference away from switch-node copper. Decide which layers carry return currents. A ground polygon's existence does not prove that the return beneath a signal is continuous. Give connector and mounting placement the same attention as the electrical loops: a heatsink, probe clip or cable can make an electrically correct board impossible to assemble or measure.
A placement/routing review should answer four concrete questions: where does the switching current circulate; where is the sensed voltage defined; what noise couples into that measurement; and how does fault shutdown reach the switch? The final layer render should answer the same questions after routing. ERC, DRC and schematic/PCB parity find different classes of error; none proves the loop stable or the lamp thermally safe.
Bring-up by evidence, not by brightness
Use a written sequence and record instruments, probe connections, supply limits, fitted assembly options and firmware identity. A bench current limit controls energy from the supply, not energy already stored in capacitors. A grounded oscilloscope clip can short a floating switch node; select the measurement method before applying power.
Stage
Measurement
Condition for proceeding
Unpowered inspection
Polarity, shorts, assembly options and continuity
No unresolved discrepancy with the assembly record
Bias only
MCU/reference rails, reset and gate-off state
Rails within budgets; switch off through startup and reset
Sensor stimulus
Current/voltage scaling, offset and fault threshold
Correct polarity and bounded errors, without switching
Bounded pulses
Gate timing, switch-node behaviour, inductor current
No unintended overlap or unexplained current rise
Closed loop
Current tracking and load/input steps
Stable operation inside the tested envelope
Faults
Last pulse, peak current/voltage and recovery
Measured bounds below component/load limits
Light and heat
Light waveform, temperature and long-duration behaviour
Meets the declared lighting requirements
Do not promote a candidate limit merely because one lower-energy test passed. A short-circuit trial at 5 V does not qualify 20 V: current slope and stored energy change. Test reset, watchdog, brownout, halted debug, invalid ADC data, disconnected thermistor, open LED and lost host separately. Define the expected output state before each test. Never interpret “software reported a fault” as proof that the hardware path stopped the switching edge in time.
Dimming: measure the delivered light
Switching PWM and brightness PWM are different clocks. A current setpoint can provide analogue dimming; gated packets of switching provide temporal dimming; a hybrid uses both. At short brightness pulses, current rise/settling time can consume most of the requested pulse and invalidate a simple duty-to-light map. TI's discussion of LED dimming methods describes this settling limitation.
Record LED current and a photodiode signal together across brightness settings, including the lowest levels. Report modulation frequency, waveform, minimum useful pulse and any low-frequency envelope. A camera banding check is useful observation but is not a calibrated flicker assessment. Revisit chapter 10 for the perceptual map and stated modulation criteria. A high switching frequency alone does not rule out visible low-frequency bursting.
An output capacitor changes both ripple and dimming. It can supply LED current while switching is inhibited and can discharge abruptly when a disconnected LED is reattached. Do not copy the large output capacitance of a 3.3 V logic supply into a current driver by habit. TI's TPS92515 documentation provides a buck example where the continuous regulated current permits operation without an output capacitor; this is a topology-specific design choice, not a rule that all LED drivers should omit it.
Thermal control and the host contract
The MOSFET temperature and LED junction temperature are different quantities. An NTC on the controller board can miss an overheating remote LED head. Place the LED temperature sensor where its relationship to junction temperature can be estimated, then measure the thermal lag. A sensor on the heatsink is not an instantaneous junction thermometer. Define open/short sensor behaviour, a derating curve, recovery hysteresis and a maximum current independent of the host.
Expose engineering units rather than implementation accidents. A minimal management contract can offer requested LED current, enable, voltage/current/temperature telemetry, fault bits, firmware identity and an explicit fault-clear operation. State ranges, scaling, update rates and whether a read is a coherent snapshot. Reject out-of-range writes. Keep regulation deadlines independent of bus traffic; telemetry can be decimated, but protection cannot wait for the host.
For domestic operation, document power-on brightness, host loss, host restart, supply loss and recovery. The future PD supervisor will report the available power contract; the LED board must obey a bounded input-power/current limit without making fast protection dependent on that report. PD hardware and USB transport remain separate work in this first platform. A supply negotiation or cable reset can remove input power even if the lighting firmware intends to hold its brightness.
Keep a learning record that survives the next PCB spin
For each revision, record the question being tested, fitted components, firmware, predicted limits, captured waveforms and outcome. Keep failed tests. If the internal amplifier clips, or a timer route cannot coexist with the management pins, that is a useful design result. Reusing owned parts is an economic choice; reusing their previous ratings without recalculation is not evidence.
The platform remains a prototype until it has measured electrical, thermal and light-quality evidence under its declared operating conditions. Neither this course nor a clean PCB report establishes a finished luminaire's compliance. The course can still teach useful control design before that qualification exists, provided each claim keeps its evidence label.
Exercise 22 · Write a first-spin acceptance sheet
Create a one-page acceptance sheet for one populated power channel. Include the LED/input envelope, current-error budget, sampling deadline, maximum fault delay/current, open-load voltage limit, temperature criteria, dimming measurements and host-loss behaviour. Select three first-spin questions and give the measurement that can falsify each answer. Mark every entry as proposed, calculated, CAD-checked or measured. For the boost candidate, draw both the switch-on overcurrent path and the MOSFET-off output-short path, and identify which protection can actually interrupt each.
Review criteria
A useful sheet contains numerical limits where the design has established them, and explicit “TBD” entries where evidence is missing. It identifies the actual sense and protection paths and the fitted assembly variant. It distinguishes LED thermal sensing from converter temperature, trip threshold from fault peak, current control from perceived light, and host communication from the local loop. A passing schematic or DRC result must not appear as evidence of thermal, flicker or fault qualification.
Notebook
Notes are saved in this browser. Export them before clearing browser data.