Synchronizing and Correlating Measurements to a Global Timebase with GPS

Overview

In many measurement applications, you need to correlate data acquired from different systems or synchronize systems together with precise timing. With PXI Counter/Timer Modules, such as the PXI-6608, you can now use a global timebase with your data acquisition measurements to do this. You can use Global Positioning System (GPS) time synchronization to correlate and synchronize measurements anywhere in the world with absolute timing, without requiring a direct connection between the measurement systems. GPS time synchronization can be used to precisely timestamp and trigger your data acquisition events.


In applications such as power grid evaluation and weather tracking, you need to correlate measurement systems over wide geographical areas; you can do this by using a global timebase. You can also use GPS time synchronization for a distributed control system, such as in a large-scale factory or mining operation. Multiple PXI chassis can be configured to start data acquisition or control processes at precisely the same time, anywhere in the world.

Each PXI-6608 has two real-time clocks that can be synchronized to external GPS signals. With GPS time synchronization, you can obtain timing accuracy down to 400 ns, depending on the accuracy of the GPS receiver. Since the PXI-6608 resynchronizes to the GPS signal each second, cumulative drift relative to the receiver is eliminated. With the improved time accuracy, you can correlate measurements taken from different systems without requiring a direct connection and synchronize multiple chassis together.

Contents

Introduction to GPS

Global Positioning System, GPS, consists of 24 satellites revolving around the earth every 12 hours. Each of these satellites has an atomic clock onboard with an accuracy of 10-13 seconds. The GPS satellites continuously transmit their coordinates in space along with a time message on a 1.5 GHz carrier frequency. The PXI-6608, along with a GPS receiver, can use this global timebase to precisely correlate, trigger, and timestamp measurement data.

More Information on GPS

GPS was developed by the United States Department of Defense during the Cold War to determine the precise location of their submarines carrying nuclear warheads. When most people think of GPS, they only think of position. However, precision timing is needed in order to calculate position. As a result, GPS has protocols for providing absolute time no matter where you are as long as the GPS receiver has a direct line of sight to the sky.

Pulse Per Second

There are two GPS timing signals supported by the PXI-6608. The first is Pulse Per Second, PPS. Most GPS receivers support PPS. A PPS signal does not contain information about the specific time of day or year; it only outputs a pulse once a second. The pulse width is generally 100 ms, but many GPS receivers allow the user to specify the pulse width, as long as it is less than 1 second. PPS is the simplest form of synchronization. A PPS signal might look like the following:

Figure 1.

IRIG-B

The second type of signal supported by the PXI-6608 is DC-level IRIG-B. IRIG, Inter-Regional Instrumentation Group, is an encoded TTL signal carrying the absolute time. IRIG repeats or re-synchronizes every second. There are multiple IRIG standards, and the PXI-6608 supports one of the most common, DC-level IRIG-B. The other standards mainly differ in the frame size or the amount of time before new information is being sent. For IRIG-B, each frame is 1 second. Below is a timing diagram of the IRIG-B standard. Each bit is represented as a 10 ms period, with 0 being a 2 ms high, 1 being a 5 ms high, and the P bit an 8 ms high. The P bit separates seconds from minutes, minutes from hours, and so on, within the 1-second frame.



Figure 2.

Figure 3.


Reprinted with permission from the University of Washington

Global Timebase Applications

You can use a global timebase for many different measurement applications. These applications include timestamping an event, timestamping events from multiple chassis to correlate measurements, generating a trigger at a user-specified time, and synchronizing chassis by generating triggers from multiple chassis.

Timestamping One Hardware Event & Correlating Measurements

The first application is to be able to precisely timestamp when an event occurs. In some applications it is necessary to know exactly when an event happened. Using GPS timing, you can do this very accurately. You can timestamp a digital trigger with the PXI-6608, and you can also timestamp analog events with the addition of other hardware. By combining a PXI analog input module, such as the PXI-6070, with analog triggering capabilities and the PXI-6608, you can timestamp when an analog signal crosses a user-defined threshold voltage.

You also have the ability to correlate data from multiple chassis. Many measurement systems are placed in large factories or even miles apart where it is not possible to connect them directly. By using GPS timing, you can correlate the data acquired from the distributed systems. This is useful when events occur at various locations that you need to relate to one another. By timestamping the events, you can precisely determine the relative times of data acquired at different locations.

An example of when this application is useful is with lighting tracking systems. When a lighting strike occurs, there are fluctuations in a power grid. By timestamping unusual activity at predefined points along the power grid, you can triangulate the point of the lightning strike. The illustration below shows how this can be done. Multiple PXI chassis with PXI-6608 modules and GPS receivers are placed along the power grid. Each system is programmed to timestamp unusual activity. These timestamps from each PXI system are then sent back to a central server where the data is analyzed to determine the location of the lightning strike.


Figure 4.


Generating a Trigger at a User-Specified Time & Synchronizing Chassis

Another application is generating a trigger at a precise, user-specified time. You can expand this application to be able to synchronize triggers generated by multiple chassis. By synchronizing systems together using GPS, you can trigger events with multiple systems at precisely the correct time.

One use for this application is re-galvanizing underground oil pipelines. Re-galvanizing pipelines is done by sending voltages down the pipeline at various points at exactly timed cascaded sequences. Doing this allows oil companies to characterize the galvanization and flaws of the pipeline. With GPS timing, you can actuate an event such as turning on a voltage source at very precise times with an accuracy of down to 400 ns. The illustration below represents how this could be configured. Three PXI systems are set up at different locations along the pipeline. A central server can communicate to the PXI chassis to tell them the absolute time they need to turn on a voltage. Because the chassis are synchronized with a global timebase, they are insured to output the signals at the precise time.

 


Figure 5.

Equipment Needed

There are three things you need to take advantage of a global timebase with your measurements.

  1. PXI-6608 -- You need a PXI-6608 along with a PXI chassis and controller. You also need the appropriate cables and accessories.
  2. NI-DAQ 6.9.1 or later -- These versions of the driver feature the ability to decode GPS signals.
  3. GPS Receiver -- You need a third party receiver that can accept a GPS signal and output either a PPS and/or a DC-level IRIG-B signal. The receiver needs a direct line of sight to the sky to intercept the GPS signal.


PXI-6608 & NI-DAQ

The PXI-6608 device consists of two real-time clocks that can synchronize with GPS signals, eight general purpose counters with a maximum timebase of 80 MHz, and a 10 MHz oven-controlled crystal oscillator (OCXO) with a stability of 75 parts per billion. The GPS real-time clock accuracy of the PXI-6608 is 300 ns, meaning that the PXI-6608 will be synchronized to the GPS receiver within 300 ns.

The PXI-6608 is equipped with the NI-TIO ASIC, a state-of-the-art counter and digital I/O ASIC developed by NI for advanced timing and counting applications. Every PXI-6608 device features two NI-TIO ASICs to provide a total of eight counter/timers. Each counter has a Gate, Up/Down, and Source input, each of which can be controlled by external or internal signals. Each counter also has one output that can be routed externally or internally to all of the counters on the board. 80 MHz, 20 MHz, and 100 kHz timebases are available onboard for use with each counter/timer. The PXI-6608 also has the ability to use a hardware trigger to start multiple counters simultaneously.

The 10 MHz OCXO in a PXI-6608 module has a frequency stability of 75 ppb over one year. This means that the frequency can be off by 0.75 Hz in 10 MHz over a period of one year. When the PXI-6608 is installed in the star trigger slot of a PXI chassis (slot 2), you can drive the OCXO signal to the PXI backplane for high-stability timing of your entire measurement system.

More Information on the PXI-6608

GPS Receiver

You need a GPS receiver to receive signals from global positioning satellites. GPS receivers come in a variety of form factors and a wide range of prices. Most GPS receivers provide some form of external timing information, such as a DC-level IRIG-B or PPS signal that you can use with the PXI-6608. Other GPS receivers do not provide PPS or DC-level IRIG-B outputs. In addition, the accuracy of GPS receivers can vary tremendously, with accuracies as good as 100 ns. When combined with the 300 ns accuracy of the PXI-6608 real-time clocks, your GPS synchronization can be as good as 400 ns. Before purchasing a GPS receiver, determine what accuracy and GPS protocol are required for your application. Below are links to two GPS receiver providers for more information on available receivers.
Symmetricom -- www.symmetricom.com

See the More Information on GPS section above for information on GPS timing signals.

Signal Connections

Timestamping a Digital Trigger and Correlating Data from Multiple Chassis

There are two signal connections you must make when timestamping a digital trigger. The first is the digital trigger that you are timestamping; the other is the GPS synchronization line. Connect the digital trigger to the Gate of the selected real time clock. The default value is PFI 7. Connect the GPS timing signal to synchronization line of the real-time clock being used. The pin for the real-time clock signal is programmable through software. The default value is PFI 6.


Figure 6.

Timestamping Analog Measurements

You can timestamp analog measurements with additional hardware. Since the PXI-6608 does not have any analog input channels, you need to install a PXI module that can export an analog trigger, such as the PXI-6070, in the same chassis. Connect the trigger to the Gate of the selected real time clock on the PXI-6608. The default is PFI 7. Connect the GPS timing signal to synchronization line of the real-time clock being used. The pin for the real-time clock signal is programmable through software. The default value is PFI 6.


Figure 7.


Generating a Trigger at a User-Specified Time & Synchronizing Chassis

This application generates a pulse at a user-defined time using a real-time clock and a counter on the PXI-6608. In this application the real-time clock polls the current GPS time, and a counter is configured to count down. The time difference in seconds from the current GPS time and the desired pulse time is loaded into the counter. The counter then counts down events on the source terminal that is connected to the GPS receiver's PPS output. When the counter reaches zero, it generates a pulse on its output line. This is illustrated in the figure below.


Figure 8.

How to Program the PXI-6608 with GPS in LabVIEW

Below are instructions on how to program the PXI-6608 with GPS timing in LabVIEW. Examples of using GPS timing to timestamp an event are installed with LabVIEW 6i. These examples, GPS - Time 1 Hardware Event (NI-TIO).vi and GPS - Time N Software Events(NI-TIO).vi, are installed in \LabVIEW\examples\daq\counter\ni-tio.llb. The GPS Alarm Clock.vi, in the LLB below, is a VI that generates a trigger at a user-specified time.

You can program your counter applications in LabVIEW easier with a new counter palette. This palette includes easy VIs for many counter applications and several utility VIs to make programming counters more efficient. 

Timestamp Event

When programming the PXI-6608 to timestamp an event, there are five main steps:
1. Set Application
2. Change Attributes
3. Program real-time Clock
4. Read Attributes
5. Reset real-time Clock

1. Set Application -- Set the program up to timestamp one hardware event or N software events.
VI Used: Counter Group Config.vi
Task Type: single triggered time measurement (18) for timestamping one hardware event or simple time measurement (17) for timestamping N software events
Counter: clock0 or clock1

2. Change Attributes
a. Set the Gate signal -- If you are timestamping a hardware event, select the line connected to the digital signal to timestamp.
VI Used: Counter Set Attribute.vi
Attribute ID: Gate Selection (2)
Attribute Value Type: PFI n (36)
Attribute Value Number: PFI 7, 15, 23, 31, 39; or RTSI 1, 2, 3, 4, 5, 6
b. Synchronization Line Select -- Select the IRIG-B or PPS GPS signal connected to the PXI-6608.
VI Used: Counter Set Attribute.vi
Attribute ID: Synchronization Line (23)
Attribute Value Type: PFI n (36)
Attribute Value Number: PFI 6, 14, 22, 30, 38; or RTSI 1, 2, 3, 4, 5, 6
c. Synchronization Method -- Select the synchronization method to use.
VI Used: Counter Set Attribute.vi
Attribute ID: Synchronization Method (24)
Attribute Value Type: IRIG-B (43) or Pulse Per Second (43)
d. Initial Seconds (Only for Pulse Per Second method) -- The time to load when you prepare and arm the real-time clock.
VI Used: Counter Set Attribute.vi
Attribute ID: Initial Seconds (25)
Attribute Value: Initial time in seconds

3. Program the Real-Time Clock
After setting the attributes, the real-time clock is prepared and armed. Once the real-time clock is armed, allow two seconds for the real-time clock to be properly synchronized before taking measurements. Refer to the example VI for implementation method.
VI Used: Counter Control.vi
Control Code: Program (0) or Prepare (3), followed by Arm (2)

4. Read Attributes
a. Check if Counter is Armed -- If timestamping a hardware event, check for trigger.
VI Used: Counter Get Attribute.vi
Attribute ID: Armed (4)
Attribute Value: yes (0) or no(0)
If yes (0), go to next step, else check again
b. Snapshot Value -- Lock in the clock value.
VI Used: Counter Control.vi
Control Code: snapshot (8)
c. Read in Seconds -- The seconds value of when the event occurred.
VI Used: Counter Get Attribute.vi
Attribute ID: seconds (19)
Attribute Value: seconds
d. Read in Nanoseconds -- The remaining nanoseconds value of when the event occurred.
VI Used: Counter Get Attribute.vi
Attribute ID: nanoseconds (20)
Attribute Value: nanoseconds

To timestamp another software event, repeat steps 4-b through 4-d.

5. Reset Real-Time Clock
VI Used: Counter Control.vi
Control Code: Reset (1)


Generate Trigger at User-Specified Time

When programming the PXI-6608 to generate a trigger at a user-specified time, there are five main steps:
1. Set Application
2. Change Attributes
3. Configure the Counter
4. Verify the Counter is Synchronized with the real-time Clock
5. Reset real-time Clock & Counter

1. Set Application -- Set up the program to retrieve the current time.
VI Used: Counter Group Config.vi
Task Type: simple time measurement (17)
Counter: clock0 or clock1

2. Change Attributes
a. Synchronization Line Select -- Select the line connected to the GPS signal.
VI Used: Counter Set Attribute.vi
Attribute ID: Synchronization Line (23)
Attribute Value Type: PFI n (36)
Attribute Value Number: PFI 6, 14, 22, 30, 38; or RTSI 0, 1, 2, 3, 4, 5, 6
b. Synchronization Method -- Select the synchronization method to use.
VI Used: Counter Set Attribute.vi
Attribute ID: Synchronization Method (24)
Attribute Value Type: IRIG-B (43) or Pulse Per Second (43) or Low -- No Synchronization (5)
c. Initial Seconds (Only if method is Pulse Per Second) -- The time to load when you prepare and arm the real-time clock.
VI Used: Counter Set Attribute.vi
Attribute ID: Initial Seconds (25)
Attribute Value: Initial time in seconds

3. Configure the Counter
a. Set Counter Operation -- Set up the counter to count events from the PPS timing signal.
VI Used: Group Config.vi
Task Type: Simple Event Counting (0)
b. Set Source to PPS GPS Line -- Configure the source of the counter to the correct PFI line on the board.
VI Used: Counter Set Attribute.vi
Attribute ID: Source Selection (0)
Attribute Value Type: PFI n (36)
Attribute Value Number: PFI number
c. Configure Gate Polarity -- Set the gate polarity.
VI Used: Counter Set Attribute.vi
Attribute ID: Gate Polarity (3)
Attribute Value Type: Low (5)
d. Set Output Mode to Pulse -- Enable the counter to output a pulse when the terminal count has been reached.
VI Used: Counter Set Attribute.vi
Attribute ID: Output Mode (4)
Attribute Value Type: Pulse (26)
e. Set Counter to Count Down -- Set the counter to count down.
VI Used: Counter Set Attribute.vi
Attribute ID: Up Down (10)
Attribute Value Type: Count Down (22)

4. Verify the Counter is Synchronized with the Real-Time Clock
a. Read Seconds Value From real-time Clock
Snapshot Value -- Lock in the clock value so it can be read using the following commands.
VI Used: Counter Control.vi
Control Code: snapshot (8)
Read in Seconds -- The seconds value of when the event occurred.
VI Used: Counter Get Attribute.vi
Attribute ID: seconds (19)
Attribute Value: seconds
b. Set Initial Count on Counter -- The value received from the real-time clock minus an offset
VI Used: Counter Set Attribute.vi
Attribute ID: Initial Count (13)
Attribute Value Number: number of seconds until you want event to occur
c. Program Counter -- Arm the counter.
VI Used: Counter Control.vi
Control Code: program (0)
d. Read Seconds From real-time Clock -- Verify the application is synchronized.
Same as 4-a
e. If the times from 4-a and 4-d are equal then everything is synchronized. If they do not equal then repeat step 4.


5. Check to see if terminal count has been reached; if it has then pulse has been generated
If the terminal count has been reached then reset the counter and real-time clock, if it has not, check again.
Reset real-time Clock and Counter
VI Used:Counter Control.vi
Control Code: Reset (1)

How to Program the PXI-6608 with GPS in CVI, Visual Basic or Visual C++

Below are instructions on how to program the PXI-6608 with GPS timing in CVI, Visual Basic or Visual C++. Examples of using GPS timing to timestamp an event are installed with CVI or NI-DAQ. They are located in the \examples folder, and their names are TIOGPStime1hardwareEvent and TIOGPStimeNsoftwareEvents. Below is an example of generating a trigger at a user-specified time.

Timestamp Event


When programming the PXI-6608 to timestamp an event there are five main steps:
1. Set Application
2. Change Attributes
3. Program real-time Clock
4. Read Attributes
5. Reset real-time Clock

1. Set Application -- Set the program up to timestamp one hardware event or N software events.
Timestamp 1 Hardware Event
GPCTR_Set_Application (device, counter, ND_SINGLE_TRIGGERED_TIME_MSR)
device = Device Number
counter = ND_CLOCK_0 or ND_CLOCK_1
Timestamp N Software Events
GPCTR_Set_Application (device, counter, ND_SIMPLE_TIME_MSR)
device = Device Number
counter = ND_CLOCK_0 or ND_CLOCK_1

2. Change Attributes
a. Set the Gate signal -- The line connected to the digital signal you wish to timestamp, if you are timestamping a hardware event.
GPCTR_Change_Parameter (device, counter, ND_GATE, paramValue )
paramValue: ND_PFI_x (x = 7, 15, 23, 31, 39); or ND_RTSI_x (x = 0, 1, 2, 3, 4, 5, 6)
b. Synchronization Line Select -- Select the line connected to the GPS signal.
GPCTR_Change_Parameter (device, counter, ND_SYNCHRONIZATION_LINE, paramValue )
paramValue: ND_PFI_x (x = 6, 14, 22, 30, 38); or ND_RTSI_x (x = 0, 1, 2, 3, 4, 5, 6)
c. Synchronization Method -- Select the synchronization method to use
GPCTR_Change_Parameter (device, counter, ND_SYNCHRONIZATION_METHOD, paramValue )
paramValue: ND_IRIG_B, ND_PULSE_PER_SECOND, ND_LOW
d. Initial Seconds (Only needed if method is Pulse Per Second) --The time that is loaded when you prepare and arm the real-time clock.
GPCTR_Change_Parameter (device, counter, ND_INITIAL_SECONDS_ENABLE, ND_YES )
GPCTR_Change_Parameter (device, counter, ND_INITIAL_SECONDS, time in seconds )

3. Program the Real-Time Clock
After setting the attributes, the real-time clock should be prepared and armed. Once the real-time clock is armed, allow two seconds before taking measurements for the real-time clock to be properly synchronized.
GPCTR_Control (device, counter, action )
action: ND_PROGRAM or ND_PREPARE followed by ND_ARM

4. Read Attributes
a. Check if Counter is Armed -- Determine if the trigger has occurred when timestamping a hardware event.
GPCTR_Watch (device, counter, ND_ARMED, entityValue returned )
entityValue returned: ND_YES or ND_NO
If yes, go to next step, else check again
b. Snapshot Value -- Lock in the clock value so it can be read using the following two commands.
GPCTR_Control (device, counter, ND_SNAPSHOT )
c. Read in Seconds -- The seconds value of when the event occurred.
GPCTR_Watch (device, counter, ND_SECONDS, time in seconds )
d. Read in Nanoseconds -- The remaining nanoseconds value of when the event occurred.
GPCTR_Watch (device, counter, ND_NANO_SECONDS, time in nanoseconds )

To timestamp another software event, repeat steps 4-b through 4-d.

5. Reset Real-Time Clock
GPCTR_Control ( device, counter, ND_RESET)

Generate Trigger at User-Specified Time


When programming the PXI-6608 to generate a trigger at a user-specified time, there are five main steps:
1. Set Application
2. Change Attributes
3. Configure the Counter
4. Verify the Counter is Synchronized with the real-time Clock
5. Reset real-time Clock & Counter

1. Set Application -- Set up the program to retrieve the current time
GPCTR_Set_Application (device, counter, ND_SIMPLE_TIME_MSR)
device = Device Number
counter = ND_CLOCK_0 or ND_CLOCK_1

2. Change Attributes
a. Synchronization Line Select -- Select the line connected to the GPS signal.
GPCTR_Change_Parameter (device, counter, ND_SYNCHRONIZATION_LINE, paramValue )
paramValue: ND_PFI_x (x = 6, 14, 22, 30, 38); or ND_RTSI_x (x = 0, 1, 2, 3, 4, 5, 6)
b. Synchronization Method -- Select the synchronization method to use
GPCTR_Change_Parameter (device, counter, ND_SYNCHRONIZATION_METHOD, paramValue )
paramValue: ND_IRIG_B, ND_PULSE_PER_SECOND, ND_LOW
c. Initial Seconds (Only needed if method is Pulse Per Second) --The time that is loaded when you prepare and arm the real-time clock.
GPCTR_Change_Parameter (device, counter, ND_INITIAL_SECONDS_ENABLE, ND_YES )
GPCTR_Change_Parameter (device, counter, ND_INITIAL_SECONDS, time in seconds )

3. Configure a Counter
a. Set Counter Operation -- Set up the counter to count events from the PPS timing signal.
GPCTR_Set_Application (device, counter, ND_SIMPLE_EVENT_CNT)
b. Set Source to PPS GPS Line -- Configure the source of the counter to the correct PFI line on the board.
GPCTR_Change_Parameter (device, counter, ND_SOURCE, paramValue)
c. Configure Gate Polarity -- Set the gate polarity.
GPCTR_Change_Parameter (device, counter, ND_GATE_POLARITY, ND_NEGATIVE)
d. Set Output Mode to Pulse -- Enable the counter to output a pulse when the terminal count has been reached.
GPCTR_Change_Parameter (device, counter, ND_OUTPUT_MODE, ND_PULSE)
e. Set Counter to Count Down -- Set the counter to count down.
GPCTR_Change_Parameter (device, counter, ND_UP_DOWN, ND_DOWN)
f. Enable Counter Output -- Set the counter up to output a pulse
Select_Signal(device, ND_GPCTRx_OUTPUT, ND_GPCTRx_OUTPUT, ND_LOW_TO_HIGH), x is the counter number

4. Verify the Counter is Programmed Correctly
a. Read seconds value from real-time clock
GPCTR_Control (device, counter, ND_SNAPSHOT )
GPCTR_Watch (device, counter, ND_SECONDS, time in seconds )
b. Set Initial Count on Counter -- The value received from the real-time clock minus an offset
GPCTR_Change_Parameter (device, counter, ND_INITIAL_COUNT, paramValue)
paramValue is the number of seconds until you want the trigger to occur
c. Program Counter -- Arm the counter.
GPCTR_Control ( device, counter, ND_PROGRAM)
d. Read in second from real-time clock to verify counter was armed in time
Same as step 4-a
e. If the times from 4-a and 4-d are equal, the counter is synchronized. If they do not equal, repeat step 4.

5. Reset real-time clock and counter after terminal count has been reached
The terminal count occurs when the trigger is generated. If TC has occurred, reset counter and real-time clock, if not, check again.
GPCTR_Control ( device, counter, ND_RESET)

Was this information helpful?

Yes

No