From c9fedad45714704f27af459ab3a7570f86610e7a Mon Sep 17 00:00:00 2001 From: "rpi2.0" <rpi2.0> Date: Fri, 28 Oct 2022 08:26:15 +0200 Subject: [PATCH] fix for v2.0 compatibility (v22.10) --- config.py | 2 +- ohmpi.py | 10 +++++----- test.py | 16 ++++++++-------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/config.py b/config.py index 73c8a402..7da09b06 100644 --- a/config.py +++ b/config.py @@ -14,7 +14,7 @@ OHMPI_CONFIG = { 'integer': 2, # Max value 10 # TODO: Explain what this is... 'version': 2, 'max_elec': 64, - 'board_address': {'A': 0x72, 'B': 0x73, 'M': 0x70, 'N': 0x71}, # def. {'A': 0x76, 'B': 0x71, 'M': 0x74, 'N': 0x70} + 'board_address': {'A': 0x73, 'B': 0x72, 'M': 0x71, 'N': 0x70}, # def. {'A': 0x76, 'B': 0x71, 'M': 0x74, 'N': 0x70} #'board_address': {'A': 0x70, 'B': 0x71, 'M': 0x72, 'N': 0x73}, # def. {'A': 0x76, 'B': 0x71, 'M': 0x74, 'N': 0x70} 'settings': 'ohmpi_settings.json', 'board_version': '22.10', diff --git a/ohmpi.py b/ohmpi.py index 6f63632e..3ecc6f52 100644 --- a/ohmpi.py +++ b/ohmpi.py @@ -853,18 +853,18 @@ class OhmPi(object): d = self.run_measurement(quad=quad, nb_stack=1, injection_duration=1, tx_volt=tx_volt, autogain=False) if self.idps: - voltage = tx_volt # imposed voltage on dps5005 + voltage = tx_volt * 1000.0 # imposed voltage on dps5005 else: voltage = d['Vmn [mV]'] current = d['I [mA]'] # compute resistance measured (= contact resistance) - resist = abs(voltage / current) / 1000 - print(str(quad) + '> I: {:>10.3f} mA, V: {:>10.3f} mV, R: {:>10.3f} kOhm'.format( + resist = abs(voltage / current) /1000. + #print(str(quad) + '> I: {:>10.3f} mA, V: {:>10.3f} mV, R: {:>10.3f} kOhm'.format( current, voltage, resist)) msg = f'Contact resistance {str(quad):s}: I: {current * 1000.:>10.3f} mA, ' \ - f'V: {voltage * 1000.:>10.3f} mV, ' \ - f'R: {resistance /1000.:>10.3f} kOhm' + f'V: {voltage :>10.3f} mV, ' \ + f'R: {resist :>10.3f} kOhm' self.exec_logger.debug(msg) diff --git a/test.py b/test.py index 8a73f168..e8cbd02d 100644 --- a/test.py +++ b/test.py @@ -9,23 +9,23 @@ n = a + 2 seq = np.c_[a, b, m, n] k = OhmPi(idps=False) -k.settings['injection_duration'] = 0.5 +k.settings['injection_duration'] = 1 k.settings['nb_stack'] = 1 k.settings['nbr_meas'] = 1 -#k.sequence = seq -#k.reset_mux() -#k.switch_mux_on([4, 7, 5, 6]) +k.sequence = seq +k.reset_mux() +#k.switch_mux_on([1, 4, 2, 3]) #k.switch_mux_on([12, 15, 13, 14]) #k.measure(strategy='vmax') #print('vab', k.compute_tx_volt(strategy='vmin')) -#k.rs_check() -# out = k.run_measurement(quad=[3, 3, 3, 3], nb_stack=1, tx_volt=12, strategy='constant', autogain=True) +k.rs_check() +#out = k.run_measurement(quad=[3, 3, 3, 3], nb_stack=1, tx_volt=12, strategy='constant', autogain=True) #k.reset_mux() #k.rs_check(tx_volt=12) # x = [] -for i in range(3): - out = k.run_measurement(injection_duration=2, nb_stack=2, strategy='constant', tx_volt=5, autogain=False) +#for i in range(3): +# out = k.run_measurement(injection_duration=2, nb_stack=2, strategy='constant', tx_volt=5, autogain=False) #x.append(out['R [ohm]']) #k.append_and_save('out.csv', out) -- GitLab