RITM SDR card management in Engee
For remote operation with the DA-AX-FMC-RF9 SDR cards on the RITM machine, the following are used EngeeDeviceManager.Targets.RITM_API.SDR — software control functions Engee. A detailed description of all functions is provided on the page Software management of RITM SDR cards.
The article uses the following abbreviations:
-
SDR is a software-defined radio system;
-
RF — radio frequency part;
-
DDS — digital synthesizer;
-
JESD — Digital interface between FPGA and transceiver;
-
FHM — carrier adjustment mode;
-
MCS — synchronization of multiple boards.
The current software control implementation is designed for two transmitting (TX) and two receiving (RX) channels. Software controls can detect and initialize boards, control carrier, synchronization, calibration, radio path, TX attenuation, RX and DDS gain, and read the status of the board and JESD lines. The transmission and reception of arrays of I/Q samples belong to a separate interface.
How management works
RITM SDR card management in Engee it is carried out using Engee.Integrations. Engee exchanges data via AMQP with the Engee client program.Integration installed on the user’s management computer. The client program accesses the manager on the RITM machine via HTTP; the manager executes the command ritm-sdr for the selected fee. The first argument of the functions SDR — the name of the registered machine, its saved IP address, or the full URL. The name and IP address must be added to Engee; the full URL can be passed directly. Argument board — the fee ID returned by the function listBoards, not the serial number of the board in the list.
Before running the examples
-
Application Engee.Integrations it must be running and connected on the user’s computer.
-
The RITM machine needs a compatible firmware version of at least
v7.10.0. -
In the Preparation section, replace
RITM 1and192.168.56.3with your car’s data. Take the card IDs fromlistBoards. -
Before operations with TX, prepare RF connections: successful completion
initialize,calibrateandsetTxAttenuationin the current version of the driver, it may leave the radio path on.
Parameters and operating procedure
The DDS carrier and frequency are set in Hz, the FHM boundaries in MHz, and the TX attenuation in millidecibels (32_000 = 32 dB), gain by the RX index of the table, DDS scale — in millionths (1_000_000 = 1.0). The TX/RX channels have numbers 0 and 1, DDS indexes — from 0 before 3. For FHM, specify both boundaries in BoardConfig; setFrequency applicable to a board that has already been initialized with FHM. For MCS, the master and slave configurations are transmitted in a single call initialize; there is no separate MCS command in the software management.
Perform preparation once, then run the necessary sections separately. Each section changes the condition of the equipment; do not perform all sections in a row. Modification methods return a dictionary with success and msg, so check the result. Reading returns the value directly and throws an exception if the request fails. Group initialization is not atomic; after an error or timeout, first read the status of the affected boards and only then decide whether to repeat the command. There is no automatic replay of SDR commands. radioOff turns off RF, saving initialization; deinitialize completes the operation of the board.
An example of using software control to work with RITM SDR cards
Preparation
Run the code below once in the current session before the selected section. It connects the software control functions, sets the name of the machine. (ritm_name) and , if necessary , adds it to Engee through addMachine. Verification of the result of operations is also defined here. After changing the machine’s name or address, run the code again.
ritm_name = "RITM 1"
if !RITM_API.isMachineExists(ritm_name)
RITM_API.addMachine(ritm_name, "192.168.56.3")
end
sdr = RITM_API.SDR
require_success = result -> begin
if !get(result, "success", false)
message = get(result, "msg", "operation failed")
error("RITM SDR: " * string(message))
end
return result
end
Initialization of a single board
Initialization of the board on a fixed carrier with internal synchronization.
let
board_id = 0
carrier_frequency_hz = 300_000_000
config = sdr.BoardConfig(
id=board_id,
frequency_hz=carrier_frequency_hz,
topology="internal",
)
require_success(sdr.initialize(ritm_name, config))
end
Single-board deinitialization
Stopping and de-initializing the selected board.
let
board_id = 0
require_success(sdr.deinitialize(ritm_name, board_id))
end
Initializing two boards in MCS
Initialize master and slave with a single group call. The MCS is executed by the driver during this operation; there is no separate MCS command.
let
master_id = 0
slave_id = 1
master_frequency_hz = 300_000_000
slave_frequency_hz = 300_000_000
configs = [
sdr.BoardConfig(
id=master_id,
frequency_hz=master_frequency_hz,
topology="master",
),
sdr.BoardConfig(
id=slave_id,
frequency_hz=slave_frequency_hz,
topology="slave",
),
]
require_success(sdr.initialize(ritm_name, configs; slave_fallback=true))
end
De-initialization of two boards
Deinitialize both boards with a single group call.
let
board_ids = [0, 1]
require_success(sdr.deinitialize(ritm_name, board_ids))
end
Channel calibration
The board must be initialized. In the example, the channels are calibrated sequentially. 0 and 1. The driver leaves the RF on after calibration, so the section turns off the RF in the unit. finally.
let
board_id = 0
channels = (0, 1)
results = Dict{Int,Any}()
try
for channel in channels
results[channel] = require_success(
sdr.calibrate(ritm_name, board_id; channel=channel),
)
end
finally
radio_result = sdr.radioOff(ritm_name, board_id)
if !get(radio_result, "success", false)
@warn "Не удалось выключить RF после калибровки" radio_result
end
end
results
end
Setting the attenuation
The board must be initialized. The attenuation of the transmitter is set in millidecibels: 32_000 respond 32 dB.
let
board_id = 0
channel = 0
attenuation_mdb = 32_000
require_success(
sdr.setTxAttenuation(ritm_name, board_id, channel, attenuation_mdb),
)
end
Sensitivity setting
The board must be initialized. The sensitivity of the receiver is set by the gain table index, not by the dB value.
let
board_id = 0
channel = 0
gain_table_index = 255
require_success(
sdr.setRxGain(ritm_name, board_id, channel, gain_table_index),
)
end
RF control: on and off
The board must be initialized. The first command turns on the radio path, the second turns it off. Start the activation only on a prepared stand.
let
board_id = 0
enabled = require_success(sdr.radioOn(ritm_name, board_id))
disabled = require_success(sdr.radioOff(ritm_name, board_id))
Dict("enabled" => enabled, "disabled" => disabled)
end
Getting the parameters of a single board
Reading attenuation and sensitivity of both RF channels, initialization status and synchronization topology. The reading functions do not include a radio track — the parameters can be read at any time.
let
board_id = 0
channels = (0, 1)
Dict(
"tx_attenuation_mdb" => Dict(
channel => sdr.getTxAttenuation(ritm_name, board_id, channel)
for channel in channels
),
"initialized" => sdr.isInitialized(ritm_name, board_id),
"topology" => sdr.getSyncTopology(ritm_name, board_id),
)
end