first attempt at radioradar

This commit is contained in:
Ayzen
2026-05-06 18:15:50 +03:00
parent cf3f3cbd67
commit bde86813e5
28 changed files with 3224 additions and 30 deletions
+60
View File
@@ -9,6 +9,7 @@ Available models:
librevna
librevna_multi
compact_m_k209
kamil_adc
```
Example configs in the repository root:
@@ -18,6 +19,7 @@ run_config_librevna.example.json
run_config_librevna_multi.example.json
run_config_compact_m_k209.example.json
run_config_compact_m_k209_local_mock_switches.example.json
run_config_kamil_adc.example.json
run_config_simulator.example.json
```
@@ -47,6 +49,7 @@ The GUI process supervisor starts the correct producer automatically:
- `librevna` -> `build/bin/sweep_orchestrator`
- `compact_m_k209` -> `build/bin/sweep_orchestrator`
- `librevna_multi` -> `python_app.scripts.multi_device_raw_producer`
- `kamil_adc` -> `python_app.scripts.kamil_adc_raw_producer`
## Pure Simulator
@@ -220,6 +223,63 @@ For a command-line connection check from the Raspberry Pi:
The Raspberry Pi does not need S2VNA or NI-VISA in this remote mode.
## Kamil ADC With Laser Control
Use this mode for the ADC collector from `/home/europa/Documents/kamil_adc`
and the laser board configured through `laser_control`. The external
`kamil_adc` project is not modified by `radar_system`; the producer launches
the configured executable and reads its TTY stream.
Config:
```json
"radar": {
"model": "kamil_adc",
"serial": "kamil_adc",
"driver_mode": "native",
"kamil_adc": {
"project_dir": "/home/europa/Documents/kamil_adc",
"executable_path": "/home/europa/Documents/kamil_adc/kamil_adc_capture",
"tty_path": "/tmp/ttyADC_data",
"args": [
"profile:phase",
"clock:internal",
"internal_ref_hz:2000000",
"mode:diff",
"channels:2",
"ch1:2",
"ch2:3",
"do1_toggle_per_frame",
"do1_pair_subtract_avg"
]
},
"laser_control": {
"enabled": true,
"port": "/dev/ttyUSB0",
"mode": "variation"
}
}
```
Notes:
- `executable_path` is mandatory and must name the real Raspberry Pi binary.
- The producer appends `tty:<tty_path>` automatically; do not put `tty:` in
`radar.kamil_adc.args`.
- The laser-control driver is vendored under `python_app.hardware_full.laser_control`.
- `laser_control` and `kamil_adc` are treated as one hardware configuration.
Changing either section requires restarting acquisition so the lasers are
configured before the ADC collector starts.
- The TTY frame `0x000A step data1 data2` is imported as `S21 = data1 + j*data2`.
`S11` is filled with explicit zeros.
Manual raw-producer run:
```bash
.venv/bin/python -m python_app.scripts.kamil_adc_raw_producer \
--config run_config_kamil_adc.example.json
```
## K209 Remote Performance
The remote K209 path keeps one persistent TCP connection open. Configuration
+110 -2
View File
@@ -32,6 +32,8 @@ Selects the radar model and sweep settings.
"driver_mode": "native",
"mock_signal_hz": 5000000.0,
"multi_device": {},
"kamil_adc": {},
"laser_control": {},
"sweep": {}
}
```
@@ -40,13 +42,15 @@ Fields:
| Field | Meaning |
| --- | --- |
| `model` | `librevna`, `librevna_multi`, or `compact_m_k209`. |
| `model` | `librevna`, `librevna_multi`, `compact_m_k209`, or `kamil_adc`. |
| `serial` | LibreVNA serial. Empty means first device for single LibreVNA. For `librevna_multi`, this is the master serial. |
| `remote_host` | K209 remote server host. Used by `compact_m_k209`; ignored by LibreVNA modes. |
| `remote_port` | K209 remote server TCP port. Default is `50209`. |
| `driver_mode` | `native` for hardware, `mock` for supported synthetic LibreVNA modes. K209 requires `native`. |
| `driver_mode` | `native` for hardware, `mock` for supported synthetic LibreVNA modes. K209 and Kamil ADC require `native`. |
| `mock_signal_hz` | Existing LibreVNA mock signal parameter used by C++ mock acquisition. |
| `multi_device` | Extra settings for `librevna_multi`. |
| `kamil_adc` | External collector process and TTY settings for `kamil_adc`. |
| `laser_control` | Laser board settings applied before `kamil_adc` collection starts. |
| `sweep` | Frequency, point count, IFBW, and power settings. |
### `radar.sweep`
@@ -103,6 +107,90 @@ Fields:
| `force_external_reference` | Configure the synchronized external reference path. |
| `recovery_attempts` | Reopen/retry attempts after native multi-device acquisition errors. |
### `radar.kamil_adc`
Used only when `radar.model == "kamil_adc"`.
```json
"kamil_adc": {
"project_dir": "/home/europa/Documents/kamil_adc",
"executable_path": "/home/europa/Documents/kamil_adc/kamil_adc_capture",
"tty_path": "/tmp/ttyADC_data",
"args": [
"profile:phase",
"clock:internal",
"internal_ref_hz:2000000",
"mode:diff",
"channels:2",
"ch1:2",
"ch2:3",
"do1_toggle_per_frame",
"do1_pair_subtract_avg"
],
"env": {},
"startup_timeout_s": 5.0,
"sweep_timeout_s": 5.0,
"stop_timeout_s": 2.0
}
```
Fields:
| Field | Meaning |
| --- | --- |
| `project_dir` | Working directory for the external ADC collector. Required. |
| `executable_path` | Full path to the Raspberry Pi executable. Required; no filename is assumed. |
| `tty_path` | TTY stream path, for example `/tmp/ttyADC_data`. The producer appends `tty:<tty_path>`. |
| `args` | Explicit collector arguments, excluding any `tty:` argument. |
| `env` | Extra environment variables for the collector process. |
| `startup_timeout_s` | Time allowed for the collector to create a fresh TTY path. |
| `sweep_timeout_s` | Time allowed to receive one full sweep packet. |
| `stop_timeout_s` | Graceful stop timeout before killing the collector process. |
The TTY frame format is strict: packet start is `0x000A 0xFFFF 0xFFFF 0xFFFF`,
then each sweep point is `0x000A step data1 data2`. Steps must arrive as
`1..points`. `S21` is `data1 + j*data2`; `S11` is stored as explicit zeros.
### `radar.laser_control`
Used with `kamil_adc` when the laser board must be configured before ADC
collection starts. `laser_control` and `kamil_adc` are one hardware
configuration unit: changing either section requires restarting acquisition.
```json
"laser_control": {
"enabled": true,
"port": "/dev/ttyUSB0",
"mode": "variation",
"pi_coeff1_p": 2560,
"pi_coeff1_i": 128,
"pi_coeff2_p": 2560,
"pi_coeff2_i": 128,
"manual": {
"temp1": 25.0,
"temp2": 25.0,
"current1": 30.0,
"current2": 30.0
},
"variation": {
"variation_type": "CHANGE_CURRENT_LD1",
"static_temp1": 28.0,
"static_temp2": 28.9,
"static_current1": 33.0,
"static_current2": 35.0,
"min_value": 33.0,
"max_value": 60.0,
"step": 0.05,
"time_step": 50,
"delay_time": 10
}
}
```
`mode="manual"` uses `manual`. `mode="variation"` uses `variation`.
`variation_type` is the enum name from `laser_control`, for example
`CHANGE_CURRENT_LD1` or `CHANGE_TEMPERATURE_LD2`.
## `switches`
Two RF switch sections are used:
@@ -319,3 +407,23 @@ Compact-M K209 via remote server:
"driver_mode": "native"
}
```
Kamil ADC:
```json
"radar": {
"model": "kamil_adc",
"serial": "kamil_adc",
"driver_mode": "native",
"kamil_adc": {
"project_dir": "/home/europa/Documents/kamil_adc",
"executable_path": "/home/europa/Documents/kamil_adc/kamil_adc_capture",
"tty_path": "/tmp/ttyADC_data"
},
"laser_control": {
"enabled": true,
"port": "/dev/ttyUSB0",
"mode": "variation"
}
}
```