diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2022-03-16 13:34:22 -0400 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2022-03-16 13:34:22 -0400 |
commit | 7f0685197d391736c1d91dadeafda1455c067bc4 (patch) | |
tree | 533be0a5b6de96169d4c62f9c7e9a4a94c87e294 /qolab | |
parent | 9c0e39201816f33467e8b6f881789c16f6d24b38 (diff) | |
download | qolab-7f0685197d391736c1d91dadeafda1455c067bc4.tar.gz qolab-7f0685197d391736c1d91dadeafda1455c067bc4.zip |
added Iout set via voltage output tune
Diffstat (limited to 'qolab')
-rw-r--r-- | qolab/hardware/power_supply/keysight_e3612a.py | 22 |
1 files changed, 22 insertions, 0 deletions
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 """ @@ -80,6 +81,26 @@ class KeysightE3612A(PowerSupplySCPI): 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})' rstr = self.query(qstr) @@ -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) |