Index: firmware/App/Controllers/ROPump.c =================================================================== diff -u -rfd5c3cff1d0beac03fb29c19f49f670568bc4178 -r9f3943dcab5881216ef0119e7de3a36668dea3bc --- firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision fd5c3cff1d0beac03fb29c19f49f670568bc4178) +++ firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision 9f3943dcab5881216ef0119e7de3a36668dea3bc) @@ -20,7 +20,6 @@ #include "etpwm.h" #include "mibspi.h" -#include "AlarmDefs.h" #include "FPGA.h" #include "OperationModes.h" #include "PIControllers.h" @@ -53,7 +52,7 @@ #define ROP_CONTROL_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the RO pump is controlled. #define ROP_RAMP_UP_CONTROL_INTERVAL ( 500 / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the RO pump is controlled. -#define ROP_RAMP_UP_P_COEFFICIENT 0.22 ///< P term for RO pump ramp up to flow control. +#define ROP_RAMP_UP_P_COEFFICIENT 0.22 ///< P term for RO pump ramp up to flow control. #define ROP_FLOW_CONTROL_P_COEFFICIENT 0.25 ///< P term for RO pump flow control. #define ROP_FLOW_CONTROL_I_COEFFICIENT 0.25 ///< I term for RO pump flow control. #define ROP_MAX_PRESSURE_P_COEFFICIENT 0.01 ///< P term for RO pump max pressure control. @@ -110,23 +109,23 @@ // ********** private data ********** -static RO_PUMP_STATE_T roPumpState = RO_PUMP_OFF_STATE; ///< current state of RO pump controller state machine. -static U32 roPumpDataPublicationTimerCounter = 0; ///< used to schedule RO pump data publication to CAN bus. +static RO_PUMP_STATE_T roPumpState = RO_PUMP_OFF_STATE; ///< Current state of RO pump controller state machine. +static U32 roPumpDataPublicationTimerCounter = 0; ///< Used to schedule RO pump data publication to CAN bus. static BOOL isROPumpOn = FALSE; ///< RO pump is currently running. -static F32 roPumpPWMDutyCyclePct = 0.0; ///< initial RO pump PWM duty cycle. -static F32 roPumpDutyCyclePctSet = 0.0; ///< currently set RO pump PWM duty cycle. -static PUMP_CONTROL_MODE_T roPumpControlMode = PUMP_CONTROL_MODE_CLOSED_LOOP; ///< requested RO pump control mode. -static PUMP_CONTROL_MODE_T roPumpControlModeSet = PUMP_CONTROL_MODE_CLOSED_LOOP; ///< currently set RO pump control mode. +static F32 roPumpPWMDutyCyclePct = 0.0; ///< Initial RO pump PWM duty cycle. +static F32 roPumpDutyCyclePctSet = 0.0; ///< Currently set RO pump PWM duty cycle. +static PUMP_CONTROL_MODE_T roPumpControlMode = PUMP_CONTROL_MODE_CLOSED_LOOP; ///< Requested RO pump control mode. +static PUMP_CONTROL_MODE_T roPumpControlModeSet = PUMP_CONTROL_MODE_CLOSED_LOOP; ///< Currently set RO pump control mode. static F32 targetROPumpFlowRate = 0.0; ///< Target RO flow rate (in L/min). static F32 targetROPumpMaxPressure = 0.0; ///< Target RO max allowed pressure (in PSI). static OVERRIDE_U32_T roPumpDataPublishInterval = { RO_PUMP_DATA_PUB_INTERVAL, RO_PUMP_DATA_PUB_INTERVAL, 0, 0 }; ///< Interval (in ms) at which to publish RO flow data to CAN bus. -static OVERRIDE_F32_T measuredROFlowRateLPM = { 0.0, 0.0, 0.0, 0 }; ///< measured RO flow rate (in L/min). +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 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