User Tools

Site Tools


bms:bestpractice:roomcontrol:headpage

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
bms:bestpractice:roomcontrol:headpage [2022/02/13 12:25] mkbms:bestpractice:roomcontrol:headpage [2022/02/15 19:53] (current) – [PID Regulator] mk
Line 1: Line 1:
-==== Room control ====+===== Room control =====
  
 Controlling the environment in a room can be tricky. Often it's based on an economic viewpoint. Controlling the environment in a room can be tricky. Often it's based on an economic viewpoint.
Line 6: Line 6:
 I will try explaining "Best Practice" or "Ideas of best practice" below with increasing advancements. I will try explaining "Best Practice" or "Ideas of best practice" below with increasing advancements.
  
-=== Room control Heat ===+==== Room control Heat ====
  
 Simplest automation, is a room temperature sensor controlling room heating. Simplest automation, is a room temperature sensor controlling room heating.
 Heat setpoint at 23 °C, and when room temperature gets below this setpoint, you can start regulation your heat option. Heat setpoint at 23 °C, and when room temperature gets below this setpoint, you can start regulation your heat option.
  
-=== Regulation types ===+==== Regulation types ====
 Regulators can be a difficult subject that requires a comprehensive explaination. Regulators can be a difficult subject that requires a comprehensive explaination.
 For now I'll just explain 2 types. For now I'll just explain 2 types.
  
-== Control curve ==+=== Control curve ===
  
 Control curves can be 2 points and upwards (Often no more then 10 points) Control curves can be 2 points and upwards (Often no more then 10 points)
Line 25: Line 25:
 </gchart> </gchart>
  
-== PID Regulator == 
  
-PID regulators is a bit more difficult to explain and understand. 
-They use more system resources so often the control curve is preferred if the system is low on resources. 
  
-I'll try a simple explanation first: +\\ 
-If the temperature (Control variable) gets below setpoint, the regulator will increase the heating (Output variable)+\\
  
-There's in a basic PID regulator, 3 variables, proportional gain (P or P-band), integral gain (I or I-time) and derivative gain (D)+\\ 
 +=== PID Regulator ===
  
-You can use 3 methods, P, PI or PID+Please visit the [[bms:guides:pid|PID guide]] in guides section
  
-=== P-regulator == +==== Sensors explained ====
-A P-regulator, will measure the "error" from ( setpoint - control variable ), if setpoint is 23 and control variable is 20, the "error" will be 3. +
-It will then take the output variable and add the error. If the output was 0, after the calculation it will be 3. +
- +
-=== Pseudo code === +
- +
-On [[https://en.wikipedia.org/wiki/PID_controller|Wikipedia]] there's a lot of information about this regulator, but I will highlight one thing from there, a pseudo code examble. +
- +
-  * Kp - proportional gain +
-  * Ki - integral gain +
-  * Kd - derivative gain +
-  * dt - loop interval time +
-  * previous_error := 0 +
-  * integral := 0 +
- +
-  loop: +
-  error := setpoint − measured_value +
-  proportional := error; +
-  integral := integral + error × dt +
-  derivative := (error − previous_error) / dt +
-  output := Kp × proportional + Ki × integral + Kd × derivative +
-  previous_error := error +
-  wait(dt) +
-  goto loop +
- +
- +
- +
-=== Proportional or P-band === +
- +
- +
- +
-=== Integral or I-time === +
- +
-=== Derivative === +
- +
-=== Illustrative examble === +
-=== Sensors explained ===+
  
 A sensor is basically anything inbound information, from temperature to light status. A sensor is basically anything inbound information, from temperature to light status.
Line 87: Line 49:
 </WRAP> </WRAP>
 <WRAP clear></WRAP> <WRAP clear></WRAP>
 +
 +
 +\\
 +\\
 +\\
 +\\
  
 ~~DISCUSSION~~ ~~DISCUSSION~~
bms/bestpractice/roomcontrol/headpage.1644751514.txt.gz · Last modified: 2022/02/13 12:25 by mk