I have a raspberry pi 4 (companion computer) connected to a kore carrier board running ardupilot.
RPI ↔ flight controller
I want to synchronize between the machines.
I have looked at the MAVLINK Time Synchronization Protocol v2 (using TIMESYNC message) - Time Synchronization Protocol v2 | MAVLink Guide
but i can’t understand from the given graph how precise this synchronization method is.
my goal is to have precision of the order of microseconds.
Could you please help me understand the precision of this protocol?
MAVLink time sync cannot achieve microsecond precision. ArduPilot estimates the transport jitter, but we are estimating jitter in milliseconds, not microseconds.
To achieve microsecond time sync, you would need to add PTP. We also can use PPS with ublox in ArduPilot, however I don’t know if you will get microsecond precision.
Thank you for your reply.
Regarding PTP, I have looked through the posts you linked, but I couldn’t find any guidance of how to achieve PTP. Is it even possible when there is no ETHERNET connection on the flight controller?
There might be a different method to achieve synchronization and I would like to have your input if it is okay.
I thought about using the AUXOUT in order to send a camera Trigger to a GPIO on the RPI and use this to synchronize the machines. The TRIG log will tell me when the pulse was sent and the RPI will know when it was received.
Some flight controllers have ethernet such as CubeRed or Holybro 6X. There is also serial to ethernet adapters. I’m not familiar with PTP, however I have some contacts at Trimble that can help. If you are interested in developing PTP support for ArduPilot, I can get you in touch for more details.
Just FYI, we uses LWIP in the network stack, so you can review something like this:
Using a GPIO for a trigger is essentially the same as PPS, so consider just expanding the PPS support. Many other people would benefit from sub-millisecond. PPS should also achieve sub millisecond accuracy.