# HG changeset patch # User Michiel Broek # Date 1587839491 -7200 # Node ID e00f8ff4de9aec678d2bc9f527c937326a54ca3b # Parent e2766e538d0e536b6f5286288ae1757aafce1143 Version 0.9.8. Added extra path to the fonts for Debian buster. Changed the PID to work on Proportional on Measurement. Added loops so that it looks like the PID is running at 100 mSec intervals. diff -r e2766e538d0e -r e00f8ff4de9a brewpanel/sdlgui.c --- a/brewpanel/sdlgui.c Mon Nov 04 13:19:27 2019 +0100 +++ b/brewpanel/sdlgui.c Sat Apr 25 20:31:31 2020 +0200 @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (C) 2015 + * Copyright (C) 2015-2020 * * Michiel Broek * @@ -124,8 +124,11 @@ if ((pFont = TTF_OpenFont(Pt, 14 )) == NULL) { sprintf(Pt, "%s", "/usr/share/fonts/truetype/freefont/DejaVuSans.ttf"); if ((pFont = TTF_OpenFont(Pt, 14 )) == NULL) { - syslog(LOG_NOTICE, "Could not load DejaVuSans.ttf"); - return -1; + sprintf(Pt, "%s", "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"); + if ((pFont = TTF_OpenFont(Pt, 14 )) == NULL) { + syslog(LOG_NOTICE, "Could not load DejaVuSans.ttf"); + return -1; + } } } } diff -r e2766e538d0e -r e00f8ff4de9a configure --- a/configure Mon Nov 04 13:19:27 2019 +0100 +++ b/configure Sat Apr 25 20:31:31 2020 +0200 @@ -2047,9 +2047,9 @@ PACKAGE="mbsePi-apps" -VERSION="0.9.7" -COPYRIGHT="Copyright (C) 2014-2019 Michiel Broek, All Rights Reserved" -CYEARS="2014-2019" +VERSION="0.9.8" +COPYRIGHT="Copyright (C) 2014-2020 Michiel Broek, All Rights Reserved" +CYEARS="2014-2020" diff -r e2766e538d0e -r e00f8ff4de9a configure.ac --- a/configure.ac Mon Nov 04 13:19:27 2019 +0100 +++ b/configure.ac Sat Apr 25 20:31:31 2020 +0200 @@ -8,9 +8,9 @@ dnl General settings dnl After changeing the version number, run autoconf! PACKAGE="mbsePi-apps" -VERSION="0.9.7" -COPYRIGHT="Copyright (C) 2014-2019 Michiel Broek, All Rights Reserved" -CYEARS="2014-2019" +VERSION="0.9.8" +COPYRIGHT="Copyright (C) 2014-2020 Michiel Broek, All Rights Reserved" +CYEARS="2014-2020" AC_SUBST(PACKAGE) AC_SUBST(VERSION) AC_SUBST(COPYRIGHT) diff -r e2766e538d0e -r e00f8ff4de9a thermferm/pid.c --- a/thermferm/pid.c Mon Nov 04 13:19:27 2019 +0100 +++ b/thermferm/pid.c Sat Apr 25 20:31:31 2020 +0200 @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (C) 2015..2016 + * Copyright (C) 2015..2020 * * Michiel Broek * @@ -41,26 +41,26 @@ { if (pid->Mode == PID_MODE_AUTO) { - double dTerm; + double dInput; if (pid->Type == PID_TYPE_HEAT) pid->Err = pid->SetP - pid->Input; else pid->Err = pid->Input - pid->SetP; + dInput = (pid->Input - pid->InputLast); + /* * Calculate the integral state with appopriate limiting. - * Use ErrLastLast as iState */ pid->iState += (pid->iGain * pid->Err); + pid->iState -= (pid->pGain * dInput); // Add Proportional on Measurement if (pid->iState > pid->iMax) pid->iState = pid->iMax; else if (pid->iState < 0) pid->iState = 0; - dTerm = (pid->Input - pid->InputLast); - - pid->OutP = (pid->pGain * pid->Err) + pid->iState - (pid->dGain * dTerm); + pid->OutP = pid->iState - pid->dGain * dInput; pid->InputLast = pid->Input; } else if (pid->Mode == PID_MODE_BOO) { diff -r e2766e538d0e -r e00f8ff4de9a thermferm/thermferm.c --- a/thermferm/thermferm.c Mon Nov 04 13:19:27 2019 +0100 +++ b/thermferm/thermferm.c Sat Apr 25 20:31:31 2020 +0200 @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (C) 2014-2019 + * Copyright (C) 2014-2020 * * Michiel Broek * @@ -1642,10 +1642,12 @@ } /* - * PID controller compute + * PID controller compute, simulate 100 mSec loops. */ - UpdatePID(unit->PID_heat); - UpdatePID(unit->PID_cool); + for (int i = 0; i < 10; i++) { + UpdatePID(unit->PID_heat); + UpdatePID(unit->PID_cool); + } /* * Logging @@ -1869,9 +1871,7 @@ publishDBirth(unit); unit->mqtt_flag &= ~MQTT_FLAG_BIRTH; } else { -// if (unit->mode != UNITMODE_OFF) { - publishDData(unit); -// } + publishDData(unit); unit->mqtt_flag &= ~MQTT_FLAG_DATA; } if (unit->mqtt_flag & MQTT_FLAG_DEATH) {