Index: firmware/App/Controllers/DialOutFlow.c =================================================================== diff -u -ra7675f3c917b632cf16207fc7ccfc1f38eb83f9b -r450fd51053df274149ec091955baa33e23e1c7a7 --- firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision a7675f3c917b632cf16207fc7ccfc1f38eb83f9b) +++ firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision 450fd51053df274149ec091955baa33e23e1c7a7) @@ -104,7 +104,8 @@ #define DOP_PWM_ZERO_OFFSET 0.1F ///< 10% PWM duty cycle = zero speed. /// Macro converts a flow rate to an estimated PWM duty cycle %. -#define DOP_PWM_FROM_ML_PER_MIN(rate) ( (rate) * DOP_ML_PER_MIN_TO_PUMP_RPM_FACTOR * DOP_GEAR_RATIO * DOP_MOTOR_RPM_TO_PWM_DC_FACTOR + DOP_PWM_ZERO_OFFSET ) +#define DOP_PWM_FROM_ML_PER_MIN(rate) ( ( (rate) * 0.0009 ) + 0.0972 + DOP_PWM_ZERO_OFFSET ) // TODO - need to consider BP rate? +//#define DOP_PWM_FROM_ML_PER_MIN(rate) ( (rate) * DOP_ML_PER_MIN_TO_PUMP_RPM_FACTOR * DOP_GEAR_RATIO * DOP_MOTOR_RPM_TO_PWM_DC_FACTOR + DOP_PWM_ZERO_OFFSET ) /// Conversion from PWM duty cycle % to commanded pump motor speed. #define DOP_PWM_TO_MOTOR_SPEED_RPM(pwm) ( ((pwm) - DOP_PWM_ZERO_OFFSET) * 4000.0F ) @@ -238,7 +239,7 @@ dopMeasuredRate = 0.0; ufMeasuredRate = 0.0; - dopRateCorrectionOffset = 40.0; // TODO - set to 0.0 when we have a better dop flow estimate. + dopRateCorrectionOffset = 0.0; resetDialOutFlowMovingAverage(); }