Commit 82b3c038 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Modifies the way a controller is used by defining several connections and...

Modifies the way a controller is used by defining several connections and adding an io to components
Showing with 14 additions and 15 deletions
+14 -15
......@@ -47,28 +47,27 @@ if within_ohmpi:
from ohmpi.ohmpi import OhmPi
print('Starting test of mux within OhmPi.')
k = OhmPi()
A, B, M, N = (32, 29, 31, 30)
#A, B, M, N = (32, 29, 31, 30)
k.reset_mux()
k._hw.switch_mux([A, B, M, N], state='on')
k._hw.vab_square_wave(12.,12., cycles=2)
k._hw.switch_mux([A, B, M, N], state='off')
k._hw.calibrate_rx_bias() # electrodes 1 4 2 3 should be connected to a reference circuit
#k._hw.switch_mux([A, B, M, N], state='on')
#k._hw.vab_square_wave(12.,1., cycles=2)
#k._hw.switch_mux([A, B, M, N], state='off')
#k._hw.calibrate_rx_bias() # electrodes 1 4 2 3 should be connected to a reference circuit
#k._hw.rx._bias = -1.38
print(f'Resistance: {k._hw.last_rho :.2f} ohm, dev. {k._hw.last_dev:.2f} %, rx bias: {k._hw.rx._bias:.2f} mV')
#print(f'Resistance: {k._hw.last_rho :.2f} ohm, dev. {k._hw.last_dev:.2f} %, rx bias: {k._hw.rx._bias:.2f} mV')
# k._hw._plot_readings()
A, B, M, N = (28, 25, 27, 26)
k._hw.switch_mux([A, B, M, N], state='on')
k._hw.vab_square_wave(12., cycle_duration=1., cycles=3)
k._hw.switch_mux([A, B, M, N], state='off')
print(f'OhmPiHardware Resistance: {k._hw.last_rho :.2f} ohm, dev. {k._hw.last_dev:.2f} %, rx bias: {k._hw.rx._bias:.2f} mV')
k._hw._plot_readings()
# k._hw.switch_mux([A, B, M, N], state='on')
# k._hw.vab_square_wave(12., cycle_duration=10., cycles=3)
# k._hw.switch_mux([A, B, M, N], state='off')
# print(f'OhmPiHardware Resistance: {k._hw.last_rho :.2f} ohm, dev. {k._hw.last_dev:.2f} %, rx bias: {k._hw.rx._bias:.2f} mV')
# k._hw._plot_readings()
print('using OhmPi')
d = k.run_measurement([A, B, M, N], injection_duration=.5, nb_stack=3)
d = k.run_measurement([A, B, M, N], injection_duration=1., nb_stack=2, duty_cycle=0.5)
print(d)
# k._hw._plot_readings()
#k._hw._plot_readings()
print(f'OhmPiHardware: Resistance: {k._hw.last_rho :.2f} ohm, dev. {k._hw.last_dev:.2f} %, sp: {k._hw.sp:.2f} mV, rx bias: {k._hw.rx._bias:.2f} mV')
print(f'OhmPi: Resistance: {d["R [ohm]"] :.2f} ohm, dev. {d["R_std [%]"]:.2f} %, rx bias: {k._hw.rx._bias:.2f} mV')
k._hw._plot_readings(save_fig=False)
# plot_exec_log('ohmpi/logs/exec.log')
change_config('../configs/config_default.py', verbose=False)
change_config('../configs/config_default.py', verbose=False)
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment