PID regulator - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: PID regulator (/showthread.php?tid=3133) |
PID regulator - tomnord - 28.01.2021 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? RE: PID regulator - admin - 28.01.2021 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? RE: PID regulator - tomnord - 28.01.2021 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% RE: PID regulator - Daniel - 28.01.2021 To what object did you link the output? RE: PID regulator - tomnord - 28.01.2021 32/1/5 Code: --PID Supply RE: PID regulator - Daniel - 28.01.2021 What datatype? RE: PID regulator - admin - 28.01.2021 ki 300 is way too much. Set is to 1, restart the script using disable/enable and check how it works. RE: PID regulator - Erwin van der Zwart - 28.01.2021 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 PID regulator - tomnord - 29.01.2021 Thank you, will do some testing. Intended use is to regulate a ventilation fan. Sent fra min SM-G980F via Tapatalk RE: PID regulator - tomnord - 01.02.2023 Code: User library tratec_PID:126: attempt to perform arithmetic on local 'setpoint' (a boolean value) Call: Code: if not pTV then RE: PID regulator - admin - 01.02.2023 Check that your setpoint group address has correct data type. Error tells that it is 1-bit instead of 2-byte float. RE: PID regulator - tomnord - 01.02.2023 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? RE: PID regulator - admin - 01.02.2023 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. RE: PID regulator - tomnord - 01.02.2023 (01.02.2023, 10:28)admin Wrote: 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. I'm not using this as a heating PID, but a fancontroller. The PID transmits settpints to a frequency drive. RE: PID regulator - admin - 01.02.2023 Then please explain exactly how the deadband should work in this case. RE: PID regulator - tomnord - 01.02.2023 (01.02.2023, 12:03)admin Wrote: Then please explain exactly how the deadband should work in this case. setpoint= 90% actual = value from regulator deadband = 0.5 if "actual" is within +/- "deadband" of "setpoint" then "output" stays uncanged. |