Index: firmware/App/Controllers/AirTrap.c =================================================================== diff -u -rcc2aeed2bef39ae4e5d3b2f9b887bdc902b0d414 -reaff654b897f641b874e3ba30a22cbda3779e4a7 --- firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision cc2aeed2bef39ae4e5d3b2f9b887bdc902b0d414) +++ firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision eaff654b897f641b874e3ba30a22cbda3779e4a7) @@ -424,7 +424,7 @@ // Air pump stop time based on the blood flow rate S32 qB = 500; // TODO abs( getTargetBloodFlowRate() ); U32 qBx = ( 0 == qB ? MIN_SET_BLOOD_FLOW_RATE : (U32)qB ); - U32 airPumpStopTime = AIR_PUMP_LOWER_OP_TIME_MIN_MS + ( ( qBx - MIN_SET_BLOOD_FLOW_RATE ) / 2 ); + U32 airPumpStopTime = 10000; //AIR_PUMP_LOWER_OP_TIME_MIN_MS + ( ( qBx - MIN_SET_BLOOD_FLOW_RATE ) / 2 ); // Transition to manual valve control state when requested if ( TRUE == pendingStopAirTrapController ) @@ -447,6 +447,7 @@ if ( TRUE == didTimeout( airTrapLowerStartTime, airPumpStopTime ) ) { // TODO - alarm??? + SEND_EVENT_WITH_2_U32_DATA( TD_EVENT_AIR_TRAP_TIMEOUT_REMOVE_TEMP, airPumpStopTime, 0 ); } result = AIR_TRAP_CLOSED_STATE; } @@ -477,6 +478,7 @@ data.h13State = get3WayValveState( H13_VALV ); data.h20State = get3WayValveState( H20_VALV ); data.isAutoControlling = isAirTrapControlling(); + data.airTrapState = airTrapControllerState; broadcastData( MSG_ID_TD_AIR_TRAP_DATA, COMM_BUFFER_OUT_CAN_TD_BROADCAST, (U08*)&data, sizeof( AIR_TRAP_PAYLOAD_T ) ); airTrapDataPublicationTimerCounter = 0; Index: firmware/App/Controllers/AirTrap.h =================================================================== diff -u -r07c1dbf3b8227766cb584352d9ea86e230270260 -reaff654b897f641b874e3ba30a22cbda3779e4a7 --- firmware/App/Controllers/AirTrap.h (.../AirTrap.h) (revision 07c1dbf3b8227766cb584352d9ea86e230270260) +++ firmware/App/Controllers/AirTrap.h (.../AirTrap.h) (revision eaff654b897f641b874e3ba30a22cbda3779e4a7) @@ -44,6 +44,7 @@ U32 h13State; ///< Is air trap intake valve open or closed U32 h20State; ///< Is air trap outlet valve open or closed BOOL isAutoControlling; ///< Flag indicates whether air trap level is being auto controlled + U32 airTrapState; } AIR_TRAP_PAYLOAD_T; #pragma pack(pop) Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -rf31c92f93880dbe20596a727dd72f48813ffa88a -reaff654b897f641b874e3ba30a22cbda3779e4a7 --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision f31c92f93880dbe20596a727dd72f48813ffa88a) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision eaff654b897f641b874e3ba30a22cbda3779e4a7) @@ -33,7 +33,7 @@ #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 10 ///< Minimum encoder position delta from target position to end transition state. +#define VALVE_TRANSITION_MIN_TGT_DELTA 1000 //10 ///< 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_ALLOWED_FAILED_VALVE_HOMINGS 3U ///< Maximum allowed failed valve home attempts @@ -539,6 +539,7 @@ { currentValveStates[ valve ].currentPosition = currentValveStates[ valve ].commandedPosition; nextState = VALVE_STATE_IDLE; + SEND_EVENT_WITH_2_U32_DATA( TD_EVENT_VALVE_POSITION_DELTA_REMOVE_TEMP, (U32)abs( delta ), 0 ); } // is transition taking too long? else if ( ( TRUE == didTimeout( currentValveStates[ valve ].transitionStartTime, VALVE_TRANSITION_TIMEOUT_MS ) ) && @@ -547,7 +548,7 @@ // Go back to Idle state and set the valve position to not in position because it was not able to get to the target position currentValveStates[ valve ].currentPosition = VALVE_POSITION_NOT_IN_POSITION; nextState = VALVE_STATE_IDLE; - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_TD_VALVE_TRANSITION_TIMEOUT, (U32)valve ); + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_VALVE_TRANSITION_TIMEOUT, (U32)valve, (U32)abs( delta ) ); // If the valve's commanded position is C, activate safety shutdown if ( VALVE_POSITION_C_CLOSE == currentValveStates[ valve ].commandedPosition ) Index: firmware/App/Drivers/GLXferPump.c =================================================================== diff -u -r0afeba28589108c3f742079a87bac313c4983b0c -reaff654b897f641b874e3ba30a22cbda3779e4a7 --- firmware/App/Drivers/GLXferPump.c (.../GLXferPump.c) (revision 0afeba28589108c3f742079a87bac313c4983b0c) +++ firmware/App/Drivers/GLXferPump.c (.../GLXferPump.c) (revision eaff654b897f641b874e3ba30a22cbda3779e4a7) @@ -28,7 +28,7 @@ // ********** private definitions ********** -#define AIR_PUMP_PWM_TIME 250 ///< Time (in 10ns increments) per PWM register count for the air pump = 20 kHz. +#define AIR_PUMP_PWM_TIME 20 ///< Time (in 10ns increments) per PWM register count for the air pump = 20 kHz. // ********** private data ********** Index: firmware/App/Drivers/GLXferPump.h =================================================================== diff -u -rb32a3dbf0675bb3378e09105e3a80ea9a7779828 -reaff654b897f641b874e3ba30a22cbda3779e4a7 --- firmware/App/Drivers/GLXferPump.h (.../GLXferPump.h) (revision b32a3dbf0675bb3378e09105e3a80ea9a7779828) +++ firmware/App/Drivers/GLXferPump.h (.../GLXferPump.h) (revision eaff654b897f641b874e3ba30a22cbda3779e4a7) @@ -36,7 +36,7 @@ #define AIR_PUMP_MOTOR_OFF 0 ///< Power level setting (PWM) for H12 air pump to turn pump off. #define AIR_PUMP_MOTOR_MAX_PWM 250 ///< Power level setting (PWM) maximum for H12 air pump. #define AIR_PUMP_MOTOR_FILL_PWM 25 ///< Power level setting (PWM) for H12 air pump to fill (raise level) the air trap. -#define AIR_PUMP_MOTOR_LOWER_PWM 250 ///< Power level setting (PWM) for H12 air pump to lower the level of the air trap. +#define AIR_PUMP_MOTOR_LOWER_PWM 125 //250 ///< Power level setting (PWM) for H12 air pump to lower the level of the air trap. // ********** public function prototypes ********** Index: firmware/App/TDCommon.h =================================================================== diff -u -rec7c0313c1ec952fb5b58bd268d1fa26e678626f -reaff654b897f641b874e3ba30a22cbda3779e4a7 --- firmware/App/TDCommon.h (.../TDCommon.h) (revision ec7c0313c1ec952fb5b58bd268d1fa26e678626f) +++ firmware/App/TDCommon.h (.../TDCommon.h) (revision eaff654b897f641b874e3ba30a22cbda3779e4a7) @@ -36,10 +36,10 @@ // #define TEST_PINCH_VALVES 1 // Alpha unit pinch valve testing // #define TEST_DEBUGGER 1 // Testing with debugger - prevents FPGA comm alarms caused by breakpoints // #define TEST_PROCESS_TASKS_WO_UI 1 // Allow task processing even when UI not connected -// #define TEST_UI_ONLY 1 // Alpha test with TD and UI only - no DD + #define TEST_UI_ONLY 1 // Alpha test with TD and UI only - no DD // #define TEST_NO_PINCH_VALVES 1 // Alpha test with no pinch valve functionality // #define TEST_USE_OFF_AS_STOP_BUTTON 1 // Alpha test re-purposing off button as a stop button -// #define TEST_NO_PRESSURE_CHECKS 1 // Alpha test with no pressure sensor checks + #define TEST_NO_PRESSURE_CHECKS 1 // Alpha test with no pressure sensor checks // #define TEST_NO_STOP_CONSUME_CHECK 1 // Alpha test with no check for stop button timeout #include