Index: firmware/App/Controllers/ROPump.c =================================================================== diff -u -r5404c0f29a5deafa1f57e5de4eb962081b1a9a38 -ra354b535581cd07768ea5bf36509022cbbbd1f73 --- firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision 5404c0f29a5deafa1f57e5de4eb962081b1a9a38) +++ firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision a354b535581cd07768ea5bf36509022cbbbd1f73) @@ -184,7 +184,7 @@ isROPumpOn = FALSE; // If there is a target flow set, transition to the PI controller and control to flow - if ( getTargetROPumpFlowRateMLPM() > 0 ) + if ( targetROPumpFlowRate.data > 0 ) { // Set pump to on isROPumpOn = TRUE; @@ -193,7 +193,7 @@ state = RO_PUMP_CONTROL_TO_TARGET_FLOW_STATE; } // If there is a target pressure set, transition to the PI controller and control to pressure. - else if ( getTargetROPumpPressure() > 0.0F ) + else if ( targetROPumpPressure.data > 0.0F ) { // Set pump to on isROPumpOn = TRUE; @@ -205,7 +205,7 @@ // If the target duty cycle is greater than zero (minimum is 10%) and the mode has been set to open // loop, set the duty cycle - else if ( getTargetROPumpDutyCyclePCT() > 0.0F ) + else if ( roPumpOpenLoopTargetDutyCycle.data > 0.0F ) { roPumpDutyCyclePctSet = getTargetROPumpDutyCyclePCT(); setFluidPumpPctToPWMDutyCycle( P12_PUMP, roPumpDutyCyclePctSet ); @@ -235,14 +235,14 @@ signalROPumpHardStop(); } // If there is a target flow set, transition to the PI controller and control to flow - else if ( getTargetROPumpFlowRateMLPM() > 0 ) + else if ( targetROPumpFlowRate.data > 0 ) { ///transition to closed loop resetPIController( PI_CONTROLLER_ID_RO_PUMP_FLOW, getTargetROPumpDutyCyclePCT(), 0 ); state = RO_PUMP_CONTROL_TO_TARGET_FLOW_STATE; } // If there is a target pressure set, transition to the PI controller and control to pressure. - else if ( getTargetROPumpPressure() > 0.0F ) + else if ( targetROPumpPressure.data > 0.0F ) { //transition to closed loop resetPIController( PI_CONTROLLER_ID_RO_PUMP_PRES, getTargetROPumpDutyCyclePCT(), 0 ); @@ -270,13 +270,13 @@ signalROPumpHardStop(); } // Check if need to switch control modes - else if ( getTargetROPumpPressure() > 0.0F ) // isTargetPressureActive() == TRUE inside isTargetPressure -> T/F based on data and ov data. + else if ( targetROPumpPressure.data > 0.0F ) { // Transition to target pressure resetPIController( PI_CONTROLLER_ID_RO_PUMP_PRES, roPumpDutyCyclePctSet, 0 ); state = RO_PUMP_CONTROL_TO_TARGET_PRESSURE_STATE; } - else if ( getTargetROPumpDutyCyclePCT() > 0.0F ) + else if ( roPumpOpenLoopTargetDutyCycle.data > 0.0F ) { roPumpDutyCyclePctSet = getTargetROPumpDutyCyclePCT(); setFluidPumpPctToPWMDutyCycle( P12_PUMP, roPumpDutyCyclePctSet ); @@ -316,12 +316,12 @@ signalROPumpHardStop(); } // Check if we are changing control - else if ( getTargetROPumpFlowRateMLPM() > 0 ) + else if ( targetROPumpFlowRate.data > 0 ) { resetPIController( PI_CONTROLLER_ID_RO_PUMP_FLOW, roPumpDutyCyclePctSet, 0 ); state = RO_PUMP_CONTROL_TO_TARGET_FLOW_STATE; } - else if ( getTargetROPumpDutyCyclePCT() > 0.0F ) + else if ( roPumpOpenLoopTargetDutyCycle.data > 0.0F ) { setFluidPumpPctToPWMDutyCycle( P12_PUMP, getTargetROPumpDutyCyclePCT() ); roPumpDutyCyclePctSet = getTargetROPumpDutyCyclePCT(); @@ -464,7 +464,7 @@ { // stopPumpRequest = TRUE; result = TRUE; - if ( ( getTargetROPumpFlowRateMLPM() == 0 ) && ( getTargetROPumpDutyCyclePCT() == 0.0 ) ) + if ( ( targetROPumpFlowRate.data == 0 ) && ( roPumpOpenLoopTargetDutyCycle.data == 0.0 ) ) { stopPumpRequest = TRUE; } @@ -537,7 +537,7 @@ { // stopPumpRequest = TRUE; result = TRUE; - if ( ( getTargetROPumpFlowRateMLPM() == 0 ) && ( getTargetROPumpPressure() == 0.0 ) ) + if ( ( targetROPumpFlowRate.data == 0 ) && ( targetROPumpPressure.data == 0.0 ) ) { stopPumpRequest = TRUE; }