From 55aac032019eb07b6840ac0be8cd3fb17232e26e Mon Sep 17 00:00:00 2001 From: rusefi Date: Thu, 22 Nov 2018 23:54:11 -0500 Subject: [PATCH] PID auto tune unit test --- firmware/controllers/electronic_throttle.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/firmware/controllers/electronic_throttle.cpp b/firmware/controllers/electronic_throttle.cpp index b8505a0af5..90a3ac461e 100644 --- a/firmware/controllers/electronic_throttle.cpp +++ b/firmware/controllers/electronic_throttle.cpp @@ -122,7 +122,7 @@ static msg_t etbThread(void *arg) { if (engine->etbAutoTune) { autoTune.input = actualThrottlePosition; - autoTune.Runtime(&logger); + bool result = autoTune.Runtime(&logger); tuneWorkingPid.updateFactors(autoTune.output, 0, 0); @@ -130,6 +130,10 @@ static msg_t etbThread(void *arg) { scheduleMsg(&logger, "output %f value=%f", autoTune.output, value); etbPwmUp.setSimplePwmDutyCycle(value); + if (result) { + scheduleMsg(&logger, "GREAT NEWS!"); + } + tuneWorkingPid.sleep(); continue; }