diff --git a/hardware/mb_2024_rev_0_0.py b/hardware/mb_2024_rev_0_0.py index 4493a3f347012e60ee53657d816f7a6c0d84130f..2b382d41380a89cc1ea4ba469f092d4c29acebea 100644 --- a/hardware/mb_2024_rev_0_0.py +++ b/hardware/mb_2024_rev_0_0.py @@ -257,7 +257,7 @@ class Rx(RxAbstract): gain_0 = _gain_auto(AnalogIn(self._ads_voltage, ads.P0)) gain_2 = _gain_auto(AnalogIn(self._ads_voltage, ads.P2)) gain = np.min([gain_0, gain_2]) - self.exec_logger.debug(f'Setting TX ADC gain automatically to {gain}') + self.exec_logger.debug(f'Setting RX ADC gain automatically to {gain}') self.adc_gain = gain @property diff --git a/hardware/ohmpi_card_3_15.py b/hardware/ohmpi_card_3_15.py index 5ac3c287ab64d50006c80fa8a7e294bb4f9f7238..2d82b8accc803e4e844f5fce7f4c8206f0c4d94f 100644 --- a/hardware/ohmpi_card_3_15.py +++ b/hardware/ohmpi_card_3_15.py @@ -226,7 +226,7 @@ class Rx(RxAbstract): gain_0 = _gain_auto(AnalogIn(self._ads_voltage, ads.P0)) gain_2 = _gain_auto(AnalogIn(self._ads_voltage, ads.P2)) gain = np.min([gain_0, gain_2]) - self.exec_logger.debug(f'Setting TX ADC gain automatically to {gain}') + self.exec_logger.debug(f'Setting RX ADC gain automatically to {gain}') self.adc_gain = gain @property diff --git a/test_ohmpi_card_3_15.py b/test_ohmpi_card_3_15.py index 7c8a39788c85a4d1697d31f2abffea7e9cd04df2..bbceaad4094cf853eaba6901a74641febce4a861 100644 --- a/test_ohmpi_card_3_15.py +++ b/test_ohmpi_card_3_15.py @@ -3,6 +3,7 @@ from OhmPi.hardware.ohmpi_card_3_15 import Tx from OhmPi.hardware.ohmpi_card_3_15 import Rx from OhmPi.logging_setup import create_stdout_logger +import numpy as np exec_logger = create_stdout_logger(name='exec') soh_logger = create_stdout_logger(name='soh') @@ -14,3 +15,16 @@ rx = Rx(exec_logger= exec_logger, soh_logger= soh_logger) print(f'TX current: {tx.current:.3f} mA') print(f'RX voltage: {rx.voltage:.3f} mV') + +tx.polarity = 1 +tx.inject(state='on') +tx.adc_gain_auto() +rx.adc_gain_auto() +r = [] +for i in range(30): + r.append(rx.voltage/tx.current) + print(f'Resistance: {r[-1]:.3f}') +r = np.array(r) +print(f'Mean resistance: {np.mean(r):.3f} Ohms') +print(f'Resistance std: {np.std(r):.3f} Ohms') +print(f'Dev. {100. * np.std(r)/np.mean(r):.1} %')