Commit fe2026b3 authored by Clement Remi's avatar Clement Remi
Browse files

Update new strategy for Vmax

Showing with 13 additions and 2 deletions
+13 -2
...@@ -283,12 +283,12 @@ class OhmPi(object): ...@@ -283,12 +283,12 @@ class OhmPi(object):
voltage_max = 4500. voltage_max = 4500.
current_min = voltage_min / (self.r_shunt * 50) # mA current_min = voltage_min / (self.r_shunt * 50) # mA
current_max = voltage_max / (self.r_shunt * 50) current_max = voltage_max / (self.r_shunt * 50)
tx_max = 40. # volt tx_max = 50. # volt
# check of volt # check of volt
volt = tx_volt volt = tx_volt
if volt > tx_max: if volt > tx_max:
self.exec_logger.warning('Sorry, cannot inject more than 40 V, set it back to 5 V') self.exec_logger.warning('Sorry, cannot inject more than 50 V, set it back to 5 V')
volt = 5. volt = 5.
# redefined the pin of the mcp (needed when relays are connected) # redefined the pin of the mcp (needed when relays are connected)
...@@ -346,6 +346,17 @@ class OhmPi(object): ...@@ -346,6 +346,17 @@ class OhmPi(object):
self.exec_logger.debug(f'Rab = {Rab:.2f} Ohms') self.exec_logger.debug(f'Rab = {Rab:.2f} Ohms')
# implement different strategy # implement different strategy
if strategy == 'vmax_rc':
factor_I = current_max / I
factor_vmn = voltage_max / Vmn
factor= factor_I
if factor_I > factor_vmn:
factor = factor_vmn
Vab = factor * tx_volt
if Vab > tx_max:
Vab=tx_max
if strategy == 'vmax': if strategy == 'vmax':
vmn_max = c * current_max vmn_max = c * current_max
if voltage_max > vmn_max > voltage_min: if voltage_max > vmn_max > voltage_min:
......
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