Index: firmware/App/Controllers/DialInFlow.c =================================================================== diff -u -r59a959e90acca96b44158dcd65706e83069dc859 -r0b8f332794e830b2a9c87c7b7ba852120e1a7334 --- firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision 59a959e90acca96b44158dcd65706e83069dc859) +++ firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision 0b8f332794e830b2a9c87c7b7ba852120e1a7334) @@ -108,7 +108,7 @@ #define DIP_PWM_ZERO_OFFSET 0.1F ///< 10% PWM duty cycle = zero speed. /// Conversion from PWM duty cycle % to commanded pump motor speed. PWM range is 10% to 90%. RPM range is 0 to 3200. 3200 / 0.8 = 4000. -#define DIP_PWM_TO_MOTOR_SPEED_RPM(pwm,dir) ( ( ((pwm) - DIP_PWM_ZERO_OFFSET) * 4000.0F ) * ( dir == MOTOR_DIR_FORWARD ? 1 : -1 ) ) +#define DIP_PWM_TO_MOTOR_SPEED_RPM(pwm,dir) ( ( ((pwm) - DIP_PWM_ZERO_OFFSET) * 4000.0F ) * ( dir == MOTOR_DIR_FORWARD ? 1.0F : -1.0F ) ) /// Conversion from pump motor speed to PWM duty cycle. #define DIP_MOTOR_SPEED_RPM_TO_PWM(rpm) ( ( rpm / 4000.0F ) + 0.1 ) // Macro converts PWM to estimate flow rate needed to achieve it. TODO - this macro does not reverse the function that estimates PWM from target flow rate - and it should @@ -1248,8 +1248,8 @@ * 2. while pump is controlling, measured motor speed should be within allowed range of commanded speed. * 3. measured motor speed should be within allowed range of measured rotor speed. * All 3 checks have a persistence time that must be met before an alarm is triggered. - * @details Inputs: targetDialInFlowRate, dialInPumpSpeedRPM, dialInPumpRotorSpeedRPM - * @details Outputs: alarm(s) may be triggered + * @details Inputs: targetDialInFlowRate, dialInPumpState, dialInPumpPWMDutyCyclePctSet, dialInPumpDirectionSet + * @details Outputs: errorDialInMotorOffPersistTimerCtr, alarm(s) may be triggered * @return none *************************************************************************/ static void checkDialInPumpSpeeds( void )