Closed chris-ste closed 1 year ago
Thanks to a comment in the mailing list, we were able to fix our C++ code using timed commands:
usrp->clear_command_time();
usrp->set_command_time(usrp->get_time_now() + uhd::time_spec_t(0.1)); //set cmd time for .1s in the future
//uhd::tune_request_t freq);
usrp->set_rx_freq(uhd::tune_request_t(cfg.frequency, LO_OFFSET),0);
usrp->set_rx_freq(uhd::tune_request_t(cfg.frequency, LO_OFFSET),1);
usrp->set_rx_freq(uhd::tune_request_t(cfg.frequency, LO_OFFSET),2);
usrp->set_rx_freq(uhd::tune_request_t(cfg.frequency, LO_OFFSET),3);
sleep(0.11); //sleep 110ms (~10ms after retune occurs) to allow LO to lock
usrp->clear_command_time();
However, the timed commands are not working with our Python code. That is not really important for us but may be relevant for other people. Thanks a lot for the suggestion in the mailing list.
This looks like my problem, did you ever get the timed commands working in python?
Sadly, no. At some point I just stopped trying and went back to C++
Issue Description
Phase alignment with TwinRX using LO sharing seems to have some problems. We want to use a x310 with two TwinRX daughter boards for direction finding. Since TwinRX supports LO sharing, the phase offset between the four channels should be the same after each restart. This is the case at least in UHD 3.14. However, when we try to use UHD 4.1, 4.2 or 4.4 the phase offset between channel 0 and one of the other channels is not fixed but seems to change in multiples of 90° after restarting the device or the software.
Any help is greatly appreciated!
Similar topics/issues: Issue 524 Issue 237
Setup Details
We use a x310 with one or two TwinRX daughter boards. UHD Version 4.1 or 4.2 or 4.4 (other 4.x versions not tested). LO sharing active (A:0 sharing to all other channels). We connect a signal generator using a powersplitter to all Rx channels and send a sinusiodal signal at for example 100 MHz center frequency. We then analyse the phase offset between the received signals of the different channels.
Expected Behavior
The phase offset between channel 0 and channels 1/2/3 should be nearly constant even after power cycling the usrp.
Actual Behaviour
The phase offset between channel 0 and channels 1/2/3 varies in multiple of 90° (pi/2).
Steps to reproduce the problem
We modified the python rx_to_file.py example to reproduce the problem. The phase offset is printed and should always be around the same value with some noise. We usually use the C++ API, so it's not a python only problem. run with: python3 rx_to_file_phase.py -o test -f 100e6 -r 0.2e6 -d 1 -c 0 1 -g 70
rx_to_file_phase.py
Additional Information
If you disable LO sharing by using
usrp.set_rx_lo_source('internal', 'all', 1)
instead ofusrp.set_rx_lo_source('companion', 'all', 1)
the phase offsets are random as expected.