Humidistat
Arduino firmware for a humidistat (humidity controller)
Loading...
Searching...
No Matches
config Namespace Reference

Define either HUMIDISTAT_CONTROLLER_SINGLE or HUMIDISTAT_CONTROLLER_CASCADE. In the latter case, flow sensors must be connected to PIN_F1 and PIN_F2. More...

Variables

const uint32_t serialRate = 115200
 Serial communication symbol rate (baud)
 
const bool overrideEEPROM = false
 Set to true to override the values stored in EEPROM and use the default PID parameters defined below.
 
const uint8_t EEPROMAddress = 0
 EEPROM address for storing the block.
 
const uint16_t dt = 500
 Global interval for PID/logger (based on polling rate of sensor, in millis)
 
const double S_lowValue = 0.75
 Minimum solenoid duty cycle (deadband)
 
const double HC_totalFlowrate = 2
 Total flowrate (for cascade controller) (L/min)
 
const double a = 0.75
 Smoothing factor of EMA filter for derivative.
 
Humidity controller PID parameters
const double HC_Kp = 0.01
 
const double HC_Ki = 0.001
 
const double HC_Kd = 0.01
 
const double HC_Kf = 0.01
 
Flow controller PID parameters
const double FC_Kp = 0.005
 
const double FC_Ki = 0.05
 
const double FC_Kd = 0
 
const double FC_Kf = 0
 
const uint16_t FC_dt = 100
 
Setpoint profiles

Here you can define setpoint profiles (arrays of Points, which are pairs of a time and setpoint value). The Point arrays must be sorted in time. Enter the profiles in profiles, which is an array of SPProfiles (which takes a pair of a label string and span of Points)

const uint8_t interval = 20
 
const Point profile_tuningtest []
 
const SPProfile profiles []
 Setpoint profile definitions.
 
UI
const uint16_t buttonDebounceInterval = 500
 For debouncing: interval the keypad state must be stable for (in micros)
 
const uint16_t inputInterval = 200
 Repeat interval for keypress events (in millis)
 
const uint16_t blinkInterval = 500
 Interval for blinking display elements (in millis)
 
const uint16_t splashDuration = 2000
 Duration for which to show the splash screen (in millis)
 
const uint16_t infoDuration = 0
 Duration for which to show the info screen (in millis)
 
const uint16_t refreshInterval = 100
 Interval for updating the display (in millis)
 
const uint8_t adjustStep = 10
 Step size by which to in-/de-crement for coarse adjustment.
 
const double tolerance = 0.01
 Tolerance in difference between process variable and setpoint outside which the setpoint blinks (in percentage points)
 
For GraphicalDisplayUI:
const uint16_t longPressDuration = 500
 Duration for counting a press as 'long' (in millis)
 
const uint8_t configSaveCooldown = 20 * 1000 / refreshInterval
 Cooldown on saving the config to EEPROM (in refresh cycles)
 

Detailed Description

Define either HUMIDISTAT_CONTROLLER_SINGLE or HUMIDISTAT_CONTROLLER_CASCADE. In the latter case, flow sensors must be connected to PIN_F1 and PIN_F2.

Define either HUMIDISTAT_DHT (for DHT22/AM2302 sensors) or HUMIDISTAT_SHT (for Sensirion SHT85 sensors). In the former case, the data pin of the sensor should be connected to PIN_DHT. In the latter case, the sensor should be connected to the I2C bus. On the Arduino Uno, these pins (SDA and SCL) are shared with A4 and A5. Define either HUMIDISTAT_INPUT_KS0256 or HUMIDISTAT_INPUT_KS0466. In either case, the keypad must be connected to PIN_BTN specified below. Define either HUMIDISTAT_UI_CHAR HUMIDISTAT_UI_GRAPH for a HD44780 16x02 character display, or a ST7920 graphical display respectively. In the former case, the display must be connected to the pins specified below (PIN_LCD_x). in the latter case, the display must be connected to the hardware SPI bus.

Variable Documentation

◆ a

const double config::a = 0.75

Smoothing factor of EMA filter for derivative.

Definition at line 72 of file config.h.

◆ adjustStep

const uint8_t config::adjustStep = 10

Step size by which to in-/de-crement for coarse adjustment.

Definition at line 166 of file config.h.

◆ blinkInterval

const uint16_t config::blinkInterval = 500

Interval for blinking display elements (in millis)

Definition at line 154 of file config.h.

◆ buttonDebounceInterval

const uint16_t config::buttonDebounceInterval = 500

For debouncing: interval the keypad state must be stable for (in micros)

Definition at line 148 of file config.h.

◆ configSaveCooldown

const uint8_t config::configSaveCooldown = 20 * 1000 / refreshInterval

Cooldown on saving the config to EEPROM (in refresh cycles)

Definition at line 180 of file config.h.

◆ dt

const uint16_t config::dt = 500

Global interval for PID/logger (based on polling rate of sensor, in millis)

Definition at line 45 of file config.h.

◆ EEPROMAddress

const uint8_t config::EEPROMAddress = 0

EEPROM address for storing the block.

Definition at line 39 of file config.h.

◆ FC_dt

const uint16_t config::FC_dt = 100

Definition at line 62 of file config.h.

◆ FC_Kd

const double config::FC_Kd = 0

Definition at line 60 of file config.h.

◆ FC_Kf

const double config::FC_Kf = 0

Definition at line 61 of file config.h.

◆ FC_Ki

const double config::FC_Ki = 0.05

Definition at line 59 of file config.h.

◆ FC_Kp

const double config::FC_Kp = 0.005

Definition at line 58 of file config.h.

◆ HC_Kd

const double config::HC_Kd = 0.01

Definition at line 52 of file config.h.

◆ HC_Kf

const double config::HC_Kf = 0.01

Definition at line 53 of file config.h.

◆ HC_Ki

const double config::HC_Ki = 0.001

Definition at line 51 of file config.h.

◆ HC_Kp

const double config::HC_Kp = 0.01

Definition at line 50 of file config.h.

◆ HC_totalFlowrate

const double config::HC_totalFlowrate = 2

Total flowrate (for cascade controller) (L/min)

Definition at line 69 of file config.h.

◆ infoDuration

const uint16_t config::infoDuration = 0

Duration for which to show the info screen (in millis)

Definition at line 160 of file config.h.

◆ inputInterval

const uint16_t config::inputInterval = 200

Repeat interval for keypress events (in millis)

Definition at line 151 of file config.h.

◆ interval

const uint8_t config::interval = 20

Definition at line 129 of file config.h.

◆ longPressDuration

const uint16_t config::longPressDuration = 500

Duration for counting a press as 'long' (in millis)

Definition at line 177 of file config.h.

◆ overrideEEPROM

const bool config::overrideEEPROM = false

Set to true to override the values stored in EEPROM and use the default PID parameters defined below.

Definition at line 36 of file config.h.

◆ profile_tuningtest

const Point config::profile_tuningtest[]
Initial value:
= {
{0 * interval, 50},
{1 * interval, 30},
{2 * interval, 60},
{3 * interval, 70},
{4 * interval, 20},
}
const uint8_t interval
Definition config.h:129

Definition at line 130 of file config.h.

◆ profiles

const SPProfile config::profiles[]
Initial value:
= {
{"Tuning test", etl::span<const Point>(profile_tuningtest)},
}

Setpoint profile definitions.

Definition at line 139 of file config.h.

◆ refreshInterval

const uint16_t config::refreshInterval = 100

Interval for updating the display (in millis)

Definition at line 163 of file config.h.

◆ S_lowValue

const double config::S_lowValue = 0.75

Minimum solenoid duty cycle (deadband)

Definition at line 66 of file config.h.

◆ serialRate

const uint32_t config::serialRate = 115200

Serial communication symbol rate (baud)

Definition at line 33 of file config.h.

◆ splashDuration

const uint16_t config::splashDuration = 2000

Duration for which to show the splash screen (in millis)

Definition at line 157 of file config.h.

◆ tolerance

const double config::tolerance = 0.01

Tolerance in difference between process variable and setpoint outside which the setpoint blinks (in percentage points)

Definition at line 170 of file config.h.