2020-10-30 02:03:12 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// Fundamental board constants
|
|
|
|
#define VCC_VOLTS (3.3f)
|
|
|
|
#define HALF_VCC (VCC_VOLTS / 2)
|
|
|
|
#define ADC_MAX_COUNT (4095)
|
2020-11-03 01:52:19 -08:00
|
|
|
#define ADC_OVERSAMPLE 24
|
2020-10-30 02:03:12 -07:00
|
|
|
|
|
|
|
// *******************************
|
|
|
|
// Nernst voltage & ESR sense
|
|
|
|
// *******************************
|
|
|
|
#define NERNST_INPUT_GAIN (1 / 2.7f)
|
|
|
|
|
|
|
|
// Nernst AC injection resistor value
|
|
|
|
#define ESR_SUPPLY_R (22000)
|
2021-01-17 03:31:44 -08:00
|
|
|
#define VM_RESISTOR_VALUE (10)
|
2020-10-30 02:03:12 -07:00
|
|
|
|
|
|
|
// *******************************
|
|
|
|
// Pump current sense
|
|
|
|
// *******************************
|
|
|
|
|
|
|
|
#define PUMP_CURRENT_SENSE_GAIN (10)
|
|
|
|
|
|
|
|
// LSU sense resistor - 61.9 ohms
|
|
|
|
#define LSU_SENSE_R (61.9f)
|
|
|
|
|
2020-12-15 14:41:09 -08:00
|
|
|
// Pump low pass filter alpha
|
|
|
|
// sampling at 2.5khz, alpha of 0.1 gives about 42hz bandwidth
|
|
|
|
#define PUMP_FILTER_ALPHA (0.1f)
|
|
|
|
|
2020-10-30 02:03:12 -07:00
|
|
|
// *******************************
|
2020-10-31 16:59:35 -07:00
|
|
|
// Pump controller
|
2020-10-30 02:03:12 -07:00
|
|
|
// *******************************
|
2020-10-31 16:59:35 -07:00
|
|
|
#define NERNST_TARGET (0.45f)
|
2020-10-31 14:58:34 -07:00
|
|
|
|
|
|
|
// *******************************
|
|
|
|
// Heater controller config
|
|
|
|
// *******************************
|
|
|
|
#define HEATER_CONTROL_PERIOD 50
|
2020-12-10 22:08:00 -08:00
|
|
|
|
|
|
|
#define HEATER_PREHEAT_TIME 5000
|
2021-03-17 23:40:23 -07:00
|
|
|
#define HEATER_WARMUP_TIMEOUT 30000
|
2020-12-10 22:08:00 -08:00
|
|
|
|
2020-12-11 15:25:01 -08:00
|
|
|
#define HEATER_CLOSED_LOOP_THRESHOLD_ESR 2000
|
2020-10-31 14:58:34 -07:00
|
|
|
#define HEATER_TARGET_ESR 300
|
2020-12-11 15:46:03 -08:00
|
|
|
#define HEATER_OVERHEAT_ESR 200
|
|
|
|
#define HEATER_UNDERHEAT_ESR 3000
|