# XFM-5050-UV single-channel driver: 19 mm round 2-board stack (KiCad 10)

Two stacked 19 mm round driver boards plus a 19 mm round LED board. Together they run one Luminus **XFM-5050-UV-D130** (275 nm UV-C) at **2.0 A continuous**, with optional strobing.
The circuit comes from the LED driver board in `../SWIRSystemController` (the "BUM2 LED Controller" stack). Earlier versions are in `archive/`: a single 63.5 mm board, then a 3-board 19 mm stack.

> **Where we left off (2026-11-12):** the driver is down to **two** 19 mm boards, after swapping in a 1-channel DAC (AD5693R) and a SOT-23 input monitor (INA236) and dropping the six bulk ceramics. Both schematics pass ERC and match their intended pin maps, the stack check confirms the bus lines up, and the only DRC errors are unrouted connections. **Nothing is routed.** Next steps are in [Open items](#open-items-resume-here).

![Both stack boards and the LED board, top and bottom](docs/stack-boards.png)

## Folder layout

| Path | What |
|---|---|
| `S1-Power/` | Stack board 1 (bottom): controller link, INA236 input monitor, LMR33640 buck. 4 layers, parts on both sides. |
| `S2-Driver/` | Stack board 2 (top): AD5693R DAC, iC-HG30 current sink, shunt + INA209, strobe inverter, LED wire pads. 4 layers, parts on both sides. |
| `LEDBoard/` | LED carrier, 2 layers (single-sided MCPCB preferred), parts on top only. |
| `lib/` | Project library: iC-HG30, AD5669R and INA209 symbols copied from the original design; new INA236 and AD5693R (LFCSP) symbols; XFM-5050-UV symbol and footprint (Luminus PDS-003131 Rev 01, p.7); `Texas_HSOP-8-1EP_ThermalVias_1col` for U3. Referenced through `${KIPRJMOD}/../lib`. |
| `docs/` | PDF schematics and `stack-boards.png` (3D renders). |
| `tools/` | Scripts that generate the design (see [Regenerating](#regenerating-the-design)). |
| `archive/63mm-driver/` | The single 63.5 mm stack driver (2x20 J34-compatible). |
| `archive/3-board-stack/` | The 3-board 19 mm stack (S1-Input / S2-Buck / S3-Driver), with the AD5669R, INA260 and 6 bulk ceramics. Its placement specs are in `archive/3-board-stack/tools/`. |
| `.history/` | KiCad 10 local history for the old root project. Leave it alone. |

## The stack

Both driver boards are 19 mm round, with their centre at (100, 100) mm in each PCB file. They are joined by a **2x6 1.27 mm bus at (96.2, 100) on both boards** (`PinHeader_2x06_P1.27mm_Vertical_SMD` on top of S1, `PinSocket_2x06_P1.27mm_Vertical_SMD` on the bottom of S2).

```
            LED board  <-- 2 wires (LED+, LED-) from S2 J2/J3; NTC lead (LED J2) to controller THERM
  top   S2 Driver   J1 socket (bottom)
  bot   S1 Power    J1 header (BOTTOM, controller ribbon), J2 header (top)
            controller  <-- 2x6 1.27 mm ribbon into S1 J1
```

**Bus pinout** (pin 1 marked on each footprint; odd pins in one row, even in the other):

| Pin | Net | Pin | Net |
|---|---|---|---|
| 1 | VIN | 2 | VIN |
| 3 | GND | 4 | GND |
| 5 | VLED_UV | 6 | VLED_UV |
| 7 | 5V_reg | 8 | 3V3_reg |
| 9 | SDA | 10 | SCL |
| 11 | ENABLE_0 | 12 | GND |

- **S1 J1 (controller link):** VIN 11-36 V, GND (3 pins), 5V_reg, 3V3_reg, SDA, SCL and ENABLE_0 from the controller. Pins 5-6 (VLED_UV) are **not connected**.
- **S1 J2 -> S2 J1:** VIN pins (1-2) are **not connected**, so VIN never reaches S2. VLED_UV crosses on pins 5-6.
- `tools/verify_stack.py` checks the mating pair, pin by pin, for position and net. It runs at the end of `regen.ps1`.

## How the driver works

```
VIN 11-36 V (S1 J1 pins 1-2)
  -> R5 10 mOhm shunt, U2 INA236 (S1, I2C 0x40, measures VIN current/voltage/power)
  -> VLED_BUCK_IN -> U3 LMR33640 buck (S1), VLED_UV = 8.14 V (R3 100k / R4 14.0k)
  -> bus pins 5-6 -> S2 J2 wire -> LED anode ... LED cathode -> S2 J3 wire (LED_K)
  -> U5 iC-HG30 (S2), channels 1-4 in parallel (current sink, ~0.5 A each)
  -> R25 20 mOhm shunt -> GND; U6 INA209 (S2, I2C 0x41) reads the shunt = LED current
U4 AD5693R (S2, I2C 0x4C) VOUT = VCI1 -> R11/R17 -> CI1-4 of U5 (sets the current)
ENABLE_0 (bus pin 11) -> U7 inverter (S2) -> EN1-4 of U5 (strobe)
```

| Board | Ref | Part | Role |
|---|---|---|---|
| S1 | J1 / J2 | 2x6 1.27 mm SMD header (bottom / top) | Controller link / bus to S2. |
| S1 | U2, R5, C1 | **INA236AIDDFR** (SOT-23-8) + 10 mΩ 0805 shunt | Input monitor on VIN, A0 = GND -> **0x40**. Use the ±81.92 mV range: 1.6 A typ = 16 mV, about 2.6 A = 26 mV with a 3.2 A LED. Bus voltage is read at IN-. VS on 3V3_reg. |
| S1 | U3 | LMR33640ADDA | The only power stage. VLED_BUCK_IN -> 8.14 V. Always on when VIN > ~10 V (EN UVLO, R1/R2 100k/13.7k). **Bottom side, directly under L1.** |
| S1 | L1 | XAL5050-103 (10 µH, Isat 4.9 A, Irms 3.6 A) | Top side, same centre as U3. |
| S1 | C4, C5 / C10-C13 | 10 µF 50 V / 22 µF 25 V 1210 | Buck input (bottom, next to U3) / output (top, next to L1). These are now the **only** bulk capacitors. |
| S2 | J1 | 2x6 socket (bottom) | Bus from S1. |
| S2 | U4, C3 | **AD5693RACPZ-RL7** (LFCSP-8 2x2 mm, LDAC version) + 10 nF on VREF | 16-bit I2C DAC, A0 = GND -> **0x4C**, ~LDAC = GND (output updates on write). The internal 2.5 V reference is on at power-up; **set GAIN = 2 in the control register** for a 0-5 V span. Powers up at 0 V. Exposed pad to GND. |
| S2 | C15, C16 | 100 nF, 10 µF | 5V_reg decoupling for U4 (placed on the top side; see open items). |
| S2 | R11 / R17 | 11.3k / 4.7k | VCI1 -> CI divider. CI is ~1.43 V at 5 V DAC output, which caps the current. |
| S2 | U5 | iC-HG30 | Low-side current regulator. CI1-4 set the current, EN1-4 switch it on/off in ~1 ns. Channels 5-6 off (CI/EN to GND, LDK open, datasheet p.8). VDD = 5 V via R23. Dissipates ~2.5 W at 2 A. Placed clear of the bus socket, so its thermal vias can't touch the socket pads. |
| S2 | U6 | INA209 | LED current via R25 (Kelvin through R26/R27 10R + C20). Convert pin = ENABLE_0 (triggered mode syncs to strobes). Bottom side. |
| S2 | U7 | 74LVC1G04 | HG_EN = NOT ENABLE_0. **ENABLE_0 low = LED on.** R29 pulls ENABLE_0 up, so the LED is off by default. |
| S2 | D6 | B340A | Free-wheeling Schottky, LED_K -> VLED_UV, next to U5 and the wire pads. Clamps the cable-inductance spike at turn-off (iC-HG30 Fig. 6). |
| S2 | J2 / J3 | 3 x 3 mm SMD wire pads | LED+ (VLED_UV) / LED- (LED_K), ~20 AWG to the LED board's J1 / J3. |

**LED board (rev B):** a 19 mm round board with no mounting holes; bond it to the heatsink with thermal adhesive or clamp it.
- D1 (XFM-5050-UV) at the centre, anode pad on the right.
- J1 (LED+, right) and J3 (LED-, left): 3 x 3 mm SMD wire pads, so the board can be single-sided aluminium MCPCB.
- J2: JST-SH 2-pin vertical (BM02B-SRSS-TB, mates with SHR-02V-S) below D1, for the NTC lead to the controller's THERM input.
- RT1: 10k 0603 NTC next to J2.
- The LED's centre pad sits on a THERMAL net tied only to the pours.

## Design decisions

**2026-11-03 (still valid)**
- **D130 variant:** Vf 5.0-7.75 V at 2 A, 3.2 A abs max, Tj max 95 C.
- **One buck from VIN:** the original power board's Vled buck/boost isn't used.
- **Four iC-HG30 channels in parallel:** each channel is 1 A CW max. The CI cap that keeps a high-gain part under 3.2 A still gets a typical part to about 2.0 A. With three channels, a typical part reaches only about 1.8 A.
- **Fixed 5 V for DAC and iC-HG30 VDD.**
- **Constant-current buck rejected:** it would run cooler, but it would lose DAC control and fast strobing.

**2026-11-12: 19 mm round boards**
- **All boards 19 mm round.** The driver no longer fits the original 2x20 J34 stack; it connects to the controller over a 2x6 1.27 mm ribbon instead.
- **Low-profile parts:** the 100 µF electrolytics and the XAL7070 were replaced (XAL5050-103 now), so the tallest part is L1 (about 5 mm).
- **0402 small passives** (0603 for 10 µF).
- **No indicator LEDs:** the old D1/D2/D3 and R6/R7/R8 were removed (they can't be seen inside a closed stack).
- **U3 sits on the bottom of S1, directly under L1**, using `Texas_HSOP-8-1EP_ThermalVias_1col`: 4 vias in one column that falls between L1's pads, and no copy of the exposed pad on the far side. The vias inside L1's courtyard are intended; `pth_inside_courtyard` is set to a warning in the project files.
- **LED power uses wire pads** on both S2 and the LED board.

**2026-11-12: consolidated to two boards**
- **AD5669R (8-channel, TSSOP-16) -> AD5693R (1-channel, 2 x 2 mm LFCSP)**, moved onto the driver board, so the DAC output no longer crosses the bus. Bus pin 12 (was VCI1) became a third GND.
- **INA260 (TSSOP-16 with built-in shunt) -> INA236 (SOT-23-8) + 10 mΩ 0805 shunt.**
- **Six bulk ceramics removed** (C3/C24/C25 on VIN and C14/C26/C27 on VLED_UV). The refdes C3 is reused for U4's VREF capacitor; C24-C27 are gaps.
- **Netclass clearance 0.15 mm** (was 0.2), so the INA236's 0.65 mm-pitch pads pass DRC. That equals the board's minimum clearance and is fine at 36 V.

## Status of checks

Checks last run 2026-11-12.

| Check | S1 Power | S2 Driver | LED |
|---|---|---|---|
| ERC (`--severity-all`) | 0 | 0 | 0 |
| Netlist vs. intended pin map | match (73 pins, 14 nets) | match (113 pins, 18 nets) | match (9 / 5) |
| DRC errors other than unrouted | 0 | 0 | 0 |
| Schematic <-> PCB parity | 0 | 0 | 0 |
| Stack bus check (`verify_stack.py`) | S1 J2 -> S2 J1 OK | | |
| Remaining DRC items | silkscreen, 4 intended `pth_inside_courtyard` warnings, 53 unrouted | silkscreen, isolated-copper warning, 69 unrouted | 2 silkscreen, 4 unrouted |

## Open items (resume here)

**Mechanics / parts**
1. **Bus connector part and board spacing.** L1 (about 5.1 mm) on S1's top faces U6 (TSSOP, 1.2 mm) and U4 on S2's bottom, so pick a 1.27 mm SMD header/socket pair with a mated height of **>= 7 mm**. Add the MPNs to J1/J2 once chosen. The estimated stack height, from S1's bottom parts to the top of D6, is about 15 mm (0.60 in), plus the ribbon plug under S1.
2. **Thermal (biggest risk).** U5 dissipates about 2.5 W at 2 A (up to about 5.7 W with a low-Vf LED on the 8.14 V rail) and U3 about 1 W, inside a closed 19 mm stack. U5's over-temperature shutdown is at 130-170 C. Plan a heat path (a metal standoff or clamp to S2's GND pour, airflow, or a lower rail voltage via R4) and measure U5's temperature at bring-up.
3. **VIN hot-plug.** With no bulk capacitor on VIN, plugging VIN in live through long leads can ring well above VIN. The LMR33640's absolute maximum input is just above its 36 V rating. Keep the controller-to-S1 ribbon short, keep the bulk capacitance on the controller side, or don't hot-plug at high VIN. A TVS doesn't help here: one that won't conduct at 36 V clamps too high to protect U3.
4. **Buck loop with an all-ceramic output** (C10-C13, 4 x 22 µF). Check against the LMR33640 datasheet's output-capacitance range and look at a load step on a scope at bring-up.
5. **LED Vf bin -> R4 (S1).** Rail = bin max Vf + ~1.2 V. R4 per bin: V3 17.4k, V4 16.0k, V5 14.7k, **V6 14.0k (fitted)**, V7 13.0k, V8 12.1k. Bins can't be ordered, so read the reel label or measure Vf at 2 A.
6. **XFM-5050-UV footprint orientation.** Built from the datasheet's bottom view as cathode on the left and anode on the right (top view). Check it against a real part.
7. **LED centre pad.** The datasheet doesn't say whether it is electrically isolated. It is left on its own THERMAL net.
8. **Confirm the I2C addresses on the datasheets:** INA236**A** with A0 = GND = 0x40 (the INA236**B** uses a different range), AD5693R with A0 = GND = 0x4C, and INA209 = 0x41. No two parts should share an address.

**Layout**
9. **Route both boards and the LED board.** The LED_Power netclass (1.5 mm) covers VIN, VLED*, LED_K, LED_A, SHUNT_HI and BUCK_SW. On 19 mm boards, use pours rather than 1.5 mm tracks where space is tight.
   - **S1:** keep the U3 / C4 / C5 input loop tight on the bottom. SW goes from U3 pin 8 straight up through vias into L1 pad 1. Put C10-C13 on top next to L1, and keep R3/R4 next to U3's FB pin. Route R5's sense connections to U2 as a Kelvin pair.
   - **S2:** keep the D6 -> J2/J3 -> U5 loop short and wide. Fill U5's exposed pad and vias into the In1 GND plane. Route R25's sense leads as a Kelvin pair to R26/R27 on the bottom. **C15 (100 nF) ended up on the top side, away from U4.** If there's any room while routing, move it next to U4's VDD pin; C3 (VREF) already sits next to U4.
   - **Both boards:** no vias or exposed copper under the other side's bus connector pads.
   - **LED board:** route LED+ / LED- as short, wide pours from J1/J3 straight to D1, and the NTC traces from RT1 to J2 below the LED. On an MCPCB, everything goes on F.Cu.
10. **LED board thermal.** The LED takes 13.5 W, and with no screws the bond to the heatsink carries all of it. Use aluminium MCPCB, or fill/cap the in-pad vias for FR4.
11. **Tidy the silkscreen** (shrink the references or move them to fab layers).

**Optional improvements**
12. **Hardware overcurrent cutoff:** route the INA209's Overlimit/Critical output (S2) to force HG_EN low. Both are on S2.
13. **Buck enable from firmware:** no bus pin is free; one of the three GND pins could be given up for it.

## Bring-up checklist (firmware)

1. Assemble S1, connect the controller ribbon to S1 J1, and apply VIN (11-36 V). Check 3V3_reg, 5V_reg and VLED_UV = 8.14 V (on C10-C13) with a meter. Then add S2. Leave the LED unplugged.
2. Do an I2C scan. Expect the INA236 at 0x40, the INA209 at 0x41 and the AD5693R at 0x4C.
3. AD5693R: write the control register with **GAIN = 2** (reference stays on), then write code 0.
4. INA236: set the ±81.92 mV range and the calibration for R5 = 10 mΩ. INA209: 20 mOhm shunt on the **±80 mV** range (2 A = 40 mV; 3.2 A = 64 mV). Its bus-voltage reading is meaningless here (low-side shunt); use the INA236 for VIN and power.
5. Solder the LED wires to S2 J2/J3. **UV-C: shield the LED and wear eye/skin protection.** Pull ENABLE_0 low, then ramp the DAC up until the INA209 reads **2.00 A**, and store that code. The iC-HG30's gain varies about 2.5x between parts: expect about 3.2 A max at full scale on a high-gain part, about 2.0 A typical, and as little as about 1.2 A on a low-gain part.
6. **Watch U5's temperature** (see open item 2). Its over-temperature shutdown is at 130-170 C.
7. Strobing: pulse ENABLE_0 at the same DAC code. Current rises in roughly 0.5 us (cable inductance). The rail may sag for tens of us after each turn-on; if pulses start low on a scope, raise the rail one step (R4 13.0k). The INA209 can't measure pulses under about 84 us, so calibrate in CW.

## Regenerating the design

The design is built by the scripts in `tools/`, which need KiCad 10 at `C:\Program Files\KiCad\10.0`:

```
powershell -ExecutionPolicy Bypass -File tools\regen.ps1             # all three boards + stack check
powershell -ExecutionPolicy Bypass -File tools\regen.ps1 -Only s1    # one board: s1, s2 or led
```

For each board the script runs: generator -> schematic upgrade -> netlist export -> project files -> `verify.py` (netlist must match the intended pin map) -> ERC -> `build_pcb.py` (outline, placement, pours) -> DRC with schematic parity -> PDF export. A full run then runs `verify_stack.py`. Reports go to `tools/out/`.
- Part values and connections: `tools/gen_stack_sch.py` (S1/S2; the bus pinout is the `BUS` table at the top) and `tools/gen_led_sch.py`.
- **Schematic drawing style (2026-11-12):** circuits are drawn with real wires inside each block. GND and the rails (VIN, VLED_BUCK_IN, VLED_UV, 5V_reg, 3V3_reg) use power symbols. Net labels appear only on the bus connector pins, I2C, ENABLE_0/HG_EN, and a few nets the PCB needs by name (VLED_BUCK_IN, BUCK_SW, CI1, VCI1, LED_K, SHUNT_HI, and LED_A/THERMAL on the LED board). Internal nets with no label get KiCad's automatic `Net-(...)` names; `verify.py` accepts those and still checks every pin's connections exactly. Wires, power symbols and positions are written by `kgen.Schematic.place/wire/pwr/label` (junction dots are added automatically).
- Placement: `tools/s1_pcb.json`, `s2_pcb.json` and `led_pcb.json`. Each has a `circle` outline, `fixed` parts (`[x, y, rot, side]`, side `B` = bottom) and packing `regions` (`side`, `up` = pack from the bottom of the box upwards). `build_pcb.py` prints any part that doesn't fit as `OVERFLOW` and parks it beside the board.
- Libraries: `make_libs.py <SWIRSystemController dir> <this dir>` rebuilds the symbols (including INA236 and AD5693R) and the LED footprint, and `make_hsop_fp.py` writes U3's single-column thermal-via footprint.

**Regenerating overwrites the `.kicad_sch` and `.kicad_pcb` files.** Use it only before you start routing or editing by hand in KiCad; after that, make changes in KiCad.

## Original-board issues found along the way

In `../SWIRSystemController`:
- The INA260_VLED monitor (U33) is powered only from the `/LEDDrivers/3.3V_LDO` net, which has no source, so that monitor never powers up.
- The AD5669R (U24) has ~CLR tied to GND. While ~CLR is low, LDAC pulses are ignored, which may also block DAC updates. Not confirmed.

## References

- Luminus XFM-5050-UV-D130 datasheet, PDS-003131 Rev 01: https://download.luminus.com/datasheets/Luminus_XFM-5050-UV_Datasheet.pdf
- iC-Haus iC-HG30 datasheet Rev B4 (via Laser Components): https://lasercomponents.com/fileadmin/user_upload/home/Datasheets/ichaus/ic-hg30-laser-switch.pdf
- ADI AD5693R: https://www.analog.com/en/products/ad5693r.html
- TI INA236: https://www.ti.com/product/INA236
- TI INA209: https://www.ti.com/lit/ds/symlink/ina209.pdf
- TI LMR33640: https://www.ti.com/product/LMR33640
- Coilcraft XAL5050: https://www.coilcraft.com/pdfs/xal50xx.pdf

UV-C at 275 nm is hazardous to eyes and skin. Do not view the LED while it is powered.
