mirror of
https://git.FreeBSD.org/src.git
synced 2024-10-19 02:29:40 +00:00
When pidctrl_daemon() is called multiple times within an interval, it
should use the cumulative error to calculate the output.
This commit is contained in:
parent
fcabd54160
commit
5b274055d1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=334769
@ -146,7 +146,7 @@ pidctrl_daemon(struct pidctrl *pc, int input)
|
||||
pc->pc_derivative = pc->pc_error - pc->pc_olderror;
|
||||
|
||||
/* Divide by inverse gain values to produce output. */
|
||||
output = (error / Kpd) + (pc->pc_integral / Kid) +
|
||||
output = (pc->pc_error / Kpd) + (pc->pc_integral / Kid) +
|
||||
(pc->pc_derivative / Kdd);
|
||||
output = MAX(output - pc->pc_output, 0);
|
||||
/* Save for sysctl. */
|
||||
|
Loading…
Reference in New Issue
Block a user