Re: [Linuxptp-devel] Optimal P, I constants
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: Miroslav L. <mli...@re...> - 2013-06-28 08:51:13
|
On Wed, May 29, 2013 at 11:53:42AM +0200, Miroslav Lichvar wrote: > On Tue, May 28, 2013 at 07:16:15PM +0200, Richard Cochran wrote: > > # method B at 2^-4 > > # pi_proportional_const 3.2 > > # pi_integral_const 0.05 > > Hm, doesn't the method B give at 2^-4 kp=0.2 and ki=0.8? Well, it doesn't. It seems I was using a wrong formula for the method B the whole time. I had not noticed it was written with multiplication instead of division. The previous comparisons I made are invalid, I'm sorry. When I use the correct (hopefully) formula, the difference is much less dramatic. This comparison is with the original method A (with jw set correctly) vs the original method B (which doesn't have a jw parameter). u\jw | 1e0 | 1e1 | 1e2 | 1e3 | 2^-7 | -1 -2 | -4 -13 | -10 -23 | -14 -33 | 2^-6 | -2 -1 | -4 -11 | -8 -22 | -13 -31 | 2^-5 | -1 0 | -3 -10 | -8 -20 | -14 -30 | 2^-4 | -2 2 | -3 -9 | -8 -19 | -13 -29 | 2^-3 | -2 4 | -2 -8 | -7 -18 | -12 -28 | 2^-2 | -2 5 | -2 -7 | -7 -18 | -12 -28 | 2^-1 | -2 4 | -2 -6 | -7 -17 | -12 -27 | 2^+0 | -1 0 | -2 -5 | -7 -17 | -13 -28 | 2^+1 | 0 0 | -0 -1 | -6 -13 | -11 -24 | 2^+2 | 1 0 | 0 -1 | -3 -8 | -9 -20 | 2^+3 | 1 0 | 0 0 | -1 -3 | -6 -15 | 2^+4 | 0 0 | 1 0 | 0 -1 | -4 -10 | 2^+5 | 0 0 | 1 0 | 0 -0 | -1 -4 | 2^+6 | 0 0 | 1 0 | 1 0 | 0 -1 | 2^+7 | 1 0 | 0 0 | 1 0 | 0 -0 | Now, as I'm writing the patch for the extended servo configuration, I'm looking for some defaults I could put into it. The most imporant difference between the method A and B is in the exponents. If I set the scale and the limiting coefficients identically and in such a way that it gives the same defaults with 1 sec interval as the current HW time stamping default, this is what I get. method A': kp = min(0.7 * u^-0.3, 0.7/u) ki = min(0.3 * u^0.4, 0.3/u) method B': kp = min(0.7 * u^-0.5, 0.7/u) ki = min(0.3 * u^0.5, 0.3/u) u\jw | 1e0 | 1e1 | 1e2 | 1e3 | 2^-7 | -0 -8 | -3 -8 | -3 -8 | -2 -8 | 2^-6 | -0 -7 | -2 -7 | -2 -7 | -2 -7 | 2^-5 | 0 -6 | -2 -6 | -1 -6 | -1 -6 | 2^-4 | 0 -4 | -1 -5 | -1 -5 | -1 -5 | 2^-3 | 0 -3 | -1 -3 | -1 -3 | -1 -3 | 2^-2 | 1 -2 | -0 -2 | -0 -2 | -0 -2 | 2^-1 | 0 -1 | -0 -1 | -0 -1 | -0 -1 | 2^+0 | -0 -0 | -0 -0 | -0 -0 | -0 0 | 2^+1 | 0 0 | 0 -0 | 0 0 | 0 0 | 2^+2 | -0 -0 | 0 0 | -0 0 | -0 0 | 2^+3 | 0 -0 | -0 -0 | 0 0 | 0 0 | 2^+4 | -0 0 | -0 0 | 0 0 | 0 0 | 2^+5 | -0 -0 | 0 0 | -0 0 | 0 0 | 2^+6 | 0 0 | -0 0 | -0 -0 | -0 -0 | 2^+7 | -0 0 | -0 -0 | -0 -0 | -0 -0 | The difference is small, but it seems the -0.3 and 0.4 exponents are slighly better in minimizing both time error and frequency error. The limiting coefficients could be increased to allow more aggresive setting with longer intervals and reduce the error, but I think we can focus on that later. Thanks, -- Miroslav Lichvar |