tests: per-MCS clean-power-ceiling calibration (adaptive-link recipe)#196
Merged
Conversation
Automates the #1 hand-tuning chore in the OpenIPC-FPV adaptive-link topic: the universal law "higher MCS => lower max clean power" (the PA garbles dense QAM first), which the community measures by hand per adapter ("raise power until garbage, back off 5") and bakes into per-MCS power tables. tests/per_mcs_power_ceiling.sh reuses this repo's diagnostics: for each MCS it sweeps the flat TXAGC index (DEVOURER_TX_PWR) while a second devourer adapter reports per-frame stats (DEVOURER_STREAM_OUT). The ceiling per MCS is the highest power that still DELIVERS cleanly — the point just before frames garble. Key finding that shaped the metric: the EVM *knee* (PA compression) is nearly the same power for every MCS, so it does NOT show the law; what differs is the decode threshold, so a denser constellation's delivery cliff comes at lower power. Delivery, not the EVM knee, is the right signal. Validated on 8812AU (8x8 sweep, chip-RSSI ground — no SDR, per the B210-front-end-limits lesson): ceiling MCS0-3 = idx56, MCS4 = 44, MCS5-7 = 32 (delivery collapses to 0 frames at idx44 for MCS7). A 24-index (~12 dB) taper, 0 law inversions — reproducing the community shape (Johhn's 8812AU 58@MCS0/1 tapering to 30@MCS5). Output is the mcs->safe-power table an adaptive link consumes; it feeds the runtime controls already shipped (SetTxPowerOffsetQdb baseline + the Jaguar2 per-packet offset). Tooling only, no library change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
From
/tmp/adaptive-link-recipes.md(the OpenIPC-FPV "Adaptive Link" topic): the #1 hand-tuning chore is the universal law "higher MCS ⇒ lower max clean power" — the PA garbles dense QAM first, so each MCS has a power ceiling above which video breaks. The whole ecosystem hand-calibrates this per adapter ("raise power until garbage, back off 5"; e.g. Johhn's 8812AU: 58@MCS0/1 → 30@MCS5) and bakes it into per-MCS power tables (wlan_adapters.yaml). This automates it, reusing the diagnostics this session already shipped.What
tests/per_mcs_power_ceiling.sh— for each MCS, sweep the flat TXAGC index (DEVOURER_TX_PWR) while a second devourer adapter reports per-frame stats (DEVOURER_STREAM_OUT). The ceiling per MCS is the highest power that still delivers cleanly — the point just before frames garble. Output is themcs → safe-powertable + the law-check.The metric matters, and the measurement corrected my first guess: the EVM knee (PA compression) turned out to be nearly the same power for every MCS, so keying on it gave a flat table. What actually differs per MCS is the decode threshold — a denser constellation garbles at lower power — so frame-delivery collapse, not the EVM knee, is the right signal.
Validation (8812AU, 8×8 sweep, chip-RSSI ground — no SDR)
Per-MCS delivery (frames/cell) shows the cliff directly:
RESULT ceiling MCS0=56 → top=32 (drop 24 index steps ≈ 12 dB); 0 law inversions → LAW REPRODUCED.This matches the community's known 8812AU shape.Chip-RSSI is the sensor (not the B210 — its front end limits on near-field frames, measured earlier this session). Fixed near-field geometry is valid: the delivery cliff is the PA's clean limit regardless of distance.
Scope
Tooling only — no library change. The table feeds the runtime controls already shipped:
SetTxPowerOffsetQdb(per-rate baseline, #188) + the Jaguar2 per-packet offset (#194). A runtime per-MCS clamp was considered and rejected: per-MCS TXAGC is individually addressable only on Jaguar1; J2/J3 group rates, so it'd be invasive for little gain. The calibration table is the valuable artifact.🤖 Generated with Claude Code