/* Program: dk_watts.c Revision: 24-May-2025 This program is used to calculate the Power Dissipation of the MSU part of the DK circuit board. Specifically this program will not see or take into consideration any power that is consumed by: the TOMCat, by the USB Cameras, or by the 5V0 feed to the Interposers. This program will see and take into consideration the 1V8 and 3V3 power feed to the Interposers (if the Interposers are connected). There are 6 DCDC Converters that power all of the MSU part of the DK circuit board and in cases some of these DCDC Converters also power external circuits, e.g. the 1V8 and 3V3 converters also send power to the Interposers. All 6 of these DCDC Converters are themselves powered the the 96 Volt to 5 Volt Converter. The 6 DCDC Converters are: Input Expected Output Current Load DCDC Output Bus Our DK Board Sample Current Expected Converter Voltage Name Principal Loads: Resistor Amps Efficiency --------- ------- --------- ----------------- -------- -------- ---------- 1 1V00 Bulk_1V00 ADC_Analog_1V00 20 mOhm 1.4 70 % ADC_Digital_1V00 2 1V05 Bulk_1V05 Core_1V05 20 mOhm 3.0 80 % XCVR_1V05 3 1V2 Bulk_1V2 DDR4 Memory 10 mOhm 3.0 80 % FPGA Banks #0, #6 4 1V8 Bulk_1V8 ADC_Analog_1V8 25 mOhm 1.5 75 % ADC_Digital_1V8 FPGA_1V8 FPGA Bank #9 to Interposers & miscellaneous 5 2V5 Bulk_2V5 Analog_2V5 25 mOhm 1.5 80 % Digital_2V5 FPGA Bank #9 Aux FPGA PLLs & Clk Buf 6 3V3 Bulk_3V3 Banks 1,2,3,5,7 25 mOhm 1.5 85 % to Interposers & miscellaneous This program starts by asking the operator to input the Voltage drop across the 6x input shunt resistors that feed the 6x DCDC Converters. Then the program makes some simple calculations for each of the 6x DCDC Converters: I_input = V_drop_measured / R_shunt W_input = I_input * 5.0 Volts W_output = W_input * Efficiency I_output = W_output / V_output The following arrays are used. All arrays run from 0:6. The index of 0 is not used but is the default starting index for C arrays. Only Indexes 1:6 are used and the index of a given element matches the Reference Designator of the particular DCDC Converter. V_drop_measured R_shunt I_input W_input Efficiency W_output V_bus I_output There are a number of constants that are used by this program: The voltage of the bus that feeds the input of the DCDC Converters, i.e. 5.0 Volts The efficiencies of the 6 DCDC Converters at their individual operating points The output bus voltages of the 6 DCDC Converters The output information from this program is the following: For each of the DCDC Converter's: V_drop_measured Input current Output current Output Watts Summary information output by this program Total Input current used by all 6 DCDC Converters Total Input Watts used by all 6 DCDC Converters Total Output Watts delivered by all 6 DCDC Converters */ /* Program Section: dk_watts_read_measured_data.c Revision: 29-May-2025 */ #include #include #include /** Define some Constants **/ #define SUPPLY_BUS_VOLTAGE 5.00 #define MAX_ARRAY 7 main( int argc, char *argv[] ) { double V_drop_measured[MAX_ARRAY] ; double R_shunt[MAX_ARRAY] ; double I_input[MAX_ARRAY] ; double W_input[MAX_ARRAY] ; double Efficiency[MAX_ARRAY] ; double W_output[MAX_ARRAY] ; double V_bus[MAX_ARRAY] ; double I_output[MAX_ARRAY] ; /** Declare Character Variables **/ char* end; /** Declare some Integer Variables **/ int loop_count = 1 ; /** Declare some Double Floating Point Variables **/ double sum_all_converters = 0.0 ; double temp_store_1 = 0.0 ; /** Give the values of the 6 Current Shunt Resistors in Ohms **/ R_shunt[1] = 0.020 ; R_shunt[2] = 0.020 ; R_shunt[3] = 0.010 ; R_shunt[4] = 0.025 ; R_shunt[5] = 0.025 ; R_shunt[6] = 0.025 ; /** Give the values of the 6 DCDC Converter Expected Efficiencies **/ /** **/ /** These values come from the TI Converter Datasheets where the **/ /** efficiency curves are evaluated at the expected operating point. **/ Efficiency[1] = 0.70 ; Efficiency[2] = 0.80 ; Efficiency[3] = 0.80 ; Efficiency[4] = 0.75 ; Efficiency[5] = 0.80 ; Efficiency[6] = 0.85 ; /** Give the values of the 6 DCDC Converter Output Voltages in Voits **/ V_bus[1] = 1.000 ; V_bus[2] = 1.050 ; V_bus[3] = 1.200 ; V_bus[4] = 1.800 ; V_bus[5] = 2.500 ; V_bus[6] = 3.300 ; /** **/ /** Before starting the actual program first put up on the **/ /** screen some background information about the 6x DCDC **/ /** Converters just to help folks recall how these DK Brd **/ /** power supplies are setup. E.G. the output voltage **/ /** from each of these 6x DCDC Converters and where on the **/ /** DK Brd they are located. **/ /** **/ printf( "\n\n\n " ); printf( " Main \n "); printf( " DCDC Output \n "); printf( " Converter Net Principal Filtered Output Nets \n "); printf( " --------- --------- ----------------------------------------- \n "); printf( " 1 BULK_1V00 ADC_ANALOG_1V00, ADC_DIGITAL_1V00 \n "); printf( " 2 BULK_1V05 CORE_1V05, XCVR_1V05 \n "); printf( " 3 BULK_1V2 \n "); printf( " 4 BULK_1V8 FPGA_1V8, ADC_ANALOG_1V8, ADC_DIGITAL_1V8 \n "); printf( " 5 BULK_2V5 ANALOG_2V5, DIGITAL_2V5 \n "); printf( " 6 BULK_3V3 \n "); printf( "\n\n\n " ); printf( " Interposer Connectors \n "); printf( " +-----------------------------------------+ \n "); printf( " | | \n "); printf( " | | \n "); printf( " | DCDC6 DCDC5 DCDC4 | \n "); printf( " Main | | \n "); printf( " Cable | | PMT \n "); printf( " Conn | | 1:8 \n "); printf( " | | \n "); printf( " | | \n "); printf( " | D D | PMT \n "); printf( " | C C DCDC1 | 9:16 \n "); printf( " | D D | \n "); printf( " | C C | \n "); printf( " | 3 2 | \n "); printf( " | | \n "); printf( " +-----------------------+ / \n "); printf( " | Optical / \n "); printf( " Barnacle | Connectors / \n "); printf( " Connector | / \n "); printf( " +------------/ \n "); printf( " \n "); /** **/ /** Get the value of the Voltage Drop across the 4 Terminal **/ /** Current Shunt Resistors at the inputs to the 6 **/ /** DCDC Converters. **/ /** **/ /** **/ /** Note: that these 6 values are in mVolts and may be either **/ /** supplied here in responce to the prompt or may have **/ /** been supplied on the command line used to start this **/ /** program. **/ /** **/ if ( argc == 1) /** Prompt the user for 6 Voltage Drop values **/ { printf(" \n \n \n ") ; loop_count = 1 ; while (loop_count <= 6) { printf("Enter the Voltage Drop across the DCDC_%1d Shunt Resistor in mV: ", loop_count ); scanf( "%lf", &V_drop_measured[loop_count] ) ; printf(" \n ") ; ++loop_count ; } } else if ( argc == 7 ) /** 6 Voltage Drops come from the command line **/ { printf( "\n\n\n " ); printf( "The 6 Shunt Voltage Drops are received from the command line. \n\n\n "); loop_count = 1 ; while (loop_count <= 6) { V_drop_measured[loop_count] = strtod(argv[loop_count], &end) ; ++loop_count ; } } else { printf( "\n\n\n " ); printf( "ERROR an illegal number of arguments was present \n "); printf( "on the command line. The user should either provide \n "); printf( "no arguments on the command line in which case this \n "); printf( "program will prompted the user for all required \n "); printf( "arguments or the user should supply all 6 \n "); printf( "Shunt Resistor Voltage Drops on the command line. \n\n\n "); exit (1); } /** **/ /** We now have all the information that we need to start the actual work **/ /** **/ /* Program Section: dk_watts_analyze.c Revision: 28-May-2025 */ /** Loop over the 6 DCDC Converters calculating **/ /** the data for each converter: **/ loop_count = 1 ; while (loop_count <= 6) { /** Based on the Measured Voltage Drop and the known **/ /** value of this DCDC Converter's Shunt Resistor - **/ /** calculate the Input Current to this Converter. **/ /** **/ /** Recall that the Shunt Voltage Drop is in mVolts **/ /** and that we will eventually calculate an Output **/ /** Current in mAmps. **/ I_input[loop_count] = V_drop_measured[loop_count] / R_shunt[loop_count] ; /** Based on the Input Current to this DCDC Converter **/ /** and the known 5.0 Volt value of the bus that feeds **/ /** the Converter's input - calculate the Power going **/ /** to this Converter's Input in mWatts. **/ W_input[loop_count] = I_input[loop_count] * SUPPLY_BUS_VOLTAGE ; /** Based on the Power going to this Converter's Input **/ /** and the Expected Efficiency of this Converter at **/ /** this Operating Point - calculate the Output Power **/ /** coming from this Converter in mWatts. **/ W_output[loop_count] = W_input[loop_count] * Efficiency[loop_count] ; /** Based on the Power coming from this Converter's **/ /** Output and the known Voltage of this Converter's **/ /** Output - calculate this Converter's Output Current. **/ /** **/ /** The Output Current is in mAmps. **/ I_output[loop_count] = W_output[loop_count] / V_bus[loop_count] ; ++loop_count ; } /** Now print a column header for the individual converter information **/ printf( "\n Shunt " ) ; printf( "\n Voltage Input Input Output Output " ) ; printf( "\n DCDC Drop Current Power Power Current " ) ; printf( "\n Converter mVolts mAmps mWatts mWatts mAmps " ) ; printf( "\n --------- ------- ------- ------- ------- ------- " ) ; printf( "\n " ) ; /** Now output the information for the individual Converters **/ loop_count = 1 ; while (loop_count <= 6) { printf( "\n %1d %7.2f %7.2f %7.2f %7.2f %7.2f \n", loop_count, V_drop_measured[loop_count], I_input[loop_count], W_input[loop_count], W_output[loop_count], I_output[loop_count] ) ; ++loop_count ; } printf( "\n\n\n " ) ; /** **/ /** Now calculate the overall: Input Current, Input Power, **/ /** and Output Power **/ /** **/ sum_all_converters = 0.0 ; loop_count = 1 ; while (loop_count <= 6) { sum_all_converters = sum_all_converters + I_input[loop_count] ; ++loop_count ; } printf( " Total Input Current for all 6 Converters = %7.2f mA \n\n", sum_all_converters ) ; sum_all_converters = 0.0 ; loop_count = 1 ; while (loop_count <= 6) { sum_all_converters = sum_all_converters + W_input[loop_count] ; ++loop_count ; } printf( " Total Input Power for all 6 Converters = %7.2f mW \n\n", sum_all_converters ) ; temp_store_1 = sum_all_converters ; sum_all_converters = 0.0 ; loop_count = 1 ; while (loop_count <= 6) { sum_all_converters = sum_all_converters + W_output[loop_count] ; ++loop_count ; } printf( " Total Output Power for all 6 Converters = %7.2f mW \n\n", sum_all_converters ) ; temp_store_1 = ( sum_all_converters / temp_store_1 ) * 100.0 ; printf( " Overall Efficiency converting 5 V to Load Buses = %5.2f percent \n\n\n", temp_store_1 ) ; /** **/ /** That finishes the DCDC Converter power analysis. **/ /** **/ return (1); }