wideband/firmware/wideband_config.h

51 lines
1.2 KiB
C
Raw Normal View History

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
2021-06-03 20:50:39 -07:00
// Heater low pass filter
#define ESR_SENSE_ALPHA (0.002f)
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
2021-06-03 20:50:39 -07:00
// sampling at 2.5khz, alpha of 0.01 gives about 50hz bandwidth
#define PUMP_FILTER_ALPHA (0.02f)
2020-12-15 14:41:09 -08:00
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-08-16 11:30:52 -07:00
#define HEATER_WARMUP_TIMEOUT 45000
2020-12-10 22:08:00 -08:00
2021-07-12 23:45:35 -07:00
#define HEATER_CLOSED_LOOP_THRESHOLD_ESR 400
2020-10-31 14:58:34 -07:00
#define HEATER_TARGET_ESR 300
2021-07-09 23:15:24 -07:00
#define HEATER_OVERHEAT_ESR 150
2021-07-12 23:45:35 -07:00
#define HEATER_UNDERHEAT_ESR 600