Index: firmware/App/Controllers/ROPump.c =================================================================== diff -u -r3156f7319833b3d58b51fbf0ee9e13e02301a678 -r8ddb7d51e6ab02591cb1c5692f62cfdf26ec7866 --- firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision 3156f7319833b3d58b51fbf0ee9e13e02301a678) +++ firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision 8ddb7d51e6ab02591cb1c5692f62cfdf26ec7866) @@ -127,6 +127,7 @@ static OVERRIDE_F32_T measuredROFlowRateLPM = { 0.0, 0.0, 0.0, 0 }; ///< Measured RO flow rate (in L/min). static U32 roControlTimerCounter = 0; ///< Determines when to perform control on RO pump. + static F32 roPumpOpenLoopTargetDutyCycle = 0; ///< Target RO pump open loop PWM. /* TODO These variables are used for POST. POST has not been implemented yet @@ -378,6 +379,7 @@ checkPersistentAlarm( ALARM_ID_FLOW_RATE_OUT_OF_UPPER_RANGE, isFlowOutOfUpperRange, currentFlow, targetFlow ); checkPersistentAlarm( ALARM_ID_FLOW_RATE_OUT_OF_LOWER_RANGE, isFlowOutOfLowerRange, currentFlow, targetFlow ); } +#endif // If the pump is off and PPi + 5psi < PPo for a certain period of time, activate safety shutdown if ( FALSE == isROPumpOn ) @@ -393,7 +395,7 @@ activateSafetyShutdown(); } } -#endif + // Publish RO pump data on interval publishROPumpData(); } @@ -556,7 +558,7 @@ resetPIController( PI_CONTROLLER_ID_RO_PUMP_MAX_PRES, roPumpDutyCyclePctSet ); state = RO_PUMP_CONTROL_TO_MAX_PRESSURE_STATE; } - // + // If the actual flow is still far from target flow, update the duty cycle using the I controller and stay in this state else if ( TRUE == isFlowOutOfRange ) { roPumpDutyCyclePctSet += ( targetFlowRate - actualFlowRate ) * ROP_RAMP_UP_P_COEFFICIENT;