def execute(self): ## Set up power supply pow_supply = ke2410(self.pow_supply_address) pow_supply.reset() pow_supply.set_source('voltage') pow_supply.set_sense('current') pow_supply.set_current_limit(self.lim_cur) pow_supply.set_voltage(0) pow_supply.set_terminal('rear') pow_supply.set_interlock_on() pow_supply.set_output_on() ## Set up lcr meter lcr_meter = hp4980(self.lcr_meter_address) lcr_meter.reset() lcr_meter.set_voltage(self.lcr_vol) lcr_meter.set_frequency(self.lcr_freq) lcr_meter.set_mode('RX') # Set up switch switch = switchcard(self.switch_address) switch.reboot() switch.set_measurement_type('CV') switch.set_cv_resistance(self.cv_res)
def execute(self): ## Set up lcr meter lcr_meter = hp4980(self.lcr_meter_address) lcr_meter.reset() lcr_meter.set_voltage(self.lcr_vol) lcr_meter.set_frequency(self.lcr_frequencies[0]) lcr_meter.set_mode('RX') hd = [ 'Single Impedance', 'Measurement Settings:', 'Frequency [Hz]\tR [ohm]\tdR \t X [ohm]\tdX \t' ] ## Print Info for line in hd: self.logging.info(line) self.logging.info("-"*int(1.2*len(hd[-1]))) ## Prepare out = [] ## Loop over frequencies try: for f in self.lcr_frequencies: lcr_meter.set_frequency(f) time.sleep(self.delay_f) time.sleep(0.001) measurements = np.array([lcr_meter.execute_measurement() for _ in range(5)]) means = np.mean(measurements, axis = 0) errs = np.std(measurements, axis = 0) R, X = means dR, dX = errs #R, X = lcr_meter.execute_measurement() #dR, dX = (0,0) line = [f, R, dR, X, dX] out.append(line) self.logging.info("\t{: <30.4E} \t{: <30.4E} \t{: <30.4E} \t{: <30.4E} \t{: <30.4E}".format(*line)) except KeyboardInterrupt: self.logging.error("Keyboard interrupt. Ramping down voltage and shutting down.") ## Close connections ## Save and print self.logging.info("\n") self.save_list(out, "ZV.dat", fmt="%.5E", header="\n".join(hd))
def execute(self): ## Set up power supply pow_supply = ke2410(self.pow_supply_address) pow_supply.reset() pow_supply.set_source('voltage') pow_supply.set_sense('current') pow_supply.set_current_limit(self.lim_cur) pow_supply.set_voltage(0) pow_supply.set_nplc(10) pow_supply.set_terminal('rear') pow_supply.set_output_on() ## Set up lcr meter lcr_meter = hp4980(self.lcr_meter_address) lcr_meter.reset() lcr_meter.set_voltage(self.lcr_vol) lcr_meter.set_frequency(self.lcr_freq) lcr_meter.set_mode('RX') # Set up switch switch = switchcard(self.switch_address) switch.reboot() switch.set_measurement_type('CV') switch.set_display_mode('OFF') ## Check settings lim_vol = pow_supply.check_voltage_limit() lim_cur = pow_supply.check_current_limit() lcr_vol = float(lcr_meter.check_voltage()) lcr_freq = float(lcr_meter.check_frequency()) temp_pc = switch.get_probecard_temperature() temp_sc = switch.get_matrix_temperature() # humd_pc = switch.get_probecard_humidity() # humd_sc = switch.get_matrix_humidity() type_msr = switch.get_measurement_type() type_disp = switch.get_display_mode() ## Print info self.logging.info("Settings:") self.logging.info("Power supply voltage limit: %8.2E V" % lim_vol) self.logging.info("Power supply current limit: %8.2E A" % lim_cur) self.logging.info("LCR measurement voltage: %8.2E V" % lcr_vol) self.logging.info("LCR measurement frequency: %8.2E Hz" % lcr_freq) self.logging.info("Voltage delay: %8.2f s" % self.delay_vol) self.logging.info("Channel delay: %8.2f s" % self.delay_ch) self.logging.info("Probecard temperature: %8.1f C" % temp_pc) self.logging.info("Switchcard temperature: %8.1f C" % temp_sc) # self.logging.info("Probecard humidity: %8.1f %" % humd_pc) # self.logging.info("Switchcard humidity: %8.1f %" % humd_sc) self.logging.info("Switchcard measurement setting: %s" % type_msr) self.logging.info("Switchcard display setting: %s" % type_disp) self.logging.info("\t") self.logging.info( "\tVoltage [V]\tTime [s]\tChannel [-]\tR [kOhm]\tX [kOhm]\tC [pF]\tTotal Current[A]" ) self.logging.info( "\t--------------------------------------------------------------------------" ) ## Prepare out = [] hd = ' Scan CV\n' \ + ' Measurement Settings:\n' \ + ' Power supply voltage limit: %8.2E V\n' % lim_vol \ + ' Power supply current limit: %8.2E A\n' % lim_cur \ + ' LCR measurement voltage: %8.2E V\n' % lcr_vol \ + ' LCR measurement frequency: %8.0E Hz\n' % lcr_freq \ + ' Voltage Delay: %8.2f s\n' % self.delay_vol \ + ' Channel Delay: %8.2f s\n' % self.delay_ch \ + ' Probecard temperature: %8.1f C\n' % temp_pc \ + ' Switchcard temperature: %8.1f C\n' % temp_sc \ + ' Switchcard measurement setting: %s\n' % type_msr \ + ' Switchcard display setting: %s\n\n\n' % type_disp \ + ' Nominal Voltage [V]\tMeasured Voltage [V]\tTime [s]\tChannel [-]\tR [kOhm]\tX [kOhm]\tC [pF]\tTotal Current[A]\n' ## Loop over voltages t = 0 try: t0 = time.time() while (time.time() - t0 < 12 * 3600): for v in self.volt_list: pow_supply.ramp_voltage(v) time.sleep(self.delay_vol) time.sleep(0.001) for c in self.cell_list: switch.open_channel(c) t = 0 t1 = time.time() while t < 60: t = time.time() - t1 vol = pow_supply.read_voltage() cur_tot = pow_supply.read_current() r, x = lcr_meter.execute_measurement() cap = (-10**(12)) / (2 * np.pi * self.lcr_freq * x) time.sleep(1) out.append([v, vol, t, c, r, x, cap, cur_tot]) self.logging.info( "\t%.2f \t%.1f \t%4d \t%.3f \t%.3f \t%.3E \t%.2E" % (vol, t, c, r / 1000., x / 1000., cap, cur_tot)) except KeyboardInterrupt: pow_supply.ramp_voltage(0) self.logging.error( "Keyboard interrupt. Ramping down voltage and shutting down.") ## Close connections pow_supply.ramp_voltage(0) pow_supply.set_output_off() pow_supply.reset() ## Save and print self.logging.info("\n") self.save_list(out, "cv.dat", fmt="%.5E", header=hd) self.print_graph(np.array(out)[:, 2], np.array(out)[:, 6], np.array(out)[:, 6]*0.001, \ 'Channel Nr. [-]', 'Total Current [A]', 'All Channels ' + self.id, fn="cv_all_channels_%s.png" % self.id) self.print_graph(np.array(out)[:, 2], np.array(out)[:, 5], np.array(out)[:, 5]*0.001, \ 'Channel Nr. [-]', 'Capacitance [F]', 'CV All Channels ' + self.id, fn="cv_all_channels_%s.png" % self.id) if (len(self.cell_list) > 2): ch = int(len(self.cell_list) * 0.1) + 1 self.print_graph(np.array([val for val in out if (val[2] == ch)])[:, 1], \ np.array([val for val in out if (val[2] == ch)])[:, 6], \ np.array([val for val in out if (val[2] == ch)])[:, 7], \ 'Bias Voltage [V]', 'Parallel Capacitance [F]', 'CV ' + self.id, fn="cv_channel_%d_%s.png" % (ch, self.id)) self.print_graph(np.array([val for val in out if (val[2] == ch)])[2:, 1], \ np.array([val for val in out if (val[2] == ch)])[2:, 6]**(-2), \ np.array([val for val in out if (val[2] == ch)])[2:, 7] * 2 * np.array([val for val in out if (val[2] == ch)])[2:, 6]**(-3), \ 'Bias Voltage [V]', '1/C^2 [1/F^2]', '1/C2 ' + self.id, fn="1c2v_channel%d_%s.png" % (ch, self.id)) # if (10 in out[:, 0]): # self.print_graph(np.array([val for val in out if (val[0] == 10)])[:, 2], \ # np.array([val for val in out if (val[0] == 10)])[:, 5], \ # np.array([val for val in out if (val[0] == 10)])[:, 6], \ # 'Channel Nr. [-]', 'Parallel Capacitance [F]', 'CV ' + self.id, fn="cv_all_channels_10V_%s.png" % self.id) # self.print_graph(np.array([val for val in out if (val[0] == 10)])[:, 2], \ # np.array([val for val in out if (val[0] == 10)])[:, 7], \ # np.array([val for val in out if (val[0] == 10)])[:, 7]*0.01, \ # 'Channel Nr. [-]', 'Total Current [A]', 'CV ' + self.id, fn="cv_total_current_all_channels_10V_%s.png" % self.id) # if (100 in out[:, 0]): # self.print_graph(np.array([val for val in out if (val[0] == 100)])[:, 2], \ # np.array([val for val in out if (val[0] == 100)])[:, 5], \ # np.array([val for val in out if (val[0] == 100)])[:, 6], \ # 'Channel Nr. [-]', 'Parallel Capacitance [F]', 'CV ' + self.id, fn="cv_all_channels_100V_%s.png" % self.id) # self.print_graph(np.array([val for val in out if (val[0] == 100)])[:, 2], \ # np.array([val for val in out if (val[0] == 100)])[:, 7], \ # np.array([val for val in out if (val[0] == 100)])[:, 7]*0.01, \ # 'Channel Nr. [-]', 'Total Current [A]', 'CV ' + self.id, fn="cv_total_current_all_channels_100V_%s.png" % self.id) self.logging.info("\n") if 0: self.save_list(range(0, 512, 1), "channel_list.txt", fmt='%d', header='')
def execute(self): ## Set up power supply pow_supply = ke2410(self.pow_supply_address) pow_supply.reset() pow_supply.set_source('voltage') pow_supply.set_sense('current') pow_supply.set_current_limit(self.lim_cur) pow_supply.set_voltage(0) pow_supply.set_terminal('rear') pow_supply.set_output_on() time.sleep(5) ## Set up lcr meter lcr_meter = hp4980(self.lcr_meter_address) lcr_meter.reset() lcr_meter.set_voltage(self.lcr_vol) lcr_meter.set_frequency(self.lcr_freq) lcr_meter.set_mode('RX') ## Check settings lim_vol = pow_supply.check_voltage_limit() lim_cur = pow_supply.check_current_limit() lcr_vol = float(lcr_meter.check_voltage()) lcr_freq = float(lcr_meter.check_frequency()) # switch = switchcard("COM4") # switch.reboot() # switch.set_measurement_type('CV') # switch.set_display_mode('OFF') # switch.open_channel(110) ## Header hd = [ 'Longterm CV\n', 'Measurement Settings:', 'Power Supply voltage limit: %8.2E V' % lim_vol, 'Power Supply current limit: %8.2E A' % float(lim_cur), 'LCR measurement voltage: %8.2E V' % lcr_vol, 'LCR measurement frequency: %8.2E Hz' % lcr_freq, '\n\n', 'Nominal Voltage [V]\t Measured Voltage [V]\tTime [s]\tR [Ohm]\tR_Err [Ohm]\tX [Ohm]\tX_Err [Ohm]\tCs [F]\tCp [F]\tTotal Current [A]' ] ## Print Info for line in hd[1:-2]: self.logging.info(line) self.logging.info("\t") self.logging.info("\t") self.logging.info(hd[-1]) self.logging.info("-" * int(1.2 * len(hd[-1]))) ## Prepare out = [] ## Loop over voltages try: for v in self.volt_list: pow_supply.ramp_voltage(v) time.sleep(self.delay_msr) vol = pow_supply.read_voltage() cur_tot = pow_supply.read_current() t = 0 t0 = time.time() while t < self.duration_msr: t = time.time() - t0 time.sleep(0.1) vol = pow_supply.read_voltage() cur_tot = pow_supply.read_current() measurements = np.array( [lcr_meter.execute_measurement() for _ in range(5)]) means = np.mean(measurements, axis=0) errs = np.std(measurements, axis=0) r, x = means dr, dx = errs z = np.sqrt(r**2 + x**2) phi = np.arctan(x / r) r_s, c_s, l_s, D = lcr_series_equ(self.lcr_freq, z, phi) r_p, c_p, l_p, D = lcr_parallel_equ(self.lcr_freq, z, phi) line = [v, vol, t, r, dr, x, dx, c_s, c_p, cur_tot] out.append(line) self.logging.info( "{:<5.2E}\t{: <5.2E}\t{: <5.2E}\t{: <5.2E}\t{: <5.2E}\t{: <5.2E}\t{: <5.2E}\t{: <8.3E}\t{: <8.3E}\t{: <5.2E}" .format(*line)) except KeyboardInterrupt: pow_supply.ramp_voltage(0) self.logging.error( "Keyboard interrupt. Ramping down voltage and shutting down.") ## Close connections pow_supply.ramp_voltage(0) time.sleep(10) pow_supply.set_interlock_off() pow_supply.set_output_off() pow_supply.reset() ## Save and print self.logging.info("") self.save_list(out, "cv_long.dat", fmt="%.5E", header="\n".join(hd)) self.print_graph(np.array(out)[:, 2], np.array(out)[:, 8], np.array(out)[:, 8] * 0.01, 'Time [s]', 'Capacitance [F]', 'Longerm CV ' + self.id, fn="cv_long_%s.png" % self.id) self.print_graph(np.array(out)[:, 2], np.array(out)[:, 9], np.array(out)[:, 9] * 0.01, 'Time [s]', 'Total Current [A]', 'Longerm CV ' + self.id, fn="cv_long_total_current_%s.png" % self.id) self.logging.info("")
def execute(self): ## Set up power supply pow_supply = ke2410(self.pow_supply_address) pow_supply.reset() pow_supply.set_source('voltage') pow_supply.set_sense('current') pow_supply.set_current_limit(self.lim_cur) pow_supply.set_voltage(0) pow_supply.set_terminal('rear') pow_supply.set_output_on() ## Set up lcr meter lcr_meter = hp4980(self.lcr_meter_address) lcr_meter.reset() lcr_meter.set_voltage(self.lcr_vol) lcr_meter.set_frequency(self.lcr_freq) lcr_meter.set_mode('RX') ## Check settings lim_vol = pow_supply.check_voltage_limit() lim_cur = pow_supply.check_current_limit() lcr_vol = float(lcr_meter.check_voltage()) lcr_freq = float(lcr_meter.check_frequency()) ## Print info self.logging.info("Settings:") self.logging.info("Power Supply voltage limit: %8.2E V" % lim_vol) self.logging.info("Power Supply current limit: %8.2E A" % float(lim_cur)) self.logging.info("LCR measurement voltage: %8.2E V" % lcr_vol) self.logging.info("LCR measurement frequency: %8.2E Hz" % lcr_freq) self.logging.info("Voltage Delay: %8.2f s" % self.delay_vol) self.logging.info("\t") self.logging.info( "\tVoltage [V]\tChannel [-]\tR [kOhm]\tX [kOhm]\tCs [pF]\tCp [pF]\tTotal Current [A]" ) self.logging.info( "\t--------------------------------------------------------------------------" ) ## Prepare out = [] hd = ' Single CV\n' \ + ' Measurement Settings:\n' \ + ' Power supply voltage limit: %8.2E V\n' % lim_vol \ + ' Power supply current limit: %8.2E A\n' % lim_cur \ + ' LCR measurement voltage: %8.2E V\n' % lcr_vol \ + ' LCR measurement frequency: %8.0E Hz\n' % lcr_freq \ + ' Voltage Delay: %8.2f s\n\n' % self.delay_vol \ + ' Nominal Voltage [V]\t Measured Voltage [V]\tChannel [-]\tR [kOhm]\tR_Err [kOhm]\tX [kOhm]\tX_Err [kOhm]\tCs [pF]\tCp [pF]\tTotal Current [A]\n' ## Loop over voltages try: j = 0 for v in self.volt_list: pow_supply.ramp_voltage(v) time.sleep(self.delay_vol) time.sleep(0.001) cur_tot = pow_supply.read_current() vol = pow_supply.read_voltage() tmp1 = [] tmp2 = [] for i in range(5): r, x = lcr_meter.execute_measurement() tmp1.append(r) tmp2.append(x) r = np.mean(np.array(tmp1)) x = np.mean(np.array(tmp2)) r_err = np.std(np.array(tmp1)) x_err = np.std(np.array(tmp2)) time.sleep(0.001) z = np.sqrt(r**2 + x**2) phi = np.arctan(x / r) r_s, c_s, l_s, D = lcr_series_equ(self.lcr_freq, z, phi) r_p, c_p, l_p, D = lcr_parallel_equ(self.lcr_freq, z, phi) out.append([v, vol, j, r, r_err, x, x_err, c_s, c_p, cur_tot]) self.logging.info( "\t%.2f \t%4d\t%.3f \t%.3f \t%.3E \t%.3E \t%.2E" % (vol, j, r / 1000., x / 1000., c_s * 10**(12), c_p * 10**(12), cur_tot)) except KeyboardInterrupt: pow_supply.ramp_voltage(0) self.logging.error( "Keyboard interrupt. Ramping down voltage and shutting down.") ## Close connections pow_supply.ramp_voltage(0) time.sleep(15) pow_supply.set_output_off() pow_supply.reset() ## Save and print self.logging.info("") self.save_list(out, "cv.dat", fmt="%.5E", header=hd) self.print_graph(np.array(out)[:, 1], np.array(out)[:, 7], np.array(out)[:, 7] * 0.01, \ 'Bias Voltage [V]', 'Parallel Capacitance [F]', 'CV ' + self.id, fn="cv_%s.png" % self.id) self.print_graph(np.array(out)[2:, 1], np.array(out)[2:, 7]**(-2), 0, \ 'Bias Voltage [V]', '1/C^2 [1/F^2]', '1/C2 ' + self.id, fn="1c2v_%s.png" % self.id) self.print_graph(np.array(out)[:, 1], np.array(out)[:, 9], np.array(out)[:, 9]*0.01, \ 'Bias Voltage [V]', 'Total Current [A]', 'IV ' + self.id, fn="iv_total_current_%s.png" % self.id) self.logging.info("")
def execute(self): ## Set up power supply pow_supply = ke2410(self.pow_supply_address) pow_supply.reset() pow_supply.set_source('voltage') pow_supply.set_sense('current') pow_supply.set_current_limit(self.lim_cur) pow_supply.set_voltage(0) pow_supply.set_nplc(2) pow_supply.set_terminal('rear') pow_supply.set_interlock_on() pow_supply.set_output_on() ## Set up lcr meter lcr_meter = hp4980(self.lcr_meter_address) lcr_meter.reset() lcr_meter.set_voltage(self.lcr_vol) lcr_meter.set_frequency(self.lcr_freq) lcr_meter.set_mode('RX') # Set up switch switch = switchcard(self.switch_address) switch.reboot() switch.set_measurement_type('CV') switch.set_cv_resistance(self.cv_res) switch.set_display_mode('OFF') ## Check settings lim_vol = pow_supply.check_voltage_limit() lim_cur = pow_supply.check_current_limit() lcr_vol = float(lcr_meter.check_voltage()) lcr_freq = float(lcr_meter.check_frequency()) temp_pc = switch.get_probecard_temperature() temp_sc = switch.get_matrix_temperature() # humd_pc = switch.get_probecard_humidity() # humd_sc = switch.get_matrix_humidity() type_msr = switch.get_measurement_type() type_disp = switch.get_display_mode() ## Header hd = [ 'Scan CV\n', 'Measurement Settings:', 'Power supply voltage limit: %8.2E V' % lim_vol, 'Power supply current limit: %8.2E A' % lim_cur, 'LCR measurement voltage: %8.2E V' % lcr_vol, 'LCR measurement frequency: %8.2E Hz' % lcr_freq, 'CV resistance: %8.2E Ohm' % self.cv_res, 'Voltage delay: %8.2f s' % self.delay_vol, 'Channel delay: %8.2f s' % self.delay_ch, 'Probecard temperature: %8.1f C' % temp_pc, 'Switchcard temperature: %8.1f C' % temp_sc, 'Switchcard measurement setting: %s' % type_msr, 'Switchcard display setting: %s' % type_disp, '\n\n', 'Nominal Voltage [V]\t Measured Voltage [V]\tFrequency[Hz]\tChannel [-]\tR [Ohm]\tR_Err [Ohm]\tX [Ohm]\tX_Err [Ohm]\tC [F]\tTotal Current [A]\n' ] ## Print Info for line in hd[1:-2]: self.logging.info(line) self.logging.info("\t") self.logging.info("\t") self.logging.info(hd[-1]) self.logging.info("-" * int(1.2 * len(hd[-1]))) # Prepare out = [] ## Loop over voltages try: for v in self.volt_list: switch.short_all() time.sleep(self.delay_ch) pow_supply.ramp_voltage(v) time.sleep(self.delay_vol) j = 0 for c in self.cell_list: ## Only measure unflagged cells if self.flag_list[j] == 0: switch.open_channel(c) time.sleep(self.delay_ch) ## Loop over freqs for freq_nom in [ 5E2, 1E3, 2E3, 3E3, 5E3, 1E4, 2E4, 5E4, 1E5, 1E6 ]: lcr_meter.set_frequency(freq_nom) time.sleep(1) freq = float(lcr_meter.check_frequency()) cur_tot = pow_supply.read_current() vol = pow_supply.read_voltage() measurements = np.array([ lcr_meter.execute_measurement() for _ in range(5) ]) means = np.mean(measurements, axis=0) errs = np.std(measurements, axis=0) R, X = means dR, dX = errs time.sleep(0.001) z = np.sqrt(R**2 + X**2) phi = np.arctan(X / R) r_s, c_s, l_s, D = lcr_series_equ(freq, z, phi) r_p, c_p, l_p, D = lcr_parallel_equ(freq, z, phi) j += 1 line = [ v, vol, freq, j, R, dR, X, dX, c_s, c_p, cur_tot ] out.append(line) self.logging.info( "{:<5.2E}\t{: <5.2E}\t{: <5.2E}\t{: <5d}\t{: <5.2E}\t{: <5.2E}\t{: <5.2E}\t{: <5.2E}\t{: <8.3E}\t{: <8.3E}\t{: <5.2E}" .format(*line)) except KeyboardInterrupt: switch.short_all() pow_supply.ramp_voltage(0) self.logging.error( "Keyboard interrupt. Ramping down voltage and shutting down.") ## Close connections switch.reset() pow_supply.ramp_voltage(0) time.sleep(15) pow_supply.set_interlock_off() pow_supply.set_output_off() pow_supply.reset() ## Save and print self.logging.info("\n") self.save_list(out, "cv.dat", fmt="%.5E", header="\n".join(hd)) self.print_graph(np.array(out)[:, 2], np.array(out)[:, 8], np.array(out)[:, 8]*0.01, \ 'Channel Nr. [-]', 'Total Current [A]', 'All Channels ' + self.id, fn="cv_total_current_all_channels_%s.png" % self.id) self.print_graph(np.array(out)[:, 2], np.array(out)[:, 6], np.array(out)[:, 6]*0.01, \ 'Channel Nr. [-]', 'Capacitance [F]', 'CV All Channels ' + self.id, fn="cv_all_channels_%s.png" % self.id) if 0: ch = 1 self.print_graph(np.array([val for val in out if (val[2] == ch)])[:, 1], \ np.array([val for val in out if (val[2] == ch)])[:, 5], \ np.array([val for val in out if (val[2] == ch)])[:, 6], \ 'Bias Voltage [V]', 'Parallel Capacitance [F]', 'CV ' + self.id, fn="cv_channel_%d_%s.png" % (ch, self.id)) self.print_graph(np.array([val for val in out if (val[2] == ch)])[2:, 1], \ np.array([val for val in out if (val[2] == ch)])[2:, 7]**(-2), \ np.array([val for val in out if (val[2] == ch)])[2:, 7] * 0.01 * 2 * (np.array([val for val in out if (val[2] == ch)])[2:, 7]*0.01)**(-3), \ 'Bias Voltage [V]', '1/C^2 [1/F^2]', '1/C2 ' + self.id, fn="1c2v_channel%d_%s.png" % (ch, self.id)) if (10 in np.array(out)[:, 0]): self.print_graph(np.array([val for val in out if (val[0] == 10)])[:, 2], \ np.array([val for val in out if (val[0] == 10)])[:, 5], \ np.array([val for val in out if (val[0] == 10)])[:, 6], \ 'Channel Nr. [-]', 'Parallel Capacitance [F]', 'CV ' + self.id, fn="cv_all_channels_10V_%s.png" % self.id) self.print_graph(np.array([val for val in out if (val[0] == 10)])[:, 2], \ np.array([val for val in out if (val[0] == 10)])[:, 8], \ np.array([val for val in out if (val[0] == 10)])[:, 8]*0.01, \ 'Channel Nr. [-]', 'Total Current [A]', 'CV ' + self.id, fn="cv_total_current_all_channels_10V_%s.png" % self.id) if (100 in np.array(out)[:, 0]): self.print_graph(np.array([val for val in out if (val[0] == 100)])[:, 2], \ np.array([val for val in out if (val[0] == 100)])[:, 5], \ np.array([val for val in out if (val[0] == 100)])[:, 6], \ 'Channel Nr. [-]', 'Parallel Capacitance [F]', 'CV ' + self.id, fn="cv_all_channels_100V_%s.png" % self.id) self.print_graph(np.array([val for val in out if (val[0] == 100)])[:, 2], \ np.array([val for val in out if (val[0] == 100)])[:, 8], \ np.array([val for val in out if (val[0] == 100)])[:, 8]*0.01, \ 'Channel Nr. [-]', 'Total Current [A]', 'CV ' + self.id, fn="cv_total_current_all_channels_100V_%s.png" % self.id) self.logging.info("\n") if 0: self.save_list(range(0, 512, 1), "channel_list.txt", fmt='%d', header='')
def execute(self): ## Test functionality if self.mode == 0: ## Header hd = [ 'Debugging\n', 'Measurement Settings:', '\n\n', 'X[-]\tY[-]' ] ## Print Info for line in hd[1:-2]: self.logging.info(line) self.logging.info("\t") self.logging.info("\t") self.logging.info(hd[-1]) self.logging.info("-" * int(1.2 * len(hd[-1]))) ## Prepare out = [] ## Create fake data try: for i in range(1, 10): line = [i, i**2, 0.1] out.append(line) time.sleep(0.1) self.logging.info("{:<5.2E}\t{: <5.2E}".format(*line)) except KeyboardInterrupt: self.logging.error("Keyboard interrupt. Ramping down voltage and shutting down.") ## Save and print self.logging.info("\t") self.logging.info("\t") self.save_list(out, "out.dat", fmt="%4d", header="\n".join(hd)) self.print_graph(np.array(out)[:, 0], np.array(out)[:, 1], np.array(out)[:, 2], 'x', 'y', 'Test Data', fn="out.png") ## Test communication elif self.mode == 1: ## Set up power supply pow_supply = ke2410(self.pow_supply_address) pow_supply.reset() pow_supply.set_source('voltage') pow_supply.set_sense('current') pow_supply.set_current_limit(self.lim_cur) pow_supply.set_voltage(0) pow_supply.set_terminal('rear') pow_supply.set_output_on() ## Set up volt meter volt_meter = ke2450(self.volt_meter_address) volt_meter.reset() volt_meter.set_source('voltage') volt_meter.set_sense('current') volt_meter.set_current_range(1E-4) volt_meter.set_voltage(0) volt_meter.set_output_on() ## Set up lcr meter lcr_meter = hp4980(self.lcr_meter_address) lcr_meter.reset() lcr_meter.set_voltage(self.test_vol) lcr_meter.set_frequency(self.test_freq) lcr_meter.set_mode('CPRP') for v in self.volt_list: pow_supply.ramp_voltage(v) time.sleep(1) vol = pow_supply.read_voltage() cur = pow_supply.read_current() cap, res = lcr_meter.execute_measurement() cur_tot = pow_supply.read_current() self.logging.info("vol %E, cur %E, cap %E, cur_tot %E" % (vol, cur, cap, cur_tot)) ## Close connections pow_supply.set_output_off() pow_supply.reset() volt_meter.set_output_off() volt_meter.reset() ## Test ramping of voltage elif self.mode == 2: ## Set up power supply pow_supply = ke2410(self.pow_supply_address) pow_supply.reset() pow_supply.set_source('voltage') pow_supply.set_sense('current') pow_supply.set_current_limit(self.lim_cur) pow_supply.set_voltage(0) pow_supply.set_terminal('rear') pow_supply.set_output_on() ## Set up volt meter volt_meter = ke2001(self.volt_meter_address) volt_meter.reset() volt_meter.setup_ammeter(nplc=10, dig=9) try: for v in [-5, -1, 0, 1, 5, 10, 25, 50]: pow_supply.ramp_voltage(v, debug=1) time.sleep(1) vol = pow_supply.read_voltage() cur = volt_meter.read_current() cur_tot = pow_supply.read_current() self.logging.info("vol %E, cur_tot %E" % (vol, cur_tot)) except KeyboardInterrupt: pow_supply.ramp_voltage(0) self.logging.error("Keyboard interrupt. Ramping down voltage and shutting down.") ## Close connections pow_supply.ramp_voltage(0, debug=1) pow_supply.set_output_off() pow_supply.reset() ## Test switchcard if self.mode == 3: ## Set up switch switch = switchcard(self.switch_address) switch.reboot() switch.set_display_mode('ON') self.logging.info("\t") self.logging.info("Channel Set [-]\tChannel Read [-]") self.logging.info("-----------------") self.logging.info("\t") try: init = time.time() for i in self.cell_list: switch.open_channel(i) ch = switch.get_channel() t = time.time() - init if ch == i: self.logging.info("\t%.3f \t%d \t%d" % (t, i, ch)) else: self.logging.warning("\t%.3f \t%d \t%d" % (t, i, ch)) except KeyboardInterrupt: self.logging.error("Keyboard interrupt. Ramping down voltage and shutting down.") ## Save and print self.logging.info("\t") self.logging.info("\t") else: pass
def execute(self): ## Set up power supply pow_supply = ke2410(self.pow_supply_address) pow_supply.reset() pow_supply.set_source('voltage') pow_supply.set_sense('current') pow_supply.set_current_limit(self.lim_cur) pow_supply.set_voltage(0) pow_supply.set_terminal('rear') pow_supply.set_interlock_on() pow_supply.set_output_on() #pow_supply.set_current_range(1E-3, 1) ## Set up lcr meter lcr_meter = hp4980(self.lcr_meter_address) lcr_meter.reset() lcr_meter.set_voltage(self.lcr_vol) lcr_meter.set_frequency(self.lcr_freq) lcr_meter.set_mode('RX') ## Check settings lim_vol = pow_supply.check_voltage_limit() lim_cur = pow_supply.check_current_limit() lcr_vol = float(lcr_meter.check_voltage()) lcr_freq = float(lcr_meter.check_frequency()) ## Header hd = [ 'Single IV\n', 'Power Supply voltage limit: %8.2E V' % lim_vol, 'Power Supply current limit: %8.2E A' % float(lim_cur), 'LCR measurement voltage: %8.2E V' % lcr_vol, 'LCR measurement frequency: %8.2E Hz' % lcr_freq, 'Voltage Delay: %8.2f s' % self.delay_vol, '\n\n', 'Nominal Voltage [V]\t Measured Voltage [V]\tFreq [Hz]\tR [Ohm]\tR_Err [Ohm]\tX [Ohm]\tX_Err [Ohm]\tCs [F]\tCp [F]\tTotal Current [A]' ] ## Print Info for line in hd[1:-2]: self.logging.info(line) self.logging.info("\t") self.logging.info("\t") self.logging.info(hd[-1]) self.logging.info("-" * int(1.2 * len(hd[-1]))) ## Prepare out = [] ## Loop over voltages try: for v in self.volt_list: pow_supply.ramp_voltage(v) while "{: <5.2E}".format( pow_supply.read_voltage()) != "{: <5.2E}".format(v): pow_supply.check_current_limit() pow_supply.read_current() #print "{: <5.2E}".format(pow_supply.read_voltage()) #print "{: <5.2E}".format(v) if "{: <5.2E}".format( pow_supply.read_current()) == "{: <5.2E}".format( self.lim_cur): break time.sleep(0.5) time.sleep(self.delay_vol) if "{: <5.2E}".format( pow_supply.read_current()) == "{: <5.2E}".format( self.lim_cur): print "Compliance " + "{: <5.2E}".format( self.lim_cur) + "A reached" break #print pow_supply.check_current_limit() #print pow_supply.read_current() vol = pow_supply.read_voltage() cur_tot = pow_supply.read_current() # for freq_nom in [self.lcr_freq]: for freq_nom in [ 1E4 ]: #[5E2, 1E3, 5E3, 7.5E3, 9E3, 1E4, 1.1E4, 1.5E4, 2E4, 5E4, 1E5, 2E5, 1E6] lcr_meter.set_frequency(freq_nom) time.sleep(1) freq = float(lcr_meter.check_frequency()) measurements = np.array( [lcr_meter.execute_measurement() for _ in range(10)]) means = np.mean(measurements, axis=0) errs = np.std(measurements, axis=0) r, x = means dr, dx = errs z = np.sqrt(abs(r)**2 + x**2) phi = np.arctan(x / abs(r)) r_s, c_s, l_s, D = lcr_series_equ(freq, z, phi) r_p, c_p, l_p, D = lcr_parallel_equ(freq, z, phi) line = [v, vol, freq, r, dr, x, dx, c_s, c_p, cur_tot] out.append(line) self.logging.info( "{:<5.2E}\t{: <5.2E}\t{: <5.2E}\t{: <5.2E}\t{: <5.2E}\t{: <5.2E}\t{: <5.2E}\t{: <8.3E}\t{: <8.3E}\t{: <5.2E}" .format(*line)) except KeyboardInterrupt: pow_supply.ramp_voltage(0) self.logging.error( "Keyboard interrupt. Ramping down voltage and shutting down.") ## Close connections pow_supply.ramp_voltage(0) time.sleep(10) pow_supply.set_interlock_off() pow_supply.set_output_off() pow_supply.reset() ## Save and print self.logging.info("") self.save_list(out, "cv.dat", fmt="%.5E", header="\n".join(hd)) self.print_graph(np.array(out)[:, 1], np.array(out)[:, 7], np.array(out)[:, 7] * 0.01, \ 'Bias Voltage [V]', 'Parallel Capacitance [F]', 'CV ' + self.id, fn="cv_%s.png" % self.id) self.print_graph(np.array(out)[2:, 1], np.array(out)[2:, 7]**(-2), 0, \ 'Bias Voltage [V]', '1/C^2 [1/F^2]', '1/C2 ' + self.id, fn="1c2v_%s.png" % self.id) self.print_graph(np.array(out)[:, 1], np.array(out)[:, 9], np.array(out)[:, 9]*0.01, \ 'Bias Voltage [V]', 'Total Current [A]', 'IV ' + self.id, fn="iv_total_current_%s.png" % self.id) self.logging.info("")
def execute(self): ## Set up power supply pow_supply = ke2410(self.pow_supply_address) pow_supply.reset() pow_supply.set_source('voltage') pow_supply.set_sense('current') pow_supply.set_current_limit(self.lim_cur) pow_supply.set_voltage(0) pow_supply.set_terminal('rear') pow_supply.set_interlock_on() pow_supply.set_output_on() ## Set up lcr meter lcr_meter = hp4980(self.lcr_meter_address) lcr_meter.reset() lcr_meter.set_voltage(self.lcr_vol) lcr_meter.set_frequency(self.lcr_freq) lcr_meter.set_mode('CPRP') ## Check settings lim_vol = pow_supply.check_voltage_limit() lim_cur = pow_supply.check_current_limit() lcr_vol = float(lcr_meter.check_voltage()) lcr_freq = float(lcr_meter.check_frequency()) ## Header hd = [ 'Interpad C\n', 'Measurement Settings:', 'Power Supply voltage limit: %8.2E V' % lim_vol, 'Power Supply current limit: %8.2E A' % float(lim_cur), 'LCR measurement voltage: %8.2E V' % lcr_vol, 'LCR measurement frequency: %8.2E Hz' % lcr_freq, 'Voltage Delay: %8.2f s' % self.delay_vol, '\n\n', ' Nominal Voltage [V]\t Measured Voltage [V]\tFrequency [Hz]\tCp [F]\tCp_Err [F]\tRp [Ohm]\tRp_Err [Ohm]\tTotal Current [A]' ] ## Print Info for line in hd[1:-2]: self.logging.info(line) self.logging.info("\t") self.logging.info("\t") self.logging.info(hd[-1]) self.logging.info("-" * int(1.2 * len(hd[-1]))) ## Prepare out = [] ## Loop over voltages try: for v in self.volt_list: switch.short_all() pow_supply.ramp_voltage(v) time.sleep(self.delay_vol) cur_tot = pow_supply.read_current() vol = pow_supply.read_voltage() for freq_nom in [5E2, 1E3, 5E3, 1E4, 2E4, 5E4, 1E5, 1E6]: lcr_meter.set_frequency(freq_nom) time.sleep(0.1) freq = float(lcr_meter.check_frequency()) measurements = np.array( [lcr_meter.execute_measurement() for _ in range(5)]) c, r = np.mean(measurements, axis=0) dc, dr = np.std(measurements, axis=0) line = [v, vol, freq, c, dc, r, dr, cur_tot] out.append(line) self.logging.info( "{:<5.2E}\t{: <5.2E}\t{: <5.3E}\t{: <5.2E}\t{: <5.2E}\t{: <5.2E}\t{: <5.2E}\t{: <5.2E}" .format(*line)) except KeyboardInterrupt: switch.short_all() pow_supply.ramp_voltage(0) self.logging.error( "Keyboard interrupt. Ramping down voltage and shutting down.") ## Close connections switch.reset() pow_supply.ramp_voltage(0) time.sleep(15) pow_supply.set_interlock_off() pow_supply.set_output_off() pow_supply.reset() ## Save and print self.logging.info("") self.save_list(out, "cv_inter.dat", fmt="%.5E", header="\n".join(hd)) self.print_graph(np.array(out)[:, 1], np.array(out)[:, 3], np.array(out)[:, 3] * 0.01, \ 'Bias Voltage [V]', 'Parallel Capacitance [F]', 'CV ' + self.id, fn="cv_inter_%s.png" % self.id) self.print_graph(np.array(out)[:, 1], np.array(out)[:, 7], np.array(out)[:, 7]*0.01, \ 'Bias Voltage [V]', 'Total Current [A]', 'IV ' + self.id, fn="iv_total_current_%s.png" % self.id) self.logging.info("")