PID auto tune unit test

This commit is contained in:
rusefi 2018-11-22 23:54:11 -05:00
parent 8156e8f752
commit 55aac03201
1 changed files with 5 additions and 1 deletions

View File

@ -122,7 +122,7 @@ static msg_t etbThread(void *arg) {
if (engine->etbAutoTune) { if (engine->etbAutoTune) {
autoTune.input = actualThrottlePosition; autoTune.input = actualThrottlePosition;
autoTune.Runtime(&logger); bool result = autoTune.Runtime(&logger);
tuneWorkingPid.updateFactors(autoTune.output, 0, 0); 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); scheduleMsg(&logger, "output %f value=%f", autoTune.output, value);
etbPwmUp.setSimplePwmDutyCycle(value); etbPwmUp.setSimplePwmDutyCycle(value);
if (result) {
scheduleMsg(&logger, "GREAT NEWS!");
}
tuneWorkingPid.sleep(); tuneWorkingPid.sleep();
continue; continue;
} }