From 7f0685197d391736c1d91dadeafda1455c067bc4 Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Wed, 16 Mar 2022 13:34:22 -0400 Subject: added Iout set via voltage output tune --- qolab/hardware/power_supply/keysight_e3612a.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'qolab/hardware/power_supply') diff --git a/qolab/hardware/power_supply/keysight_e3612a.py b/qolab/hardware/power_supply/keysight_e3612a.py index bb99bc3..f2720b4 100644 --- a/qolab/hardware/power_supply/keysight_e3612a.py +++ b/qolab/hardware/power_supply/keysight_e3612a.py @@ -1,5 +1,6 @@ from qolab.hardware.basic import BasicInstrument from qolab.hardware.power_supply import PowerSupplySCPI +import time class KeysightE3612A(PowerSupplySCPI): """ Keysight E3612A power supply """ @@ -79,6 +80,26 @@ class KeysightE3612A(PowerSupplySCPI): rstr = self.query(qstr) return( float(rstr) ) + @BasicInstrument.tsdb_append + def setChanIout(self, chNum, val, currentPrecision=5e-6, currentHeadRoom=1e-3, dwellTime=0.1): + """ + Tuning Vout to achieve desired Iout. + Generally setting current limit will maintain current near but not exact to desired. + This function will try to guess the correct Vout value + """ + iDesired = val + self.setChanIlimit(chNum, val+currentHeadRoom) + # here we assume that hook up is already made, so we can estimate source resistance + for i in range(10): + iOut=self.getChanIout(chNum) + if abs(iOut-iDesired) <= currentPrecision: + break + vOut=self.getChanVout(chNum) + R=vOut/iOut + vDesired = R*iDesired + self.setChanVlimit(chNum, vDesired) + time.sleep(dwellTime) + @BasicInstrument.tsdb_append def getChanIlimit(self, chNum): qstr = f'SOURce:CURR? (@{chNum})' @@ -87,6 +108,7 @@ class KeysightE3612A(PowerSupplySCPI): @BasicInstrument.tsdb_append def setChanIlimit(self, chNum, val): + """ Set current limit, seems to be >=0.002 """ cmnd = f'SOURCe:CURR {val},(@{chNum})' rstr = self.write(cmnd) -- cgit v1.2.3