forked from zietzm/Helmholtz_Test_Bench
Fixed error in voltage limit computation.
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user