Index: firmware/App/Drivers/GLXferPump.c =================================================================== diff -u -r285b5d82539c96524c93703d52a66fff76fb64fc -rceddc04641038a62bbbd9714a045d0cbfc473c8f --- firmware/App/Drivers/GLXferPump.c (.../GLXferPump.c) (revision 285b5d82539c96524c93703d52a66fff76fb64fc) +++ firmware/App/Drivers/GLXferPump.c (.../GLXferPump.c) (revision ceddc04641038a62bbbd9714a045d0cbfc473c8f) @@ -46,6 +46,7 @@ { currentAirPumpMotorPowerLevel = AIR_PUMP_MOTOR_OFF; setAirPumpMotorPowerLevel( currentAirPumpMotorPowerLevel ); + setAirPumpMotorPWMCntTime( 800 ); } /*********************************************************************//** Index: firmware/App/Services/FpgaTD.c =================================================================== diff -u -r285b5d82539c96524c93703d52a66fff76fb64fc -rceddc04641038a62bbbd9714a045d0cbfc473c8f --- firmware/App/Services/FpgaTD.c (.../FpgaTD.c) (revision 285b5d82539c96524c93703d52a66fff76fb64fc) +++ firmware/App/Services/FpgaTD.c (.../FpgaTD.c) (revision ceddc04641038a62bbbd9714a045d0cbfc473c8f) @@ -102,7 +102,7 @@ S16 H1CmdPosition; ///< Reg 278. H1 commanded position (200 steps/rev). S16 H1EncPosition; ///< Reg 280. H1 encoder position (1024 counts/rev). U08 H1Status; ///< Reg 282. H1 status. - U08 reserved4; ///< Reg 283. Reserved and available for future use. + U08 reserved1; ///< Reg 283. Reserved and available for future use. U08 BEMStatus; ///< Reg 284. BEM status. U08 BEMEncStatus; ///< Reg 285. BEM encoder status. S32 BEMEncPosition; ///< Reg 286. BEM encoder position. @@ -156,10 +156,17 @@ U08 H4Control; ///< Reg 20. H4 Blood pump control register. U08 H19Control; ///< Reg 21. H19 control register. U16 H19Position; ///< Reg 22. H19 position set register (200 steps/rev). - U16 H1Position; ///< Reg 24. H1 position set register (200 steps/rev). - U08 H1Control; ///< Reg 26. H1 control register. - U08 valveEncoderControl; ///< Reg 27. H1/H19 encoder control register. - U08 alarmControl; ///< Reg 28. Alarm audio control register. + U16 H19MotorSpeed; ///< Reg 24. H19 stepper motor speed (uSec/step). + U16 H1Position; ///< Reg 26. H1 position set register (200 steps/rev). + U16 H1MotorSpeed; ///< Reg 28. H1 stepper motor speed (uSec/step). + U08 H1Control; ///< Reg 30. H1 control register. + U08 valveEncoderControl; ///< Reg 31. H1/H19 encoder control register. + U08 alarmControl; ///< Reg 32. Alarm audio control register. + U08 syrPumpControl; ///< Reg 33. Syringe pump control register. + U32 syrPumpSpeed; ///< Reg 34. Syringe pump time between step toggle (1/2 step period). + U16 syrPumpDACData; ///< Reg 38. Syringe pump DAC data (12 bits). + U16 syrPumpDACControl; ///< Reg 40. Syringe pump ADC and DAC control register. + U16 h12Period; ///< Reg 42. H12 Air pump time period for each count in PWM register. } FPGA_ACTUATORS_T; #pragma pack(pop) @@ -719,7 +726,7 @@ * @note VBTControl register bit 0 will drive state of H13 valve (0=closed, 1=open). * @details \b Inputs: fpgaActuatorSetPoints * @details \b Outputs: fpgaActuatorSetPoints - * @param state : The valve state to command H13 valve to + * @param state The valve state to command H13 valve to * @return none *************************************************************************/ void setH20ValveState( VALVE_3WAY_STATE_T state ) @@ -740,7 +747,7 @@ * to 0 to turn pump off or 1..255 for varying power levels. * @details \b Inputs: fpgaActuatorSetPoints.h12Control * @details \b Outputs: fpgaActuatorSetPoints.h12Control - * @param power : The set power level to set the H12 air pump to. + * @param power The set power level to set the H12 air pump to. * @return none *************************************************************************/ void setAirPumpMotorPowerLevel( U08 power ) @@ -750,6 +757,21 @@ /*********************************************************************//** * @brief + * The setAirPumpMotorPWMCntTime function sets the air pump motor PWM count + * time in increments of 10 nS. The PWM period will then be 255 x given + * value x 10 nS. + * @details \b Inputs: fpgaActuatorSetPoints.h12Period + * @details \b Outputs: fpgaActuatorSetPoints.h12Period + * @param tenNS The time associated with each PWM count in power level setting. + * @return none + *************************************************************************/ +void setAirPumpMotorPWMCntTime( U16 tenNS ) +{ + fpgaActuatorSetPoints.h12Period = tenNS; +} + +/*********************************************************************//** + * @brief * The H18BubbleDetected function determines whether H18 bubble detector * sensor is currently detecting a bubble. * @details \b Inputs: fpgaSensorReadings Index: firmware/App/Services/FpgaTD.h =================================================================== diff -u -r285b5d82539c96524c93703d52a66fff76fb64fc -rceddc04641038a62bbbd9714a045d0cbfc473c8f --- firmware/App/Services/FpgaTD.h (.../FpgaTD.h) (revision 285b5d82539c96524c93703d52a66fff76fb64fc) +++ firmware/App/Services/FpgaTD.h (.../FpgaTD.h) (revision ceddc04641038a62bbbd9714a045d0cbfc473c8f) @@ -86,6 +86,7 @@ void setH20ValveState( VALVE_3WAY_STATE_T state ); void setAirPumpMotorPowerLevel( U08 power ); +void setAirPumpMotorPWMCntTime( U16 tenNS ); void setH19Control( U08 controlBits ); U08 getH19Control( void ); Index: firmware/App/TDCommon.h =================================================================== diff -u -rb2cd44f58d468ff1a220cd7fff3bc6de3ca89679 -rceddc04641038a62bbbd9714a045d0cbfc473c8f --- firmware/App/TDCommon.h (.../TDCommon.h) (revision b2cd44f58d468ff1a220cd7fff3bc6de3ca89679) +++ firmware/App/TDCommon.h (.../TDCommon.h) (revision ceddc04641038a62bbbd9714a045d0cbfc473c8f) @@ -32,7 +32,7 @@ #ifndef _RELEASE_ #ifndef _VECTORCAST_ // #define TASK_TIMING_OUTPUT_ENABLED 1 // Re-purposes alarm lamp pins for task timing -// #define TEST_AIR_TRAP_ALPHA_TESTING 1 // Alpha unit air trap testing + #define TEST_AIR_TRAP_ALPHA_TESTING 1 // Alpha unit air trap testing #include #include Index: firmware/App/Tasks/TaskGeneral.c =================================================================== diff -u -r285b5d82539c96524c93703d52a66fff76fb64fc -rceddc04641038a62bbbd9714a045d0cbfc473c8f --- firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision 285b5d82539c96524c93703d52a66fff76fb64fc) +++ firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision ceddc04641038a62bbbd9714a045d0cbfc473c8f) @@ -186,7 +186,7 @@ sta = 1; // lower the level set3WayValveState( H13_VALV, VALVE_3WAY_COMMON_TO_OPEN_STATE ); - setAirPumpState( AIR_PUMP_STATE_ON, 255 ); + setAirPumpState( AIR_PUMP_STATE_ON, 25 ); } break; case 1: @@ -201,14 +201,16 @@ } break; case 2: +#if 1 // stay low for 5 sec - if ( ++ctr > ( 5 * 20 ) ) +// if ( ++ctr > ( 5 * 20 ) ) { // raise the level set3WayValveState( H20_VALV, VALVE_3WAY_COMMON_TO_OPEN_STATE ); - setAirPumpState( AIR_PUMP_STATE_ON, 255 ); + setAirPumpState( AIR_PUMP_STATE_ON, 25 ); sta = 3; } +#endif break; case 3: // look for fluid at high level and stop @@ -217,19 +219,30 @@ // stop raising level set3WayValveState( H20_VALV, VALVE_3WAY_COMMON_TO_CLOSED_STATE ); setAirPumpState( AIR_PUMP_STATE_OFF, AIR_PUMP_MOTOR_OFF ); - ctr = 0; sta = 4; } break; case 4: +#if 1 + // look for air at high level + if ( AIR_TRAP_LEVEL_AIR == getRawLevelSensorState( H16_LEVL ) ) + { + // start raising level + set3WayValveState( H20_VALV, VALVE_3WAY_COMMON_TO_OPEN_STATE ); + setAirPumpState( AIR_PUMP_STATE_ON, 25 ); + sta = 3; + } +#endif +#if 0 // stay high for 5 sec if ( ++ctr > ( 5 * 20 ) ) { // lower the level set3WayValveState( H13_VALV, VALVE_3WAY_COMMON_TO_OPEN_STATE ); - setAirPumpState( AIR_PUMP_STATE_ON, 255 ); + setAirPumpState( AIR_PUMP_STATE_ON, 25 ); sta = 1; } +#endif break; default: sta = 0;