Optional "pulse" waveform option for galvo#1226
Conversation
Pretty basic pulse, delayed by camera delay and lasting sweep time duration. Goal is to have a simple pulse which can run the resonant galvo while acquiring.
Expose the new galvo pulse waveform in the configuration selector and user documentation so NI and synthetic galvo users can choose it explicitly. The underlying single_pulse waveform expects delay and pulse_width values as percentages of the sweep, but the galvo pulse branch was passing camera_delay / sweep_time as a fractional ratio. Convert the camera delay to percent before calling single_pulse and derive the remaining pulse width from that percent value. Add a regression test that uses the real SyntheticGalvo adjust path with a 10 ms camera delay over a 100 ms sweep. The test verifies the pulse starts after the expected delay and remains active for the rest of the sweep. Validation: python -m pytest -o addopts='' test/model/devices/galvo/test_galvo_base.py test/model/test_waveforms.py -q; ruff check/format on changed Python files; git diff --check.
|
@conorhughmcfadden I pushed an update in The key correction is that Could you please pull the latest branch and test the software again on your machine with your resonant galvo setup? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1226 +/- ##
===========================================
+ Coverage 64.53% 64.54% +0.01%
===========================================
Files 190 190
Lines 26408 26412 +4
===========================================
+ Hits 17042 17048 +6
+ Misses 9366 9364 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Last sample in single_pulse must be zero to clear the buffer, or else the galvo never shuts off. I did this before by making the pulse width max 99%, but better to just set the last sample to zero.
Resonant galvos work differently from linear galvos: they run at a fixed frequency with only the amplitude being controllable by a DC input voltage. I'm tired of fiddling with the little USB voltage generators every time I image. The goal is to have a simple pulse which can run the resonant galvo while acquiring, but is otherwise silent.
Example config
Pretty basic pulse, delayed by camera delay and lasting sweep time duration.
Creates a
waveforms.single_pulsefor the galvo with just amplitude as a user flex parameter.