summaryrefslogtreecommitdiffstats
path: root/pid
diff options
context:
space:
mode:
authorJames Feist <james.feist@linux.intel.com>2019-02-15 16:14:31 -0800
committerJames Feist <james.feist@linux.intel.com>2019-02-15 16:34:31 -0800
commitdca2d484ee91ee40fc94509d831ef2c5fa792ca0 (patch)
tree4614f4f40377d6620cbbd19b7ee7177103250194 /pid
parent18b1311e7588769c3da0a0250c28c80214cba2af (diff)
downloadphosphor-pid-control-dca2d484ee91ee40fc94509d831ef2c5fa792ca0.tar.gz
phosphor-pid-control-dca2d484ee91ee40fc94509d831ef2c5fa792ca0.zip
DBusConfiguration: Fix scaling
Revert the removal of the /100 because that caused 90% to be passed as 90 instead of .9. To counter-act this multiply the stepwise controller by 100 so that setting 50 is 50%. Tested-by: Used sensor override to make stepwise jump threshold and got desired pwm result. Change-Id: I629bf0d4b0b3bc77660c09fccae82b1bdac4c578
Diffstat (limited to 'pid')
-rw-r--r--pid/fancontroller.cpp6
-rw-r--r--pid/stepwisecontroller.cpp2
2 files changed, 2 insertions, 6 deletions
diff --git a/pid/fancontroller.cpp b/pid/fancontroller.cpp
index ee43e4e..4a61def 100644
--- a/pid/fancontroller.cpp
+++ b/pid/fancontroller.cpp
@@ -14,8 +14,6 @@
* limitations under the License.
*/
-#include "config.h"
-
#include "fancontroller.hpp"
#include "util.hpp"
@@ -128,12 +126,8 @@ void FanController::outputProc(double value)
}
#endif
-// in the dbus configurations the /100 is added to the configurations
-// directly so this step is not needed
-#if !CONFIGURE_DBUS
// value and kFanFailSafeDutyCycle are 10 for 10% so let's fix that.
percent /= 100;
-#endif
// PidSensorMap for writing.
for (const auto& it : _inputs)
diff --git a/pid/stepwisecontroller.cpp b/pid/stepwisecontroller.cpp
index 43fd241..fee25ab 100644
--- a/pid/stepwisecontroller.cpp
+++ b/pid/stepwisecontroller.cpp
@@ -95,6 +95,8 @@ double StepwiseController::inputProc(void)
void StepwiseController::outputProc(double value)
{
+ // values are 10 for 10%
+ value *= 100;
_owner->addRPMSetPoint(value);
return;
OpenPOWER on IntegriCloud