Skip to content
Vadim Tkachenko edited this page Sep 26, 2023 · 3 revisions

Before you start

This page uses legacy code syntax. Current configuration is significantly simpler, but the concepts described are the same. This page will be moved into the code base shortly.

IMPORTANT: see Current vs. Legacy Code Base


Introduction

Your average thermostat rarely, if ever, gives you fine tuning options (except maybe [hysteresis](http://diy-zoning.blogspot.com/2007/07/rite-temp-gpmg8085c-informal-review.html hysteresis)). DZ thermostat is based on a PID controller with windup protection.

PID controller tuning is not as simple as it may seem ( google it up if you doubt). Whereas DZ PID controller can be tuned up according to classical PID tuning tutorials, there are some concepts understandable to non-geeks.

PID Controller Configuration XML Tag

Looks like this (see Configuration Guide for details):

<bean id="pid_controller-6500000055FF1A26" class="net.sf.dz3.controller.pid.SimplePidController">
  <!-- Setpoint (all configuration values are in SI Units only) -->
  <constructor-arg index="0" value="20.5"/>
  <!-- P -->
  <constructor-arg index="1" value="1"/>
  <!-- I -->
  <constructor-arg index="2" value="0.0000002"/>
  <!-- D, careful with it -->
  <constructor-arg index="3" value="0"/>
  <!-- Saturation limit, 1.1 is a reasonable default -->
  <constructor-arg index="4" value="3"/>
</bean>

Heating vs Cooling

This one is simple.

  • For cooling, both P and I are positive.
  • For heating, both P and I are negative.

Hysteresis, a.k.a. Temperature Swing

  • Decrease P to make the swing wider. This is good for your unit (less start/stops = longer unit ilfe, higher runtime = higher efficiency), but bad for comfort.
  • Increase P to make the swing narrower. Bad for your unit, good for your comfort. Remember, though, the price is high - your unit life, and, even more importantly, your electric bill (due to less efficient operation (see HVAC short cycling)).

Size Does Matter

  • For small rooms, consider decreasing P. Yes, the swing will be wider, but you'll save some money on the bill.
  • For big rooms, consider increasing P if your HVAC unit runs too long.

Fighting "Stale" Air

If your HVAC unit is stopped for extended periods of time (this happens mostly in mid-season, when ambient temperature is close to your setpoint), the air in your house starts feeling "stale". To avoid this, increase I. Be careful with this value - make sure you have saturation limit set to something other than zero, and PID signal graphs enabled so you can diagnose a problem should you accidentally remove a few extra zeros from the I value.

Magnitude of change

  • Sane values of P seem to lie between 0.25 and 10
  • Start with default value for I (above) and multiply or divide it by 10 to get the next candidate for consideration. Did I mention be careful? Also, having the telemetry enabled simplifies things a lot, one picture is better than a thousand words.