Index: firmware/App/Controllers/ROPump.c =================================================================== diff -u -r228bdc53e9e88533429cd514d1d509a6fcd361d0 -r77738b42add276957539f0efb3f9a4092852c5ce --- firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision 228bdc53e9e88533429cd514d1d509a6fcd361d0) +++ firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision 77738b42add276957539f0efb3f9a4092852c5ce) @@ -50,7 +50,7 @@ #define ROP_PSI_TO_PWM_DC(p) ( 0.2 + ( (F32)((p) - 100) * 0.01 ) ) ///< conversion factor from target PSI to PWM duty cycle estimate TODO - this is a place holder for real conversion -#define RO_FLOW_ADC_TO_LPM_FACTOR 0.00018 ///< conversion factor from ADC counts to LPM (liters/min) for RO flow rate. +#define RO_FLOW_ADC_TO_LPM_FACTOR 10909.0909 ///< conversion factor from ADC counts to LPM (liters/min) for RO flow rate (multiply this by inverse of FPGA reading). typedef enum ROPump_States { @@ -183,7 +183,7 @@ { S32 roFlow = (S32)getFPGAROPumpFlowRate(); - measuredROFlowRateLPM.data = (F32)(roFlow) * RO_FLOW_ADC_TO_LPM_FACTOR; + measuredROFlowRateLPM.data = ( 1.0 / (F32)(roFlow) ) * RO_FLOW_ADC_TO_LPM_FACTOR; measuredROPumpPressure = getMeasuredDGPressure( PRESSURE_SENSOR_RO_PUMP_OUTLET ); // TODO - check pressure?