Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Currently, the following potentiostats are included in the library:
* CHI1242B from CH Instruments (chi1242b)
* CHI601E from CH Instruments (chi601e)
* CHI760E from CH Instruments (chi760e)
* CHI760F from CH Instruments (chi760f)
* Emstat Pico from PalmSens (emstatpico)

with the following techniques:
Expand All @@ -22,7 +23,7 @@ with the following techniques:
* Linear sweep voltammetry, LSV
* Open circuit potential, OCP

For the CHI601E and CHI760E only:
For the CHI601E and CHI760E/F only:
* Normal pulse voltammetry, NPV

# Installation
Expand All @@ -38,7 +39,7 @@ Here are quick examples on how to use the library. For more help check the [Wiki
import hardpotato as hp

# Potentiostat setup
# Choose the correct model from ['chi760e', 'chi1205b', 'emstatpico']:
# Choose the correct model from ['chi760f','chi760e', 'chi1205b', 'emstatpico']:
model = 'chi760e'
# Write the path where the chi software is installed (this line is optional when
# using the Pico). Make sure to use / instead of \:
Expand Down
99 changes: 98 additions & 1 deletion src/hardpotato/chi760e.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def __init__(self, Eini, Efin, dE, tsample, twidth, tperiod, sens,

self.validate(Eini, Efin, dE, tsample, twidth, tperiod, sens)

self.head = 'C\x02\0\0\nfolder: ' + folder + '\n' + fileOverride + \
self.head = 'C\x02\0\0\nfolder: ' + folder + '\n' + '\nfileoverride\n' + \
'header: ' + header + '\n\n'
self.body = 'tech=NPV\nei=' + str(Eini) + '\nef=' + str(Efin) + \
'\nincre=' + str(dE) + '\npw=' + str(tsample) + \
Expand Down Expand Up @@ -266,7 +266,72 @@ def bipot(self, E, sens):
self.foot = '\n forcequit: yesiamsure\n'
self.text = self.head + self.body2 + self.foot

class PCA:
'''
'''
def __init__(self, Eini, E1, E2, nStep, pw, dt, sens, folder, fileName, header,
path_lib, **kwargs):
self.fileName = fileName
self.folder = folder
self.text = ''

if 'qt' in kwargs:
qt = kwargs.get('qt')
else:
qt = 2
if 'resistance' in kwargs:
resistance = kwargs.get('resistance')
else:
resistance = 0

# correcting parameters:
Ei = Eini
if E1 > E2:
eh = E1
el = E2
pn = 'p'
else:
eh = E2
el = E1
pn = 'n'

self.head = 'C\x02\0\0\nfolder: ' + folder + '\nfileoverride\n' + \
'header: ' + header + '\n\n'
self.body = 'tech=CA\nei=' + str(Ei) + '\neh=' + str(eh) + '\nel=' + str(el) + '\npn=' + pn + \
'\ncl=' + str(nStep) + '\npw=' + str(pw) + '\nsi=' + str(dt) + \
'\nsens=' + str(sens)
if resistance: # In case IR compensation is required
self.body2 = self.body + '\nmir=' + str(resistance) + \
'\nircompon\nrun\nircompoff\nsave:' + self.fileName + \
'\ntsave:' + self.fileName
else:
self.body2 = self.body + '\nrun\nsave:' + self.fileName + \
'\ntsave:' + self.fileName
self.foot = '\n forcequit: yesiamsure\n'
self.text = self.head + self.body2 + self.foot

self.validate(Eini, E1, E2, nStep, pw, dt, sens)


def validate(self, Eini, E1, E2, nStep, pw, dt, sens):
info = Info()
info.limits(Eini, info.E_min, info.E_max, 'Estep', 'V')
info.limits(E1, info.E_min, info.E_max, 'Estep', 'V')
info.limits(E2, info.E_min, info.E_max, 'Estep', 'V')
#info.limits(dt, info.dt_min, info.dt_max, 'dt', 's')
#info.limits(ttot, info.ttot_min, info.ttot_max, 'ttot', 's')
#info.limits(sens, info.sens_min, info.sens_max, 'sens', 'A/V')

def bipot(self, E, sens):
# Validate bipot:
info = Info()
info.limits(E, info.E_min, info.E_max, 'E2', 'V')
#info.limits(sens, info.sens_min, info.sens_max, 'sens2', 'A/V')
self.body2 = self.body + \
'\ne2=' + str(E) + '\nsens2=' + str(sens) + '\ni2on' + \
'\nrun\nsave:' + self.fileName + '\ntsave:' + self.fileName
self.foot = '\n forcequit: yesiamsure\n'
self.text = self.head + self.body2 + self.foot

class OCP:
'''
Expand Down Expand Up @@ -301,6 +366,38 @@ def validate(self, ttot, dt):
#info.limits(dt, info.dt_min, info.dt_max, 'dt', 's')
#info.limits(ttot, info.ttot_min, info.ttot_max, 'ttot', 's')

class BE:

def __init__(self, Estep, iratio, dt, preE, pret, folder, fileName, header, path_lib, **kwargs):
self.fileName = fileName
self.folder = folder
self.text = ''

if 'qt' in kwargs:
qt = kwargs.get('qt')
else:
qt = 2
if 'resistance' in kwargs:
resistance = kwargs.get('resistance')
else:
resistance = 0

self.head = 'C\x02\0\0\nfolder: ' + folder + '\nfileoverride\n' + \
'header: ' + header + '\n\n'
self.body = 'tech=be\nei=' + str(Estep) + '\niratio=' + str(iratio) + \
'\nsi=' + str(dt) + '\nbepe=' + str(preE) + '\nbept=' + str(pret) + \
'\nrun\nsave:' + self.fileName + '\ntsave:' + self.fileName
self.foot = '\nforcequit: yesiamsure\n'
self.text = self.head + self.body + self.foot

self.validate(Estep)

def validate(self, Estep):
info = Info()
info.limits(Estep, info.E_min, info.E_max, 'Estep', 'V')
#info.limits(ttot, info.ttot_min, info.ttot_max, 'ttot', 's')


class EIS:
'''
Pending:
Expand Down
Loading