Skip to content

Calibration Commands

Commands for performing VNA calibration and managing calibration data.

Perform calibration measurements or control calibration state.

cal [operation] [value]
OperationDescription
openMeasure OPEN standard
shortMeasure SHORT standard
loadMeasure LOAD standard
thruMeasure THRU standard (S21)
isolnMeasure isolation (S21)
doneCalculate error terms and apply
resetReset calibration data
onEnable calibration correction
offDisable calibration correction
data <n>Output calibration data for type n
IndexTypeStandard
0CAL_LOAD50 ohm load
1CAL_OPENOpen circuit
2CAL_SHORTShort circuit
3CAL_THRUThrough connection
4CAL_ISOLNIsolation
ch> sweep 1M 100M 101
ch> cal open
open
ch> cal short
short
ch> cal load
load
ch> cal thru
thru
ch> cal done
done
ch> save 0
ch> cal data 0
0.001234 0.005678
0.001245 0.005689
...

Each line contains real and imaginary parts for one sweep point.


Save current calibration and settings to flash memory slot.

save <slot>
ParameterDescription
slotCalibration slot number (0-4 for F072, 0-6 for F303)
ch> save 0
ch> save 3

The properties_t structure is saved, containing:

  • Calibration data for all standards
  • Frequency range (start, stop, points)
  • Electrical delay settings
  • S21 offset
  • Trace configurations
  • Marker positions
  • Current calibration slot number
  • Checksum
TargetSlotsSize per Slot
F0725 (0-4)0x1800 (6 KB)
F3037 (0-6)0x4000 (16 KB)

Load calibration and settings from flash memory slot.

recall <slot>
ParameterDescription
slotCalibration slot number
ch> recall 0
ch> recall 3

All data saved by save command:

  • Calibration coefficients
  • Sweep settings
  • Trace/marker configuration
  • If slot contains valid data, loads and applies it
  • If slot is empty or corrupted, reports error
  • Triggers sweep restart with loaded settings

After recall, use these commands to verify:

ch> sweep
1000000 100000000 101
ch> trace 0
0 1 0 1 1.000000 7.000000

Calibration data is stored as complex values per sweep point:

[cal_type][point_index][re/im]
float cal_data[CAL_TYPE_COUNT][SWEEP_POINTS_MAX][2];

The cal_status byte indicates which calibrations are valid:

BitMaskCalibration
00x01LOAD
10x02OPEN
20x04SHORT
30x08THRU
40x10ISOLN

Full 1-port cal requires bits 0-2 (mask 0x07). Full 2-port cal requires bits 0-4 (mask 0x1F).

When cal done is executed:

  1. Calculates 1-port error terms from OPEN, SHORT, LOAD
  2. Calculates 2-port error terms from THRU, ISOLN (if available)
  3. Sets CALSTAT_APPLY flag to enable correction

If sweep range differs from calibration range:

  • RANGE mode ON: Interpolates calibration data
  • RANGE mode OFF: Uses closest calibration points

Control via menu: CALIBRATE > RANGE

Or via config command:

ch> config range 1

For S21 measurements with limited standards:

  1. Perform THRU measurement only
  2. Calculate response correction

Enable via menu: CALIBRATE > ENHANCED RESPONSE


If using non-standard load impedance (requires __VNA_Z_RENORMALIZATION__):

ch> config loadr <ohms>

Example for 75 ohm system:

ch> config loadr 75
ch> cal load
... (connect 75 ohm load)

Calibration commands in main.c:

  • cmd_cal: lines 2400-2500
  • cmd_save: lines 2502-2530
  • cmd_recall: lines 2532-2570

Calibration math in main.c:

  • apply_CH0_error_term: lines 900-950
  • apply_CH1_error_term: lines 952-1000
  • cal_interpolate: lines 1002-1100