Index: firmware/App/Controllers/Ejector.c =================================================================== diff -u -rc0678a04714199fd57a0128f3bd4c65e53ba0454 -r0e4a62ba24d906d9e5b33b293f93405b8c0391ce --- firmware/App/Controllers/Ejector.c (.../Ejector.c) (revision c0678a04714199fd57a0128f3bd4c65e53ba0454) +++ firmware/App/Controllers/Ejector.c (.../Ejector.c) (revision 0e4a62ba24d906d9e5b33b293f93405b8c0391ce) @@ -277,6 +277,10 @@ setEjectorSpeed( EJECTOR_RETRACT_MOTOR_SPEED_RPM ); state = EJECTOR_STATE_HOMING; } + else + { + disableEjectorMotor(); + } return state; } @@ -321,6 +325,10 @@ setEjectorSpeed( EJECTOR_EXTEND_MOTOR_SPEED_RPM ); state = EJECTOR_STATE_EXTENDING; } + else + { + disableEjectorMotor(); + } return state; } @@ -343,6 +351,10 @@ setEjectorSpeed( EJECTOR_RETRACT_MOTOR_SPEED_RPM ); state = EJECTOR_STATE_RETRACTING; } + else + { + disableEjectorMotor(); + } return state; } Index: firmware/App/Drivers/EjectorMotor.c =================================================================== diff -u -r82bb2222f791a434d22921e2fe4f5edd7e74776d -r0e4a62ba24d906d9e5b33b293f93405b8c0391ce --- firmware/App/Drivers/EjectorMotor.c (.../EjectorMotor.c) (revision 82bb2222f791a434d22921e2fe4f5edd7e74776d) +++ firmware/App/Drivers/EjectorMotor.c (.../EjectorMotor.c) (revision 0e4a62ba24d906d9e5b33b293f93405b8c0391ce) @@ -61,6 +61,12 @@ EJECTOR_MOTOR_CONTROL_FORWARD_DIR | EJECTOR_MOTOR_CONTROL_32TH_STEP; +/// Control bits to disable ejector motor +static const U08 EJECTOR_MOTOR_CONTROL_DISABLED = EJECTOR_MOTOR_CONTROL_SLEEP_OFF | + EJECTOR_MOTOR_CONTROL_NOT_RESET | + EJECTOR_MOTOR_CONTROL_FORWARD_DIR | + EJECTOR_MOTOR_CONTROL_32TH_STEP; + /// Payload record structure for ejector motor set request typedef struct { @@ -95,11 +101,28 @@ ejectorMotorRampUpInProgress = FALSE; setH5StepToggleTime( ejectorMotorSetToggleTime ); - setH5ControlFlags( EJECTOR_MOTOR_CONTROL_RUN_FORWARD ); + setH5ControlFlags( EJECTOR_MOTOR_CONTROL_DISABLED ); } /*********************************************************************//** * @brief + * The disableEjectorMotor function sets the ejector motor to be disabled + * when not in motion to prevent over-heating. + * @note Ejector motor must be off first. + * @details \b Inputs: none + * @details \b Outputs: none + * @return none + *************************************************************************/ +void disableEjectorMotor( void ) +{ + if ( ejectorMotorSetToggleTime != EJECTOR_MOTOR_MICROSTEP_TOGGLE_TIME_FOR_STOP ) + { + setH5ControlFlags( EJECTOR_MOTOR_CONTROL_DISABLED ); + } +} + +/*********************************************************************//** + * @brief * The setEjectorMotorSpeed function sets the ejector motor to the given * set speed and direction. * @details \b Inputs: currentEjectorMotorSetSpeed Index: firmware/App/Drivers/EjectorMotor.h =================================================================== diff -u -r5dc5b0076f547c0c14e71f0e5373112e9c890f4f -r0e4a62ba24d906d9e5b33b293f93405b8c0391ce --- firmware/App/Drivers/EjectorMotor.h (.../EjectorMotor.h) (revision 5dc5b0076f547c0c14e71f0e5373112e9c890f4f) +++ firmware/App/Drivers/EjectorMotor.h (.../EjectorMotor.h) (revision 0e4a62ba24d906d9e5b33b293f93405b8c0391ce) @@ -36,6 +36,7 @@ // ********** public function prototypes ********** void initEjectorMotor( void ); +void disableEjectorMotor( void ); BOOL setEjectorMotorSpeed( F32 rpm ); F32 getEjectorMotorSetSpeed( void ); void execEjectorMotorRamping( void ); Index: firmware/App/Drivers/RotaryValve.c =================================================================== diff -u -r37294a71c0b3e3ca67ccb10b85536d124d3ef028 -r0e4a62ba24d906d9e5b33b293f93405b8c0391ce --- firmware/App/Drivers/RotaryValve.c (.../RotaryValve.c) (revision 37294a71c0b3e3ca67ccb10b85536d124d3ef028) +++ firmware/App/Drivers/RotaryValve.c (.../RotaryValve.c) (revision 0e4a62ba24d906d9e5b33b293f93405b8c0391ce) @@ -138,8 +138,8 @@ { if ( valve < NUM_OF_VALVES ) { - U16 mag8 = ( ( mag % 8 ) < 4 ? ( mag >> 3 ) << 3 : ( ( mag >> 3 ) << 3 ) + 1 ); // round to multiple of 8 to maximize holding torque - S16 chgSteps = (S16)mag * ( MOTOR_DIR_REVERSE == dir ? -1 : 1 ); // convert to signed change in position - negative value indicates reverse direction + U16 mag8 = ( ( mag % 8 ) < 4 ? ( mag >> 3 ) << 3 : ( ( mag >> 3 ) << 3 ) + 8 ); // round to multiple of 8 to maximize holding torque + S16 chgSteps = (S16)mag8 * ( MOTOR_DIR_REVERSE == dir ? -1 : 1 ); // convert to signed change in position - negative value indicates reverse direction // log event showing valve position change commanded SEND_EVENT_WITH_2_U32_DATA( TD_EVENT_VALVE_POS_CHANGE, (U32)commandValvePos[ valve ], (U32)chgSteps ); Index: firmware/App/Drivers/RotaryValve.h =================================================================== diff -u -r37294a71c0b3e3ca67ccb10b85536d124d3ef028 -r0e4a62ba24d906d9e5b33b293f93405b8c0391ce --- firmware/App/Drivers/RotaryValve.h (.../RotaryValve.h) (revision 37294a71c0b3e3ca67ccb10b85536d124d3ef028) +++ firmware/App/Drivers/RotaryValve.h (.../RotaryValve.h) (revision 0e4a62ba24d906d9e5b33b293f93405b8c0391ce) @@ -35,8 +35,7 @@ #define ROTARY_VALVE_MICROSTEP_FRACTION 8 ///< Rotary valve motors configured for 1/8 step microstepping. #define ROTARY_VALVE_GEAR_RATIO 3.7F ///< Rotary valve motor gear ratio is 3.7:1. -#define ROTARY_VALVE_FULL_SWING_TRAVEL_DEG 200.0F ///< Rotary valve swing arm travel range is appx. 200 degrees. -#define ROTARY_VALVE_FULL_SWING_TRAVEL_COUNTS 256 ///< Rotary valve swing arm travel range is appx. 256 enconder counts. +#define ROTARY_VALVE_FULL_SWING_TRAVEL_COUNTS 1798 ///< Rotary valve swing arm travel range is appx. micro steps. /// rotary pinch valve names typedef enum valveNames Index: firmware/App/Services/Messaging.c =================================================================== diff -u -rb88a8fd2c5fca8f055d6df1437635692388fcb0d -r0e4a62ba24d906d9e5b33b293f93405b8c0391ce --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision b88a8fd2c5fca8f055d6df1437635692388fcb0d) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision 0e4a62ba24d906d9e5b33b293f93405b8c0391ce) @@ -99,6 +99,7 @@ static const MSG_HANDLER_LOOKUP_T MSG_FUNCTION_HANDLER_LOOKUP[] = { { MSG_ID_UI_ACTIVE_ALARMS_LIST_REQUEST, &handleActiveAlarmListRequest }, { MSG_ID_FW_VERSIONS_REQUEST, &handleVersionRequestMessage }, + { MSG_ID_UI_CHECK_IN, &handleUICheckIn }, { MSG_ID_DD_OP_MODE_DATA, &setDDOpMode }, { MSG_ID_DD_PRESSURES_DATA, &setDialysatePressure }, { MSG_ID_UI_TREATMENT_PARAMS_TO_VALIDATE, &validateAndSetTreatmentParameters }, @@ -598,6 +599,19 @@ /*********************************************************************//** * @brief + * The handleUICheckIn function handles a Ui check in message. + * @details \b Inputs: none + * @details \b Outputs: none + * @param message Pointer to the UI check-in message + * @return TRUE if check-in successful, FALSE if not + *************************************************************************/ +BOOL handleUICheckIn( MESSAGE_T *message ) +{ + return TRUE; // no specific handling required. +} + +/*********************************************************************//** + * @brief * The handleTesterLogInRequest function handles a Dialin request to login. * @details \b Inputs: none * @details \b Outputs: Dialin logged in if request is authenticated. Index: firmware/App/Services/Messaging.h =================================================================== diff -u -rc8a6bfae0f88b45e3783632c868235077e4cbeec -r0e4a62ba24d906d9e5b33b293f93405b8c0391ce --- firmware/App/Services/Messaging.h (.../Messaging.h) (revision c8a6bfae0f88b45e3783632c868235077e4cbeec) +++ firmware/App/Services/Messaging.h (.../Messaging.h) (revision 0e4a62ba24d906d9e5b33b293f93405b8c0391ce) @@ -156,6 +156,7 @@ void setTesterStatusToLoggedOut( void ); void handleIncomingMessage( MESSAGE_T *message ); +BOOL handleUICheckIn( MESSAGE_T *message ); BOOL handleTesterLogInRequest( MESSAGE_T *message ); BOOL testTDSoftwareResetRequest( MESSAGE_T *message ); Index: firmware/App/Tasks/TaskGeneral.c =================================================================== diff -u -rb32a3dbf0675bb3378e09105e3a80ea9a7779828 -r0e4a62ba24d906d9e5b33b293f93405b8c0391ce --- firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision b32a3dbf0675bb3378e09105e3a80ea9a7779828) +++ firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision 0e4a62ba24d906d9e5b33b293f93405b8c0391ce) @@ -134,21 +134,27 @@ // ****************** Start Air Trap Test Code ************************ #ifdef TEST_PINCH_VALVES -#if 0 - static BOOL vlvCmd = FALSE; +#if 1 + static U32 vlvCmd = 0; S16 pos = getH19EncoderPosition(); readValves(); // Get level sensor data readAirTrapLevelSensors(); - if ( TRUE == vlvCmd ) + if ( 1 == vlvCmd ) { - setValveCmdChangePosition( H1_VALV, 500, MOTOR_DIR_FORWARD ); // s/b ~30 deg - //setValveCmdChangePosition( H19_VALV, 2000, MOTOR_DIR_FORWARD ); - vlvCmd = FALSE; + setValveCmdChangePosition( H1_VALV, 896, MOTOR_DIR_FORWARD ); + setValveCmdChangePosition( H19_VALV, 1600, MOTOR_DIR_FORWARD ); + vlvCmd = 0; } + if ( 2 == vlvCmd ) + { + setValveCmdChangePosition( H1_VALV, 0, MOTOR_DIR_FORWARD ); + setValveCmdChangePosition( H19_VALV, 0, MOTOR_DIR_FORWARD ); + vlvCmd = 0; + } #endif -#if 1 +#if 0 { static BOOL homeValveCmd = FALSE; static BOOL setValvePos = FALSE;