I read a research paper which proposes an algorithm to synchronize sensors in a way that is independent of the sensors.

Beginning with the simplified version which assumes no drift between the sensor p and the host q clocks and assumes p does not send a time with its messages but consistently sends measurements at a rate of 75 Hz for example.

How do I obtain multiple measurements of p's and q's clock based on some starting event?

More specifically, let's say that p is an Ultrasonic Range Sensor, and q is a Raspberry-Pi running Linux.

Assuming p is a higher-end sensor with an ADC and can provide the distance values over SPI but without a timestamp; I realize that's not how these common sensors are but let's simplify things.

I also realize the SPI frequency of the Rpi is approx 3.5 kHz to 125 MHz, but let's again say we set the SPI clock such that we know p is generating measurements at 75 Hz.

Having these equations

enter image description here enter image description here enter image description here

where A is the constant offset between clocks, t is the time on the Rpi at which the sensor observed the data, and e is the latency by which the Rpi processes the message.

We cannot observe A or e directly but we know p and q.

If I say that q1 is the epoch time on the Rpi when I start the SPI communication to read one measurement, is the value of p1 simply

q1 + (1/75)

The author says this method is not useful and is illustrative of the basic idea of the approach, and having written it out like this does make that clear. But I want to verify I've understood it before moving on to the real algorithm.

Let's finally say I am using a common sensor that I have connected to an STM32 blue pill which the Rpi uses SPI to read the measurement, how does that change p1?

  • \$\begingroup\$ Why don't you just poll the sensors from the host and collect data on demand like most systems do? \$\endgroup\$ – Andy aka Jun 30 '20 at 7:41
  • \$\begingroup\$ Because you may have several of these sensors on the same robot plus one or more cameras, plus a GPS, etc, etc. All those must be synchronized for the data to be useful to localization, perception, object avoidance. The problem is exacerbated when the robot is moving or turning even at modest speeds \$\endgroup\$ – Sam Hammamy Jun 30 '20 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.