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

PWM workaround #325

Open
Funkenschuhster opened this issue Aug 19, 2024 · 0 comments
Open

PWM workaround #325

Funkenschuhster opened this issue Aug 19, 2024 · 0 comments

Comments

@Funkenschuhster
Copy link

Funkenschuhster commented Aug 19, 2024

Due to the big hysteresis of the thermostat and the slow reaction of my floor heating I was never happy with the thermostat. It was periodically to hot or to cold in the room.
Now I found a crude workaround, to make PWM PID happen. The trick is to set the temperature higher or lower than the actual value to trigger the hysteresis.

Here is how I did it in node-red:

  1. I set up a standard PID controller. Analog input is the room temperature reading of the BHT-002. Analog output has a dynamic range of 0.0...1.0
  2. The analog output goes into a PWM node converting the analog 0.0...1.0 into a PWM at very slow frequency e. g. 200s on / 800s off = 0.25 = 25%
  3. The pulse goes to a converter which is generating a dynamic setpoint for BHT-002 based on the actual room temperature. See codebox below.
  4. The dynamic setpoint is calculated and sent to the BHT-002 frequently every two minutes. Frequently to make sure its always +-1K off even if the actual temperature just changed during calculation.

Code of the Setpoint generator:

// Open thermostat: set setpoint temperature higher than actual temperature
if (msg.pulseOut == 1) {
    msg.becaSetpoint = msg.becaRoomTemperature + 1K;
}

// Close thermostat: set setpoint temperature lower than actual temperature
if (msg.pulseOut == 0) {
    msg.becaSetpoint = msg.becaRoomTemperature - 1K;
}

return msg;

Used Nodes:
PID: node-red-contrib-pid
PWM: node-red-contrib-timeprop

I wonder if you could implement a PID workaround directly in the thermostat. Recommended features:

  • adjustable setpoint
  • adjustable PWM cycle time
  • adjustable PID parameter
  • integral lock (if window is open or difference too high for long)
  • summer valve anti seize feature: open valve daily/weekly for x amount of time
  • support an external room temperature sensor on ESP as actual value for PID (like DS18B20 or BME280 or BMP280)
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

1 participant