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

Tests pwr_latency

Showing with 6 additions and 7 deletions
+6 -7
......@@ -55,6 +55,7 @@ class PwrAbstract(ABC):
self._current_max = kwargs.pop('current_max', 0.)
self._voltage_min = kwargs.pop('voltage_min', 0.)
self._voltage_max = kwargs.pop('voltage_max', 0.)
self._switchable = False
self.connection = kwargs.pop('connection', None)
self._battery_voltage = np.nan
......@@ -422,7 +423,8 @@ class TxAbstract(ABC):
def pwr_state(self, state):
if state == 'on':
self._pwr_state = 'on'
self.exec_logger.debug(f'{self.model} cannot switch on power source')
if not self.pwr.switchable:
self.exec_logger.debug(f'{self.model} cannot switch on power source')
self.pwr.reload_settings()
elif state == 'off':
self._pwr_state = 'off'
......
......@@ -14,7 +14,7 @@ SPECS = {'model': {'default': os.path.basename(__file__).rstrip('.py')},
'current_max': {'default': 60.},
'current_adjustable': {'default': False},
'voltage_adjustable': {'default': True},
'pwr_latency': {'default': .3}
'pwr_latency': {'default': .5}
}
# TODO: Complete this code... handle modbus connection
......
......@@ -329,9 +329,6 @@ class OhmPiHardware:
# bounds on vmn
vmn_upper_bound = vmn_mean + 2 * vmn_std
vmn_lower_bound = np.max([0.000001, vmn_mean - 2 * vmn_std])
# ax.plot([vab[k]] * 2, [vmn_lower_bound, vmn_upper_bound], '-b')
# ax.plot([0, vab_max], [0, vmn_upper_bound * vab_max / vab[k]], '-r', alpha=(k + 1) / n_steps)
# ax.plot([0, vab_max], [0, vmn_lower_bound * vab_max / vab[k]], '-g', alpha=(k + 1) / n_steps)
# bounds on rab
rab_lower_bound = np.max([0.1, np.abs(vab / iab_upper_bound)])
rab_upper_bound = np.max([0.1, np.abs(vab / iab_lower_bound)])
......
......@@ -500,7 +500,7 @@ class OhmPi(object):
bypass_check = kwargs['bypass_check'] if 'bypass_check' in kwargs.keys() else False
d = {}
if self.switch_mux_on(quad, bypass_check=bypass_check, cmd_id=cmd_id):
tx_volt = self._hw._compute_tx_volt(tx_volt=.5, strategy=strategy, vmn_max=5.) # TODO: use tx_
tx_volt = self._hw._compute_tx_volt(tx_volt=.5, strategy=strategy, vmn_max=5.) # TODO: use tx_volt and vmn_max instead of hardcoded values
self._hw.vab_square_wave(tx_volt, cycle_duration=injection_duration*2/duty_cycle, cycles=nb_stack, duty_cycle=duty_cycle)
if 'delay' in kwargs.keys():
delay = kwargs['delay']
......@@ -528,7 +528,7 @@ class OhmPi(object):
"nbStack": nb_stack,
"Tx [V]": tx_volt,
"CPU temp [degC]": self._hw.ctl.cpu_temperature,
"Nb samples [-]": len(self._hw.readings), # TODO: use only samples after a delay in each pulse
"Nb samples [-]": len(self._hw.readings[x,2]), # TODO: use only samples after a delay in each pulse
"fulldata": self._hw.readings[:, [0, -2, -1]],
# "I_stack [mA]": i_stack_mean,
"I_std [%]": I_std,
......
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