Solutions for synchronization with GPS clock

149 views
Skip to first unread message

Shijie Lin

unread,
Nov 7, 2022, 9:22:11 PM11/7/22
to davis-users
Dear team,

I would like to syn my DVXplore sensor to the GPS clock using the PPS signal and GPS text coming from serial port, I would like to know did the inivation has the best practice about how to syn it? The best solution for me is to use the external trigger signal (PPS) and connect to the -sync in- port, GND also. And every time I read a PPS signal as a special events, I read the GPS time from port and then reset the system clock. But it seems need me to modify and recompile the basic modules of event sensor? Did you have any suggestion that can save time for the development?

best,
Shijie Lin
HKU

Luca Longinotti

unread,
Nov 9, 2022, 11:05:30 AM11/9/22
to davis...@googlegroups.com
Hi Shijie Lin,

your approach seems correct, sending the PPS signal into the SYNC_IN port on the SIGNAL pin and using external trigger detection should work.
Documentation on that feature is available here:
​You need both GND and VDD to always be present on the SYNC_IN port!
If you then need to read GPS time on each trigger event, you will have to modify DV code, yes. The camera modules in dv-runtime/modules/cameras/ do add a time-offset to the timestamp from the device, to get an absolute time, I suppose that would be the right place to update this time-offset with GPS time somehow.
Every time you receive a trigger event you could read the GPS time and update the correspondence between device-timestamp and GPS time and then use that somehow to generate a final timestamp for all data.

Hope this helps, have a nice day!

Shijie Lin

unread,
Nov 19, 2022, 12:08:51 AM11/19/22
to davis-users
Hi Luca,
Thanks for the email.
I follow you instruction and revise the dv module. I use the PPS signal coming from the GPS module as well as the GPRMC timing to sync. Every time I received a special signal, I update the time offset tsOffset ( similar to the function of timestep reset). Everything works well, except for a small problem. It seems every time I update the  tsOffset, it may cause some events to be out of order (the time not mono increasing, because its been updated to a new offset). Then the Accumulator gives following error:
Accumulator moduleRun(): 'std::out_of_range :: Tried adding event store to store out of order. Ignoring packet.', disabling module.
Do you have any suggestion to this problem?

Thanks again for the help.

Shijie

Luca Longinotti

unread,
Nov 25, 2022, 11:27:27 AM11/25/22
to davis...@googlegroups.com
Hello, sorry for the delay in replying!

Time has to be monotonically increasing, so you have to make sure changes to tsOffset are always positive, you always have to jump forward in time.
If you cannot guarantee this, if sometimes tsOffset gets a bit smaller, you might have to drop some data in the affected time window. Or manually shift its timestamp forward a bit.

Hope this helps, have a nice week!
-- 
Luca Longinotti (llongi)

Head of Embedded Platforms
iniVation AG - https://inivation.com/
Zurich, Switzerland
Office: +41 44 500 32 14

Shijie Lin

unread,
Nov 25, 2022, 9:20:00 PM11/25/22
to davis-users
Thank you Luca,
Very helpful suggestion, which solves my problem indeed.
Thanks again,
Lin
Reply all
Reply to author
Forward
0 new messages