Go to file
2024-12-26 22:47:35 +01:00
.vscode add control table 2024-12-22 16:34:26 +01:00
hardware/De_Dietrich_GTU add De Dietrich GTU connector J9 mechanics 2024-12-01 13:26:17 +01:00
main disable log 2024-12-26 22:47:12 +01:00
.gitignore update .gitignore and license 2024-12-03 22:41:13 +01:00
CMakeLists.txt move files in root dir 2024-12-07 15:47:55 +01:00
LICENSE update .gitignore and license 2024-12-03 22:41:13 +01:00
README.md update example metric 2024-12-26 20:47:21 +01:00

smart-oil-heating-control-system

Software

Design

classDiagram
Inputs <|-- Control
Outputs <|-- Control
Sntp <|-- Control
Inputs <|-- Safety
Outputs <|--|> Safety

Inputs <|-- Metrics
Outputs <|-- Metrics
Control <|-- Metrics
Safety <|-- Metrics
Sntp <|-- Metrics

    class Inputs{
        +initInputs()
        -taskInput()
        +getChamberTemperature()
        +getOutdoorTemperature()
        +getInletFlowTemperature()
        +getReturnFlowTemperature()
        +getBurnerError()
    }

    class Outputs{
        +initOutputs()
        +getCirculationPumpState()
        +setCirculationPumpState()
        +getBurnerState()
        +setBurnerState()
        +getSafetyControlState()
        +setSafetyControlState()
    }

    class Control{
        +taskControl()
        -controlTable
        +getControlState()
    }

    class Safety{
        +initSafety()
        -taskSafety()
        -setSafeState()
        -checkSensorSanity()
        +getSensorSanityStates()
        +getSafetyState()
    }


    class Wifi{
        +initWifi()
    }

    class Sntp{
        +initSntp()
        +getSntpState()
    }

    class Metrics{
        +initMetrics()
        -taskMetrics()
        -metrics
        +event_handler()
        +connect_wifi()
        +setMetrics()
    }

Prometheus Metrics

curl http://X.X.X.X:9100/metrics

Example

burner_fault_pending 1
circulation_pump_enabled 1
burner_enabled 0
safety_contact_enabled 0
chamber_temperature 58.750000
chamber_temperature_avg10 58.931252
chamber_temperature_avg60 59.190475
chamber_temperature_pred60 55.870998
inlet_flow_temperature 53.875000
inlet_flow_temperature_avg10 53.900002
inlet_flow_temperature_avg60 53.994320
inlet_flow_temperature_pred60 52.848743
outdoor_temperature 18.000000
outdoor_temperature_avg10 18.006250
outdoor_temperature_avg60 18.002840
outdoor_temperature_pred60 18.050785
return_flow_temperature 48.625000
return_flow_temperature_avg10 48.718750
return_flow_temperature_avg60 48.846592
return_flow_temperature_pred60 47.383083
chamber_temperature_state 0
outdoor_temperature_state 0
inlet_flow_temperature_state 0
return_flow_temperature_state 0
safety_state 0
control_state 3
sntp_state 0
system_unixtime 1735242392
uptime_seconds 40
wifi_rssi -74

Status Encoding

Digital Themperatur Sensor DS10B20
  • chamber_temperature_state
  • outdoor_temperature_state
  • inlet_flow_temperature_state
  • return_flow_temperature_state
Enum eSensorErrorState in safety.h Value Description
SENSOR_NO_ERROR 0
SENSOR_TOO_HIGH 1 Sanity check failed
SENSOR_TOO_LOW 2 Sanity check failed
SENSOR_UNCHANGED 3 Sanity check failed
SENSOR_NOT_FOUND 4 No Communication
Safety Loop
  • safety_state
Enum eSafetyState in safety.h Value Description
SAFETY_NO_ERROR 0
SAFETY_SENSOR_ERROR 1 At least one sensor failed
SAFETY_INTERNAL_ERROR 2 Internal error
Control Loop
  • control_state
Enum eControlState in control.h Value Description
CONTROL_STARTING 0
CONTROL_HEATING 1 Burner running
CONTROL_OUTDOOR_TOO_WARM 2 Heating not needed
CONTROL_RETURN_FLOW_TOO_WARM 3 Heating not needed
CONTROL_FAULT_BURNER 4 Burner reported fault after threshold is reached
CONTROL_FAULT_SAFETY 5 Unable to control due safety fault
CONTROL_FAULT_SNTP 6 Unable to control due SNTP fault
SNTP Client
  • sntp_state
Enum eSntpState in sntp.h Value Description
SYNC_SUCCESSFUL 0
SYNC_NOT_STARTED 1
SYNC_FAILED 2

Hardware

Function ESP32 PLC ES32C14
Output CirculationPump IO27 Relay 1 NC1
Output Burner Fire Signal IO14 Relay 2 NC2
Output Safety Contact (powers Burner) IO12 Relay 3 NC2
Input Burner Fault IO19 Digital Input IN1
Input Temperature DS10B20 IO04 1-Wire