mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eduardo Valentin <edubezval@gmail.com>
To: Javi Merino <javi.merino@arm.com>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	punit.agrawal@arm.com, broonie@kernel.org,
	Zhang Rui <rui.zhang@intel.com>
Subject: Re: [PATCH v1 4/7] thermal: introduce the Power Allocator governor
Date: Tue, 24 Feb 2015 14:21:26 -0400	[thread overview]
Message-ID: <20150224182124.GB3448@developer.amazonguestwifi.org> (raw)
In-Reply-To: <1422464438-16761-5-git-send-email-javi.merino@arm.com>

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

Javi,

One minor clarification as follows:

On Wed, Jan 28, 2015 at 05:00:35PM +0000, Javi Merino wrote:

<big cut>

> +
> +k_d
> +---
> +
> +`k_d` configures the PID loop's derivative term constant.  It's
> +recommended to leave it as the default: 0.
> +

I know we are considering K_d = 0. However, ...

<yet another big cut>

> +	/*
> +	 * Calculate the derivative term
> +	 *
> +	 * We do err - prev_err, so with a positive k_d, a decreasing
> +	 * error (i.e. driving closer to the line) results in less
> +	 * power being applied, slowing down the controller)
> +	 */
> +	d = mul_frac(tz->tzp->k_d, err - params->prev_err);


... Shouldn't the above d component consider the rate of changes over time of the error?

I would expect you should do:
d = k_d * (dE / dt)

or

d = K_d * ((err - params->prev_err) / sampling_period)

in plain C:

+	d = mul_frac(tz->tzp->k_d, err - params->prev_err);
+	d /= tz->passive_polling; /* might require fixed point division */

---
Eduardo Valentin

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  parent reply	other threads:[~2015-02-24 18:20 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-28 17:00 [PATCH v1 0/7] The power allocator thermal governor Javi Merino
2015-01-28 17:00 ` [PATCH v1 1/7] thermal: let governors have private data for each thermal zone Javi Merino
2015-01-28 17:00 ` [PATCH v1 2/7] thermal: extend the cooling device API to include power information Javi Merino
2015-01-28 17:00 ` [PATCH v1 3/7] thermal: cpu_cooling: implement the power cooling device API Javi Merino
2015-01-28 17:56   ` Eduardo Valentin
2015-01-29 19:11     ` Javi Merino
2015-01-28 17:00 ` [PATCH v1 4/7] thermal: introduce the Power Allocator governor Javi Merino
2015-02-02 23:51   ` Lina Iyer
2015-02-03 13:03     ` Javi Merino
2015-02-03  4:31       ` Eduardo Valentin
2015-02-03 17:32         ` Lina Iyer
2015-02-03 19:19           ` Eduardo Valentin
2015-02-04 23:47             ` Lina Iyer
2015-02-09 10:14               ` Javi Merino
2015-02-24 18:21   ` Eduardo Valentin [this message]
2015-02-25 14:48     ` Javi Merino
2015-02-25 19:00       ` Eduardo Valentin
2015-02-26 17:52         ` Javi Merino
2015-02-26 20:32   ` Eduardo Valentin
2015-01-28 17:00 ` [PATCH v1 5/7] thermal: add trace events to the power allocator governor Javi Merino
2015-01-28 17:31   ` Steven Rostedt
2015-02-02 15:44     ` Javi Merino
2015-01-28 17:00 ` [PATCH v1 6/7] of: thermal: Introduce sustainable power for a thermal zone Javi Merino
2015-01-28 17:00 ` [PATCH v1 7/7] thermal: export thermal_zone_parameters to sysfs Javi Merino
2015-02-05 12:06 ` [PATCH v1 0/7] The power allocator thermal governor Javi Merino

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=20150224182124.GB3448@developer.amazonguestwifi.org \
    --to=edubezval@gmail.com \
    --cc=broonie@kernel.org \
    --cc=javi.merino@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=punit.agrawal@arm.com \
    --cc=rui.zhang@intel.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

all inboxes | Powered by JetHome®