Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] PID controler - heater thermostat #2425

Closed
sirLeone opened this issue Apr 12, 2018 · 10 comments
Closed

[Request] PID controler - heater thermostat #2425

sirLeone opened this issue Apr 12, 2018 · 10 comments

Comments

@sirLeone
Copy link

It would be great to have a possbility to control heater (e.g. water heater, electric heater) via SSR (Fotek ?) and tasmota. As a temp sensor could be used DS18x20. SSR is driven by 3-32VDC so it is not a problem to find on board.
Arduino has its own PID library so maybe it is not a huge effort to port it to esp8266.
I am sure that there are a lot of people interested in having such a functionality.

@Jason2866
Copy link
Collaborator

Dump question what is SSR?

@KPK75
Copy link

KPK75 commented Apr 12, 2018

Solid State Relay?

@sirLeone
Copy link
Author

Exactly - SSR - Solid State Relay, most common (and counterfeited) is FOTEK but can can be any other with specific parameters (driven by 3-32 VDC)

@AlexTransit
Copy link

I use SSR on my boiler.
added a couple lines of code (no settings)
and works almost a year.

@LEMD49
Copy link

LEMD49 commented Apr 13, 2018

+1

@Jason2866
Copy link
Collaborator

I dont understand why a SSR needs an change in the software. Just connect it instead of a normal relay.
Or do i miss something?

@Frogmore42
Copy link
Contributor

People are asking for a PID controller to be implemented in Tasmota itself. I find it somewhat funny. A PID controller is a commonly used system in industrial process control, but it is far from necessary, or justified, for many systems. The far more common bang-bang controller is fine for many systems and proper use of a PID controller requires tuning and stability testing/design. Bang-bang control is what is used by most home heating systems. When the temperature drops below the set point, the system turns on the heater. When it goes above the set point, it turns off the heater.

I first implemented various control strategies in a lab course 35 years ago and it was fun to watch the system respond. Five years ago I needed a freeze protection system. I implemented a very simple bang-bang controller. On one part, the heater is probably 20x more than what is needed and the thermal inertia is quite large. With 0 deadband there is still an overshoot of about 20 degrees. In this case a nicely tuned PID controller (with at least P and I non zero) would likely offer better performance, with better defined as maintaining temperature much closer to set point. But, since the goal was to keep the faucet from freezing, the current solution is fine. On another part of the system, the heat input much more closely matches the need and the thermal mass of the medium is much less (difference between water and air). On this part of the system, bang-bang keeps the temperature of the coldest part within a degree or so the set point.

Last year (before winter) I stared using Tasmota for this purchase (since my original systems started failing and were no longer available). I use standard Tasmota, mosquito, and NodeRED. I have a flow in NodeRED that takes the sensor readings and does the comparison and then sends a MQTT message to Tasmota to turn on the relay. Tasmota is configured to automatically turn off the relay, which makes sure it will fail in safe condition. I need to add a thermal limit switch as a backup (in case Tasmota or the hardware fails with the relay powered on).

If I really wanted PID control, I could add it in NodeRED. Or, use the PID controller developed by another user.

@Frogmore42
Copy link
Contributor

@ascillato
Copy link
Contributor

Hi,

In the wiki, now is available an example of a Simple Thermostat using RULE feature (https://github.com/arendst/Sonoff-Tasmota/wiki/Rules#7-simple-thermostat-example)

Please, check it to see if that helps you.

The control technique used there is just a simple ON/OFF with 2 set point values (upper and lower limit)

To use PID you will have to add the PID files as explained on the wiki and modify the thermostat example to use the PID commands explained inside the PIDs files.

@ascillato2
Copy link
Collaborator

Hi, If your issue is not solved with all the links provided, please reopen it. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants