Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -r166d929af60e9051ca100b6914d0bc0af76576b5 -ra85769a39d5c918a1595b22b66322df123017601 --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 166d929af60e9051ca100b6914d0bc0af76576b5) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision a85769a39d5c918a1595b22b66322df123017601) @@ -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) @@ -1241,7 +1249,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 } /*********************************************************************//** @@ -1255,7 +1272,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 } /*********************************************************************//** @@ -2333,6 +2359,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 @@ -3928,4 +3968,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; +} + /**@}*/