LPC1768: Increase ADC median filter from 3 values to 23

Clarify the HAL_adc_get_result method to make sure correct values enter the filters

HAL: Fix the PID control loop for non-AVR platforms
This commit is contained in:
Christopher Pepper
2018-01-07 22:15:20 +00:00
parent 9bfabc1f13
commit 14dcad6bbc
3 changed files with 117 additions and 37 deletions

View File

@ -90,7 +90,7 @@ enum ADCSensorState {
#if HAS_PID_HEATING
#define PID_K2 (1.0-PID_K1)
#define PID_dT ((OVERSAMPLENR * float(ACTUAL_ADC_SAMPLES)) / (F_CPU / 64.0 / 256.0))
#define PID_dT ((OVERSAMPLENR * float(ACTUAL_ADC_SAMPLES)) / TEMP_TIMER_FREQUENCY)
// Apply the scale factors to the PID values
#define scalePID_i(i) ( (i) * PID_dT )