From 85b0c4b6b4599da6aac67edaad54449c418b1720 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Sat, 31 Oct 2020 18:44:09 -0700 Subject: [PATCH] gains --- firmware/heater_control.cpp | 2 +- firmware/pump_control.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/firmware/heater_control.cpp b/firmware/heater_control.cpp index f96c152..28e6ef3 100644 --- a/firmware/heater_control.cpp +++ b/firmware/heater_control.cpp @@ -50,7 +50,7 @@ static HeaterState GetNextState(HeaterState state, float sensorEsr) return state; } -static Pid heaterPid(0.05f, 0.15f, HEATER_CONTROL_PERIOD); +static Pid heaterPid(0.01f, 0.05f, HEATER_CONTROL_PERIOD); static float GetDutyForState(HeaterState state, float heaterEsr) { diff --git a/firmware/pump_control.cpp b/firmware/pump_control.cpp index 7d3131c..4fef4e8 100644 --- a/firmware/pump_control.cpp +++ b/firmware/pump_control.cpp @@ -7,7 +7,7 @@ #include "ch.h" -static Pid pumpPid(0, 0.01f, 2); +static Pid pumpPid(50.0f, 300.0f, 2); static THD_WORKING_AREA(waPumpThread, 256); static void PumpThread(void*) @@ -22,7 +22,7 @@ static void PumpThread(void*) float result = pumpPid.GetOutput(NERNST_TARGET, nernstVoltage); // result is in mA - SetPumpCurrentTarget(result / 1000.0f); + SetPumpCurrentTarget(result * 1000); } // Run at 500hz