Lua Scripts questions for PID implementation

Moderator: leecollings

Post Reply
philou
Posts: 2
Joined: Thursday 26 June 2014 14:08
Target OS: Linux
Domoticz version:
Contact:

Lua Scripts questions for PID implementation

Post by philou »

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
philou
Posts: 2
Joined: Thursday 26 June 2014 14:08
Target OS: Linux
Domoticz version:
Contact:

Re: Lua Scripts questions for PID implementation

Post by philou »

Hi Again,

So I have partially solve my issues at least the Issue 1 by creating a fake device which switch every 15 seconds, so when it switch off I move it back to On and my script is call every 15 seconds. I could have set it to a smaller but it generate thousand of logs, which brings me to a new question:

Is there a way to not log state changes for a specific device ?

And my issue 2 about setting the temperature is still valid if somebody has an idea, then it could be great !

Thanks
Thomasdc
Posts: 133
Joined: Wednesday 11 March 2015 19:13
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Lua Scripts questions for PID implementation

Post by Thomasdc »

does someone has a good workind scrip with PID implementation? (For controlling my heating)
jannl
Posts: 673
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Geleen
Contact:

Re: Lua Scripts questions for PID implementation

Post by jannl »

I suppose you used google?

https://www.google.nl/webhp?sourceid=ch ... #q=pid+lua

Propably not going to be easy.
Thomasdc
Posts: 133
Joined: Wednesday 11 March 2015 19:13
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Lua Scripts questions for PID implementation

Post by Thomasdc »

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest