Index: firmware/App/Monitors/Voltages.c =================================================================== diff -u -r830213bc6dcc1a684610caf78c79d55f2cb41e93 -rd3443d6a118d1d2565e86d95b5c7013d91145fea --- firmware/App/Monitors/Voltages.c (.../Voltages.c) (revision 830213bc6dcc1a684610caf78c79d55f2cb41e93) +++ firmware/App/Monitors/Voltages.c (.../Voltages.c) (revision d3443d6a118d1d2565e86d95b5c7013d91145fea) @@ -33,10 +33,13 @@ // ********** private definitions ********** -#define VOLTAGES_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the voltages data is published on the CAN bus. -#define VOLTAGES_ALARM_PERSISTENCE_MS ( 1 * MS_PER_SECOND ) ///< Alarm persistence period for voltage monitor alarms in milliseconds. -#define POWER_LOSS_VOLTAGE_PERSISTENCE_MS 500 ///< Power supply voltage out of range persistence in milliseconds. -#define DATA_PUBLISH_COUNTER_START_COUNT 14 ///< Data publish counter start count. +#define VOLTAGES_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the voltages data is published on the CAN bus. +#define VOLTAGES_ALARM_PERSISTENCE_MS ( 1 * MS_PER_SECOND ) ///< Alarm persistence period for voltage monitor alarms in milliseconds. +#define POWER_LOSS_VOLTAGE_PERSISTENCE_MS 500 ///< Power supply voltage out of range persistence in milliseconds. +#define DATA_PUBLISH_COUNTER_START_COUNT 14 ///< Data publish counter start count. +#define MAX_COUNT_AC_MONITORS 550000.0F ///< Max count value for power monitors +#define COUNT_TO_CURRENT( count ) ( ( count / MAX_COUNT_AC_MONITORS ) * 30.0F ) ///< Count to current conversion +#define COUNT_TO_VOLTAGE( count ) ( ( ( count / MAX_COUNT_AC_MONITORS ) / 4.0F ) * 1534.0F ) ///< Count to voltage conversion /// Defined states for the voltage monitor state machine. typedef enum Voltages_States @@ -273,14 +276,18 @@ { VOLTAGES_DATA_PAYLOAD_T data; - data.adc1_2VProc = getMonitoredLineLevel( MONITORED_VOLTAGE_1_2V ); - data.adc3_3V = getMonitoredLineLevel( MONITORED_VOLTAGE_3_3V ); - data.adc5VLogic = getMonitoredLineLevel( MONITORED_VOLTAGE_5V_LOGIC ); - data.adc24V_1 = getMonitoredLineLevel( MONITORED_VOLTAGE_24V_1 ); - data.adc24V_2 = getMonitoredLineLevel( MONITORED_VOLTAGE_24V_2 ); - data.fpgaVcc = getMonitoredLineLevel( MONITORED_VOLTAGE_FPGA_VCC_V ); - data.fpgaVaux = getMonitoredLineLevel( MONITORED_VOLTAGE_FPGA_AUX_V ); - data.fpgaVpvn = getMonitoredLineLevel( MONITORED_VOLTAGE_FPGA_PVN_V ); + data.adc1_2VProc = getMonitoredLineLevel( MONITORED_VOLTAGE_1_2V ); + data.adc3_3V = getMonitoredLineLevel( MONITORED_VOLTAGE_3_3V ); + data.adc5VLogic = getMonitoredLineLevel( MONITORED_VOLTAGE_5V_LOGIC ); + data.adc24V_1 = getMonitoredLineLevel( MONITORED_VOLTAGE_24V_1 ); + data.adc24V_2 = getMonitoredLineLevel( MONITORED_VOLTAGE_24V_2 ); + data.fpgaVcc = getMonitoredLineLevel( MONITORED_VOLTAGE_FPGA_VCC_V ); + data.fpgaVaux = getMonitoredLineLevel( MONITORED_VOLTAGE_FPGA_AUX_V ); + data.fpgaVpvn = getMonitoredLineLevel( MONITORED_VOLTAGE_FPGA_PVN_V ); + data.fpgaACDCVoltage = COUNT_TO_VOLTAGE(getFPGAACDCPowerSupplyVoltage()); + data.fpgaACDCCurrent = COUNT_TO_CURRENT(getFPGAACDCPowerSupplyCurrent()); + data.fpgaACHeaterVoltage = COUNT_TO_VOLTAGE(getFPGAACHeaterVoltage()); + data.fpgaACHeaterCurrent = COUNT_TO_CURRENT(getFPGAACHeaterCurrent()); broadcastData( MSG_ID_DD_VOLTAGES_DATA, COMM_BUFFER_OUT_CAN_DD_BROADCAST, (U08*)&data, sizeof( VOLTAGES_DATA_PAYLOAD_T ) ); voltagesDataPublicationTimerCounter = 0; Index: firmware/App/Monitors/Voltages.h =================================================================== diff -u -r830213bc6dcc1a684610caf78c79d55f2cb41e93 -rd3443d6a118d1d2565e86d95b5c7013d91145fea --- firmware/App/Monitors/Voltages.h (.../Voltages.h) (revision 830213bc6dcc1a684610caf78c79d55f2cb41e93) +++ firmware/App/Monitors/Voltages.h (.../Voltages.h) (revision d3443d6a118d1d2565e86d95b5c7013d91145fea) @@ -59,6 +59,10 @@ F32 fpgaVcc; ///< FPGA source voltage F32 fpgaVaux; ///< FPGA aux. voltage F32 fpgaVpvn; ///< FPGA pvn voltage + F32 fpgaACDCVoltage; ///< FPGA Power Supply Voltage + F32 fpgaACDCCurrent; ///< FPGA Power Supply Current + F32 fpgaACHeaterVoltage; ///< FPGA AC Heater Voltage + F32 fpgaACHeaterCurrent; ///< FPGA AC Heater Current } VOLTAGES_DATA_PAYLOAD_T; // ********** public function prototypes ********** Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -r9eae2f683887bededd2240f51ddfc667d8c1d566 -rd3443d6a118d1d2565e86d95b5c7013d91145fea --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 9eae2f683887bededd2240f51ddfc667d8c1d566) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision d3443d6a118d1d2565e86d95b5c7013d91145fea) @@ -458,6 +458,12 @@ U08 fpgaP18TempReadCount; ///< Reg 818. P18 temperature successful read count U08 fpgaP18TempErrorCount; ///< Reg 819. P18 Temperature error read count U08 fpgaP18CalMemCounter; ///< Reg 820. P18 CAL counter + U08 notUsed; ///< Reg 821. Not used. + U16 fpgaACDCPMonIrms; ///< Reg 822. AC DC Power Supply RMS Current + U16 fpgaACDCPMonVrms; ///< Reg 824. AC DC Power Supply RMS Voltage + U16 fpgaACHeaterPMonIrms; ///< Reg 826. AC Heater RMS Current + U16 fpgaACHeaterPMonVrms; ///< Reg 828. AC Heater RMS Voltage. + } DD_FPGA_SENSORS_T; // TODO: Remove when Beta 1.9 is obsolete @@ -4015,4 +4021,52 @@ return fpgaSensorReadings.fpgaD92SpeedCnt; } +/*********************************************************************//** + * @brief + * The getFPGAACDCPowerSupplyCurrent function gets AC/DC Power Supply Current + * @details \b Inputs: fpgaACDCPMonIrms + * @details \b Outputs: none + * @return power supply current in counts. + *************************************************************************/ +U16 getFPGAACDCPowerSupplyCurrent( void ) +{ + return fpgaSensorReadings.fpgaACDCPMonIrms; +} + +/*********************************************************************//** + * @brief + * The getFPGAACDCPowerSupplyCurrent function gets AC/DC Power Supply Voltage + * @details \b Inputs: fpgaACDCPMonVrms + * @details \b Outputs: none + * @return power supply voltage in counts. + *************************************************************************/ +U16 getFPGAACDCPowerSupplyVoltage( void ) +{ + return fpgaSensorReadings.fpgaACDCPMonVrms; +} + +/*********************************************************************//** + * @brief + * The getFPGAACHeaterCurrent function gets AC Heater Current + * @details \b Inputs: fpgaACHeaterPMonIrms + * @details \b Outputs: none + * @return ac heater current in counts. + *************************************************************************/ +U16 getFPGAACHeaterCurrent( void ) +{ + return fpgaSensorReadings.fpgaACHeaterPMonIrms; +} + +/*********************************************************************//** + * @brief + * The getFPGAACHeaterVoltage function gets AC Heater Voltage + * @details \b Inputs: fpgaACHeaterPMonVrms + * @details \b Outputs: none + * @return power supply current in counts. + *************************************************************************/ +U16 getFPGAACHeaterVoltage( void ) +{ + return fpgaSensorReadings.fpgaACHeaterPMonVrms; +} + /**@}*/ Index: firmware/App/Services/FpgaDD.h =================================================================== diff -u -r9eae2f683887bededd2240f51ddfc667d8c1d566 -rd3443d6a118d1d2565e86d95b5c7013d91145fea --- firmware/App/Services/FpgaDD.h (.../FpgaDD.h) (revision 9eae2f683887bededd2240f51ddfc667d8c1d566) +++ firmware/App/Services/FpgaDD.h (.../FpgaDD.h) (revision d3443d6a118d1d2565e86d95b5c7013d91145fea) @@ -249,6 +249,11 @@ void setFPGAD79RinsePumpPWMControl( U08 value ); U16 getFPGAD79RinsePumpPulseWidth( void ); +U16 getFPGAACDCPowerSupplyCurrent( void ); +U16 getFPGAACDCPowerSupplyVoltage( void ); +U16 getFPGAACHeaterCurrent( void ); +U16 getFPGAACHeaterVoltage( void ); + //*************** IOFP ******************* void setFPGAFPValveStates( U08 valveStates ); @@ -323,6 +328,8 @@ U16 getFPGAP40PumpPWM( void ); U16 getFPGAP40PumpTachCount( void ); + + /**@}*/ #endif