Commit 55133939 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Adds constant strategy

Showing with 3 additions and 1 deletion
+3 -1
...@@ -46,12 +46,14 @@ class Ctl(CtlAbstract): ...@@ -46,12 +46,14 @@ class Ctl(CtlAbstract):
warnings.resetwarnings() warnings.resetwarnings()
# Extended I2C # Extended I2C
warnings.filterwarnings("error") # to filter out adafruit warning about setting I2C frequency
try: try:
self.interfaces['i2c_ext'] = ExtendedI2C(4) # 4 is defined self.interfaces['i2c_ext'] = ExtendedI2C(4) # 4 is defined
except RuntimeWarning: except RuntimeWarning:
pass pass
except Exception as e: except Exception as e:
self.exec_logger.warning(f'Could not initialize Extended I2C:\n{e}') self.exec_logger.warning(f'Could not initialize Extended I2C:\n{e}')
warnings.resetwarnings()
# modbus # modbus
try: try:
......
...@@ -435,7 +435,7 @@ class OhmPiHardware: ...@@ -435,7 +435,7 @@ class OhmPiHardware:
current, voltage = 0., 0. current, voltage = 0., 0.
diff_vab = np.inf diff_vab = np.inf
if strategy == 'constant': if strategy == 'constant':
tx_volt = vab_max*.9 vab_max = tx_volt * 1.001
strategy = 'vmax' strategy = 'vmax'
if strategy == 'vmax': if strategy == 'vmax':
while (k < n_steps) and (diff_vab > diff_vab_lim) and (vab_list[k] < vab_max): while (k < n_steps) and (diff_vab > diff_vab_lim) and (vab_list[k] < vab_max):
......
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