Synchronizing PPS signal to NMEA UTC values -- which modules

Does anyone know whether the San Jose FV-M8 module’s 1-PPS signal is well-synchronized to the UTC values output in the NMEA sentences? I need to match up 5 Hz readings of the GPS to ~100 Hz samples of an Inertial Measurement unit. (It’s a UAV application.) Because of the uncertainty in the time it takes the GPS’s info to transmit over the serial lines (and the unknown latency in the device, between the time the fix was obtained and the NMEA message sent), I need some way to synchronize the GPS to the IMU. I could use the 1-PPS signal to trigger readings of the IMU, but that would only help if I knew that the PPS signal corresponded to, say, a NMEA UTC value of xxx.000 seconds.

Does anyone know whether any of the other GPS modules on this site have PPS signals synchronized to the NMEA values? Thanks if you’ve any info.

(Well, I found out the answer to my own question – all I had to do was dig through the data sheets. Just in case anybody is interested in a sort-of answer, all of the modules based on the SiRF Star III seem to have their 1PPS pulses synchronized to the UTC xxx.000 times.)

Just in case this is useful to anyone out there: I looked at the 1PPS outputs from a SiRF III and a SANAV FV-M8 on an oscilloscope, and the SANAV pulse reliably trails the SiRF III pulse by 0.5 us. So the SANAV’s output is well synchronized to the UTC 1-second epoch.

Hi dctowery,

Can you share info how you synchronised the GPS with the IMU?

Thanks!

The IMU I’m using outputs a pulse on one of its digital i/o lines whenever it samples. I tie that line to one external interrupt pin in my microcontroller, and the GPS 1PPS line to another. I use a free-running timer in the microcontroller as a “wall clock”. The interrupt handlers record the wall-clock time each time an pulse (IMU or 1PPPS) is received. So, for each IMU sample at 120 Hz, the microcontroller always “knows” how much time has elapsed since the last 1PPS, to within the precision of the wall clock. The wall clock has some jitter, of course, but over the one second that elapses between 1 PPS pulses, it won’t accumulate much error – not significant for my purposes.

So that gets me the IMU’s sampling instants relative to the 1PPS train. I have some start-up code that monitors the GPS packets for their timestamps. The first packet with a timestamp that arrives after a 1PPS pulse was captured by the interrupt handler lets me sync the 1PPS pulse train to UTC – that is, I know the UTC that corresponded to that 1PPS pulse (it’s the value in the packet’s UTC field) and I know the wall-clock time that corresponds to that pulse (it’s the most recently captured arrival time). I also have to look at the inter-pulse arrival times of the 1PPS pulses to make sure that pulses haven’t been missed or dropped (say, because of a temporary link loss with the satellites), but the 1-second resolution on 1PPS is coarse enough that I can detect such missing pulses with the wall clock.

So I’m able to timestamp each IMU sample with UTC values, which is enough for my purposes.

Thanks :slight_smile: