Index: firmware/App/Controllers/ROPump.c =================================================================== diff -u -rf9d0e15ba8e25a69666ed0231721ea58e2145f2f -rb9410f03da0a767684f35843a0b3d4a0733c622b --- firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision f9d0e15ba8e25a69666ed0231721ea58e2145f2f) +++ firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision b9410f03da0a767684f35843a0b3d4a0733c622b) @@ -54,10 +54,15 @@ #define ROP_PRESSURE_TO_PWM_INTERCEPT 0.0F ///< Intercept of pressure to PWM line equation. #define DATA_PUBLISH_COUNTER_START_COUNT 10 ///< Data publish counter start count. + /// PWM line equation for pressure. converted to percentage. + #define ROP_PRESSURE_TO_PWM_PCT(pres) ( ( ROP_PRESSURE_TO_PWM_SLOPE * pres + ROP_PRESSURE_TO_PWM_INTERCEPT ) / MAX_FLUID_PUMP_PWM_DUTY_CYCLE ) + /// PWM line equation for flow converted to percentage. + #define ROP_FLOW_TO_PWM_PCT(slope, intercept, flow) ( ( slope * log(flow) + intercept ) / MAX_FLUID_PUMP_PWM_DUTY_CYCLE ) + #define FP_FLOW_RATE_BELOW_TARGET_TIMEOUT_MS ( 10 * MS_PER_SECOND ) ///< Timeout for flow rate below 75% of target flow rate #define FP_FLOW_RATE_BELOW_TARGET_CLEAR_MS ( 10 * MS_PER_SECOND ) ///< Clear timeout for flow rate below target flow rate #define PERMEATE_FLOW_LOW_OUT_OF_RANGE_EXEMPT_MS ( 10 * MS_PER_SECOND ) ///< Permeate flow low alarm exempt for 10 seconds after starting from Off