Calibration and EEPROM storage

Calibration

Note that to be available after reboot values need to be persisted to EEPROM.

LMS6002D

UmTRX does not require LMS6002D calibration to operate and provide decent signal quality. Most users won’t see a difference when operating OpenBSC, OpenBTS or similar software. That said, we provide a script for automatic calibration, which improves Tx DC offset (LO leakage), as well as Tx I/Q imbalance.

Run it without parameters to show help:

$ umtrx_auto_calibration
Automatic calibration of an UmTRX for a set of given presets (bands).

Usage:
umtrx_cal <preset> [<preset>] [<preset>] ...

preset - GSM850, EGSM900 (same as GSM900), GSM1800 (same as DCS1800), GSM1900 (same as PCS1900).

Calibrations to be performed:
- Tx DC offset calibration
- Tx IQ balance calibration

The result of the calibration is stored in the DIR/.uhd/cal/ directory. DIR is one of the $APPDATA, $HOME and /tmp,
whichever is defined. Make sure you run calibration from the same user as the one who runs applications or define
$APPDATA or $HOME appropriately. Calibration files will be loaded by the application automatically on startup.
Old calibration files are renamed when you run a calibration to avoid overwriting.

Calibration is permanent and only depends on temperature. If the temperature of the system is stable, you need to
run the calibration only once.

TCXO

GSM Standard requires frequency offset to be less than 50ppb, which puts strict requirements onto the reference oscillator (TCXO in our case). Most consumer and laboratory SDR devices does not pay attention to TCXO stability, which leads to various issues during a network operation. Phones typically tolerate offsets of 200ppb (sometimes up to 500ppb), but the more offset you have, the more random issues you get. UmTRX has really good 260ppb TCXO which works reasonably well even without calibration, and in addition to that it offers manual TCXO calibration and a GPS module for automatic calibration.

Automatic calibration with GPS

Using GPS is the best way to maintain UmTRX TCXO calibration in system running in production. GPS module provides continuous calibration of TCXO, so it’s not affected by temperature variations and aging. Note though, that the current version of UmTRX firmware does not save TCXO calibration into EEPROM when GPS is used, so calibration will be lost after UmTRX reset or power off.

  1. Connect a GPS antenna to UmTRX and make sure antenna has clear sky view. Note, that windows with protective coating found in many new buildings completely block GPS signal, so it’s highly recommended to put your antenna outside of a window.
  2. Wait for G LED on UmTRX to start flashing, which means GPS is locked. In case of bad (e.g. too narrow) sky view, lock may take 5-10 min or even more.
  3. Wait about 2 min after the lock to make sure the TCXO has been tuned to precise position.

Manual calibration

Manual calibration allows you to store calibration value to EEPROM to make sure it’s maintained between UmTRX resets/power offs. It’s a perfect options when you’re using UmTRX indoors and don’t want to have it constantly connected to a GPS antenna.

  1. Clone the umtrx_scripts repository:
    $ git clone https://github.com/fairwaves/umtrx_scripts
  2. Calibrate your UmTRX either with GPS (see above) or with a laboratory protocol analyzer like Agilent E4406A, Rohde&Shwarz CMD57 or similar.
  3. After calibration read the current TCXO calibration value by running umtrx_vcxo.py without parameters and write down this value.
    $ ./python_lib/umtrx_vcxo.py
  4. If you’re calibrating with a protocol analyzer, you should adjust the TCXO calibration value until the frequency error measured by your analyzer falls into 50ppb limit. To change the calibration in real time, use umtrx_vcxo.py again:
    $ ./python_lib/umtrx_vcxo.py –dac-value <val>
  5. Write the calibrated value to EEPROM:
    /usr/lib/uhd/utils/usrp_burn_mb_eeprom –args addr=<UmTRX IP> –values “tcxo-dac=<val>”

Now your UmTRX will be calibrated even when you restart of power cycle it. Note though, that frequency will fluctuate with temperature, so it’s recommended to perform manual calibration in your typical setting and run UmTRX for a while to warm it up before calibration.

EEPROM

At present the following values are stored in EEPROM:

KEY
DESCRIPTION
tx-vga1-dc-iDC offset calibration value for LMS6002D Tx I channel
tx-vga1-dc-qDC offset calibration value for LMS6002D Tx Q channel
tcxo-dacTCXO calibration value

Once the UmTRX EEPROM framework is in place we’ll be able to store additional values as required. For example,  Rx DC offset values or power limits for particular units.

The only limitation is the size of the EEPROM, which is 256 bytes in size and with around 200 bytes currently unused. With the strong correlation between temperature/frequency and calibration values, we could need a two-dimensional array for each value. In this case we may decide to move storage to flash instead of EEPROM. Since this would require further work it is being considered for future.

Writing values

Values can be written to EEPROM with the command:

  /usr/lib/uhd/utils/usrp_burn_mb_eeprom --values "<key>=<value>"

Reading values

All values can be read from EEPROM with the command:

  /usr/lib/uhd/utils/usrp_burn_mb_eeprom --read-all

uhd_usrp_probe can be used to display them all as well:

  _____________________________________________________
 /
|       Device: UmTRX Device
|     _____________________________________________________
|    /
|   |       Mboard: UMTRX-REV0
|   |   hardware: 64000
|   |   mac-addr: 00:50:c2:85:3f:ff
|   |   ip-addr: 192.168.10.4
|   |   gpsdo: none
|   |   serial: 1
|   |   tx-vga1-dc-i: 114
|   |   tx-vga1-dc-q: 138
|   |   tcxo-dac: 2022
|   |   
|   |   Time sources: none, external, _external_, mimo
|   |   Clock sources: internal, external, mimo
|   |   Sensors: ref_locked
|   |     _____________________________________________________
|   |    /
|   |   |       RX DSP: 0
|   |   |   Freq range: -6.500 to 6.500 Mhz
|   |     _____________________________________________________
|   |    /
|   |   |       RX DSP: 1
|   |   |   Freq range: -6.500 to 6.500 Mhz
|   |     _____________________________________________________
|   |    /
|   |   |       RX Dboard: A
|   |   |   ID: LMS RX (0xfa09)
|   |   |   Serial: 1
|   |   |     _____________________________________________________
|   |   |    /
|   |   |   |       RX Subdev: 0
|   |   |   |   Name: LMS RX (0xfa09) - 0
|   |   |   |   Antennas: RX0, RX1, RX2, RX3, CAL
|   |   |   |   Sensors: 
|   |   |   |   Freq range: 232.500 to 3720.000 Mhz
|   |   |   |   Gain range VGA2: 0.0 to 30.0 step 3.0 dB
|   |   |   |   Connection Type: IQ
|   |   |   |   Uses LO offset: No
|   |   |     _____________________________________________________
|   |   |    /
|   |   |   |       RX Codec: A
|   |   |   |   Name: LMS_RX
|   |   |   |   Gain Elements: None
|   |     _____________________________________________________
|   |    /
|   |   |       TX DSP: 0
|   |   |   Freq range: -32.500 to 32.500 Mhz
|   |     _____________________________________________________
|   |    /
|   |   |       TX Dboard: A
|   |   |   ID: LMS TX (0xfa07)
|   |   |   Serial: 1
|   |   |     _____________________________________________________
|   |   |    /
|   |   |   |       TX Subdev: 0
|   |   |   |   Name: LMS TX (0xfa07) - 0
|   |   |   |   Antennas: TX0, TX1, TX2, CAL
|   |   |   |   Sensors: 
|   |   |   |   Freq range: 232.500 to 3720.000 Mhz
|   |   |   |   Gain range VGA: -35.0 to 21.0 step 1.0 dB
|   |   |   |   Connection Type: IQ
|   |   |   |   Uses LO offset: No
|   |   |     _____________________________________________________
|   |   |    /
|   |   |   |       TX Codec: A
|   |   |   |   Name: LMS_TX
|   |   |   |   Gain Elements: None