diff --git a/cage_func.py b/cage_func.py index 988322c..da7dbb1 100644 --- a/cage_func.py +++ b/cage_func.py @@ -135,7 +135,7 @@ class Axis: # determine voltage limit to be set on PSU, must be high enough to not limit the current: # min. 8V, max. max_volts, in-between as needed with current value (+margin to not limit current) - maxVoltage = min(max(1.3 * value * self.resistance, 8), self.max_volts) # limit voltage + maxVoltage = min(max(1.3 * abs(value) * self.resistance, 8), self.max_volts) # limit voltage if self.connected == "Connected": # only try to command the PSU if its actually connected self.device.set_current(abs(value), self.channel) # set desired current self.device.set_voltage(maxVoltage, self.channel) # set voltage limit