Hey Devin,

you don't need a calibrated receiver for a calibrated TX. I'll need to get
back to my setup to see if maybe there is a bug here and I simply missed it
because I had a lingering RX calibration file.

The temperature field on X300 is currently unused (X300 does not have a
temperature sensor we can use for this). B200 does actually tie this into
the temperature sensor on the AD9361. We had a thought of providing a way
of manually entering the ambient temperature, but it got dropped in
priority. Let us know if  that's something that would make your life more
useful (but to be clear, it would mean you have to provide your own
temperature sensor).

--M



On Tue, May 18, 2021 at 5:25 PM Devin Kelly <[email protected]> wrote:

> Hi Martin,
>
> Thanks for the help.
>
> When I add the trace debugging I get this:
>
> ...
>
> Setting TX Rate: 1.000000 Msps...
>> [TRACE] [0/DUC#0] Setting property interp@USER:0
>> [TRACE] [0/DUC#0] Locally resolving 2 dirty properties plus dependencies.
>> [TRACE] [0/DUC#0] Calling resolver for `interp'@0
>> [TRACE] [0/DUC#0] Set interp to 200
>> [TRACE] [0/DUC#0] Calling resolver for `samp_rate_in'@0
>> [TRACE] [0/DUC#0] New samp_rate_in is 1e+06
>> [TRACE] [0/DUC#0] New samp_rate_out is 2e+08
>> [TRACE] [0/DUC#1] Setting property interp@USER:0
>> [TRACE] [0/DUC#1] Locally resolving 2 dirty properties plus dependencies.
>> [TRACE] [0/DUC#1] Calling resolver for `interp'@0
>> [TRACE] [0/DUC#1] Set interp to 200
>> [TRACE] [0/DUC#1] Calling resolver for `samp_rate_in'@0
>> [TRACE] [0/DUC#1] New samp_rate_in is 1e+06
>> [TRACE] [0/DUC#1] New samp_rate_out is 2e+08
>> Actual TX Rate: 1.000000 Msps...
>>
>> Setting TX Freq: 900.000000 MHz...
>> Setting TX LO Offset: 0.000000 MHz...
>> [TRACE] [MULTI_USRP] Frequency Range 9.500MHz->6000.500MHz
>> [TRACE] [MULTI_USRP] Clipped RX frequency requested: 900.000000MHz
>> [TRACE] [MULTI_USRP] Target RF Freq: 900.000000MHz
>> [TRACE] [UBX] UBX TX: the requested frequency is 900.000000 MHz
>> [TRACE] [MAX287X] Intermediates: ref=50000000.00, outdiv=8.000000,
>> fbdiv=36.000000
>> [TRACE] [MAX287X] Tune: R=1, BS=500, N=36, FRAC=0, MOD=4095, T=1, D=0,
>> RFdiv=4, type=Fractional
>> [TRACE] [MAX287X] Frequencies (MHz): REQ=900.00, ACT=900.00, VCO=3600.00,
>> PFD=25.00, BAND=0.05
>> [TRACE] [UBX] UBX TX: the actual frequency is 900.000000 MHz
>> [TRACE] [CAL::DATABASE] Checking for file at
>> /home/lb/.local/share/uhd/cal/tx_iq_311A8A8.cal
>> [TRACE] [CAL] Checking for deprecated CSV-based cal data at
>> "/home/lb/.uhd/cal/tx_iq_cal_v0.2_311A8A8.csv"
>> [TRACE] [CAL] No calibration data found for tx_iq serial=311A8A8
>> [TRACE] [CAL::DATABASE] Checking for file at
>> /home/lb/.local/share/uhd/cal/tx_dc_311A8A8.cal
>> [TRACE] [CAL::DATABASE] Checking for file at
>> /home/lb/.local/share/uhd/cal/tx_dc_311A8A8.cal
>> [TRACE] [CAL::DATABASE] Checking for file at
>> /home/lb/.local/share/uhd/cal/tx_dc_311A8A8.cal
>> [TRACE] [CAL::DATABASE] Reading 32872 bytes from
>> "/home/lb/.local/share/uhd/cal/tx_dc_311A8A8.cal"
>> [DEBUG] [CAL] Loaded calibration data for tx_dc serial=311A8A8
>> [TRACE] [MULTI_USRP] Target DSP Freq: -0.000000MHz
>> [TRACE] [0/DUC#0] Setting property freq@USER:0
>> [TRACE] [0/DUC#0] Locally resolving 1 dirty properties plus dependencies.
>> Actual TX Freq: 900.000000 MHz...
>>
>> [TRACE] [X300-CAL-RX] Looking for power cal data for
>> x3xx_pwr_generic_rx_rx2, serial 311A8A8#0
>> [TRACE] [CAL::DATABASE] Checking for file at
>> /home/lb/.local/share/uhd/cal/x3xx_pwr_generic_rx_rx2_311A8A8#0.cal
>> ERROR: USRP does not have a reference power API on channel 0!
>> [TRACE] [X300-CAL-RX] No power cal data found for key
>> x3xx_pwr_generic_rx_rx2, key x3xx_pwr_generic_rx_rx2, serial 311A8A8#0
>> [TRACE] [RFNOC::GRAPH] Shutting down detail::graph...
>> [TRACE] [RFNOC::GRAPH::DETAIL] graph::shutdown()
>> [TRACE] [RFNOC::GRAPH] Shutting down all blocks ...
>> [TRACE] [0/Replay#0] Calling deinit()
>> [DEBUG] [0/Replay#0] deinit() called, but not implemented.
>> [DEBUG] [0/Replay#0] Invalidating register interface
>> [TRACE] [0/Radio#1] Calling deinit()
>> [TRACE] [0/Radio#1] deinit()
>> [DEBUG] [0/Radio#1] Invalidating register interface
>> [TRACE] [0/DUC#0] Calling deinit()
>> [DEBUG] [0/DUC#0] deinit() called, but not implemented.
>> [DEBUG] [0/DUC#0] Invalidating register interface
>> [TRACE] [0/DDC#0] Calling deinit()
>> [DEBUG] [0/DDC#0] deinit() called, but not implemented.
>> [DEBUG] [0/DDC#0] Invalidating register interface
>> [TRACE] [0/Radio#0] Calling deinit()
>> [TRACE] [0/Radio#0] deinit()
>> [DEBUG] [0/Radio#0] Invalidating register interface
>> [TRACE] [0/DDC#1] Calling deinit()
>> [DEBUG] [0/DDC#1] deinit() called, but not implemented.
>> [DEBUG] [0/DDC#1] Invalidating register interface
>> [TRACE] [0/DUC#1] Calling deinit()
>> [DEBUG] [0/DUC#1] deinit() called, but not implemented.
>> [DEBUG] [0/DUC#1] Invalidating register interface
>>
>
> It looks like the transmit command is failing because I haven't calibrated
> the receiver.  Is that a bug or is it necessary to have a calibrated
> receiver in order to have a calibrated transmitter?  I'm only interested in
> the TX side for now.
>
> Also, I looked at the cal data, looks good to me (I removed some lines for
> brevity)
>
> {
>>   "metadata": {
>>     "name": "X310 Power Cal",
>>     "serial": "311A8A8#0",
>>     "timestamp": 1619197435,
>>     "version_major": 1
>>   },
>>   "temp_freq_map": [
>>     {
>>       "temperature": 20,
>>       "freqs": [
>>         {
>>           "freq": 900000000,
>>           "powers": [
>>             {
>>               "gain": 0.0,
>>               "power_dbm": -11.72615954336
>>             },
>>             {
>>               "gain": 1.0,
>>               "power_dbm": -11.40312274336
>>             },
>>             {
>>               "gain": 2.0,
>>               "power_dbm": -10.86652754336
>>             },
>>             {
>>               "gain": 3.0,
>>               "power_dbm": -9.80502054336
>>             },
>>             {
>>               "gain": 4.0,
>>               "power_dbm": -8.98940624336
>>             },
>>             {
>>               "gain": 5.0,
>>               "power_dbm": -8.25477364336
>>             },
>>             {
>>               "gain": 6.0,
>>               "power_dbm": -7.02245754336
>>             },
>>             {
>>               "gain": 7.0,
>>               "power_dbm": -6.08657944336
>>             },
>>  ...
>>             {
>>               "gain": 25.0,
>>               "power_dbm": 11.25659145664
>>             },
>>             {
>>               "gain": 26.0,
>>               "power_dbm": 12.48234065664
>>             },
>>             {
>>               "gain": 27.0,
>>               "power_dbm": 13.41146185664
>>             },
>>             {
>>               "gain": 28.0,
>>               "power_dbm": 14.19771805664
>>             },
>>             {
>>               "gain": 29.0,
>>               "power_dbm": 15.42982635664
>>             },
>>             {
>>               "gain": 30.0,
>>               "power_dbm": 16.36669455664
>>             },
>>             {
>>               "gain": 31.0,
>>               "power_dbm": 17.17767755664
>>             }
>>           ],
>>           "min_power": -11.84374834336,
>>           "max_power": 17.17767755664
>>         }
>>       ]
>>     }
>>   ],
>>   "ref_gain": 0
>> }
>
>
> When looking at the cal data I notice there's a temperature field.  Is
> there a temperature sensor in the USRP that this cal is using? That would
> be really helpful for me to have the calibration include temperature.
>
> Thanks again,
> Devin
>
>
> On Tue, May 4, 2021 at 9:33 AM Martin Braun <[email protected]>
> wrote:
>
>> Also, another clue to what's going wrong could be in the cal data. Can
>> you please convert it to JSON (flatc --strict-json -t
>> /path/to/uhd/host/include/uhd/cal/pwr_cal.fbs --
>> ~/.local/share/uhd/cal/x3xx_pwr_generic_tx_tx+rx_XXXXXXX#0.cal).
>>
>> You'll need to install flatc (flatbuffer compiler) first (e.g. apt
>> install flatbuffers-compiler).
>>
>> --M
>>
>> On Tue, May 4, 2021 at 3:22 PM Martin Braun <[email protected]>
>> wrote:
>>
>>> Devin,
>>>
>>> I tried running the exact sequence that you did, and it worked fine
>>> (X310, UBX). Are you compiling UHD from source? If yes, can you please
>>> first enable full logging (-DUHD_LOG_MIN_LEVEL=trace) and then produce a
>>> full log (with UHD_LOG_LEVEL=trace environment variable, and/or
>>> UHD_LOG_CONSOLE_LEVEL=trace environment variable depending on your config).
>>>
>>> Side note -- I'm happy you're using this API, and you seem to have
>>> gotten pretty far. Kudos!
>>>
>>> --M
>>>
>>> On Fri, Apr 23, 2021 at 7:09 PM Devin Kelly <[email protected]> wrote:
>>>
>>>> Hello,
>>>>
>>>> I'm trying to calibrate the TX power for a USRP X310 using a Keysight
>>>> Field Fox N9952B.
>>>>
>>>> I wrote a class for the field fox that subclasses VISADevice.  It seems
>>>> to get the numbers from the FF fox fine.
>>>>
>>>> I run the calibration and it seems to work just fine:
>>>>
>>>> ./uhd_power_cal.py --args type=x300 -d tx --meas-dev visa --antenna 
>>>> 'TX/RX' -o 'import=field_fox' -o 'visa_query=USB0::MY_INSTRUMENT::INSTR'
>>>>
>>>> === Detecting USRP...
>>>> === Measurement direction: tx
>>>> === Initializing measurement device...
>>>> Loading external module: field_fox
>>>> /usr/local/lib/python3.6/site-packages/gpib_ctypes/gpib/gpib.py:54: 
>>>> UserWarning: GPIB library not found. Please manually load it using 
>>>> _load_lib(filename). All GPIB functions will raise OSError until the 
>>>> library is manually loaded.
>>>>   warnings.warn(message)
>>>> Loading external module: field_fox
>>>> Found VISA device: Keysight Field Fox N9952B
>>>> === Initializing port connector...
>>>> === Initializing USRP calibration object...
>>>> === Detected USRP type: X310
>>>> === Calibrating for channels: 0
>>>> === Calibrating for antennas: TX/RX
>>>> === Requested sampling rate: 5.0 Msps, actual rate: 5.0 Msps
>>>> === Launching calibration...
>>>> === Using USRP LO offset: 10.00 MHz
>>>> === Running calibration for channel 0, antenna TX/RX.
>>>> [tx] Connect your signal generator to device channel 0, antenna TX/RX. 
>>>> Then, hit Enter.
>>>> [X310] Switching to channel 0, antenna TX/RX.
>>>> [WARNING] [0/Radio#0] Attempting to set tick rate to 0. Skipping.
>>>>
>>>> [WARNING] [CAL::DATABASE] Calibration data already exists for key: 
>>>> `x3xx_pwr_generic_tx_tx+rx' serial: `311A8A8#0'. Backing up to: 
>>>> "/home/lb/.local/share/uhd/cal/x3xx_pwr_generic_tx_tx+rx_311A8A8#0.cal.1619197435"
>>>>
>>>>
>>>>
>>>> However, when I try to use the Power API I run into problems:
>>>>
>>>> ./tx_waveforms --rate 1e6 --freq 900e6 --wave-type SINE --wave-freq
>>>> 10e3 --power 10 --args='type=x300,serial=XXXXXXX' --channels 0
>>>>
>>>> Creating the usrp device with: type=x300,serial=XXXXXX...
>>>> Using Device: Single USRP:
>>>>   Device: X-Series Device
>>>>   Mboard 0: X310
>>>>   RX Channel: 0
>>>>     RX DSP: 0
>>>>     RX Dboard: A
>>>>     RX Subdev: UBX RX
>>>>   RX Channel: 1
>>>>     RX DSP: 1
>>>>     RX Dboard: B
>>>>     RX Subdev: UBX RX
>>>>   TX Channel: 0
>>>>     TX DSP: 0
>>>>     TX Dboard: A
>>>>     TX Subdev: UBX TX
>>>>   TX Channel: 1
>>>>     TX DSP: 1
>>>>     TX Dboard: B
>>>>     TX Subdev: UBX TX
>>>>
>>>> Setting TX Rate: 1.000000 Msps...
>>>> Actual TX Rate: 1.000000 Msps...
>>>>
>>>> Setting TX Freq: 900.000000 MHz...
>>>> Setting TX LO Offset: 0.000000 MHz...
>>>> Actual TX Freq: 900.000000 MHz...
>>>>
>>>> ERROR: USRP does not have a reference power API on channel 0!
>>>>
>>>>
>>>>
>>>> What am I not doing right?   All my cal files are
>>>> in  ~/.local/share/uhd/cal/
>>>>
>>>> The documentation (link
>>>> <https://files.ettus.com/manual/page_power.html>) talks about table
>>>> storage options (hard coded, eeprom, local files) but it doesn't discuss
>>>> how to configure the UHD to use any of those options.  I tried looking at
>>>> the documentation for multi_usrp class too (link
>>>> <https://files.ettus.com/manual/classuhd_1_1usrp_1_1multi__usrp.html#af5384b36f4fe1f8f90b41d8632c85ada>)
>>>> without any sucess.
>>>>
>>>> Devin
>>>> _______________________________________________
>>>> USRP-users mailing list -- [email protected]
>>>> To unsubscribe send an email to [email protected]
>>>>
>>> _______________________________________________
>> USRP-users mailing list -- [email protected]
>> To unsubscribe send an email to [email protected]
>>
>
_______________________________________________
USRP-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to