wideband/firmware/wideband_config.h

52 lines
1.3 KiB
C
Raw Normal View History

2020-10-30 02:03:12 -07:00
#pragma once
2021-12-27 20:42:57 -08:00
#include "io_pins.h"
2022-01-28 11:21:38 -08:00
#include "wideband_board_config.h"
2020-10-30 02:03:12 -07:00
// *******************************
// Nernst voltage & ESR sense
// *******************************
// Nernst AC injection resistor value
#define ESR_SUPPLY_R (22000)
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
2022-01-10 01:46:43 -08:00
#define HEATER_WARMUP_TIMEOUT 60000
2020-12-10 22:08:00 -08:00
#define HEATER_BATTERY_STAB_TIME 3000
// minimal battery voltage to start heating without CAN command
#define HEATER_BATTERY_ON_VOLTAGE 9.5
// mininal battery voltage to continue heating
#define HEATER_BATTETY_OFF_VOLTAGE 8.5
2022-01-10 01:46:43 -08:00
#define HEATER_CLOSED_LOOP_THRESHOLD_ESR 500
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
2022-01-10 01:46:43 -08:00
#define HEATER_UNDERHEAT_ESR 700