Add fast moving average filter for faster startup

This commit is contained in:
2021-01-09 22:26:31 +01:00
parent bbfcd429fe
commit 69ff13a991
2 changed files with 19 additions and 2 deletions

View File

@@ -38,6 +38,12 @@
*/
#define ADC_PT1000_FILTER_WEIGHT 0.005f
/**
* @brief Moving average filter weight used for fast regaulation. This is used when the measured resistance
* is more than 20 Ohms away from the current averaged value.
*/
#define ADC_PT1000_FILTER_WEIGHT_FAST 0.05
/**
* @brief ADC channel number of PT1000 sensor input
*/
@@ -99,6 +105,8 @@
*/
#define ADC_TO_RES(adc) ((float)(adc) / 4096.0f * 2500.0f)
#define RES_TO_ADC(res) ((float)(res) / 2500.0f * 4096.0f)
/**
* @brief This function sets up the ADC measurement fo the external PT1000 temperature sensor
*