Skip to content

Power Hierarchy Rule: Driver → PA Protection

The Rule

Driver P1dB must be ≤ PA P1dB − 6 dB

Source of truth: POWER_HIERARCHY_HEADROOM_DB = 6.0 in backend/services/rf_chain/constants.py, applied by _filter_power_hierarchy() in backend/services/rf_chain/steps/driver/select.py.

# backend/services/rf_chain/steps/driver/select.py
max_driver_p1db = pa_p1db - POWER_HIERARCHY_HEADROOM_DB   # PA P1dB − 6 dB
hierarchy_passed = [c for c in components if _get_output_power(c) <= max_driver_p1db]

History: earlier frontend-era implementations used a 2 dB and later a 4 dB margin (frontend/src/services/driverSelection/ — since removed). The canonical backend System-A engine uses 6 dB. If you see other values in old logs or archived docs, they predate the backend port.

Fail-Open Behavior

The filter is fail-open: if no candidate driver satisfies P1dB ≤ PA P1dB − 6 dB, all candidates are kept (with a logged warning) so the chain still gets a driver:

"No drivers pass power hierarchy (max P1dB=%.1f), keeping all %d candidates"

This means the rule is a strong preference, not a hard guarantee — a design where every available driver is too powerful will still complete, and the downstream drive-level matching (attenuator insertion) manages the actual input power delivered to the PA.

Why This Rule Exists

1. Prevents PA overdrive

If the driver's P1dB is at or above the PA's, the driver can deliver more power than the PA input stage can safely absorb:

  • Overdrive of the PA input (damage risk)
  • PA forced into compression (distortion, spectral regrowth, harmonics)
  • Exceeding the PA's maximum input power rating

2. Ensures a sane power hierarchy

RF transmit chains should escalate power capability stage by stage:

VCO < (Predriver) < Driver < PA

Each stage has lower power capability than the next, so no stage can damage its successor and the signal compresses (if at all) at the final, designed-for stage.

3. Why 6 dB?

The margin absorbs, simultaneously:

  • Part-to-part P1dB tolerance on both the driver and the PA
  • Gain variation over temperature and frequency
  • Keeping the PA in its linear region at the operating drive level

What Happens When a Driver Violates the Rule

Example with the current 6 dB rule:

Driver P1dB: 40 dBm
PA P1dB:     42 dBm
Check:       40 ≤ 42 − 6 = 36 → FAILS

The driver is filtered out (logged as Power hierarchy: rejected N/M drivers (driver P1dB must be <= 36.0 dBm = PA 42.0 - 6.0)) and selection proceeds with the remaining candidates — unless nothing passes, in which case the fail-open path keeps all candidates as described above.

Predrivers: No P1dB Hierarchy Rule

There is no analogous "Predriver P1dB ≤ Driver P1dB − N dB" filter in the current engine. A predriver is inserted for a drive-level reason, not a protection reason:

  • If the VCO's output leaves less than MINIMUM_EXCESS_DB = 3.0 dB of headroom over the driver's required input (the "3 dB rule"), a predriver is inserted to bridge the gap (backend/services/rf_chain/steps/driver/select.py, predriver search in steps/driver/predriver.py).
  • The predriver itself is chosen by the driver agent's scoring against required_output_power_dbm — internally-matched parts are preferred via scoring weight, not hard-filtered.

All in backend/services/rf_chain/constants.py:

Constant Value Meaning
POWER_HIERARCHY_HEADROOM_DB 6.0 Driver P1dB must be ≤ PA P1dB minus this
MINIMUM_EXCESS_DB 3.0 3 dB rule: stage output must exceed next-stage required input by this
DRIVER_TO_PA_TRACE_LOSS 0.24 Estimated PCB trace loss (dB) between driver and PA

Key Insight

The algorithm prioritizes safety (power hierarchy) over optimal matching (3 dB rule). When no driver can linearly deliver the required drive, the engine still completes the chain — highest-capability driver plus a predriver and/or attenuator to set the correct drive level — and the fail-open log makes the compromise visible instead of silently blocking the design.