Lua Scripts questions for PID implementation
Posted: Thursday 17 July 2014 15:34
Hi all,
I'am trying to create a scritp to implement the famous PID thermostat controller for heaters and today I'am encountering 2 different issues:
1/ this kind of script needs to be able to switch On/Off on a timing smaller than a minute.
For example if the calculation define a heating period of 1 minute and 50 seconds, how could I control these 50 seconds ? I could do some rounding to maximise the periods to 30 seconds by saying for example if the timing returned is below 30 seconds then I execute it he minute and if it is after 30 seconds then I execute it the minute after.
But by doing that I am loosing a lot in precision and I would have at least a precision of 15 seconds which could be done by having a script called each 30 seconds instead of each minute of having some kind of Sleep method, then I could loop in my script.
2/ My temperature configuration is currently hardcoded in the script and I have not find any way to control it by the UI directly do you have any idea how I could do that from the UI ?
Thanks
I'am trying to create a scritp to implement the famous PID thermostat controller for heaters and today I'am encountering 2 different issues:
1/ this kind of script needs to be able to switch On/Off on a timing smaller than a minute.
For example if the calculation define a heating period of 1 minute and 50 seconds, how could I control these 50 seconds ? I could do some rounding to maximise the periods to 30 seconds by saying for example if the timing returned is below 30 seconds then I execute it he minute and if it is after 30 seconds then I execute it the minute after.
But by doing that I am loosing a lot in precision and I would have at least a precision of 15 seconds which could be done by having a script called each 30 seconds instead of each minute of having some kind of Sleep method, then I could loop in my script.
2/ My temperature configuration is currently hardcoded in the script and I have not find any way to control it by the UI directly do you have any idea how I could do that from the UI ?
Thanks