# DIY Audiophile 3-Way Active Speaker System

Complete design package for an **active 3-way loudspeaker**: analog Linkwitz-Riley crossover feeding three power amplifiers (LM3886 Class-AB midrange by default, with a TPA3255 Class-D alternative), plus SPICE, KiCad skeletons, BOMs, and measurement scripts.

```
Line / DAC
    │
    ▼
┌──────────────────────────┐
│  Active crossover (LR4)  │  OPA2134 @ ±15 V
│  300 Hz / 3000 Hz        │
└───────────┬──────────────┘
     ┌──────┼──────┐
     ▼      ▼      ▼
  Woofer   Mid   Tweeter
   amp     amp     amp     ← LM3886 (±25 V) or TPA3255 (PVDD 24–36 V)
     │      │      │
     ▼      ▼      ▼
   Woofer  Mid   Tweeter drivers
```

## Repository map

| Path | Contents |
|------|----------|
| [`lm3886-poweramp/`](lm3886-poweramp/) | Class-AB mid amp: SPICE, KiCad, BOM, README |
| [`active-crossover/`](active-crossover/) | LR4 Sallen-Key: calculator, SPICE (W/M/T), KiCad sheets, BOM |
| [`single-mid/`](single-mid/) | Single midrange channel package (amp + XO + sealed box) |
| [`church-active-mid/`](church-active-mid/) | **CAMS-1 manufacturing pack** — church active mid speaker + stand for ~300 people |
| [`enclosure/`](enclosure/) | Latest speaker-box diagrams (PNG + SVG elevations/cutaway) |
| [`tpa3255-classd/`](tpa3255-classd/) | Class-D alternative: design rules, skeleton schematic, filter BOM |
| [`measurement/`](measurement/) | WAV generators, THD+N, frequency-response plots |
| [`bom/`](bom/) | Aggregated CSV BOMs |

## Build-order checklist

1. **Simulate** — run ngspice netlists in `lm3886-poweramp/spice` and `active-crossover/spice`; re-run `calculator.py` if you change crossover frequencies.  
2. **PCB design in KiCad GUI** — open the `.kicad_sch` skeletons, complete footprints/ERC/DRC, and **VERIFY every IC pin against the datasheet** (and TPA3255 **EVM** if using Class-D).  
3. **Order boards** — after ERC/DRC clean and BOM freeze.  
4. **Assemble** — power supply section first; inspect solder joints / polarity.  
5. **Test power supply alone** — confirm ±15 V (crossover) and ±25 V or PVDD (amps) **before** inserting ICs when possible; use current-limited supplies.  
6. **Test with IC** — still no speaker; check quiescent current and temperature.  
7. **Measure DC offset** — at amp outputs; investigate if more than a few mV–tens of mV (topology dependent).  
8. **Connect speaker** — start at minimum volume with a disposable/cheap driver if unsure.  
9. **Run measurement scripts** — `generate_test_signals.py` → play → record via **attenuator** → `measure_thd.py` / `plot_frequency_response.py`.

## Quick start (simulation & calculator)

```bash
# Crossover component values for 300 Hz / 3 kHz
python3 active-crossover/calculator/calculator.py 300 3000

# SPICE (requires ngspice)
ngspice -b lm3886-poweramp/spice/lm3886_poweramp.cir
ngspice -b active-crossover/spice/full_3way_lr4.cir

# Measurement tooling
pip install -r measurement/requirements.txt
python3 measurement/generate_test_signals.py --outdir measurement/wav_out
```

## Safety warnings

- **Mains voltage** kills. The crossover PSU and any linear amp supplies use hazardous AC mains. Use fused primaries, correct insulation, earth/chassis bonding per your electrical code, and never work on live exposed wiring.  
- **High-current DC rails** (±25 V, PVDD up to 36 V) can weld jewelry, start fires, and destroy devices instantly if shorted. Use current limiting during bring-up.  
- **Speaker-level ≠ line-level.** Always insert a **resistive attenuator** before any sound-card input when measuring amp outputs (`measurement/measure_thd.py` comments).  
- **Heatsinks & thermal pads** — LM3886 and TPA3255 require proper thermal design; verify tab isolation (LM3886 tab is often at V−).  
- **VERIFY against datasheets** before ordering PCBs anywhere this repo flags it — SPICE macromodels and schematic skeletons are design aids, not drop-in certified products.

## License / intent

Educational DIY electronics project files. You are responsible for safe construction, EMC, and compliance in your jurisdiction. TI part names/models are trademarks of their owners; download official SPICE models and EVM docs from manufacturer sites.
