2.3 KiB
Session summary — scan timeout & geometry fixes
Bug fixed: oscilloscope timeout on first row
File: hardware/tektronix_base.py — transfer_fastframe() (~line 1414)
The scope was configured for N frames but only triggered on fewer (e.g. 57 of 58) because
the stage decelerates before the last laser pulse. transfer_fastframe looped using
get_fastframe_count() (the configured maximum), so the final read_raw() call blocked
waiting for data that never came and timed out.
Fix: replaced get_fastframe_count() with a live query:
acquired = int(self.query("ACQuire:NUMFRAMESACQuired?"))
The loop now reads exactly as many frames as the scope actually captured.
Scan geometry overhaul
File: sc3_aui_app.py
Constants added (near line 71)
LASER_FREQ_HZ = 2000.0 # fixed laser pulse frequency
SCAN_RAMP_MM = v² / (2a) # ≈ 3.33 mm (100² / 2×1500)
SCAN_RAMP_MM is the distance the stage needs to accelerate from rest to full scan
velocity, or decelerate back to rest.
_run_scan() changes
points_per_rownow usesLASER_FREQ_HZinstead of the param-suppliedlaser_freq.- Pre-scan X position is
x_start - SCAN_RAMP_MMso the stage arrives atx_startalready at full velocity (TRIGOUT_MAXV fires at the right place). - Scan move ends at
x_start + x_delta + SCAN_RAMP_MMso the stage doesn't begin decelerating until after the last data point.
Travel-limit guards added (before any hardware interaction)
Raises ValueError with an actionable message if the extended move would exceed the
stage limits baked into the driver (bbd20x.py: X 0–110 mm, Y 0–75 mm):
x_start - SCAN_RAMP_MM < 0x_start + x_delta + SCAN_RAMP_MM > 110- any Y row position outside 0–75 mm
Error messages tell the user exactly how many mm to adjust.
What to check / next steps
- Verify
ACQuire:NUMFRAMESACQuired?is the correct query string for the specific scope model in use (MDO/MSO series assumed; confirm against programmer manual). LASER_FREQ_HZ = 2000.0is a temporary constant — wire it to the UI param when ready.- Confirm
SCAN_RAMP_MMmatches observed stage behaviour; if the BBD202 velocity profile is not perfectly triangular the empirical ramp may differ slightly from v²/2a.