/* CMX Actual Trip Voltage Created: 12-Dec-2013 This program asks for the values of the 3 resistors in the Hi/Low Voltage Monitor Rx, Ry, Rz and then knowing the 0.500 Volt threshold of the comparators in the ADM12914 monitor IC it prints out the actual Low and Hi Trip Voltages. The intent is to help fine tune the trip voltages based on the available resistors in the normal 1% series and to confirm that the other cmx hi/low resistor program has picked rational value resistors. */ #include #include #define Comp_Voltage 0.500 main() { float Standing_Nom_mA, V_Nom, V_Tol ; float Rx_Ohms, Ry_Ohms, Rz_Ohms ; float Hi_Trip_Volts, Low_Trip_Volts ; float Total_Divider_Ohms ; float Hi_Trip_Current, Low_Trip_Current ; /* Calculate the Actual Trip Voltages */ printf(" \n \n \n ") ; printf("Enter the value of Rx in Ohms: "); scanf( "%f", &Rx_Ohms ) ; printf(" \n ") ; printf("Enter the value of Ry in Ohms: "); scanf( "%f", &Ry_Ohms ) ; printf(" \n ") ; printf("Enter the value of Rz in Ohms: "); scanf( "%f", &Rz_Ohms ) ; printf(" \n ") ; Total_Divider_Ohms = Rx_Ohms + Ry_Ohms + Rz_Ohms ; Hi_Trip_Current = Comp_Voltage / Rz_Ohms ; Hi_Trip_Volts = Hi_Trip_Current * Total_Divider_Ohms ; Low_Trip_Current = Comp_Voltage / ( Ry_Ohms + Rz_Ohms ) ; Low_Trip_Volts = Low_Trip_Current * Total_Divider_Ohms ; V_Nom = ( Hi_Trip_Volts + Low_Trip_Volts ) / 2.0 ; V_Tol = (( Hi_Trip_Volts - Low_Trip_Volts ) / 2.0 ) / V_Nom ; Standing_Nom_mA = V_Nom / Total_Divider_Ohms * 1000.0 ; /* Print all of this information. */ printf( " Hi Trip voltage is = %5.3f Volts \n", ( Hi_Trip_Volts ) ) ; printf( " Low Trip voltage is = %5.3f Volts \n", ( Low_Trip_Volts ) ) ; printf( " The Nominal voltage is = %5.3f Volts \n \n", ( V_Nom ) ) ; printf( " The Trip voltage tolerance is = %4.1f percent \n", ( (V_Tol * 100.0) ) ) ; printf( " The Nominal current is = %7.4f mA \n", ( Standing_Nom_mA ) ) ; }