Commit Graph
85 Commits
Author SHA1 Message Date
Ayzen 4947d5a14e Polish GUI design 2026-10-06 14:16:14 +03:00
Ayzen 5bb86b7165 Rework radar system 2026-10-06 12:32:26 +03:00
Ayzen 552cdc688a Add object calibration 2026-10-05 17:39:40 +03:00
Ayzen 8f097dfa2e Refactor radar system 2026-10-05 16:46:28 +03:00
Ayzen d283ecfdf1 keep sweeps in acquisition order through history replays
The processor appended sweeps the GUI fed back to its own history, so its next replay
published them twice and out of order, and the B-scan came out with rotated columns.
Fed-back sweeps now stay out of that history, results are kept in timestamp order,
picking the displayed combo only redraws and only new sweeps are recorded to disk.
2026-10-02 16:05:32 +03:00
Ayzen 45861f4047 sar3d: GPU port of the notebook with four views
The sar3d processor is rewritten as a checked port of Multi_antenna_3D_clean_v1.ipynb:
NVRTC kernels, timing from the trace stamps, notebook parameter names and one cubic
SAR_VOXEL_M. It adds front, side, top and 3D views, drops gpr_cpp and the parity tools,
and the GUI speed now applies only while the socket speed is ignored.
2026-10-02 16:05:22 +03:00
Ayzen 61ef8720e1 number stimulus outputs in device stage order
The output index now equals the device stage, so outputs follow the order the
device measures them: master port 1 through its switch positions, then port 2.
The previous position-major numbering permuted the middle two against the
physical order, so data captured before this needs its calibration re-captured.
2026-10-02 13:57:33 +03:00
aweandClaude Fable 5 7329750c0c sar3d: fixed default scene window X [-2,2], Y [-0.5,2], Z [0,8] m
The grid bounds are now explicit config (sar3d_x/y/z_min/max_m) instead of
being derived from the antenna span and the depth gate. The depth mask
still zeroes voxels outside [min_depth, max_depth], so the wider Z window
just shows the masked wedge. The bound fields are double: the parity tool
recomputes the notebook-derived bounds (notebook_grid_bounds) and passes
them through the live config, and a float roundtrip shifted the axes by
~1e-7 m, flipping depth-mask knife-edge voxels against the reference npz.
Parity on frames 0034-0036 unchanged (1.3e-6, axes bit-match).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-25 17:12:18 +03:00
aweandClaude Fable 5 e1dfbec712 sar3d: python plumbing for the new parameters and real replay timing
- replay_raw_producer carries the RECORDED per-trace capture windows
  from each snapshot's meta.json (re-anchored by the same shift as the
  frame time) instead of one synthetic window for all traces — without
  this the segmented timing model degenerates in replay;
- GUI/profile/orchestration swap the removed window knobs
  (center_depth, half_width_*, grid_n*) for the notebook parameters
  (ground depth, pitch override, voxel pitch, Y range, X margin, norm
  edge margin, smooth sigma, comp power, tx per segment).

Headless replay smoke on the 20260922_mine_fast_true dataset passes:
51 sar3d result collections, transparent preprocessor.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-25 16:42:14 +03:00
aweandClaude Fable 5 b8cb572bc4 sar3d: port the Multi_antenna_3D_clean_v1 notebook algorithm
The old sar3d core was a port of the superseded Horns_3D notebook and
produced wrong volumes. The compute core now follows the reference
notebook exactly:

- segmented_interleaved frame timing rebuilt from per-trace capture
  stamps (uniform tx_per_segment split as the no-stamps fallback), with
  the coarse inter-segment dtau and the intra-sweep dtau applied as one
  phase ramp before the IFFT;
- ground scene coordinates with the ground_depth_m lift (scene Y=0 is
  the ground), full-region grid instead of a window around a center
  depth, geo_ref compensation anchored on the ground plane, power 0.3;
- notebook finalization in C++: |acc/cnt|, depth mask, normalization
  without the Y-edge planes, separable Gaussian over (Z, X), level;
- CUDA kernel computes geometry in double: float32 loses ~3e-4 of an
  A-scan sample in tau and drifts ~1e-4 from the float64 reference.

Live-config keys follow: the center_depth/half_width/grid_n window knobs
are replaced by ground/voxel/y-range/margin/sigma/power/tx_per_segment.

Parity against the notebook npz exports (frames 0034-0036 of the
20260922_mine_fast_true dataset): max|diff| <= 1.6e-6 off the depth-mask
knife edge, identical argmax, level rel diff <= 7e-7. Verified via
make sar3d_parity --dump-dir + scripts/sar3d_volume_compare.py; the
executable spec lives in scripts/sar3d_reference_check.py (bit-tight
against the npz, including the animation shifted-grid arithmetic).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-25 16:42:01 +03:00
aweandClaude Fable 5 e9a0b43ed3 revert gpr heatmap threshold, keep it for sar3d only
The display threshold from 'add treshhold' (e113ef6) was meant for the
sar3d projections; the GPR heatmap goes back to full-range levels and
the constant moves into sar3d_plot_mixin.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-25 14:52:20 +03:00
awe ebf0462d85 Revert "move to new version"
This reverts commit e202f57ef8.
2026-09-25 14:51:04 +03:00
awe f0ad4e6185 jetson compile fix 2026-09-18 16:34:44 +03:00
awe e202f57ef8 move to new version 2026-09-17 17:58:36 +03:00
awe e113ef60ab add treshhold 2026-09-17 16:43:22 +03:00
awe 16ccafff69 test new version 2026-09-16 13:22:21 +03:00
awe b3339d101c projector version 2026-09-15 19:06:05 +03:00
Ayzen 62c0266a6b per-point switching: hardware bring-up, profiles, protocol doc
Verified on the bench that the modified master bitstream excites in every stage
and the RF switch routes: 16 traces per sweep, 62 dB between the two switch
positions of one master port, 9.9k measurements/s. Adds the built master image,
two run profiles, a verification script and librevna_protocol.md, and drops the
stale prototype driver copy that the firmware tree still carried.
2026-09-15 14:41:54 +03:00
AyzenandClaude Opus 5 59c9d4f255 fpga: replace variable shift with a compare mask in port gating
Контрольная сборка стока в ISE показала, что первая версия правки внесла
нарушение тайминга: сток даёт Timing Score 0, а она — 1880 (hold на входе
MCU_MOSI). Причина — shift_right с переменным сдвигом синтезируется в barrel
shifter, а вызывался он четырежды: +142 LUT при +3 регистрах, из-за чего
поехало размещение и пострадала SPI-шина, по которой MCU пишет регистры FPGA.
Сбой там означал бы неверную конфигурацию развёртки.

Теперь младшие биты счётчика стадий просто маскируются, а маска декодируется
из SUBSTAGE_BITS тремя вентилями. Итог: 2182 LUT против 2189 у стока, то есть
логика стала дешевле стоковой. При SUBSTAGE_BITS=0 маска все единицы и
выражение вырождается в стоковое stage_cnt = port_stage буквально.

Заодно контракт стал однозначнее: хост присылает ПЕРВУЮ стадию блока порта, а
не индекс порта. Без под-стадий это то же число, поэтому стоковая совместимость
сохраняется, а зарезервированное "7 = порт выключен" больше не может совпасть с
настоящей стадией (при четырёх под-стадиях маскированная семёрка совпадала с
блоком второго порта).

Из VHDL убраны не-ASCII символы: GHDL отвергает их даже в комментариях.

Проверено: тестбенч проходит все четыре сценария и падает под мутацией
(8 сработавших проверок), 305 python-тестов зелёные, ISE собирает битстрим.
Остаточное нарушение hold на MCU_MOSI ловится подбором cost table размещателя —
ограничение маргинально уже в стоке (запас +0.458 нс).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 14:02:30 +03:00
AyzenandClaude Opus 5 c1f8654677 review fixes: shared mock capture window, 2-position controller caveat
Мок-бэкенд ставил каждому трейсу свой capture_end_ns, потому что метка бралась
в момент создания трейса. На реальном железе все комбинации коллекции выходят из
одного синхронизированного цикла и делят одно окно — мок теперь ведёт себя так
же, иначе он вводит в заблуждение при чтении записанных меток.

В README контроллера добавлена оговорка: прошивка рассчитана ровно на два
положения ключа. Хост допускает и 4, но тогда положение перестаёт быть
чередованием одного бита и нужен контроллер на две управляющие линии.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-09 22:15:50 +03:00
AyzenandClaude Opus 5 6693ece0aa per-point stimulus switching: host side
Матрица 4x4 за одну развёртку: каждый порт мастера измеряется на каждой частоте
дважды, с двумя положениями выходного ключа. Ключ дёргает контроллер в
триггерной петле, поэтому расбери переключателями больше не управляет —
SwitchedMatrixRadarService уходит из тракта, все 16 комбинаций снимаются в
пределах одной точки вместо разброса между тремя развёртками.

Выходы нумеруются позиция-мажорно, стадии порт-мажорно (старшие биты счётчика
стадий выбирают порт, младший — положение ключа). Из этого следует, что
положение ключа = младший бит номера стадии, а период 2 нацело делит 4 стадии —
поэтому контроллеру достаточно инвертировать ногу на каждый цикл триггера, без
абсолютного счётчика. Выходы 0 и 1 при этом сохраняют прежний смысл.

Приёмники слейвов пронумерованы от числа выходов + 1, а не от фиксированного 3:
иначе при 4 выходах прямой член «приёмник 3 <- выход 3» назывался бы так же, как
отражение выхода 3. При двух выходах даёт прежние порты 3..6.

Слейвам порт-стадии выставляются в 7: стоковый приём «одна за последней стадией»
перестаёт работать, когда порт выбирается старшими битами.

Всё за флагом multi_device.stimulus_switch_positions (1 = прежнее поведение,
байт в байт). Спецификация правок FPGA/STM в device_firmware/per_point_switching.md.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-09 21:26:56 +03:00
Ayzen 7997abe2d9 added capture time for every sweep 2026-09-03 17:30:19 +03:00
Ayzen 6ada811c2f some fixes 2026-08-26 15:02:21 +03:00
BogatskiyG 74723bb635 Merge branch 'laser-temp-monitoring' into feature/switched-matrix-radar 2026-08-04 14:57:03 +03:00
BogatskiyG 7c0ae1ecf8 removed the b-scan collection_id floor 2026-08-03 18:59:34 +03:00
BogatskiyG b183401e6f added bscan reprocessing 2026-07-31 18:14:54 +03:00
BogatskiyG d61b59b9a4 added a bscan extension 2026-07-31 15:46:08 +03:00
BogatskiyG 7c6cab07fc some changes and log fix 2026-07-30 19:58:53 +03:00
BogatskiyG 68bec25f17 Add real switch support for multi-device matrix radar
MultiDeviceLibreVnaService only exposes the 2x4 virtual combo matrix on
its own USB transport. When a physical GPIO switch sits on the master
stimulus and/or slave receiver path, the effective matrix is wider than
that. SwitchedMatrixRadarService wraps the inner service and drives the
extra switch(es) between acquire_collection calls, widening the combo
matrix by the physical position counts (matrix_output_switch_positions /
matrix_input_switch_positions in RunConfigModel).

Combo-matrix construction was centralized into
RunConfigModel.build_runtime_combos() so the GUI, workflows, and codec
all derive the same widened matrix instead of each computing its own
version of the virtual 2x4 layout.
2026-07-29 17:44:28 +03:00
aweandClaude Opus 4.8 e219f6ec02 Add laser temperature monitoring for current-variation runs
Independent monitor + checker for CHANGE_CURRENT_LD1 variation, where the
board sweeps LD1 current autonomously while both laser temperatures must stay
on their static setpoints. Nothing previously verified that the setpoints were
actually reached, so a stale temperature silently corrupted measurements.

New package python_app/hardware_full/laser_control/monitoring/:
- session.py: LaserVariationSession snapshot (targets + tolerance frozen at start)
- readings_channel.py: JSONL append/tail channel for per-sweep readings
- monitor.py: LaserTemperatureMonitor polls the board once per sweep, publishes
- checker.py: LaserTemperatureChecker validates temp1/temp2 vs targets (0.03 C),
  warns to console per laser with anti-spam state

CLI entry points scripts/laser_temp_monitor.py and scripts/laser_temp_checker.py
run as independent processes communicating via IPC files.

Also: add temp_tolerance_c to LaserVariationModeModel (schema + codec round-trip)
and write the session snapshot from apply_kamil_adc_laser_control's variation path
so the checker works with pipeline-started runs too.

Tests in tests/test_laser_temp_monitoring.py (17 cases); existing laser-control
protocol and config-codec suites remain green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-27 21:41:14 +03:00
awe 52c1218bf7 Independent monitor + checker for CHANGE_CURRENT_LD1 variation 2026-07-27 16:24:58 +03:00
Ayzen 3efe968dd1 some kamil_adc fixes 2026-07-02 17:44:24 +03:00
Ayzen 42532c9868 added new filtration and fixed processing parameters 2026-06-23 21:55:40 +03:00
BogatskiyG f967da7f53 added a warning line in GUI and WEBUI 2026-06-23 18:30:20 +03:00
BogatskiyG 9d30fab534 Merge branch 'some-additions'
export reference png added
2026-06-23 14:01:08 +03:00
BogatskiyG d522828875 some fixes 2026-06-23 13:52:31 +03:00
BogatskiyG 02bbe83446 added reference png export 2026-06-23 12:34:48 +03:00
Ayzen 8db14b9482 added data saving feature 2026-06-23 12:19:31 +03:00
Ayzen 716fd0b07a microfix 2026-06-22 17:33:15 +03:00
Ayzen d7ddca6e76 added diagnostics 2026-06-22 16:30:55 +03:00
Ayzen 7c381facaf some fixes 2026-06-22 15:01:26 +03:00
Ayzen e7f2d25585 new gpr 2026-06-13 12:07:23 +03:00
Ayzen f0d095de80 new GPR 2026-06-11 19:51:30 +03:00
Ayzen 9661504e51 new kamil adc 2026-06-11 13:02:02 +03:00
Ayzen 21f76d7cd2 some webUI fixes 2026-06-10 14:39:25 +03:00
Ayzen c12ae05148 some fixes 2026-06-06 02:07:46 +03:00
Ayzen b3a8cd834f some fixes 2026-06-06 01:42:18 +03:00
Ayzen aea49f6128 improved logging 2026-06-06 00:52:52 +03:00
Ayzen af6005d68f web UI added and refactoring done 2026-06-06 00:06:30 +03:00
Ayzen 3c30a12d4a some fixes again 2026-06-05 17:50:59 +03:00