jimy-byerley / etherage

An ethercat master library written in pure rust, the closest possible to the ethercat nature
https://docs.rs/etherage
13 stars 1 forks source link

Add distributed clock #7

Closed CendreQuasar540 closed 1 year ago

CendreQuasar540 commented 1 year ago

Add method/class to enforce clock synchronization between master and slave during initialization process.

jimy-byerley commented 1 year ago

The clock implementation is now precise at ~50µs

We will try to merge it in the master branch, and see what to improve afterward

improvements to investigate:

jimy-byerley commented 1 year ago

Some of our problems are coming from the tokio timers tokio::time::Interval, according to this issue, their implementation is not precise below 1ms, and we need 1µs Let's use tokio-timerfd instead, experimentation shows that it is precise at least at 10µs

before: image

after:
image