From 7c9e390acb20d03f73d8f9a10a9b273dba8fc611 Mon Sep 17 00:00:00 2001 From: Max McEvoy Date: Tue, 13 Jan 2026 14:08:23 -0800 Subject: [PATCH 1/2] Added module-level documentation for PID controller --- PID.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/PID.c b/PID.c index 877c32d..3c844b9 100644 --- a/PID.c +++ b/PID.c @@ -1,3 +1,13 @@ +/* + * PID Controller implementation + * + * Features: + * - Proportional, Integral, Derivative control + * - Anti-windup via integrator clamping + * - Band-limited differentiator (derivative on measurement) + * + * Suitable for embedded and real-time systems. + */ #include "PID.h" void PIDController_Init(PIDController *pid) { From a6df65b3d0a3d9703b88ecb25980995c90a17dda Mon Sep 17 00:00:00 2001 From: Max McEvoy Date: Tue, 13 Jan 2026 14:27:51 -0800 Subject: [PATCH 2/2] Added simple pointer check to PIDController_Init --- PID.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PID.c b/PID.c index 3c844b9..4f41e6b 100644 --- a/PID.c +++ b/PID.c @@ -12,6 +12,8 @@ void PIDController_Init(PIDController *pid) { + if (pid == 0) return; + /* Clear controller variables */ pid->integrator = 0.0f; pid->prevError = 0.0f;