Skip to content

Commit

Permalink
Commit for Thales version 5.9.2
Browse files Browse the repository at this point in the history
Function added to measure single frequency with PAD4 channels.
PAD4 example extended by single frequency measurements and DC measurements.
  • Loading branch information
maxkrapp1 committed Jan 31, 2024
1 parent 46692b1 commit 4816fe3
Show file tree
Hide file tree
Showing 13 changed files with 630 additions and 435 deletions.
186 changes: 158 additions & 28 deletions Examples/EISPad4/EISPad4.ipynb

Large diffs are not rendered by default.

40 changes: 31 additions & 9 deletions Examples/EISPad4/EISPad4.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
from thales_remote.connection import ThalesRemoteConnection
from thales_remote.script_wrapper import (
PotentiostatMode,
Expand All @@ -14,14 +13,13 @@
import numpy as np
from matplotlib.ticker import EngFormatter

if __name__ == "__main__":
zenniumConnection = ThalesRemoteConnection()
zenniumConnection.connectToTerm("localhost", "ScriptRemote")
zenniumConnection = ThalesRemoteConnection()
zenniumConnection.connectToTerm("192.168.2.47", "ScriptRemote")

zahnerZennium = ThalesRemoteScriptWrapper(zenniumConnection)
zahnerZennium.forceThalesIntoRemoteScript()
zahnerZennium = ThalesRemoteScriptWrapper(zenniumConnection)
zahnerZennium.forceThalesIntoRemoteScript()

zahnerZennium.calibrateOffsets()
zahnerZennium.calibrateOffsets()

zahnerZennium.setEISNaming(FileNaming.COUNTER)
zahnerZennium.setEISCounter(1)
Expand All @@ -41,11 +39,35 @@
zahnerZennium.setScanDirection(ScanDirection.START_TO_MAX)
zahnerZennium.setScanStrategy(ScanStrategy.SINGLE_SINE)

zahnerZennium.setPotential(1)
zahnerZennium.enablePotentiostat()

print(f"ACQ-Setup: {zahnerZennium.readAcqSetup()}")

for i in range(2):
print(f"Current:\t{zahnerZennium.getCurrent():>10.3e} A")
print(f"Potential:\t{zahnerZennium.getPotential():>10.6f} V")
print(zahnerZennium.readAllAcqChannels())
print(f"PAD4 Channel: {0} = {zahnerZennium.readAcqChannel(0)}")
print(f"PAD4 Channel: {1} = {zahnerZennium.readAcqChannel(1)}")


zahnerZennium.setPotential(0)

zahnerZennium.setupPad4Channel(1, 1, 1, voltageRange=4.0, shuntResistor=10e-3)
zahnerZennium.setupPad4Channel(1, 2, 1, voltageRange=4.0, shuntResistor=10e-3)
zahnerZennium.setupPad4Channel(1, 3, 0)
zahnerZennium.setupPad4Channel(1, 4, 0)
zahnerZennium.setupPad4ModeGlobal(Pad4Mode.VOLTAGE) # or Pad4Mode.CURRENT
zahnerZennium.enablePad4Global()

for frequency in [100, 300, 1000]:
print(f"frequency: {frequency}")
impedanceResult = zahnerZennium.getImpedancePad4(frequency=frequency)

for key, val in impedanceResult.items():
print(f"{key}: {val}")

zahnerZennium.enablePotentiostat()
zahnerZennium.measureEIS()
zahnerZennium.disablePotentiostat()
Expand Down Expand Up @@ -97,8 +119,8 @@

nyquistAxis.grid(which="both")
nyquistAxis.set_aspect("equal")
nyquistAxis.xaxis.set_major_formatter(EngFormatter(unit="$\Omega$"))
nyquistAxis.yaxis.set_major_formatter(EngFormatter(unit="$\Omega$"))
nyquistAxis.xaxis.set_major_formatter(EngFormatter(unit=r"$\Omega$"))
nyquistAxis.yaxis.set_major_formatter(EngFormatter(unit=r"$\Omega$"))
nyquistAxis.set_xlabel(r"$Z_{\rm re}$")
nyquistAxis.set_ylabel(r"$-Z_{\rm im}$")
nyquistAxis.legend(fontsize="large")
Expand Down
Loading

0 comments on commit 4816fe3

Please sign in to comment.