/* Program: r_sample_series.c Revision: 9-Nov-2020 This program calculates the value of R_sample in mOhms for a series of Feedback Signal Voltages in terms of 5 parameters that it asks you to enter. The 5 parameters and their entry and display units are: - known target current from the current sweeper mAmps - known Rref mOhm - known Rfb Ohm - known null detector supperconducting transformer ratio - - known value of Internal FB current per Volt of FB uAmps - and the known equivalence of Input & RF coils in putting flux into SQUID R-sample is displayed in mOhms. The Feedback Signal Voltages that are used for these calculations are: 0.1 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 Volts */ #include #include #define PI 3.1415926 main () { float R_sample ; /* Resistance of the Sample Resistor Ohms */ float R_ref ; /* Resistance of the Reference Resistor Ohms */ float R_fb ; /* Resistance of the Feedback Resistor Ohms */ float I_sweeper ; /* Current to Sample from the Current Sweeper Amps */ float V_fb[10] ; /* Feedback Voltage used for calculation Volts */ float I_nulldet ; /* Current across top side of Bridge - Null Det. Amps */ float R_eref ; /* Thevenin Equivalent Reference Resistor Ohms */ float V_esample ; /* Thevenin Equivalent Sample Voltage Volts */ float V_efb ; /* Thevenin Equivalent Feedback Voltage Volts */ float Range ; /* Amps Internal Feedback per Volt of Feedback Amps */ float Turns_Ratio ; /* Effective Turns Ratio of Superconducting Transformer */ float temp_1 ; int Index ; /* Define the 10 Feedback Signal Voltages for which */ /* the value of the Sample Resistor will be calculated */ V_fb[1] = 1.000 ; V_fb[2] = 2.000 ; V_fb[3] = 3.000 ; V_fb[4] = 4.000 ; V_fb[5] = 5.000 ; V_fb[6] = 6.000 ; V_fb[7] = 7.000 ; V_fb[8] = 8.000 ; V_fb[9] = 9.000 ; V_fb[10] = 10.000 ; /* Ask for and echo back the various parameters. */ printf(" \n "); printf(" Enter the various operating parameters. \n "); printf(" \n "); printf(" Enter the Current Sweeper Target Current (mAmps): "); scanf( "%f", &temp_1 ) ; printf(" \n ") ; I_sweeper = temp_1 / 1000 ; printf(" Enter the value of the Reference Resistor (mOhms): "); scanf( "%f", &temp_1 ) ; printf(" \n ") ; R_ref = temp_1 / 1000 ; printf(" Enter the value of the Feedback Resistor (Ohms): "); scanf( "%f", &R_fb ) ; printf(" \n ") ; printf(" Enter the SQUID Controller Range, i.e. how many \n "); printf(" uAmps of Internal FB per Volt of FB Signal (uAmps): "); scanf( "%f", &temp_1 ) ; printf(" \n ") ; Range = temp_1 / 1000000 ; printf(" Enter the Turns Ratio of the Superdonducting Transformer, \n "); printf(" i.e. how much is the Bridge un-balance current stepped up \n "); printf(" before it is sent to the Input Coil of the SQUID (ratio): "); scanf( "%f", &Turns_Ratio ) ; printf(" \n ") ; printf(" \n ") ; printf(" \n ") ; /* Print out all of this input information. */ temp_1 = I_sweeper * 1000 ; printf( "\n The Sweeper Target Current is = %8.4f mAmps \n", temp_1 ) ; temp_1 = R_ref * 1000 ; printf( "\n The Reference Resistor is = %8.3f mOhms \n", temp_1 ) ; printf( "\n The Feedback Resistor is = %9.3f Ohms \n", R_fb ) ; temp_1 = Range * 1000000 ; printf( "\n The Internal FB Range is = %6.3f uAmps/Volt \n", temp_1 ) ; printf( "\n The Transformer Turns Ratio is = %6.2f to 1 Pri/Sec \n", Turns_Ratio ); printf( "\n\n\n" ) ; printf( " Feedback R_sample \n" ) ; printf( " Volts mOhms \n\n" ) ; for ( Index = 1; Index < 11; Index++ ) { /* Calculate the Thevenin Equivalent Feedback Voltage */ /* and its equivalent Feedback Voltage Source Resistance */ V_efb = ( R_ref / (R_fb + R_ref)) * V_fb[Index] ; R_eref = ( R_fb * R_ref ) / ( R_fb + R_ref ) ; /* Calculate the current in the Bridge Null Detector, i.e. */ /* the current flowing across the top side of the Bridge. */ I_nulldet = ( V_fb[Index] * Range ) / Turns_Ratio ; /* Now calculate the value of the Sample Resistor */ R_sample = ( V_efb + (R_eref * I_nulldet)) / ( I_sweeper - I_nulldet ) ; /* Print the value of V_fb and Sample Resistor */ temp_1 = R_sample * 1000 ; printf( " %8.3f %8.3f \n", V_fb[Index], temp_1 ) ; } printf( "\n \n \n" ) ; }