Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r4778daea54641e73f72322ba660a673f9ba6dfb8 -rd466db5e5f2d865456aa12140b3d1bb56335730b --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 4778daea54641e73f72322ba660a673f9ba6dfb8) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision d466db5e5f2d865456aa12140b3d1bb56335730b) @@ -37,11 +37,12 @@ #define VALVES_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Valves data publish interval. #define DATA_PUBLISH_COUNTER_START_COUNT 13 ///< Valves data publish start counter. -#define VALVE_TRANSITION_MIN_TGT_DELTA 5 ///< Minimum encoder position delta from target position to end transition state. +#define VALVE_TRANSITION_MIN_TGT_DELTA 5 ///< Minimum encoder position delta from target position to end transition state. #define VALVE_HOME_MIN_POS_CHG 3 ///< Minimum encoder position change to indicate a home operation is still moving toward edge. #define VALVE_HOME_BACK_OFF_EDGE 3 ///< Encoder counts to back off of detected edge position. #define MAX_HOME_FULL_TRAVEL_DIFF 10U ///< Maximum allowed difference in full travel encoder counts between expected and measured during home operation. #define VALVE_TRANSITION_TIMEOUT_MS ( 3 * MS_PER_SECOND ) ///< Valves transition time out in ms. +#define VALVE_HOMING_TIMEOUT_MS ( 15 * MS_PER_SECOND ) #define HOMING_EDGE_DETECTION_TIMEOUT_MS ( 0.5 * MS_PER_SECOND ) ///< Valves homing edge detection timeout in milliseconds. #define VALVE_FORCE_HOME TRUE ///< Force valve to home even if already homed. #define ZERO_ENC_DEBOUNCE_THRESHOLD_CNT 5 ///< Valves zero encoder debounce threshold count. @@ -63,7 +64,7 @@ // Homing variables BOOL hasHomingBeenRequested; ///< Valve homing request flag. BOOL hasValveBeenHomed; ///< Valve homing completed flag. - BOOL homingOperationActive; + BOOL homingOperationActive; ///< Valve homing active flag. } VALVE_STATUS_T; /// Payload record structure for pinch valve set position request @@ -399,7 +400,7 @@ nextState = VALVE_STATE_IDLE; } else if ( ( TRUE == currentValveStates[ valve ].homingOperationActive ) && - ( TRUE == didTimeout( currentValveStates[ valve ].valveOpsStartTime, VALVE_TRANSITION_TIMEOUT_MS ) ) && + ( TRUE == didTimeout( currentValveStates[ valve ].valveOpsStartTime, VALVE_HOMING_TIMEOUT_MS ) ) && ( TRUE != getCPLDACPowerLossDetected() ) ) { currentValveStates[ valve ].homingOperationActive = FALSE; @@ -548,7 +549,6 @@ data.posA = (S16)getPinchValveStoredPosition( valve, VALVE_POSITION_A_INSERT_EJECT ); data.posB = (S16)getPinchValveStoredPosition( valve, VALVE_POSITION_B_OPEN ); data.posC = (S16)getPinchValveStoredPosition( valve, VALVE_POSITION_C_CLOSE ); - broadcastData( MSG_ID_TD_VALVES_DATA, COMM_BUFFER_OUT_CAN_TD_BROADCAST, (U08*)&data, sizeof( TD_VALVE_DATA_T ) ); }