From 3b6ce7565c7c161f384fef0b137d6b474a086cc0 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Sun, 4 Jun 2017 13:21:07 -0400 Subject: [PATCH] change of PID period to reset PID --- firmware/controllers/math/pid.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/firmware/controllers/math/pid.cpp b/firmware/controllers/math/pid.cpp index bcf553e52d..d62b68f551 100644 --- a/firmware/controllers/math/pid.cpp +++ b/firmware/controllers/math/pid.cpp @@ -27,8 +27,11 @@ void Pid::init(pid_s *pid) { } bool Pid::isSame(pid_s *pid) { - return this->pid->dFactor == pid->dFactor && this->pid->iFactor == pid->iFactor && - this->pid->offset == pid->offset && this->pid->pFactor == pid->pFactor; + return this->pid->pFactor == pid->pFactor + && this->pid->iFactor == pid->iFactor + && this->pid->dFactor == pid->dFactor + && this->pid->offset == pid->offset + && this->pid->period == pid->period; } float Pid::getValue(float target, float input) {