Hi Jason,

if I understand your problem correctly, this is a bit like the problem that, say, independent user equipment (UE) devices (==mobile phones) need to solve in a cellular network: they all need to align their clocks to the network-provided time, based on some synchronization signal.

You *can* do that, but I don't think it has much to do what you mention here. Let me sketch what I think you should consider:

1. let's assume for the time being that your two UEs and the network have the 
same notion
   of *frequency*, so f₁ = f₂, and because they're USRP, that also means their 
sampling
   rates are identical.
2. However, both UE have totally independent notions of time, because both 
started
   running at different times (t₁ ≠ t₂) (i.e., relative to network time, UE1 
and UE2 had
   their zeroth sample late by t₁ and t₂, respectively);
   also, the network time t₀ is also different (t₁ ≠ t₀ ≠ t₂; wlog t₀ = 0)
   However, since the sampling rates r are identical, a time interval T means 
the same
   exact time difference to all three.
3. Now, on UE1, a synchronization burst is observed. This gives us the 
information that
   at sample n₁, which, in terms of time for UE happened at sample r·t₁+x₁=n₁; 
it
   however, knows from the type or content of the burst that it happend at 
n₀=r·t₀+y on
   the network side.
4. UE1 now calculates the difference between the known network time of the 
burst and the
   observed time: r·(t₀-t₁)=y-x₁; since r, y and x₁ are know to UE1,this gives 
the time
   by which the UE lags t₀. That means we need to "jump" the time by -(t₀-t₁).
5. UE2 does the same calculation, but for-(t₀-t₁.
6. Both USPRs use a fixed time m₁, m₂ *by their own* counting, to set the 
internal time
   to m₁-(t₀-t₁), and m₂-(t₀-t₁), respectively.

There's ways to implement 6.: I can't remember whether the X310 in absence of an external PPS source synthesizes an internal PPS every (master clock rate) clock ticks. If that's the case: just loop till get_time_last_pps() changes, then add 1-(t₀-t₁) to it, and set the result set_time_next_pps.

If that's not the case, you can either modify the FPGA image to make that happen, or just use the GPIO API, which you can use with timed commands, and a cable from the front panel GPIO back to the PPS input, to emulate the same.

Best regards,

Marcus M

DISCLAIMER: Any attached Code is provided As Is. It has not been tested or 
validated as a product, for use in a deployed application or system, or for use 
in hazardous environments. You assume all risks for use of the Code. Use of the 
Code is subject to terms of the licenses to the UHD or RFNoC code with which 
the Code is used. Standard licenses to UHD and RFNoC can be found at 
https://www.ettus.com/sdr-software/licenses/.

NI will only perform services based on its understanding and condition that the 
goods or services (i) are not for the use in the production or development of 
any item produced, purchased, or ordered by any entity with a footnote 1 
designation in the license requirement column of Supplement No. 4 to Part 744, 
U.S. Export Administration Regulations and (ii) such a company is not a party 
to the transaction.  If our understanding is incorrect, please notify us 
immediately because a specific authorization may be required from the U.S. 
Commerce Department before the transaction may proceed further.

On 08.12.21 21:14, Jason Merlo wrote:
Hi All,

I’m currently working to synchronize multiple X310’s clocks without a PPS input, however right now the best method I can find to update the clock from a host PC (using the C++ API) is to query the current time from the USRP device (using usrp::multi_usrp::get_time_now), add a time delta to the current time, then send back the new clock time to the USRP device (using usrp::multi_usrp::set_time_now).  Unfortunately, this method introduces large timing errors due to the nondeterministic nature of packet processing on both he CPU and network stack.

I’m wondering if anyone knows of any other techniques for an "in-place" time update. I.e., is there a method for the host PC to send a time delta to the USRP which would be added to the clock register in a single operation?

I see there are other get/set_time_now functions in the rfnoc::mb_control and rfnoc::radio_control  classes, but I’m not sure if these would allow me to accomplish this using only the C++ API. I can’t seem to find much documentation on this aside from the examples in the “uhd/host/examples/rfnoc*” folder.

If it’s not possible to accomplish this using a purely C++ approach, is it possible to do this through a custom RFNoC block?  I don’t have experience with RFNoC at the moment and I’m not sure if that register is exposed to user blocks, or if so, if the register update would be deterministic in time, but if there’s motivation I would be willing go down the RFNoC path.

Thanks in advance,
Jason

_______________________________________________
USRP-users mailing list -- usrp-users@lists.ettus.com
To unsubscribe send an email to usrp-users-le...@lists.ettus.com
_______________________________________________
USRP-users mailing list -- usrp-users@lists.ettus.com
To unsubscribe send an email to usrp-users-le...@lists.ettus.com

Reply via email to