Re: [Linuxptp-devel] [PATCH v1] pi: Fix drift history when entering SERVO_LOCKED state

2023-08-22 Thread Maciek Machnikowski
On 8/22/2023 1:50 PM, Miroslav Lichvar wrote: > On Tue, Aug 22, 2023 at 12:34:35PM +0200, Maciek Machnikowski wrote: >> root@equinox:[~]#: phc_ctl ens6f0np0 set freq 5000 >> root@equinox:[~]#: sudo ptp4l -m -i ens6f0np0 -2 -s > >> ptp4l[248.614]: master offset -301008874 s0 freq -5000

Re: [Linuxptp-devel] [PATCH v1] pi: Fix drift history when entering SERVO_LOCKED state

2023-08-22 Thread Miroslav Lichvar
On Tue, Aug 22, 2023 at 12:34:35PM +0200, Maciek Machnikowski wrote: > root@equinox:[~]#: phc_ctl ens6f0np0 set freq 5000 > root@equinox:[~]#: sudo ptp4l -m -i ens6f0np0 -2 -s > ptp4l[248.614]: master offset -301008874 s0 freq -5000 path delay > 1136508 > ptp4l[249.615]: master offset

Re: [Linuxptp-devel] [PATCH v1] pi: Fix drift history when entering SERVO_LOCKED state

2023-08-22 Thread Maciek Machnikowski
On 8/22/2023 11:24 AM, Miroslav Lichvar wrote: > On Mon, Aug 21, 2023 at 07:02:55PM +0200, Maciek Machnikowski wrote: >> On 8/21/2023 2:04 PM, Miroslav Lichvar wrote: >>> s->drift is the drift of the uncompensated clock. It's not supposed to be >>> scaled by anything. >> If that's the intended

Re: [Linuxptp-devel] [PATCH v1] pi: Fix drift history when entering SERVO_LOCKED state

2023-08-22 Thread Miroslav Lichvar
On Mon, Aug 21, 2023 at 07:02:55PM +0200, Maciek Machnikowski wrote: > On 8/21/2023 2:04 PM, Miroslav Lichvar wrote: > > s->drift is the drift of the uncompensated clock. It's not supposed to be > > scaled by anything. > If that's the intended use - then the line 147: > s->drift += ki_term; > >

Re: [Linuxptp-devel] [PATCH v1] pi: Fix drift history when entering SERVO_LOCKED state

2023-08-21 Thread Maciek Machnikowski
On 8/21/2023 2:04 PM, Miroslav Lichvar wrote: > On Fri, Aug 18, 2023 at 12:31:47PM +0200, Maciek Machnikowski wrote: >> Current implementation saves s->drift as an offset between current clock >> frequency and the remote clock frequency calculated on first two samples. >> >> Locked state of the

Re: [Linuxptp-devel] [PATCH v1] pi: Fix drift history when entering SERVO_LOCKED state

2023-08-21 Thread Miroslav Lichvar
On Fri, Aug 18, 2023 at 12:31:47PM +0200, Maciek Machnikowski wrote: > Current implementation saves s->drift as an offset between current clock > frequency and the remote clock frequency calculated on first two samples. > > Locked state of the PI servo assumes the s->drift holds the history > of

[Linuxptp-devel] [PATCH v1] pi: Fix drift history when entering SERVO_LOCKED state

2023-08-18 Thread Maciek Machnikowski
Current implementation saves s->drift as an offset between current clock frequency and the remote clock frequency calculated on first two samples. Locked state of the PI servo assumes the s->drift holds the history of clock frequency difference scaled by s->ki * weight. As a result the lock