# Active Crossover — Linkwitz-Riley 4th Order (3-way)

Unity-gain Sallen-Key filters using **OPA2134** dual op-amps on **±15 V**.  
Crossover points: **300 Hz** (woofer↔mid) and **3000 Hz** (mid↔tweeter).

## Topology

Each LR4 filter is **two cascaded identical 2nd-order Butterworth** (Q = 1/√2) stages → **24 dB/octave**.

| Channel | Stages | Result |
|---------|--------|--------|
| Woofer | LPF 300 Hz → LPF 300 Hz | LR4 low-pass |
| Midrange | HPF 300 → HPF 300 → LPF 3k → LPF 3k | LR4 bandpass |
| Tweeter | HPF 3k → HPF 3k | LR4 high-pass |

**Why LR4?** At the crossover frequency each electrical filter is −6 dB, so the acoustic sum (same polarity) is flat, and the lobing pattern is well-behaved for vertical driver arrays.

### Formulas (calculator)

- **Low-pass:** R1 = R2 = R, C2 = 2·C1, `R = 1/(2·π·fc·√2·C1)`
- **High-pass:** C1 = C2 = C, R2 = 2·R1, `R1 = 1/(2·π·fc·√2·C)`

## Recalculating for different drivers

```bash
cd active-crossover/calculator
python3 calculator.py 300 3000              # full 3-way tables (E24)
python3 calculator.py 250 3500 --series E12 # new drivers
python3 calculator.py 400 --channel mid     # single-fc HP+LP tables
python3 calculator.py 300 3000 --channel woofer
```

Update SPICE `.param` lines and the KiCad hierarchical sheet values to match the printed E-series parts. Prefer film capacitors (C0G/NP0 or PP/PPS) in the signal path.

## How to run SPICE

```bash
cd active-crossover/spice
ngspice -b midrange_lr4_bandpass.cir
ngspice -b woofer_lr4_lowpass.cir
ngspice -b tweeter_lr4_highpass.cir
ngspice -b full_3way_lr4.cir          # overlay all three channels
```

### Interpreting the AC output

| What you see | Meaning |
|--------------|---------|
| Midband ≈ 0 dB | Unity-gain stages working |
| −6 dB at each fc | Classic LR4 electrical property |
| −24 dB/oct skirts | Two stacked 2nd-order stages |
| Phase continuous / no wild peaking | Stable Sallen-Key; check layout if peaking appears on PCB |
| `full_3way_lr4` overlays | Woofer + mid + tweet should meet near −6 dB at 300 / 3000 Hz |

Optional: install TI’s [OPA2134](https://www.ti.com/product/OPA2134) model and replace the macromodel `.subckt` for more realistic noise/distortion.

## KiCad

- [`kicad/midrange_channel.kicad_sch`](kicad/midrange_channel.kicad_sch) — root with four hierarchical sheets  
- [`kicad/sk_highpass_stage.kicad_sch`](kicad/sk_highpass_stage.kicad_sch) — reusable HP stage  
- [`kicad/sk_lowpass_stage.kicad_sch`](kicad/sk_lowpass_stage.kicad_sch) — reusable LP stage  

Copy the midrange root and delete unused sheets for woofer (2× LP) or tweeter (2× HP). Change R/C values per `calculator.py`.

**VERIFY** OPA2134 package pinout and ±18 V abs-max against the [datasheet](https://www.ti.com/lit/ds/symlink/opa2134.pdf) before ordering PCBs.

## Power supply (±15 V)

On-board linear supply from a center-tapped transformer → bridge → 7815/7915. See [`docs/BOM.csv`](docs/BOM.csv). Keep analog ground star/return careful; decouple each op-amp with 100 nF at the pins.

## Files

| Path | Role |
|------|------|
| `calculator/calculator.py` | E12/E24 R/C calculator |
| `spice/*.cir` | Channel + full-system AC sims |
| `kicad/*.kicad_sch` | Hierarchical schematic skeleton |
| `docs/BOM.csv` | Op-amps, R/C, PSU parts |
