openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Drew Macrae <drewmacrae@google.com>
To: Patrick Venture <venture@google.com>
Cc: "Josh Lehan" <krellan@google.com>,
	openbmc <openbmc@lists.ozlabs.org>,
	"周 远清" <zhouyuanqing8@outlook.com>,
	"uperic@163.com" <uperic@163.com>
Subject: Re: about pid speed control
Date: Wed, 11 Nov 2020 20:20:39 -0500	[thread overview]
Message-ID: <CAAD+EBrBsS-aBqfLt_pD8swaiMWzY6Du44AhbfBOZ9qj3DFWEg@mail.gmail.com> (raw)
In-Reply-To: <CAO=noty2jQdnWKp+tT52V9+OH6RH0C8uykqaTvOz2sPQ8cE5HQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 6715 bytes --]

Hi,

I'm bad at feedback control math, but we've seen issues like this that
can't be addressed by tuning alone, so I thought I'd weigh in.

We've observed some noise in the RPM readings on some platforms, which can
create oscillations in the RPM control loop. Our thermal engineers end up
simplifying things by using only feedforward coefficients to control RPM,
and then use the feedback control for temperatures. This simplifies it to a
single feedback loop which should also make tuning generally easier and
avoid these sorts of problems with hunting/limit cycles/instability.
So for the speed loop you only need to tune:
                        "feedFwdOffsetCoeff": 0.0,
                        "feedFwdGainCoeff": 1.0,
until RPM is correct at failsafe and minimum RPMs. This isn't particularly
robust, but we don't really need it to be. Robust control of temperature is
our priority.

Then you can tune thermal performance with the thermal loop:
                        "proportionalCoeff": 0.1,
                        "integralCoeff": 1.0,

Many of the other parameters aren't linear but are useful to
address/prevent integral windup and over-torque/over-current conditions.

On Wed, Nov 11, 2020 at 10:16 AM Patrick Venture <venture@google.com> wrote:

> On Sun, Sep 27, 2020 at 6:27 AM 周 远清 <zhouyuanqing8@outlook.com> wrote:
>
>> Hi everyone,
>>
>>           For the parameters of the following table, does the PID code of
>> openbmc have a clearer transfer function corresponding to this table? By
>> adjusting the following parameters, fancontrol has taken effect. I set 5000
>> rpm, but the fan will change back and forth between 4500-5500. The change
>> in this range is still relatively large. If there is a transfer function,
>> the adjustment will be more accurate and faster.
>>
>>
>> https://github.com/openbmc/phosphor-pid-control/blob/master/configure.md
>> <https://github.com/openbmc/phosphor-pid-control/blob/master/configure.md>
>> openbmc/phosphor-pid-control
>> <https://github.com/openbmc/phosphor-pid-control/blob/master/configure.md>
>> OpenBMC PID-based Thermal Control Daemon. Contribute to
>> openbmc/phosphor-pid-control development by creating an account on GitHub.
>> github.com
>>
>> field type meaning
>> samplePeriod double How frequently the value is sampled. 0.1 for fans,
>> 1.0 for temperatures.
>> proportionalCoeff double The proportional coefficient.
>> integralCoeff double The integral coefficient.
>> feedFwdOffsetCoeff double The feed forward offset coefficient.
>> feedFwdGainCoeff double The feed forward gain coefficient.
>> integralLimit_min double The integral minimum clamp value.
>> integralLimit_max double The integral maximum clamp value.
>> outLim_min double The output minimum clamp value.
>> outLim_max double The output maximum clamp value.
>> slewNeg double Negative slew value to dampen output.
>> slewPos double Positive slew value to accelerate output.
>>
> +Josh Lehan <krellan@google.com> for input.
>
>>
>>
>> ------------------------------
>> *发件人:* 周 远清 <zhouyuanqing8@outlook.com>
>> *发送时间:* 2020年9月27日 11:17
>> *收件人:* openbmc <openbmc@lists.ozlabs.org>
>> *抄送:* uperic@163.com <uperic@163.com>
>> *主题:* about pid speed control
>>
>> Hi everyone,
>>
>>     I added the phophor-pid-control module to my project. After the PID
>> module was started, the pwm value oscillated between 12 and 153. I deleted
>> other configurations and only kept one fan and one temp. I have debugged
>> various PID parameter values of fan, and there is no obvious change in the
>> phenomenon. Please take a look at it, thank you.
>>
>>    The configuration is as follows:
>>
>>    4611 root      7616 S    /usr/bin/swampd -t -l /tmp/
>>
>>    root@starlake-sn:~# cat /etc/thermal.d/setpoint
>>    3000
>>
>>    config.json as follow:
>>    {
>>     "sensors" : [
>>         {
>>             "name": "Fan0_Speed",
>>             "type": "fan",
>>             "readPath":
>> "/xyz/openbmc_project/sensors/fan_tach/Fan0_Speed",
>>             "writePath":
>> "/xyz/openbmc_project/sensors/fan_tach/Fan0_Speed",
>>             "min": 0,
>>             "max": 255,
>>             "timeout": 0
>>         },
>>         {
>>             "name": "inlet_Temp",
>>             "type": "temp",
>>             "readPath":
>> "/xyz/openbmc_project/sensors/temperature/inlet_Temp",
>>             "writePath": "",
>>             "min": 0,
>>             "max": 0,
>>             "ignoreDbusMinMax": true,
>>             "timeout": 0
>>         }
>>     ],
>>   "zones" : [
>>         {
>>             "id": 1,
>>             "minThermalOutput": 3000.0,
>>             "failsafePercent": 75.0,
>>             "pids": [
>>                 {
>>                     "name": "Fan0_Speed",
>>                     "type": "fan",
>>                     "inputs": ["Fan0_Speed"],
>>                     "setpoint": 50.0,
>>                     "pid": {
>>                         "samplePeriod": 0.1,
>>                         "proportionalCoeff": 20.0,
>>                         "integralCoeff": 0.1,
>>                         "feedFwdOffsetCoeff": 0.0,
>>                         "feedFwdGainCoeff": 1.0,
>>                         "integralLimit_min": 0.0,
>>                         "integralLimit_max": 5.0,
>>                         "outLim_min": 5.0,
>>                         "outLim_max": 60.0,
>>                         "slewNeg": 0.0,
>>                         "slewPos": 0.0
>>                     }
>>                 },
>>                 {
>>                     "name": "inlet_Temp",
>>                     "type": "temp",
>>                     "inputs": ["inlet_Temp"],
>>                     "setpoint": 50.0,
>>                     "pid": {                      amplePeriod": 0.1,
>>                         "samplePeriod": 1.0,
>>                         "proportionalCoeff": -0.1,
>>                         "integralCoeff": 1.0,     36;34Hin": 5.0,
>>                         "feedFwdOffsetCoeff": 0.0,
>>                         "feedFwdGainCoeff": 0.0,
>>                         "integralLimit_min": 0.0,
>>                         "integralLimit_max": 0.0,
>>                         "outLim_min": 3000.0,
>>                         "outLim_max": 16000.0,
>>                         "slewNeg": 0.0,
>>                         "slewPos": 0.0,
>>                         "positiveHysteresis": 1.0,
>>                         "negativeHysteresis": 1.0
>>                     }
>>            }
>>             ]
>>         }
>>     ]
>> }
>>
>

[-- Attachment #2: Type: text/html, Size: 26244 bytes --]

      reply	other threads:[~2020-11-12  1:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-14  1:33 How to let openbmc's kernel load jffs2 file system 周 远清
2020-07-14  2:41 ` 郁雷
2020-07-14  4:30 ` Milton Miller II
2020-09-27  3:17   ` about pid speed control 周 远清
2020-09-27 13:26     ` 回复: " 周 远清
2020-11-11 15:15       ` Patrick Venture
2020-11-12  1:20         ` Drew Macrae [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAD+EBrBsS-aBqfLt_pD8swaiMWzY6Du44AhbfBOZ9qj3DFWEg@mail.gmail.com \
    --to=drewmacrae@google.com \
    --cc=krellan@google.com \
    --cc=openbmc@lists.ozlabs.org \
    --cc=uperic@163.com \
    --cc=venture@google.com \
    --cc=zhouyuanqing8@outlook.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).