Fixed error in voltage limit computation.

This commit is contained in:
2021-06-05 14:41:58 +02:00
parent 4c6164c41f
commit faa913fcd7
+1 -1
View File
@@ -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