From f3cd0fc6756098fb99f954a8a8da46db9c35d0ab Mon Sep 17 00:00:00 2001 From: hartytp Date: Tue, 6 Oct 2020 15:33:18 +0100 Subject: [PATCH] wrpll.filters: the helper clipping threshold is currently way too low. Move clipping after the bitshift to increase a bit. TODO: think about this and pick a sensible threshold (and also think about integrator anti windup) --- artiq/gateware/drtio/wrpll/filters.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artiq/gateware/drtio/wrpll/filters.py b/artiq/gateware/drtio/wrpll/filters.py index 41fb06291..470f17bf3 100644 --- a/artiq/gateware/drtio/wrpll/filters.py +++ b/artiq/gateware/drtio/wrpll/filters.py @@ -32,9 +32,9 @@ def helper(tag_diff): helper_xn2 = helper_xn1 helper_xn1 = helper_xn0 - helper_yn0 = min(helper_yn0, helper_yr) - helper_yn0 = max(helper_yn0, 0 - helper_yr) helper_out = 268435456*helper_yn0 >> 44 + helper_out = min(helper_out, helper_yr) + helper_out = max(helper_out, 0 - helper_yr) return helper_out