if message == 'y' and (batt_num == '1' or batt_num == '2' or batt_num == '3' or batt_num == '4'): break; print "Accessing the power supplies and electronic loads" pfc_v = 50 pfc_i = 2 batt_i = 10 batt_i_max = 15 ps1 = xpf6020.Xpf6020(ps1_path) ps1.reset_ps() ps1.set_voltage(1, pfc_v) ps1.set_currentlimit(1, pfc_i) bkload1 = bk8500.Bk8500(eload1_path) bkload1.remote_switch('on') bkload1.config_cc_mode(batt_i, batt_i_max) if batt_num == '2': ps1.set_voltage(2, pfc_v) ps1.set_currentlimit(2, pfc_i) bkload2 = bk8500.Bk8500(eload2_path) bkload2.remote_switch('on') bkload2.config_cc_mode(batt_i, batt_i_max) elif batt_num == '3': ps1.set_voltage(2, pfc_v) ps1.set_currentlimit(2, pfc_i) ps2 = xpf6020.Xpf6020(ps2_path) ps2.reset_ps() ps2.set_voltage(1, pfc_v)
# Input vin = 43 iin = 1.5 # Output (BK8500) mppt_v = 46 # can't be greater than mppt_v_max mppt_v_max = 50 print "Accessing the XPF6020 Power Supply" ps = xpf6020.Xpf6020(ps_path) ps.reset_ps() ps.set_voltage(1, vin) ps.set_currentlimit(1, iin) print "Accessing the BK8500 Electronic Load" bkload = bk8500.Bk8500() bkload.remote_switch('on') bkload.config_cv_mode(mppt_v, mppt_v_max) print "Accessing the Chroma62020H Power Supply" chroma = chroma62020H.Chroma62020H(chroma_path) chroma.reset() chroma.set_mode('SAS') chroma.set_sas_voc('25.67') chroma.set_sas_isc('5.629') chroma.set_sas_vmpp('20.12') chroma.set_sas_impp('4.971') print "Accessing the Agilent34972A DAQ" daq = agilent34972A.Agilent34972A(agilent_path) daq.factory_reset()
# Battery PS - Outside MPPT ps3_path = '/dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller_D-if00-port0' ps3 = xpf6020.Xpf6020(ps3_path) ps3.reset_ps() ps3.set_voltage(1, solar_vin) ps3.set_currentlimit(1, solar_iin) ps3.set_voltage(2, solar_vin) ps3.set_currentlimit(2, solar_iin) print "Accessing the BK8500 Electronic Loads" mppt_v = 46 mppt_v_max = 50 bkload1 = bk8500.Bk8500() bkload1.remote_switch('on') bkload1.config_cv_mode(mppt_v, mppt_v_max) bkload2 = bk8514.Bk8514() bkload2.remote_switch('on') bkload2.config_cv_mode(mppt_v, mppt_v_max) def bkload_measure_check(ch, cycle, current, voltage, tolerance): ts = datetime.now() ts = ts.replace(microsecond=0) if ch == '1': [r_load_v, r_load_i] = bkload1.read()