soloam / ha-pid-controller

PID Controller to Home Assistant
MIT License
97 stars 12 forks source link

When I lower the set-point, PID goes to min #31

Open lukepighetti opened 1 year ago

lukepighetti commented 1 year ago

Temp was 275f, set point was 275f. P is 3 and I is 0.01

Changed set point to 250f. It immediately dropped to the minimum. I expected it to smoothly transition.

Is this a tuning problem or a bug?

Screen Shot 2022-10-18 at 12 57 32 PM
soloam commented 1 year ago

What version of the PID are you running? Is it the latest?

soloam commented 1 year ago

Normally that bump is because you might have a very high "p". Give me your config, aren't you using the "d"?

Pukinn commented 1 year ago

I have the same issue. But it's not because of a high Kp. It seems the controller resets after changing the set_point. The attributes p, i, d are going to 0. If a high Kp were the reason, I think p should go to a negative value.
Also it goes to min value, if I increase the set_point (invert == false).

I use the latest version 1.1.5

soloam commented 1 year ago

Yes the pid is resetting when the set point is changed! Probably this could be avoided, but I don't know if in some cases it wouldn't be desirable!

On Thu, Dec 15, 2022, 14:35 Pukinn @.***> wrote:

I have the same issue. But it's not because of a high Kp. It seems the controller resets after changing the set_point. The attributes p, i, d are going to 0. If a high Kp were the reason, I think p should go to a negative value. Also it goes to min value, if I increase the set_point (invert == false).

I use the latest version 1.1.5

— Reply to this email directly, view it on GitHub https://github.com/soloam/ha-pid-controller/issues/31#issuecomment-1353189741, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3FPI53W6SHKC4JECYBXPLWNMUB7ANCNFSM6AAAAAARIJJOP4 . You are receiving this because you commented.Message ID: @.***>

Pukinn commented 1 year ago

In which scenario this could be desirable? After a change of the set point I expect a correction because of the derivative part in the next cycle.
But I increase the set_point and the correction goes down to 0 until the next update of the source.

I think the controller should only reset if the reset is manually triggered.

soloam commented 1 year ago

I agree with that! The reason to do this is to avoid sudden spikes up in the pid, but this is making the spike down! I'll fix it!