Index: firmware/App/Controllers/DrainPump.c =================================================================== diff -u -r3f7d30b23906496854054949d4491f3bae6ef3c4 -rb63e03ba8b2568afbbd314e9ba6c59c16db29f42 --- firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision 3f7d30b23906496854054949d4491f3bae6ef3c4) +++ firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision b63e03ba8b2568afbbd314e9ba6c59c16db29f42) @@ -54,9 +54,9 @@ #define DRP_CONTROL_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the Drain pump is controlled. -#define RPM_2_DAC_SLOPE 0.0011 ///< RPM to DAC conversion slope. -#define RPM_2_DAC_INTERCEPT 0.0585 ///< RPM to DAC conversion intercept. -#define GET_RPM_2_DAC_CONVERSION(rpm) ( ( RPM_2_DAC_SLOPE * rpm ) + RPM_2_DAC_INTERCEPT + \ +#define RPM_2_DAC_SLOPE 0.0547 ///< RPM to DAC conversion slope. +#define RPM_2_DAC_INTERCEPT 2.9968 ///< RPM to DAC conversion intercept. +#define GET_RPM_2_DAC_CONVERSION(rpm) ( ( RPM_2_DAC_SLOPE * rpm ) - RPM_2_DAC_INTERCEPT + \ FLOAT_TO_INT_ROUNDUP_OFFSET ) ///< RPM to DAC conversion equation. #define TOGGLE_PERIOD_RESOLUTION_SECONDS 0.000005 ///< Toggle period to resolution in seconds. @@ -175,7 +175,7 @@ if ( ( 0 == rpm ) || ( ( rpm >= MIN_DRAIN_PUMP_RPM ) && ( rpm <= MAX_DRAIN_PUMP_RPM ) ) ) { - //drainPumpDAC = (U32)((F32)rpm * DRP_SPEED_RPM_TO_ADC_FACTOR + FLOAT_TO_INT_ROUNDUP_OFFSET); TODO remove. Yes, it is temporary don't laugh + //drainPumpDAC = (U32)((F32)rpm * DRP_SPEED_RPM_TO_ADC_FACTOR + FLOAT_TO_INT_ROUNDUP_OFFSET); //TODO remove. Yes, it is temporary don't laugh drainPumpDAC = (U32)GET_RPM_2_DAC_CONVERSION(rpm);