summaryrefslogtreecommitdiffstats
path: root/pid/stepwisecontroller.cpp
Commit message (Collapse)AuthorAgeFilesLines
* rename RPMSetPoint to SetPointPatrick Venture2019-07-161-1/+1
| | | | | | | | | | | The PIDs were originally focused on collecting RPM set points from thermal PIDs and then having fan PIDs use the highest value collected, it doesn't need to be strictly an RPM set point. It does however need to be one type of value. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I1d589cf4b2688d7e86030c10496d737dc5bbdadf
* stepwise: Add ceiling typeJames Feist2019-02-261-4/+8
| | | | | | | | | | | Add a stepwise ceiling type, this is used as a upper clipping curve to limit the max output based on a temperature sensor. This is commonly used for quiet fan mode where CPU throttling is allowed to preserve a max fan noise. Change-Id: I181d5913c92e5498a34e6d3f67cf99b67471479c Signed-off-by: James Feist <james.feist@linux.intel.com>
* DBusConfiguration: Fix scalingJames Feist2019-02-151-0/+2
| | | | | | | | | | | | 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
* Allow multiple inputs to thermal and stepwise controllersJames Feist2018-11-151-3/+9
| | | | | | | | | | | | | Use std::max to determine which input value to apply. Also start throwing when inputs are empty as otherwise there will be a nullptr dereference. Tested-by: Added multiple inputs and application no longer segfaults and verifed max was being used. Also added unit tests. Change-Id: I7c8eda45b99247b8e92e629f036c9a46c98d9fe2 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Move all floats to doublesPatrick Venture2018-11-111-5/+5
| | | | | | | | | The code was developed initially around a pid loop implemented using floats. Therefore, the code was converting back and forth between double for sensor values as inputs and outputs from this PID loop. Change-Id: I2d2919e1165103040729c9f16bb84fde3dd6b81b Signed-off-by: Patrick Venture <venture@google.com>
* style: member functions should be lower camelPatrick Venture2018-10-301-5/+5
| | | | | | | Rename member functions to be lower camel instead of snake case. Change-Id: Ib227fd3dadb6d9607290277205223a4324cd4ce5 Signed-off-by: Patrick Venture <venture@google.com>
* Add hysteresis to stepwise controllerJames Feist2018-09-211-2/+22
| | | | | | | | Tested-by: Ran on platform monitoring output and wrote unit test Change-Id: I74a1d21544c1a9cb4c1cb26dd4a353cbff0442d0 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Add stepwise controllerJames Feist2018-09-121-0/+75
This adds the ability to use stepwise curves alongside pid control. This creates a base controller class that pidcontroller and stepwise controller inherit from. Note: Hysteresis to come in follow-on patch Tested-by: Created a stepwise controller and noticed that when it crossed a threshold that it contributed to the pwm setting. Change-Id: I6cf842f80eaccafc905d620970afe91e2092d568 Signed-off-by: James Feist <james.feist@linux.intel.com>
OpenPOWER on IntegriCloud