Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How to synchronize the PCI-1588 with the PPS signal of a external GPS receiver?

The PCI-1588 was suggested for my project in order to get data acquisition with accurate GPS time stamping (hh:mm:ss.sss UT).

How to syncronize the PCI-1588 with PPS signal of the external GPS receiver?

Nothing is described about PPS synchronization in the PCI-1588 manual.
Doesn´t the PCI-1588 support synchronization using GPS?

Regards,
Lilian
0 Kudos
Message 1 of 11
(7,126 Views)
Start with the NI-Sync User Manual. It has a whole section on using PPS on page 3-10. If you can't find it make sure you have the latest help manual. PPS support wasn't added until NI-Sync 3.1 in the August 2007 User Manual. Essentially all you need to do is call the niSync Set Time Reference function and specify the initial time of the first pulse. I would suggest looking at the NI-Sync API Reference Help for information on niSync Set Time Reference.

-Josh
0 Kudos
Message 2 of 11
(7,118 Views)
Josh,

Thank you for your help.

You are right, I have downloaded and read the NI-Sync User Manual (October 2005 and August 2007) two months ago. In this week, I have read the NI-Sync User manual again, but the old manual.

The NI-Sync 3.0 is the latest driver (not 3.1), isn't it?

I began working in this project a few months ago and I don't have experience with NI hardware and software.
The previous developer doesn't work here more and he can't help me.

In short time, I had to learn many things about the project, GPS receiver, GPS timing boards, NI devices and drivers.

At the beginning, everything that I had to do was find the adequate devices and develop the program to timestamp the data acquisition.

The problem is that the deadline to conclude this project is very short. The deadline was postponed for a few months when I began it. Now I will also have to replace the DAQ device and develop the acquisition program with the PCI-6010.

We will have to import the PCI-6010, PCI-1588 and the GPS receiver in two months at most. After this, the resources to import the devices won't be more available for us.

I have already read the NI Manuals and Help many times, but I am sorry, I still need help because I can't make mistakes. This is the last chance for the conclusion of the project.

I have some questions:

  1) Will the PCI-1588 and NI-Sync can support the Linux some day?

  2) Does the PCI-1588 support the IRIG-B Time Reference?
     Sorry, maybe I am confused due to another GPS timing board. It uses the IRIG-B source to syncronize the onboard time with the external GPS receiver in order to get timestamps of a trigger signal (hh:mm:ss.sssssssss). It is not required set the initial time.
     I am not sure if the PCI-1588 supports this too. I think that no.
  
  3) I believe that Garmin GPS receivers don't have a PPS or IRIG-B output to connect to the PCI-1588.  Please tell me if I'm wrong.
     The Trimble's Thumderbolt E GPS receiver has the PPS and IRIG-B outputs. In order to connect the PPS output to the PCI-1588, a NI-SMB110 (SMB to BNC cable) is required.
      Do you could indicate me a low cost GPS receiver?

  4) Somebody in our organization told us some time ago that the PCI-1588 doesn't fit in our computers. I have searched information about PCI slot, and now I think this was a error. How can I be sure that the slot is compatible with the PCI-1588? I don't understand about this very well.
     
If you can help me again, thank you so much.

Thank you for reading my poor English too.

Regards,
Lilian

0 Kudos
Message 3 of 11
(7,104 Views)
It may help if you could explain your project a little more. What are you trying to do with the DAQ board and how do you need to incorporate GPS? The PCI-1588 board was really designed to integrate IEEE 1588 with DAQ products or to synchronized multiple DAQ systems over ethernet using IEEE 1588, not GPS or IRIG. The PCI-1588 does not support directly support IRIG-B or GPS.

I can help you more once I understand your problem better. To me it really sounds like you should be using the PXI-6682 with a PXI-6220. The PXI-6682 is a bit more expensive than the PCI-1588, but it has an integrated GPS receiver built into it and all you need to do is connect an active GPS antenna or purchase the GPS antenna NI sells as an accessory. The PXI-6682 would use the PXI backplane to sync the DAQ board, so no external cables would be needed between the PXI-6682 and the PXI-6220. The PXI-6682 also supports IRIG-B as an input so you could use it with an external GPS receiver that has an IRIG-B output.

I think it would simplify your system a bunch, but it would require you to move from PCI to PXI. If you still wanted to use a desktop computer to control it instead of a PXI controller you could purchase a PXI-1033 chassis, which allows you to use PXI cards from a desktop computer.

This could be over kill for your application or out of your budget, but it would be the easiest and fastest way to synchronize DAQ to GPS and we could help you with the programming. It should be rather straight forward. Are you planning to use C or LabVIEW?

-Josh
0 Kudos
Message 4 of 11
(7,085 Views)
Josh,

Thank you for all suggestions.

I have explained my problem better in the message How to timestamp continuous analog data acquisition using USB-6009 and GPS timing board?   Let me know if you need more information.

           "..it really sounds like you should be using the PXI-6682 with a PXI-6220."

Yes, I think it would be the ideal hardware. But our budget is really very limited and the import taxes are high.
We need acquire two devices to get data acquisition and two devices to get timestamps (one device operating and one spare device).
The total cost of our project using the PXI system will be approximately twice the cost of two PCI-6010, two PCI-1588 and an external GPS.

If the PCI-1588 can acquire timestamps of the data acquisition, and it is synchronized to PPS signal of a external GPS, in this case I will use the PCI-1588 with PPS Time Reference. I only need verify if everything is OK, because I need be sure that the project will work properly.

I will develop the program in C.

Regards,
Lilian
0 Kudos
Message 5 of 11
(7,075 Views)
I'll see if we can test something out here and I'll have someone get back to you or I will soon.

-Josh
0 Kudos
Message 6 of 11
(7,050 Views)
Just to throw another (currently supported) option out there, you could timestamp both the signal of interest and the PPS from the GPS receiver.

Your timestamps would not be synchronized to GPS but would be constant between the timestamps you get from the PPS and the signal you are interested in. You could then use the relationship between the two to adjust the timestamps accordingly.

-Adam
0 Kudos
Message 7 of 11
(7,033 Views)
That will give you a very accurate offset from the seconds boundary, but how does that help with the absolute time. You need to know what that PPS signal meant in time.

-Josh
0 Kudos
Message 8 of 11
(7,030 Views)
Adam, thank you for your suggestion, but this won’t be necessary because the PCI-1588 is syncronized to PPS. If you have more suggestions, every help will be welcome!

Josh, I am looking for a low cost GPS receiver to use with PCI-1588. Please verify if I understood well some points about the syncronization with PPS.

When the GPS sends a ZDA message of the NMEA-0183 standard (see description below) after a PPS pulse, I have to decode this message and set the initial time of the PCI-1588 with NI-Sync function. Every subsequent pulse is interpreted to be received one second later and the PCI-1588 time syncronized accordingly.

niSync_SetTimeReferencePPS (ViSession vi, ViConstString terminalName, ViBoolean useManualTime, ViUInt32 initialTimeSeconds, ViUInt32 initialTimeNanoseconds, ViUInt16 initialTimeFractionalNanoseconds);

The initialTimeSeconds is the number of seconds elapsed since Coordinated Universal Time (UTC) of January 1, 1970 (not counting leap seconds). In such case, I have to convert the UTC time (hhmmss.s, day, month and year of the ZDA message) to UNIX time as described here using the C functions and the time_t type of time.h.

The NI-Sync driver don’t use the UTC timescale. It returns the current time using the TAI timescale. In the document Why Is My PXI-6682 Off By 19 Seconds When Using GPS Protocol? , I found this: “If the TAI time scale does not work for your application the time source can be manually adjusted by using the NI-Sync property node and selecting "Clock Adjustment Offset".  Does the PCI-1588 using PPS as Reference time accept the NISYNC_ATTR_1588_1588_CLK_ADJ_OFFSET attribute?

If I set the initial time to 1200300400.000000000 and a timestamp occurs at 1200300405.123456789, then  1200300405 is the timeSeconds and 123456789 is the timeNanoseconds.  In the niSync_ReadTriggerTimeStamp function, what is the timeFractionalNanoseconds?

niSync_ReadTriggerTimeStamp (ViSession vi, ViConstString terminal, ViReal64 timeout, ViUInt32* timeSeconds, ViUInt32* timeNanoseconds, ViUInt16* timeFractionalNanoseconds, ViInt32* detectedEdge);

In my project I will use niSync_ReadMultipleTriggertimestamp, then I am going to examine the TimeStampClock-Cont.vi when someone send me the C code in this thread.  

Let me know if you had some problem with your test.

Thank you,
Lilian

-----------------------------
ZDA NMEA Message
The GPS receiver outputs the time associated with the current 1 PPS pulse. Each message is output within 100–500 ms after the 1 PPS pulse is output and tells the time of the pulse that just occurred. The ZDA message contains UTC time, the day, the month and the year.

$GPZDA,hhmmss.s,dd,mm,yyyy,00,00*hh<CR><LF>
$GPZDA,102030.5,12,04,2008,00,00*4F<CR><LF>

Field Description
1 UTC time
2 Day (01 to 31)
3 Month (01 to 12)
4 Year
5 unused
6 unused
hh Checksum
----------------------------

0 Kudos
Message 9 of 11
(6,993 Views)
I think the trick part will be setting the initial time. Since your GPS receiver will tell you the current time, but the PCI-1588 is expecting the time of the next PPS. I would suggest reading the GPS time until you get something in the range of X.0 to X.3. Then floor the time to X.0 and add one second and use that as the initial time. All of this should be able to execute in less than a half second, so the PCI-1588 will have to correct initial time.

-Josh
0 Kudos
Message 10 of 11
(6,988 Views)