Add software TES bias waveform generator - #79
Open
bengineerd wants to merge 5 commits into
Open
Conversation
Adds TesBiasWaveformProcess (a pr.Process node) plus the tesBiasWaveformGenerator device, which play software-clocked sine/square/constant waveforms on the TES bias lines for testing and characterization. Registered on Group alongside the other tuning/diagnostic processes; exported from warm_tdm_api. Generator count is sized dynamically to the group's TesBias length. Uses the process logger (not print) for status/stop/idle messages. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new server-side pyrogue.pr.Process (TesBiasWaveformProcess) and per-bias generator device to produce software-clocked TES bias waveforms (sine/square/constant) for testing/characterization, and wires it into the Group device tree and warm_tdm_api exports.
Changes:
- Introduces
_TesBiasWaveform.pyimplementing the waveform generator devices and the process loop that updatesGroup.TesBias. - Registers
TesBiasWaveformProcessunderGroupalongside existing tuning/diagnostic processes. - Exports the new process/device via
warm_tdm_api/__init__.py.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| software/python/warm_tdm_api/_TesBiasWaveform.py | New TES bias waveform generator device + pr.Process implementation and software-timed update loop. |
| software/python/warm_tdm_api/_Group.py | Adds TesBiasWaveformProcess to the Group’s tuning/diagnostic process list. |
| software/python/warm_tdm_api/init.py | Re-exports the new module’s symbols from the package. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Rework the TES bias waveform generator per PR #79 review: - Size the generator list once at construction from `config.numColumns` (== ColumnBoards*8) instead of from `self.parent` in __init__. The parent isn't attached during __init__ (so the old call always hit the fallback of 8), and the previous design otherwise mutated the device tree at run time via self.add() inside the process function, which would desync connected clients. TesBiasWaveformProcess now takes config= like the sibling processes. - Add an over-rate latency warning: warn once (via the process logger) if the requested SoftwareClock can't be sustained and waveform timing lags (#55). - Fix Mode enum ordering to 0:None, 1:Sine, 2:Square (was 1:Square, 2:Sine). - PascalCase the sub-device: tesBiasWaveformGenerator -> TesBiasWaveformGenerator. - Rename wfstep -> wfsquare for consistency with the 'Square' mode. Verified in emulate: 4 column boards -> 32 generators created at construction, enum order correct, package imports, compileall clean, waveform math checked. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Raise ValueError if SoftwareClock <= 0 before using it as a divisor (dt = 1/clk_hz), instead of a ZeroDivisionError / undefined behavior. - Replace the 10 us busy-poll (`while t-t0 < step_t: sleep(10us)`) with a single sleep of the remaining time until the next tick, so a high SoftwareClock no longer spins the server CPU. Verified: clk<=0 raises; loop paces and stops cleanly, restoring biases. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
"SoftwareClock" described the implementation, not the quantity, and invited confusion with a hardware timebase / with per-line waveform Frequency. Rename to UpdateRate (Hz) — the rate at which the host recomputes and writes the TES bias vector (the waveform sample rate). Expand the description: it's best-effort and host-limited (real ceiling is the host->board TesBias.set() round-trip), must stay well above the highest per-line Frequency, and the bench-achievable value is still TBD (issue #55) — start ~10-100 Hz until characterized. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Closes #55.
Adds the software TES bias waveform generator —
TesBiasWaveformProcess(apr.Process) plus oneTesBiasWaveformGeneratorsub-device per TES bias line —which plays software-clocked sine / square / constant waveforms on the TES bias
lines for testing and characterization. Registered on
Groupalongside theother tuning/diagnostic processes and exported from
warm_tdm_api.config(numColumns==ColumnBoards * 8) at construction time — one generator per TES bias entry.a warning if every generator is set to
None.SoftwareClockcan't besustained and waveform timing lags — the over-rate check called for in Feature request : Add TES bias waveform generator in software #55.
print.Split out of #68/PR #78 so it can land independently: it's a server-side
device node with no dependency on the
warm_tdm_api.operationsclient layerbeing reworked in #78. Once merged, #78 picks it up via the next
pre-release→wtj-refactormerge and shrinks to just the operations work.Validated in emulate mode: process registers on
Group, generators sized fromconfig at construction (4 column boards → 32 generators), package imports,
compileallclean, waveform math checked.Status: ready pending hardware testing. Code-complete and verified in emulate (construction-time sizing, input guards, paced loop, waveform math). The remaining gate is on the analog bench: confirm waveforms play correctly on real TES bias lines and measure the achievable
UpdateRate(the host->board round-trip ceiling — issue #55).Hardware verification procedure: https://github.com/slaclab/warm-tdm/wiki/HW-Verify-Issue-55-TES-Bias-Waveform-Generator (wiki → step-by-step bench steps + pass criteria; the analog-bench pass is this PR's remaining gate).