Posts: 212
Threads: 61
Joined: May 2018
Reputation:
4
I'm trying to get the PID working the way I want to.
It doesn't seem to adjust to the parameters in the way I'm used to.
with just 1% over or under SP the output goes to 0 or 100..
Any advice in tweaking this to work better?
Posts: 7741
Threads: 42
Joined: Jun 2015
Reputation:
446
For how long was the script running? PID needs some time to stabilize and if you restart the script the accumulated values will be lost. Have you modified the kp/ki/kd gain values?
Posts: 212
Threads: 61
Joined: May 2018
Reputation:
4
Yes I have modified the kp,ki,kd,it has ben on for hours now with same result.
I suspect there is something off in my parameters, cause I changed the max to 80% but it still gives out 100%
Posts: 4614
Threads: 24
Joined: Aug 2017
Reputation:
206
To what object did you link the output?
------------------------------
Ctrl+F5
Posts: 4614
Threads: 24
Joined: Aug 2017
Reputation:
206
What datatype?
------------------------------
Ctrl+F5
Posts: 7741
Threads: 42
Joined: Jun 2015
Reputation:
446
ki 300 is way too much. Set is to 1, restart the script using disable/enable and check how it works.
Posts: 1762
Threads: 6
Joined: Jul 2015
Reputation:
117
Try this:
To make it work as expected, i.e output 0-100%:
The p-term is calculated in range 0-1, so it should be multiplied with 100 in the script.
Some other points:
Kp = 1 / P-band --> P-band = 4 K -> Kp = 0,25
Ki = Kp / Ti * 100 --> Ti = (1 min * 60 s) -> Ki = 0.42
You can easily test this:
Current: 20
Setpoint: 21
P-term immediately gives output: 25%
After 1 min output is 50% (as the I-term is aiming reaching P-term i Ti-time)
So if you want 5 K / 240 min
Kp = 1 / 5 -> 0,2
Ki = (0,2 / 240 * 60) * 100 -> 0.0014
Posts: 212
Threads: 61
Joined: May 2018
Reputation:
4
Thank you, will do some testing. Intended use is to regulate a ventilation fan.
Sent fra min SM-G980F via Tapatalk
Posts: 7741
Threads: 42
Joined: Jun 2015
Reputation:
446
Check that your setpoint group address has correct data type. Error tells that it is 1-bit instead of 2-byte float.
Posts: 212
Threads: 61
Joined: May 2018
Reputation:
4
01.02.2023, 10:05
(This post was last modified: 01.02.2023, 10:25 by tomnord.)
figured it out. Is it possible to set some sort of deadband on the PID? So the output does not change when value within a deadband of e.g 2.5
It still regulates as described above, 0 and then 100. I want the output to gradually increese when closing on setpoint, and then gradually reduce when above. Im used to Pgain and I time. but this is not applicable here? d gain, how do you dissable this? does it accept 0?
Posts: 7741
Threads: 42
Joined: Jun 2015
Reputation:
446
Do you need deadband for combined heating and cooling? One option is to have two PID scripts where only one is active at a time. For this you will need an extra object to for mode switch. You can also modify the PID library. Otherwise PID library should be modified to incorporate this.
Erwin's already described how to tune gain values.
Posts: 7741
Threads: 42
Joined: Jun 2015
Reputation:
446
Then please explain exactly how the deadband should work in this case.