Skip to content

Piksi PPS Sync

Rik Baehnemann edited this page Sep 16, 2019 · 2 revisions

Timestamping sensor messages on arrival introduces jitter (and transmission and buffering delay) from the communication interface (USB, TCP, Serial). The package piksi_pps_sync address this problem by timestamping the GPS data with the correct GPS timestamp and synchronizing the (x86) host against the PPS clock.

Configuration

To activate GPS time stamping set the flag in the driver settings.

Hardware Setup

The Piksi is delivering its SBP messages through TCP to the ROS driver. UART 1 publishes the NMEA GPZDA message at 1Hz to get absolute time on the computer. The PPS is enabled with default settings and goes into a GPIO port of the x86.
For validation we record an additional IMU on a microcontroller connected to the host computer where the hardware timestamps get translated via cuckoo time translator.

System Diagram

Piksi time sync hardware setup

Piksi UART 1 Settings

Piksi UART 1 NMEA settings

Piksi NMEA Settings

NMEA message settings

Software Setup

On the host machine we install a custom PPS driver to expose the PPS signal to Chrony. The NMEA is read out through GPSD. Chrony is configured to use the PPS as a local reference clock.

NOTE: On an ARM host computer you can easily configure the default PPS-GPIO module to readout the PPS signal.

Upboard Status Indication

One-liner that turns on green LED on UP board if clock error is below 999ns.

while true; do var=$(chronyc sources -v | grep PPS0 | sed 's/.*+\/- \(.*\)ns/\1/'); var_low=0; var_high=999; if [ $var -gt $var_low -a $var -lt $var_high ]; then echo 1 > /sys/class/leds/upboard\:green\:/brightness; else echo 0 > /sys/class/leds/upboard\:green\:/brightness; fi; sleep 1; done

Results

We validate synchronization of the host against the GPS clock using chronyd sources -v. After some convergence time one can observe nanoseconds offset between the PPS and the host clock.

To show the improvement over the existing time stamp on arrival (rospy.Time.now()) we cross validate the angular velocity of the Piksi IMU with the external IMU described above. Here the system was rotated on a chair.

Not synchronizing against PPS

2019-05-22-09-47-12_no_sync

Clear buffering delays in the time stamps

2019-05-22-09-47-12 bag_no_sync_buffering

Synchronizing against PPS

2019-05-22-11-54-47_sync

No more buffering delays in the time stamps

2019-05-22-11-54-47_sync_no_buffering

First of all we observe that the synchronized messages still have a delay of 10-15 ms. This may be due to internal filtering of the Piksi Bosch IMU, transmission delays or translation delay of the external ADIS IMU. But very importantly there is no buffering delay / jitter on the data anymore!