From 0609877f9e13764d8d31d9ed361a984dc6613138 Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Fri, 15 May 2026 14:02:49 +0200 Subject: [PATCH] remove negative windup --- fw/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fw/main.c b/fw/main.c index a75947c..a154b91 100644 --- a/fw/main.c +++ b/fw/main.c @@ -391,7 +391,7 @@ uint16_t pid(int16_t delta, int16_t max_duty) // TODO: use a back calculation anti windup strategy // only integrate if the output is less then max - if (e < i2fp(100)) { + if (e < i2fp(100) && e > 0) { intgrt = fp_add(intgrt, err_i); }