#
bd63bcac |
| 16-Aug-2024 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda forma
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda formatting also changed, so we have made changes to the organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style. See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: I0f105c3310e87172c65a09a8787a2db5a4041cc0 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
5d897e2a |
| 04-Jun-2024 |
Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com> |
Modified the naming to get the value of checkhysterwithsetpt
Modified the naming to get the value of checkhysterwithsetpt in dbus configuration and json configuration.
Change-Id: Ic9cc6a6bfd0da69ac
Modified the naming to get the value of checkhysterwithsetpt
Modified the naming to get the value of checkhysterwithsetpt in dbus configuration and json configuration.
Change-Id: Ic9cc6a6bfd0da69acc1638ca7ebd6712211e2984 Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
show more ...
|
#
9788963c |
| 05-Nov-2023 |
Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com> |
Support to accumulate PWM of different controllers for same sensor
Description: 1. Add one property: accumulateSetPoint in zone of fan table that could be used to enable accumulation of output PW
Support to accumulate PWM of different controllers for same sensor
Description: 1. Add one property: accumulateSetPoint in zone of fan table that could be used to enable accumulation of output PWM of different controllers with same sensor.
2. Add one property: checkHysterWithSetpt in pid info of fan table to select to compare current input and setpoint to check hysteresis.
3. The purpose of accumulate the stepwise output and PID output for one sensor is that the setting of stepwise could use to prevent the fan speed from suddenly increasing from a very low speed to a very high speed due to reaching the setpoint.
Use stepwise before setpoint could also keep the PWM steady at low ambient temperature.
Design: 1. Search "accumulateSetPoint" field in fan table. If the value was true, accumulate the output PWM of different controllers with same profile name.
2. Support two method to calculate PID output that could be chosen by setting the "checkHysterWithSetpt" to true in pid info of fan table.
If the flag was set to true, it won't calculate PWM output if the input lower than setpoint.
Test Case: 1. Check the output PWM of different controllers with same profile name could be accumulated - pass.
2. Set "checkHysterWithSetpt" to true and check PID output would not be calculated if the input temperature was lower than setpoint - pass.
Please see more details in gist: https://gist.github.com/DelphineCCChiu/a6170d3e1a12fc4ee76fad324382fba3
Change-Id: I9f38f250d72545784c6c11be2fde7d45f0b385c4 Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
show more ...
|
#
3f0f7bc3 |
| 13-Feb-2023 |
Josh Lehan <krellan@google.com> |
Add MissingIsAcceptable feature to avoid failsafe
This is a partial implementation of the ideas here: https://github.com/openbmc/phosphor-pid-control/issues/31
A new configuration item is supported
Add MissingIsAcceptable feature to avoid failsafe
This is a partial implementation of the ideas here: https://github.com/openbmc/phosphor-pid-control/issues/31
A new configuration item is supported in the PID object, named "MissingIsAcceptable" (for D-Bus) or "missingIsAcceptable" (for the old config.json). The value is an array of strings. If these strings match sensor names, those sensors will be flagged as "missing is acceptable", that is, they can go missing and the zone will not be thrown into failsafe mode as a result.
This can be handy for sensors that are not always available on your particular machine. It is independent of the existing Availability interface, because the decision to go into failsafe mode or not is a property of the PID loop, not of the sensor itself.
If a PID loop consists of all sensors that are missing, the output will be deemed to be the setpoint, thus essentially making the PID loop a no-op. Now initializing sensor values to NaN, not zero, as zero is not a good default if PID loop is margin, undoing a bug I made: https://gerrit.openbmc.org/c/openbmc/phosphor-pid-control/+/38228
Tested: It worked for me. Also, added a unit test case.
Change-Id: Idc7978ab06fcc9ed8c6c9df9483101376e5df4d1 Signed-off-by: Josh Lehan <krellan@google.com>
show more ...
|
#
31058fd3 |
| 13-Jan-2023 |
Josh Lehan <krellan@google.com> |
Implementing the TempToMargin feature
Wrapping the input name std::string in a new structure SensorInput, so that the TempToMargin information can be cleanly carried along with it, all the way down
Implementing the TempToMargin feature
Wrapping the input name std::string in a new structure SensorInput, so that the TempToMargin information can be cleanly carried along with it, all the way down to the PID input processing layer where it is needed. This allows the conversion to be done just-in-time before the temperature reading is interpreted, minimizing the blast radius of this change. Nonetheless, because of the type change, there was a somewhat large blast radius to implement this feature.
The design, and the documentation, is already here: https://github.com/openbmc/phosphor-pid-control/issues/23
Tested: Added unit tests for JSON parsing and for proper execution of the TempToMargin feature. They pass. Ran it locally, on our appropriately-configured system, and it seems to work for me.
Change-Id: I598ba485195aaa70c26e91a1da3ab88fff8c3a4c Signed-off-by: Josh Lehan <krellan@google.com>
show more ...
|
#
9fe3a3c7 |
| 11-May-2023 |
ykchiu <Chiu.YK@inventec.com> |
Set failsafePwm by pid configuration
<motivation> Current phosphor-pid-control service supports one zone with one failsafepwm. However, for some platforms there are different pluggable cards in a zo
Set failsafePwm by pid configuration
<motivation> Current phosphor-pid-control service supports one zone with one failsafepwm. However, for some platforms there are different pluggable cards in a zone. Different combinations may require different failsafe pwm settings. Why not just use one zone failsafepwm for all the combinations? because if we take power consumption or acoustic into consideration, we will find that not all the cases need the same high failsafepwm. Each case just need high enough failsafepwm to cool down the system in that condition.
For example case1: zone0 : gpuA card + motherboard in zone0 =>requires failsafepwm = 80
case2: zone1 : gpuB card + motherboard in zone0 =>requires failsafepwm = 60
In order to solve the problem described above , we propose the design that. Each pidloop has its own failsafepwm. The final failsafepwm will be calculated during building zone process. The detailed design concept is described in design concept section.
<design concept> a zone has several pid loops, each one has its own pid failsafe pwm defined in its configuration.
The calculation flow goes as below: 1.Take failsafepwm of the pidloops and the zone from the configuration files, if any is missing , set it to zero. 2.Take max value of (zone failsafepwm and pid loops failsafepwm). 3.If the max value from 'step 2' is zero indicates none of failsafepwm is configured, set it to default setting 100%.
<note> 1.this is intended for dbus configuration method, since one zone may have different pidloops from different pluggable boards entity json, but this design also works for static configuration method, therefore, the zone with different boards will need different failsafepwm. 2.keep it back compatible with original design , also take zone failsafepwm into calculation.
Working example as below
Case1 Zone0: zone0 pidloop failsafepwm = 60 gpuA pidloop failsafepwm = 70 Motherboard failsafepwm = 40
=>final failsafepwm = 70
Case2 Zone0: zone0 pidloop failsafepwm = 60 gpuB pidloop failsafepwm = 80 Motherboard failsafepwm = 40
=>final failsafepwm = 80
Change-Id: I5aa1c6a7108f4520f41de5d8eba3075d021bbe79 Signed-off-by: ykchiu <Chiu.YK@inventec.com>
show more ...
|
#
7c6d35d5 |
| 10-May-2023 |
ykchiu <Chiu.YK@inventec.com> |
Allow disabling PID loops at runtime
<design concept> Add the map of object enable interface to pid loops in the zone then we can disable/enable each pid loop process in a zone by dbus command.
[no
Allow disabling PID loops at runtime
<design concept> Add the map of object enable interface to pid loops in the zone then we can disable/enable each pid loop process in a zone by dbus command.
[note] Enable = true : enable process (default) Enable = false : disable process
Tested: In this case: we set Enable = false to disable pidloop:Zone_Temp_0, and see how it affects the zone final pwm, when pidloop: Zone_Temp_0 in zone 0 is disabled.
then even we are trying to heat up the temperature of a sensor: Temp_0 in pidloop: Zone_Temp_0, this set point of the pidloop will not be taken into the calculation for the final set point of the whole zone.
``` <service object> root@openbmc:/tmp# busctl tree xyz.openbmc_project.State.FanCtrl `-/xyz `-/xyz/openbmc_project `-/xyz/openbmc_project/settings `-/xyz/openbmc_project/settings/fanctrl |-/xyz/openbmc_project/settings/fanctrl/zone0 | |-/xyz/openbmc_project/settings/fanctrl/zone0/Zone_Temp | |-/xyz/openbmc_project/settings/fanctrl/zone0/Zone_Temp_0 | `-/xyz/openbmc_project/settings/fanctrl/zone0/Zone_Temp_1
====Enable process for pidloop:Zone_Temp_0 with p-switch temperature sensor:Temp_0 at runtime==== root@openbmc:~# busctl introspect xyz.openbmc_project.State.FanCtrl /xyz/openbmc_project/settings/fanctrl/zone0/Zone_Temp_0 NAME TYPE SIGNATURE RESULT/VALUE FLAGS xyz.openbmc_project.Object.Enable interface - - - .Enabled property b true emits-change writable
====Disable process for pidloop:Zone_Temp_0 with p-switch temperature sensor: Temp_0==== root@openbmc:~# busctl set-property xyz.openbmc_project.State.FanCtrl /xyz/openbmc_project/settings/fanctrl/zone0/Zone_Temp_0 xyz.openbmc_project.Object.Enable Enabled b false root@openbmc:~# busctl introspect xyz.openbmc_project.State.FanCtrl /xyz/openbmc_project/settings/fanctrl/zone0/Zone_Temp_0 NAME TYPE SIGNATURE RESULT/VALUE FLAGS xyz.openbmc_project.Object.Enable interface - - - .Enabled property b false emits-change writable ```
when Disable the process of the pidloop: Zone_Temp_0, the requester switches from Zone_Temp_0 to the others, when you enable the pidloop: Zone_Temp_0, the setpoint of Zone_Temp_0 will be take into consideration again
Change-Id: I95ae700144f0d16049fff8b309f05ae690a7ef72 Signed-off-by: ykchiu <Chiu.YK@inventec.com>
show more ...
|
#
239aa7d7 |
| 17-Nov-2022 |
Harvey Wu <Harvey.Wu@quantatw.com> |
Replace some duplicate codes about time setting
- Replace duplicate codes in pid/buildjson.cpp and dbusconfiguration.cpp
TEST: D-Bus config => { "FailSafePercent": 90.0,
Replace some duplicate codes about time setting
- Replace duplicate codes in pid/buildjson.cpp and dbusconfiguration.cpp
TEST: D-Bus config => { "FailSafePercent": 90.0, "MinThermalOutput": 0.0, "CycleIntervalTimeMS": 101, "UpdateThermalsTimeMS": 1000, "Name": "Zone 0", "Type": "Pid.Zone", "ZoneIndex": 0 }, { "FailSafePercent": 90.0, "MinThermalOutput": 0.0, "CycleIntervalTimeMS": 100, "Name": "Zone 1", "Type": "Pid.Zone", "ZoneIndex": 1 }, { "FailSafePercent": 100.0, "MinThermalOutput": 0.0, "UpdateThermalsTimeMS": -1000, "Name": "Zone 2", "Type": "Pid.Zone", "ZoneIndex": 2 },
pid journal log => Mar 09 04:49:23 qbmc swampd[4823]: Zone 1: UpdateThermalsTimeMS cannot find setting. Use default 1000 ms Mar 09 04:49:24 qbmc swampd[4823]: Zone 2: CycleIntervalTimeMS cannot find setting. Use default 100 ms Mar 09 04:49:24 qbmc swampd[4823]: Zone 2: UpdateThermalsTimeMS is invalid. Use default 1000 ms
Static JSON => { "id": 0, "minThermalOutput": 0.0, "failsafePercent": 100.0, "cycleIntervalTimeMS": 100, "updateThermalsTimeMS": 1000, ... ... { "id": 1, "minThermalOutput": 0.0, "failsafePercent": 100.0, "updateThermalsTimeMS": 0,
pid journal log => Mar 09 04:38:44 qbmc swampd[10646]: Zone 1: cycleIntervalTimeMS cannot find setting. Use default 100 ms Mar 09 04:38:44 qbmc swampd[10646]: Zone 1: updateThermalsTimeMS is invalid. Use default 1000 ms
Change-Id: I75d272d9458978790d2b8fe2def35a0e6ba126b0 Signed-off-by: Harvey Wu <Harvey.Wu@quantatw.com>
show more ...
|
#
9f9a06aa |
| 14-Dec-2022 |
Josh Lehan <krellan@google.com> |
Fix interval calculation bug and D-Bus init
The new timing parameters were not settable from the D-Bus code path, only from the old static JSON code path. Also, the divison would not occur, causing
Fix interval calculation bug and D-Bus init
The new timing parameters were not settable from the D-Bus code path, only from the old static JSON code path. Also, the divison would not occur, causing the variable to remain at 1000 by default, not 10, causing the thermal intervals to run 100 times slower than intended!
I fixed the algorithm used to calculate when the thermal intervals should be inserted amongst the fan intervals. Now, the division is not necessary, and any value should work, so long as the thermal interval is greater than or equal to the fan interval.
I also fixed a subtle bug regarding the timer scheduling. It was reinitializing the timer expiration time from "now" each interval, instead of cleanly incrementing from the original expiration. This caused the timer to run slower than intended, as the execution time of each interval would not be subtracted out from the remaining time that needs to be waited for, as it should have been.
Tested: Default values, for timing parameters, now work as intended
Signed-off-by: Josh Lehan <krellan@google.com> Change-Id: I759387b97af3ce93a76459faf5e9e7be3474016e
show more ...
|
#
c612c051 |
| 12-Dec-2022 |
Josh Lehan <krellan@google.com> |
Allow derivativeCoeff and DCoefficient optional
To avoid breaking existing configurations in the field, treat the new "derivativeCoeff" parameter as optional, not mandatory.
This affects both the o
Allow derivativeCoeff and DCoefficient optional
To avoid breaking existing configurations in the field, treat the new "derivativeCoeff" parameter as optional, not mandatory.
This affects both the old JSON parser, and the new D-Bus entity-manager parser (it's called "DCoefficient" there).
Signed-off-by: Josh Lehan <krellan@google.com> Change-Id: Ifcaf47d66e009b48e41b510a2ef1686b8860ad35
show more ...
|
#
0e8fc398 |
| 04-Oct-2022 |
Bonnie Lo <Bonnie_Lo@wiwynn.com> |
Support derivative term in PID algorithm and support to set cycle interval time from fan table
1. Support to calculate derivative term in PID algorithm. 2. Add two properties: cycleIntervalTimeMS an
Support derivative term in PID algorithm and support to set cycle interval time from fan table
1. Support to calculate derivative term in PID algorithm. 2. Add two properties: cycleIntervalTimeMS and updateThermalsTimeMS in fan table that could be used to decide "time interval of PID control loop" and "time interval to update thermals' cached value".
Tested:
- PID algorithm: 1. Check pid-control-service could calculate output PWM according to the fan table.
[Test log] root@greatlakes:~# systemctl status phosphor-pid-control -l * phosphor-pid-control.service - Phosphor-Pid-Control Margin-based Fan Control Daemon Loaded: loaded (/lib/systemd/system/phosphor-pid-control.service; enabled; preset: enabled) Active: active (running) since Fri 2018-03-09 05:09:35 PST; 1min 47s ago Main PID: 3105 (swampd) CGroup: /system.slice/phosphor-pid-control.service `-3105 /usr/bin/swampd -c /usr/share/entity-manager/configurations/fan-table.json ... Mar 09 05:10:29 greatlakes phosphor-pid-control[3105]: PID Zone 1 max SetPoint 3.75 requested by PID_NIC_SENSOR_TEMP BMC_SENSOR_FAN0_TACH BMC_SENSOR_FAN2_TACH BMC_SENSOR_FAN4_TACH BMC_SENSOR_FAN6_TACH
- Cycle interval time: 1. Set cycleIntervalTimeMS and updateThermalsTimeMS to 1000 ms in fan table 2. Check service would update thermal every second from debug log.
[Test log] root@greatlakes:~# journalctl -u phosphor-pid-control --since "Mar 09 04:52:16" Mar 09 04:52:16 greatlakes systemd[1]: Started Phosphor-Pid-Control Margin-based Fan Control Daemon. ... Mar 09 04:53:28 greatlakes phosphor-pid-control[2795]: processThermals Mar 09 04:53:28 greatlakes phosphor-pid-control[2795]: processFans Mar 09 04:53:29 greatlakes phosphor-pid-control[2795]: processThermals Mar 09 04:53:29 greatlakes phosphor-pid-control[2795]: processFans Mar 09 04:53:30 greatlakes phosphor-pid-control[2795]: processThermals Mar 09 04:53:30 greatlakes phosphor-pid-control[2795]: processFans
Change-Id: I04e1b440603c3ad66a1e26c96451992785da6fe6 Signed-off-by: Bonnie Lo <Bonnie_Lo@wiwynn.com>
show more ...
|
#
1df9e879 |
| 08-Oct-2020 |
Patrick Venture <venture@google.com> |
drop struct keyword for non-packed objects
As a style decision, struct is often used with packed structures to indicate they are used like C-structs. Cleanup this codebase to not use the extra stru
drop struct keyword for non-packed objects
As a style decision, struct is often used with packed structures to indicate they are used like C-structs. Cleanup this codebase to not use the extra struct keyword throughout.
Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I2f83bb1989e4d1f2f843ba3e45fb82e04f0fa61c
show more ...
|
#
a076487a |
| 08-Aug-2020 |
Patrick Venture <venture@google.com> |
sensors/zones: place in namespace and cleanup
Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I527dbc8477a232945f696227a7b0b2adbee45175
|
#
a83a3ecc |
| 04-Aug-2020 |
Patrick Venture <venture@google.com> |
update clang-format from Latest in docs
Updates the clang-format file and then applies it.
Signed-off-by: Patrick Venture <venture@google.com> Change-Id: Ia9faf13ce171f90bf07547efd781139bee23e8c7
|
#
375f7098 |
| 29-Mar-2019 |
Hank Liou <Hank.Liou@quantatw.com> |
Add stepwise parser
The json parser cannot read stepwise setting from config. This change adds support to stepwise type of pid.
Change-Id: I650c5bd6a0040bf25630e33b3bd36abf388f0cd8 Signed-off-by: H
Add stepwise parser
The json parser cannot read stepwise setting from config. This change adds support to stepwise type of pid.
Change-Id: I650c5bd6a0040bf25630e33b3bd36abf388f0cd8 Signed-off-by: Hank Liou <Hank.Liou@quantatw.com>
show more ...
|
#
e3eeef45 |
| 26-Mar-2019 |
Patrick Venture <venture@google.com> |
bugfix: grab hystersis parameter from pid json
The code incorrectly attempts to read the hystersis parameters from the wrong scope of the json object. This fixes it to read from the pid configurati
bugfix: grab hystersis parameter from pid json
The code incorrectly attempts to read the hystersis parameters from the wrong scope of the json object. This fixes it to read from the pid configuration's scope.
Tested: Added a new unit-test to hit this case. Change-Id: I808bc907ec33a0b12d68a88fd316c3c9fae41516 Signed-off-by: Patrick Venture <venture@google.com>
show more ...
|
#
f81f2886 |
| 26-Feb-2019 |
James Feist <james.feist@linux.intel.com> |
Expand conf namespace
Put rest of conf.hpp in the conf namespace. This is largely a sed replace, and wrapping from_json in conf namespace as it failed to build.
Change-Id: I9fe5c7b2fface44618c43af2
Expand conf namespace
Put rest of conf.hpp in the conf namespace. This is largely a sed replace, and wrapping from_json in conf namespace as it failed to build.
Change-Id: I9fe5c7b2fface44618c43af2367035afc39bcb64 Signed-off-by: James Feist <james.feist@linux.intel.com>
show more ...
|
#
3484beda |
| 25-Feb-2019 |
James Feist <james.feist@linux.intel.com> |
s/minThermalRPM/minThermalOutput
The minThermalRPM is only an RPM by the fact that that is the units of the PID. As the PID units can be anything, change this to minThermalOutput to allow for differ
s/minThermalRPM/minThermalOutput
The minThermalRPM is only an RPM by the fact that that is the units of the PID. As the PID units can be anything, change this to minThermalOutput to allow for different units (i.e. percent).
Change-Id: Ic53fef1159ade5a413e5d519d407947f3023d8e3 Signed-off-by: James Feist <james.feist@linux.intel.com>
show more ...
|
#
903b0427 |
| 20-Feb-2019 |
Patrick Venture <venture@google.com> |
conf change: s/feedFwdOffOffsetCoeff/feedFwdOffsetCoeff/g
Fixup spelling mistake for configuration field name.
Change-Id: I92d0af06f4e15f4408dd10f0dd9cd71099b77f4f Signed-off-by: Patrick Venture <v
conf change: s/feedFwdOffOffsetCoeff/feedFwdOffsetCoeff/g
Fixup spelling mistake for configuration field name.
Change-Id: I92d0af06f4e15f4408dd10f0dd9cd71099b77f4f Signed-off-by: Patrick Venture <venture@google.com>
show more ...
|
#
d1491724 |
| 08-Feb-2019 |
Patrick Venture <venture@google.com> |
add support to build zones and PIDs from json
Add support to build zones and PIDs from a json configuration file.
Change-Id: If8608dcd3e084cebabb71fc39851044df4d5d7c2 Signed-off-by: Patrick Venture
add support to build zones and PIDs from json
Add support to build zones and PIDs from a json configuration file.
Change-Id: If8608dcd3e084cebabb71fc39851044df4d5d7c2 Signed-off-by: Patrick Venture <venture@google.com>
show more ...
|