Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calibration on X310 with WBX-120: NO CAL antenna #731

Open
keukenrol opened this issue Feb 28, 2024 · 10 comments
Open

Calibration on X310 with WBX-120: NO CAL antenna #731

keukenrol opened this issue Feb 28, 2024 · 10 comments

Comments

@keukenrol
Copy link

keukenrol commented Feb 28, 2024

Issue Description

I am using an X310 with WBX-120 and TwinRX daughterboards. The transmission seems to have a lot of carrier leakage (when sending a stream of 0's, there is still a frequency spike at the carrier frequency at -50dBm). I found out about calibration methods, which are supported by the TX board (WBX-120). https://files.ettus.com/manual/page_calibration.html

When running the uhd_usrp_probe command, I can see the board gives me the following info:

TX Frontend: 0

| | | Name: WBX-120 TX+GDB
| | | Antennas: TX/RX, CAL
| | | Sensors: lo_locked
| | | Freq range: 25.000 to 2200.000 MHz
| | | Gain range PGA0: 0.0 to 31.0 step 1.0 dB
| | | Bandwidth range: 120000000.0 to 120000000.0 step 0.0 Hz
| | | Connection Type: IQ
| | | Uses LO offset: No

However, when running uhd_cal_tx_iq_balance or uhd_cal_tx_dc_offset it gives me the following error:

Running calibration for WBX-120 TX+GDB
Daughterboard serial: [censored]
Error: This board does not have the CAL antenna option, cannot self-calibrate.

Setup Details

UHD_4.6.0.HEAD-0-g50fa3baa
FPGA version of X310 is HG

Expected Behavior

Calibration of TX (and RX) for both DC offset and IQ.

Actual Behaviour

This board does not have the CAL antenna option, cannot self-calibrate.

Steps to reproduce the problem

Using a X310 with a WBX-120 daughterboard, run the following command:
uhd_cal_tx_iq_balance --verbose --args="addr=192.168.10.2"
remark: i have the default IP from the HG fw version.

Additional Information

Source code: https://github.com/EttusResearch/uhd/blob/master/host/utils/usrp_cal_utils.hpp
The functions get_rx_antennas() and get_tx_antennas are part of https://github.com/EttusResearch/uhd/blob/master/host/lib/usrp/multi_usrp.cpp This might be helpful.

@manderseck
Copy link
Contributor

@keukenrol Sorry for the late response. I don't have such a device at hand and I'm not too familiar with this product series, but from what the cal_utils do it seems like they check both TX and the RX antennas and if one of them fails (and only in that case) they come up with that error. In your snipped I only see the TX output. Can you confirm that the RX frontend reports to have a CAL antenna, too? That may bring us a little bit further.

@keukenrol
Copy link
Author

keukenrol commented May 15, 2024

Hello @manderseck. This is the output of uhd_find_devices:
| _____________________________________________________
| /
| | TX Dboard: 0/Radio#1
| | ID: WBX-120 (0x0080)
| | Serial: [censored]
| | Revision: 2
| | ID: WBX + Simple GDB, WBX v3 + Simple GDB, WBX v4 + Simple GDB, WBX-120 + Simple GDB (0x004f)
| | Serial: [censored]
| | Revision: 2
| | _____________________________________________________
| | /
| | | TX Frontend: 0
| | | Name: WBX-120 TX+GDB
| | | Antennas: TX/RX, CAL
| | | Sensors: lo_locked
| | | Freq range: 25.000 to 2200.000 MHz
| | | Gain range PGA0: 0.0 to 31.0 step 1.0 dB
| | | Bandwidth range: 120000000.0 to 120000000.0 step 0.0 Hz
| | | Connection Type: IQ
| | | Uses LO offset: No
| _____________________________________________________
| /
| | RX Dboard: 0/Radio#1
| | ID: WBX-120, WBX-120 + Simple GDB (0x0081)
| | Serial: [censored]
| | Revision: 2
| | _____________________________________________________
| | /
| | | RX Frontend: 0
| | | Name: WBX-120 RX+GDB
| | | Antennas: TX/RX, RX2, CAL
| | | Sensors: lo_locked
| | | Freq range: 25.000 to 2200.000 MHz
| | | Gain range PGA0: 0.0 to 31.5 step 0.5 dB
| | | Bandwidth range: 120000000.0 to 120000000.0 step 0.0 Hz
| | | Connection Type: IQ
| | | Uses LO offset: No
It does show a CAL antenna option on the RX frontend.

@manderseck
Copy link
Contributor

Thanks for providing the full output. From that it looks like it should work, indeed. So to get further I'd take the usrp_cal_utils.hpp and add some print or log statements to see which antennas it thinks are available. As mentioned earlier, unfortunately I don't have such a device available with these particular daughterboards for testing and debugging it myself.

@keukenrol
Copy link
Author

Thanks for providing the full output. From that it looks like it should work, indeed. So to get further I'd take the usrp_cal_utils.hpp and add some print or log statements to see which antennas it thinks are available. As mentioned earlier, unfortunately I don't have such a device available with these particular daughterboards for testing and debugging it myself.

I suppose I need to rebuild the whole uhd package to get the print statements working? Suggestions where to add them and what to print? Thanks!

@manderseck
Copy link
Contributor

@keukenrol Yes, rebuilding will be required, but if you built your current installation yourself already, then rebuilding from the same directory will be pretty fast.
To see which antennas it thinks it has when checking if the CAL antenna is among them I propose to add the following debug lines after line 244 ("set the antennas to cal"):

    auto rx_ant = usrp->get_rx_antennas();
    auto tx_ant = usrp->get_tx_antennas();
    std::cout << "RX antennas:" << std::endl;
    for (const auto& ant : rx_ant) {
        std::cout << "  " << ant << std::endl;
    }
    std::cout << "TX antennas:" << std::endl;
    for (const auto& ant : tx_ant) {
        std::cout << "  " << ant << std::endl;
    }

The error message that you get comes a few lines later, so this is the place where something seems to go wrong. Thanks for your effort!

@keukenrol
Copy link
Author

keukenrol commented Aug 9, 2024

@manderseck

This is the output of uhd_cal_tx_iq_balance:

Creating the usrp device with: ,ignore_cal_file=1,ignore-cal-file=1...
[INFO] [UHD] linux; GNU C++ version 11.4.0; Boost_107400; UHD_4.6.0.HEAD-0-g50fa3baa
[INFO] [X300] X300 initialization sequence...
[INFO] [X300] Maximum frame size: 1472 bytes.
[INFO] [X300] Radio 1x clock: 200 MHz
Running calibration for WBX-120 TX+GDB
Daughterboard serial: [CENSORED]
RX antennas:
RX1
RX2
TX antennas:
TX/RX
CAL
Error: This board does not have the CAL antenna option, cannot self-calibrate.

@manderseck
Copy link
Contributor

@keukenrol Thanks for getting back with this information. Interesting to see that usrp_probe reports a CAL antenna back for RX and TX while the getter doesn't find a CAL antenna in the RX path. Will check where this difference comes from.

@keukenrol
Copy link
Author

@manderseck Do you have any news on this? Thanks!

@manderseck
Copy link
Contributor

manderseck commented Sep 4, 2024

@keukenrol I'm sorry, still didn't find a WBX to test this with. It's EOL which is why it's hard to find them and why it's difficult to prioritize this. I've created a bug for this in our internal bug tracker, though.
What happens here is that there seem to be two sources of information about the available antennas. The RX path claims to not have a CAL antenna option while in theory it should have this. In case the query for available antenna names just returns a wrong list you could try what happens if you open a session to the device (for instance in Python to make things easy) and then set the rx antenna to CAL:

import uhd
usrp = uhd.usrp.MultiUSRP("addr=DEVICE_IP")
usrp.set_rx_antenna('CAL',0)

If that doesn't complain you could simply remove the check for available antenna ports in usrp_cal_utils.hpp, however my hopes are low. This is not meant to be a solution but a way to unblock you. If that doesn't work you may still create a loopback at the frontpanel from TX to the corresponding RX, remove the check and change the antenna names in the code accordingly. After recompilation that should work.

@keukenrol
Copy link
Author

Hi

I have tested the above code and obtained the following output:
in
usrp.set_rx_antenna('CAL',0)
RuntimeError: ValueError: Invalid antenna selection CAL for channel 0. Must be RX1 or RX2

Thanks for your suggestion, we will have to fall back on the alternative method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants