History log of /openbmc/phosphor-pid-control/pid/zone_interface.hpp (Results 1 – 9 of 9)
Revision Date Author Comments
# 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 ...


# 37180062 01-Oct-2023 Harvey Wu <Harvey.Wu@quantatw.com>

zone: Add debug thermal/power interface

- Add xyz.openbmc_project.Debug.Pid.ThermalPower interface to
fanctrl/zoneX/pid dbus to record some datas in thermal/power
PID loop.

Tested:
```
busctl i

zone: Add debug thermal/power interface

- Add xyz.openbmc_project.Debug.Pid.ThermalPower interface to
fanctrl/zoneX/pid dbus to record some datas in thermal/power
PID loop.

Tested:
```
busctl introspect xyz.openbmc_project.State.FanCtrl /xyz/openbmc_project/settings/fanctrl/zone0/CPU0_PID xyz.openbmc_project.Debug.Pid.ThermalPower
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
.ClassType property s "Temperature" emits-change
.Input property d 36.594 emits-change
.Leader property s "Die_CPU0" emits-change
.Output property d 4200 emits-change
.Setpoint property d 70 emits-change
```

Signed-off-by: Harvey Wu <Harvey.Wu@quantatw.com>
Change-Id: I6846c3878c2ca5eaeeb6eaf48aaf0f604a2beccf

show more ...


# c51ba919 12-Oct-2022 Bonnie Lo <Bonnie_Lo@wiwynn.com>

Add debug mode

Description:
1. Could enable debug mode by adding file: /etc/thermal.d/debugging.
$ mkdir /etc/thermal.d
$ touch /etc/thermal.d/debugging
$ systemctl resta

Add debug mode

Description:
1. Could enable debug mode by adding file: /etc/thermal.d/debugging.
$ mkdir /etc/thermal.d
$ touch /etc/thermal.d/debugging
$ systemctl restart phosphor-pid-control

2. Could record fans output PWM, chosen temperature, PID/stepwise output PWM in debug mode.

Design:
1. Create debugging file and restart service to enable debug mode.

2. Check if debug mode is enabled to output fans output PWM, chosen temperature,
PID/stepwise output PWM, and so on.

Test Case:
1. Enable debug mode and check logs: pass

Change-Id: I8527ebcb81e723298ba7e786b4501f986ebd439e
Signed-off-by: Bonnie Lo <Bonnie_Lo@wiwynn.com>

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 ...


# b300575e 22-Feb-2022 Josh Lehan <krellan@google.com>

pid/zone: Adding unscaled to cache and logging

The "ReadReturn" structure, and the cache within DbusPidZone, have
been widened, to hold both the scaled and the original unscaled values
at the same t

pid/zone: Adding unscaled to cache and logging

The "ReadReturn" structure, and the cache within DbusPidZone, have
been widened, to hold both the scaled and the original unscaled values
at the same time. This allows logging to show both at once, and also
clears up confusion/bugs resulting from storing one or the other and
losing track of which was which.

Compatibility setValue() and getCachedValue() functions still
retained, so this will not break other sensors. These functions still
only take a single argument/return, which will be used for both value
and unscaled, indicating scaling is unknown or irrelevant to this
sensor.

Also, the PWM output of the PID loop appears in the log file,
conveniently right alongside the RPM input of the PID loop.

An output cache has been added to the zone interface, and, unlike the
input cache, use of it is optional. It is only to help populate the
logging, so subclasses are free to ignore it if they want.

Tested: In the logging files, I can see both PWM and RPM, and they are
consistent, showing how the PID loop is trying to update the PWM to
target the desired RPM.

Example: Here's /tmp/zone_0.log on my system
epoch_ms,setpt,fan0_tach,fan0_tach_raw,fan0_tach_pwm,fan0_tach_pwm_raw,bmcmargin_zone0,bmcmargin_zone0_raw,thermal_zone0,thermal_zone0_raw,failsafe
3097918,3818.42,0.748267,11224,0,0,0.724753,56.812,0.745098,62,0
3098022,3818.42,0.748267,11224,0.266666,67,0.724753,56.812,0.745098,62,0
3098132,3818.42,0.748267,11224,0.266666,67,0.724753,56.812,0.745098,62,0

Here's what we can now learn:
The desired setpoint is 3818 RPM.
The fan is at 74.8% of scale, which is 11224 RPM.
The written PWM, after the first PID loop pass, is a raw value of 67,
which is 26.6% of scale.
The first margin temperature is 56.8 degrees of margin, which is 72.4%
of scale.
The second margin temperature is 62 degrees of margin, which is 74.5%
of scale.
This zone is not in failsafe mode.
As you can see, this will be rather useful for PID loop tuning.

Signed-off-by: Josh Lehan <krellan@google.com>
Change-Id: I972a4e4a3b787255f0dcafa10d4498ee58b682f0

show more ...


# ccc8bb62 17-Feb-2022 Nirav Shah <nirav.j2.shah@intel.com>

For each zone log sensor name with max setpoint

Add sensor name that has the maximum setpoint for a PID zone.
Log a debug message when the sensor is changed.
The name is also added to the log file f

For each zone log sensor name with max setpoint

Add sensor name that has the maximum setpoint for a PID zone.
Log a debug message when the sensor is changed.
The name is also added to the log file for each log record.

Tested:
Override one CPU temperature sensor
busctl set-property xyz.openbmc_project.CPUSensor /xyz/openbmc_project/sensors/temperature/DTS_CPU1 xyz.openbmc_project.Sensor.Value Value d 82
Observed log message:
swampd[443]: PID Zone 0 max SetPoint 34.5546 requested by DTS_CPU1

Signed-off-by: Nirav Shah <nirav.j2.shah@intel.com>
Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
Change-Id: Ifc12cb9a106da1bf41dd35697210f74ba1b589db

show more ...


# a4146eb1 01-Oct-2020 Josh Lehan <krellan@google.com>

pid/zone: Restore PWM when fans returned to auto

This makes use of the improved write() interface, to allow the
PID-loop-determined PWM to be restored, when the fan is returned to
automatic mode.

W

pid/zone: Restore PWM when fans returned to auto

This makes use of the improved write() interface, to allow the
PID-loop-determined PWM to be restored, when the fan is returned to
automatic mode.

Without this fix, a fan set to manual mode, then manually set to a
different speed, would not properly return to the correct speed, when
transitioning back to automatic from manual.

This patch also adds a stub to allow the caller to learn the raw PWM
value written as output, another useful write() interface improvement.
Although not the topic of this change, it is included here, to avoid
later patch conflicts.

Tested: I can now correctly toggle between automatic, and manual, fan
control. Upon resuming automatic control, after a few seconds, the fan
PWM is now properly restored, to what the PID loop wanted it to be at.

Signed-off-by: Josh Lehan <krellan@google.com>
Signed-off-by: Jason Ling <jasonling@google.com>
Change-Id: I46fc65d6b931755d51093ea475c64cf5e3e6bacb

show more ...


# 7a98c19a 12-Aug-2020 Patrick Venture <venture@google.com>

use ZoneInterface pointers where Dbus aspect not important

The implementation of the ZoneInterface used is the DbusPidZone, however
using the ZoneInterface when the Dbus aspect is unimpo

use ZoneInterface pointers where Dbus aspect not important

The implementation of the ZoneInterface used is the DbusPidZone, however
using the ZoneInterface when the Dbus aspect is unimportant provides for
trivial support of other implementations.

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I0ed87322904e7f87e5b5c8a50c01144f3d843a10

show more ...


# 1a153794 11-Aug-2020 Patrick Venture <venture@google.com>

pid/zone: split zone interface into its own header

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I8f516353ddf7777ec750549e748c96afa211ea6e