Index: firmware/App/Controllers/DrainPump.c =================================================================== diff -u -rd325999b7b3ea03b7e294cb8a0b97df93812fbe9 -re2406180bf569fb495b709542c12da099c8e23ea --- firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision d325999b7b3ea03b7e294cb8a0b97df93812fbe9) +++ firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision e2406180bf569fb495b709542c12da099c8e23ea) @@ -51,7 +51,7 @@ #define DRAIN_PUMP_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) ///< Interval (ms/task time) at which the Drain Pump data is published on the CAN bus. #define DRP_CONTROL_INTERVAL ( 1000 / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the Drain pump is controlled. -#define DRP_CONTROL_MAX_ALLOWED_PPO_PSI 30.0F ///< Drain pump maximum allowed PPo pressure in psi. +#define DRP_CONTROL_MAX_ALLOWED_PPO_PSI CLEANING_MODE_HIGH_TEMP_MAX_RO_PRESSURE_PSI ///< Drain pump maximum allowed PPo pressure in psi. #define DRP_CONTROL_MAX_ALLOWED_PDR_PSI 40.0F ///< Drain pump maximum allowed PDr pressure in psi. #define DRP_CONTROL_PSI_TO_DAC_P_ONLY_TERM 0.2F ///< Drain pump psi to DAC conversion. #define DRP_CONTROL_FLOW_TO_DAC_P_ONLY_TERM 100.0F ///< Drain pump flow (L/min) to DAC conversion. @@ -715,10 +715,11 @@ if ( TRUE == isDrainPumpControlInFlowMode ) { - F32 dac = runPIController( PI_CONTROLLER_ID_DRAIN_PUMP, targetROFlowLPM, msrdROFlowLPM ); + F32 dac = runPIController( PI_CONTROLLER_ID_DRAIN_PUMP, targetROFlowLPM, msrdROFlowLPM ); + drainPumpDACSet = (U32)( dac + FLOAT_TO_INT_ROUNDUP_OFFSET ); - if ( ( drainPumpOutletPressurePSI > DRP_CONTROL_MAX_ALLOWED_PDR_PSI ) || ( roPumpOutletPressurePSI > DRP_CONTROL_MAX_ALLOWED_PPO_PSI ) ) + if ( ( drainPumpOutletPressurePSI > DRP_CONTROL_MAX_ALLOWED_PDR_PSI ) || ( roPumpOutletPressurePSI > (F32)DRP_CONTROL_MAX_ALLOWED_PPO_PSI ) ) { // If either of the pressure sensors are above range, transition to control to pressure isDrainPumpControlInFlowMode = FALSE; @@ -736,7 +737,7 @@ // Get the status of the current pressure readings with respect to their maximum pressures // Get the maximum of the pressure difference of PPo and PDr F32 pdrSubPSI = drainPumpOutletPressurePSI - DRP_CONTROL_MAX_ALLOWED_PDR_PSI; - F32 ppoSubPSI = roPumpOutletPressurePSI - DRP_CONTROL_MAX_ALLOWED_PPO_PSI; + F32 ppoSubPSI = roPumpOutletPressurePSI - (F32)DRP_CONTROL_MAX_ALLOWED_PPO_PSI; F32 maxPresPSI = MAX( pdrSubPSI, ppoSubPSI ); if ( ( pdrSubPSI > 0.0F ) || ( ppoSubPSI > 0.0F ) )