From 42c1f429b56d0835afe5516b10aaae0f23fe96a7 Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Tue, 7 Jul 2020 10:16:38 +0000 Subject: [PATCH] test(bkgpslog):Add debug messages --- exec/bkgpslog | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/exec/bkgpslog b/exec/bkgpslog index 0dd7f5d..99238ed 100755 --- a/exec/bkgpslog +++ b/exec/bkgpslog @@ -950,8 +950,8 @@ magicBufferSleepPID() { ### PID Control factors K_P=1; # Gain for compensating buffer round lag - T_I="$((4*BUFFER_TTL_NS))"; # Consider this number of past nanoseconds to eliminate error - T_D="$((1*BUFFER_TTL_NS))"; # Predict value this number of nanoseconds into the future + T_I="$(((4)*BUFFER_TTL_NS/(1)))"; # Consider this number of past nanoseconds to eliminate error + T_D="$(((1)*BUFFER_TTL_NS/(1)))"; # Predict value this number of nanoseconds into the future # Calculate Error, errNS, in nanoseconds ## Get current time @@ -982,6 +982,11 @@ magicBufferSleepPID() { # Calculate errRate in nanoseconds per nanosecond errRate="$(( errNS / BUFFER_TTL_NS ))" && vbm "errRate:$errRate"; # errRatex10e3="$(( ( errNSx10e3 ) / BUFFER_TTL_NS ))" && vbm "errRatex10e3:$errRatex10e3"; + + # Debug + vbm "errNS :$errNS"; + vbm "errResetTerm:$((errReset/T_I))"; + vbm "errRateTerm :$((errRate*T_D))"; # Calculate PID control signal ## ADJ = K_P * (errNS + errReset/T_I + errRate*T_D) -- 2.30.2