How precise is the timing?

Applications, development tools, FPGA, C, WEB
majtom
Posts: 19
Joined: Thu Nov 08, 2018 10:29 am

How precise is the timing?

Post by majtom » Thu Nov 08, 2018 10:40 am

Hi everybody,

I am planning to use the Red Pitaya for scientific purposes and so far I am very impressed with its abilities.

I am interested in any experience with the board in regards to precise time stamping of data.

1)As far as I understand it is not possible to timestamp individual samples, but only the entire buffer. Is this correct?

2) I can see that the board has a lightweight version of NTP. This way I can synchronize it with my PC which is connected to a GPS. But, how precise will the timestamp on my data package be, if I simply use a time function i c to add a timestamp to my data?

I am looking for ms precision.

I hope someone has experience with this and can give me some advise.

Cheers!

pavel
Posts: 790
Joined: Sat May 23, 2015 5:22 pm

Re: How precise is the timing?

Post by pavel » Thu Nov 08, 2018 11:38 am

I think that a time stamp with a precision of around a few microseconds is relatively easy to implement.

It's possible to connect Red Pitaya to a GPS module with a PPS output. The Linux kernel and the FPGA configuration should be slightly modified to forward the PPS signal to the programs running under Linux. Then gpsd and chrony can be configured to use the GPS module for the time synchronization.

I'm using this kind of configuration for my multiband WSPR transceiver project:

http://pavel-demin.github.io/red-pitaya ... -interface

majtom
Posts: 19
Joined: Thu Nov 08, 2018 10:29 am

Re: How precise is the timing?

Post by majtom » Thu Nov 08, 2018 1:29 pm

Dear Pavel,

Thank you very much for the fast answer.

Do you add one timestamp to your output file or do you timestamp each data point in the buffer?
And have you ever tested the system time offset from the pps signal?

Also, from the documentation I thought there would only be a limited version of NTP on the RP? Not one including ntpd and chrony.

I am sorry for the many questions, but it would be amazing if we could achieve a few microseconds precision with the RP.

Cheers!

pavel
Posts: 790
Joined: Sat May 23, 2015 5:22 pm

Re: How precise is the timing?

Post by pavel » Thu Nov 08, 2018 3:10 pm

The SD card images provided by the Red Pitaya developers are based on the Ubuntu Linux distribution that provides several NTP implementations. It's also possible to build from the source codes any version of any open source NTP implementation.

For my projects, I use the Alpine Linux distribution. This distribution also provides several NTP implementations.

You can find some plots of the time offset and jitter at the following link:

http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html

The only time measurement that I did was to check the time offset and jitter reported by chrony. The results were similar to the results from the above link.

In my projects, I use the PPS signal mainly for the frequency calibration and it works well.

I think that the following C code should be enough to read the time for a time stamp:

Code: Select all

struct timespec t;
clock_gettime(CLOCK_REALTIME, &t);

majtom
Posts: 19
Joined: Thu Nov 08, 2018 10:29 am

Re: How precise is the timing?

Post by majtom » Tue Nov 13, 2018 11:49 am

Dear Pavel,

Thank you very much for the info.
I just ordered a RP and I am looking forward to playing around with it.

- Maja

majtom
Posts: 19
Joined: Thu Nov 08, 2018 10:29 am

Re: How precise is the timing?

Post by majtom » Thu Jan 17, 2019 3:05 pm

Dear Pavel,

I am trying to use your SD card image. I can boot and log on with no problem.

I have attached my GPS like this: PPS to DIO3_N and the Data In and Data out to the UART TX and UART RX respectively. But the PPS signal is not registered.

chronyc sources shows a ? in front of PPS and there is nothing in the assert file for the pps0 device.

I have tried to change the configuration file for chrony, but it is overwritten every time I boot.

Do you have any suggestions for what I can do?

Thank you in advance!

pavel
Posts: 790
Joined: Sat May 23, 2015 5:22 pm

Re: How precise is the timing?

Post by pavel » Thu Jan 17, 2019 3:37 pm

The service reading the GPS data is disabled by default. It can be started with the following command:

Code: Select all

service gpsd start
The following two commands enable the automatic start of this service during the boot:

Code: Select all

rc-update add gpsd default
lbu commit -d

majtom
Posts: 19
Joined: Thu Nov 08, 2018 10:29 am

Re: How precise is the timing?

Post by majtom » Fri Jan 18, 2019 11:21 am

Dear Pavel,

Thank you for that! However, I still get nothing on the PPS source in chronyc and nothing in the /sys/class/pps/pps0/assert .

Do the pins need to be configured in some way?

I know my GPS is working and has a PPS signal.

- Maja

pavel
Posts: 790
Joined: Sat May 23, 2015 5:22 pm

Re: How precise is the timing?

Post by pavel » Fri Jan 18, 2019 11:31 am

I forgot to mention that the FPGA configuration should contain a correct connection for the PPS input. At the moment, this connection is present in two FPGA configurations: sdr_transceiver_wspr and sdr_transceiver_ft8.

Here is a command to load one of these two configurations into the FPGA:

Code: Select all

cat /media/mmcblk0p1/apps/sdr_transceiver_wspr/sdr_transceiver_wspr.bit > /dev/xdevcfg

majtom
Posts: 19
Joined: Thu Nov 08, 2018 10:29 am

Re: How precise is the timing?

Post by majtom » Fri Jan 18, 2019 3:47 pm

Thanks! That did the trick! Now I see the pps input on the pin.

It still doesn't show up in chrony though. Also, chrony does not output any statistics or a log file.
Is there a way to permanently make changes to the chrony configuration file?
That way I can play around with it, make a statistics file etc.

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: Google [Bot] and 16 guests