Re: [Linuxptp-devel] [PATCH RFC 0/6] Improve accuracy with software timestamping
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
|
From: Keller, J. E <jac...@in...> - 2015-02-13 16:08:34
|
On Fri, 2015-02-13 at 13:56 +0100, Miroslav Lichvar wrote: > These patches should improve the synchronization of the clock with > larger jitters, e.g. with software timestamping, wireless networks, > etc. > > The idea is to give smaller weights to samples where the sync and/or > delay messages were delayed significantly in the network and possibly > include a large error. The sample offset is based directly on the > sample delay instead of the long-term filtered delay and the sample > weight is set to the ratio of the sample delay to the long-term > average. E.g. if the measured delay is normally 1 ms and the new > sample has 10ms delay, the sample weight (and the clock adjustment > that will be made) will be 10 times smaller. > This seems like a good idea, to help in the case where spiked delays could cause swings which take a while to settle out. A bit like dropping the outlying parameters. > This "weighting" mode is enabled only when the sync interval is equal > or longer than the delay/pdelay request interval to not reuse the > delay timestamps too many times and keep the interval between sample > times stable. In some tests I saw an improvement also with 2:1 > sync/delay rate and maybe even higher, but it would probably be tricky > to implement if it should be enabled automatically, possibly requiring > some cooperation with the delay filter. > > In my testing I did so far it seems to work nicely. With the linreg > servo there should be no regression. With PI there can be worse > performance observed when the constants are not configured properly, > that is when the servo is too slow to track the frequency changes and > weighted samples make it even slower. Currently, the weighting mode is > enabled only when ki <= 0.01 to include the default SW timestamping > constant and not the HW constant. It could be always enabled or I > could add an option to override it if you think it would be useful, > I'm not sure. > > What do you think? Does this make sense? > I like the idea, but I confess you do know more about the clock than I do. Regards, Jake > > Miroslav Lichvar (6): > clock: save delay timestamps and correction. > clock: split out calculation of sample delay. > servo: add support for weighted samples. > clock: set sample weight. > linreg: use sample weight. > pi: use sample weight. > > clock.c | 85 ++++++++++++++++++++++++++++++++++++++++++++------------- > clock.h | 10 +++++-- > linreg.c | 64 +++++++++++++++++++++++++++++-------------- > ntpshm.c | 1 + > phc2sys.c | 2 +- > pi.c | 20 ++++++++++++-- > port.c | 10 +++++-- > servo.c | 11 +++++++- > servo.h | 10 +++++++ > servo_private.h | 4 ++- > 10 files changed, 169 insertions(+), 48 deletions(-) > |