Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -r498757853c009a4e25dec98461be91fcadd8057d -rc400845083cc6fc90f70f308ae953e05b45acbf8 --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 498757853c009a4e25dec98461be91fcadd8057d) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision c400845083cc6fc90f70f308ae953e05b45acbf8) @@ -102,6 +102,10 @@ #define FPGA_D5_HEATER_CNTRL_BIT 0x01 ///< FPGA GIO D5 heater control bit mask #define FPGA_D5_HEATER_PWM_ENABLE_BIT 0x02 ///< FPGA D5 PWM based heater control bit mask +#define MAX_PUMP_SPEED 3000.0F ///< Maxon controller pump maximum speed +#define PUMP_SPEED_OFFSET 168.7F ///< Speed Scale adjustment intercept factor +#define PUMP_SPEED_FULL_SCALE 3187.0F ///< Speed scale adjustment slope factor + /// FPGA size of V3 read bytes. #define FPGA_SIZE_OF_V3_READ_BYTES ( FPGA_READ_V3_END_BYTE_NUM - FPGA_READ_V3_START_BYTE_NUM ) @@ -252,12 +256,15 @@ U16 fpgaD76PumpHallSense; ///< Reg 444. UF D76_Pump hall sensor pulse width U16 fpgaD76PumpStepCountStatus; ///< Reg 446. UF pump revolution down count status U08 fpgaD76PumpFault; ///< Reg 448: UF pump fault + U08 fpgaUnUsed; ///< Reg 449: Unused byte + U16 fpgaD79PumpSpeed; ///< Reg 450: 4-wire Rinse pump (D79) speed - U32 fpgaD74CondDataOut; ///< Reg 449. Data read from Conductivity Sensor D74 register - U16 fpgaD74CondCond; ///< Reg 453. D74 conductivity - U16 fpgaD74CondTemp; ///< Reg 455. D74 Temperature - U08 fpgaD74CondReadCnt; ///< Reg 457. D74 successful read count - U08 fpgaD74CondErrorCnt; ///< Reg 458. D74 error read count + U32 fpgaD74CondDataOut; ///< Reg 452. Data read from Conductivity Sensor D74 register + U16 fpgaD74CondCond; ///< Reg 456. D74 conductivity + U16 fpgaD74CondTemp; ///< Reg 458. D74 Temperature + U08 fpgaD74CondReadCnt; ///< Reg 460. D74 successful read count + U08 fpgaD74CondErrorCnt; ///< Reg 461. D74 error read count + } DD_FPGA_SENSORS_T; typedef struct @@ -356,9 +363,10 @@ U16 fpgaD76PumpSpeed; ///< Reg 152. UF Pump Speed/RPM Control U16 fpgaD76PumpRevCount; ///< Reg 154. UF pump revolution count U08 fpgaD76PumpControl; ///< Reg 156. UF Pump Control - U08 fpgaConSensD74Control; ///< Reg 157. Conductivity/Temperature Sensors D74 Control registers - U16 fpgaConSensD74_Addrs; ///< Reg 158. D74 Initialization Address register - U32 fpgaConSensD74_Data_In; ///< Reg 160. D74 Initialization data register + U08 fpgaD79PumpControl; ///< Reg 157. D79 pump control + U08 fpgaConSensD74Control; ///< Reg 158. Conductivity/Temperature Sensors D74 Control registers + U16 fpgaConSensD74_Addrs; ///< Reg 159. D74 Initialization Address register + U32 fpgaConSensD74_Data_In; ///< Reg 161. D74 Initialization data register } FPGA_ACTUATORS_T; #pragma pack(pop) @@ -564,7 +572,16 @@ *************************************************************************/ void setFPGAD48PumpSpeed( U16 speed ) { - fpgaActuatorSetPoints.fpgaD48PumpSpeed = speed; +#ifdef __MAXON_SPEED_UPDATE__ + { + U16 currentSpeed =(U16)( ( ( speed + PUMP_SPEED_OFFSET ) / PUMP_SPEED_FULL_SCALE ) * MAX_PUMP_SPEED ); + fpgaActuatorSetPoints.fpgaD48PumpSpeed = currentSpeed; + } +#else + { + fpgaActuatorSetPoints.fpgaD48PumpSpeed = speed; + } +#endif } /*********************************************************************//** @@ -578,7 +595,16 @@ *************************************************************************/ void setFPGAD12PumpSpeed( U16 speed ) { - fpgaActuatorSetPoints.fpgaD12PumpSpeed = speed; +#ifdef __MAXON_SPEED_UPDATE__ + { + U16 currentSpeed =(U16)( ( ( speed + PUMP_SPEED_OFFSET ) / PUMP_SPEED_FULL_SCALE ) * MAX_PUMP_SPEED ); + fpgaActuatorSetPoints.fpgaD12PumpSpeed = currentSpeed; + } +#else + { + fpgaActuatorSetPoints.fpgaD12PumpSpeed = speed; + } +#endif } /*********************************************************************//** @@ -1656,6 +1682,20 @@ /*********************************************************************//** * @brief + * The setFPGAD79RinsePumpPWMControl function sets the 4-wire Rinse pump + * control. + * @details \b Inputs: none + * @details \b Outputs: fpgaD79PumpControl + * @param control the PWM count to control the rinse pump + * @return none + *************************************************************************/ +void setFPGAD79RinsePumpPWMControl( U08 control ) +{ + fpgaActuatorSetPoints.fpgaD79PumpControl = control; +} + +/*********************************************************************//** + * @brief * The getFPGAVersions function gets the FPGA version numbers. * @details \b Inputs: fpgaHeader * @details \b Outputs: none @@ -3224,4 +3264,17 @@ return fpgaSensorReadings.fpgaD42RxFIFODataOut; } +/*********************************************************************//** + * @brief + * The getFPGAD79RinsePumpSpeed function returns the 4-wire rinse pump + * speed. + * @details \b Inputs: fpgaD79PumpSpeed + * @details \b Outputs: none + * @return fpgaSensorReadings.fpgaD79PumpSpeed + *************************************************************************/ +U16 getFPGAD79RinsePumpSpeed( void ) +{ + return fpgaSensorReadings.fpgaD79PumpSpeed; +} + /**@}*/