From 2154fe56c6ad00da9c43517d32871b8ed003447b Mon Sep 17 00:00:00 2001 From: Martin Zietz Date: Mon, 25 Jan 2021 10:34:00 +0100 Subject: [PATCH] restructure to have class for Arduino --- Arduino/__pycache__/arduino.cpython-37.pyc | Bin 18809 -> 0 bytes Arduino/arduino.py | 2 +- User_Interface.py | 7 +- cage_func.py | 82 ++++++++++++--------- main.py | 6 +- 5 files changed, 57 insertions(+), 40 deletions(-) delete mode 100644 Arduino/__pycache__/arduino.cpython-37.pyc diff --git a/Arduino/__pycache__/arduino.cpython-37.pyc b/Arduino/__pycache__/arduino.cpython-37.pyc deleted file mode 100644 index ce96862ecd6195c8972e4907a1af2643cb9033ce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18809 zcmdUXZEze%dfv?J><1Pf1VNCZc&GD_cRF%q5F#l`qIi;y_!dqi$Rqe6u1G=4?Ex_4 zVi)Y0C5hGIE_GDOvQwAnauqv?6C1FViXFR>l=CBY{=^k0smrgVT>dq7s$3QSL8{`) zzf|du^E}=2v5OBmR-q}bEYnvFX!F-J!_*NGMlEns>=10 zd+G(1Dwd1FF88{|MxWciX_f~>R^&c5%KOCgA}{#BZ_#kU-XJT{0_|+qF)Sr zY={B(z>`dQ82No-5cxrO82N+9?-xVJ52^QukUt=Xksnt1=a4@r4k3R?SgnDa*I$QH(I%$3ZrSo8c~VYMLxKg>Mx>Mi@msnOS}e9eoK)PtK3{5F6v*NwHI zz}PSYkMF5(XjHoS=bp(3Ewj;&_28D?vj#jYY?IrB|t`s;quu;_{`EqsHvGk5SdD zFFB1mTJ(IU+E`g_qVA|F-g@Dkv8$6e$F5G@o}9WdJ27=>?8@!=sjIVN7tzS2EfZ5R zS1N`%OdYxr<}a_h^>^L1aOjapBU~#5=QdQ+PQ)C1pc~JyVaX?rPvQ z>R}K288jL-Kg?De&3b^B_2$ZrO0DUJ8H_3%oT@+cWTU>~)&o_&WQX=@C0GtK_wgaq z3o{QZwcj@60rchb`N{LQFI6O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I|kH>`SLTL(MFe2!FHQ- zvVCrtX(bGEUWj}GkSC&nB%hSnUT2LyGlx z$r2*-0&f2dz*A*OU-WMza?!t$$ctV`lYTjgimfvW1F0>>G0-TW51P~y83_6ukT!^u zb&qZuyeDw0Fyd~*D>k{TRDL{5Xne?#lbt9lcVG0?9cOTn@I6#svOM&%kUtH`NKI$V(2sOt)uD zQpp^juLuD_g}4j8=9z3AO4(3^h>eoQ2>#W9`o9%R+Ix!gE8Ou(TTs4YU0*w_@h!yz zN8$>2ppLrGU!PW#moNuvipsX@K9bLNUF)L`<$Tm<`48E^E~cDb?nDupxPdtP9cNtn zqM6XlnhT0o7m7Z_1Fa54hg&8)=sXptPp5N;PdOLwszF^UnlKOGt4rzqo^ut;pRqS; zJ0tN>{|r!7&baOld*c6LsigRjq@lgVC^_%P#0MR7JewUa86F|)STvfM>whs&dJ0ef zw`k=VJe`d8eST8$^bB~qT^J}1DF)2=$Rp)E&V+GqPO^l2k>DkO&}MK>xzATe-$&KI zfKkWh;cr;;!=hRZK9AB$%60XBHq;@{au0UcFQQGHzf*ROa?0?3t!T~Ub*4`83%SPK zdkD+cep)(Al^0N%E=uO8PIjmwiRBX(-qa56w@I=7D1bh(PS}SNoPF@m;7o~C%oGk3 ZhYF_)#li0z-#5NHm>cXJoEg0Ee*xFSzm)(0 diff --git a/Arduino/arduino.py b/Arduino/arduino.py index e76a5b5..597c58b 100644 --- a/Arduino/arduino.py +++ b/Arduino/arduino.py @@ -103,6 +103,7 @@ def find_port(baud, timeout): return sr return None + def get_version(sr): cmd_str = build_cmd_str("version") try: @@ -115,7 +116,6 @@ def get_version(sr): class Arduino(object): - def __init__(self, baud=115200, port=None, timeout=2, sr=None): """ Initializes serial communication with Arduino if no connection is diff --git a/User_Interface.py b/User_Interface.py index d028c1d..a5811fe 100644 --- a/User_Interface.py +++ b/User_Interface.py @@ -90,7 +90,7 @@ class StatusDisplay(Frame): rowCounter = rowCounter + 1 # increase row counter to place future stuff below header # define content of row entries - TextLabels = ["PSU Serial Port:", "PSU Channel:", "Connection Status:", "", "Output:", "Remote Control:", + TextLabels = ["PSU Serial Port:", "PSU Channel:", "PSU Status:", "Arduino Status:", "", "Output:", "Remote Control:", "Voltage Setpoint:", "Actual Voltage:", "Current Setpoint:", "Actual Current:", "", "Target Field:", "Trgt. Field Raw:", "Target Current:", "Inverted:"] self.rowNo = len(TextLabels) # get number of label rows @@ -121,10 +121,11 @@ class StatusDisplay(Frame): i = 0 for axis in g.AXES: if axis.device is not None: - axis.update_values() + axis.update_status_info() self.label_dict["PSU Serial Port:"][i].set(g.ports[i]) self.label_dict["PSU Channel:"][i].set(axis.channel) - self.label_dict["Connection Status:"][i].set(axis.connected) + self.label_dict["PSU Status:"][i].set(axis.connected) + self.label_dict["Arduino Status:"][i].set(g.ARDUINO.connected) # ToDo (optional): make this multicolumn self.label_dict["Output:"][i].set(axis.output_active) self.label_dict["Remote Control:"][i].set(axis.remote_ctrl_active) self.label_dict["Voltage Setpoint:"][i].set("%0.3f V" % axis.voltage_setpoint) diff --git a/cage_func.py b/cage_func.py index da98df8..f0802fd 100644 --- a/cage_func.py +++ b/cage_func.py @@ -39,8 +39,8 @@ class Axis: self.polarity_switched = "Unknown" # polarity switched on the Arduino? - self.target_field_comp = 0.0 # field to be created by coil pair (this is sent to the coils) [T] - self.target_field = 0.0 # field that should occur in measurement area (ambient still needs to be compensated) [T] + self.target_field_comp = 0 # field to be created by coil pair (this is sent to the coils) [T] + self.target_field = 0 # field that should occur in measurement area (ambient still needs to be compensated) [T] self.target_current = 0 # signed current that should pass through coil pair [A] if self.device is not None: @@ -73,9 +73,12 @@ class Axis: if g.ARDUINO.digitalRead(self.ardPin): # ToDo: Test if this actually works self.polarity_switched = "True" else: self.polarity_switched = "False" - except serial.serialutil.SerialException: - # print("Connection Error with Arduino") + except Exception: + print("Error with Arduino") self.polarity_switched = "Unknown" + g.ARDUINO.connected = "Connection Error" + else: + g.ARDUINO.connected = "Connected" def print_status(self): # axis = axis control variable, stored in settings.py print("%s, %0.2f V, %0.2f A" @@ -122,30 +125,49 @@ class Axis: self.set_signed_current(current) +class ArduinoCtrl(Arduino): + + def __init__(self, pins): + self.connected = "Unknown" + self.pins = pins + print("Connecting to Arduino...") + try: + Arduino.__init__(self) # search for connected arduino and connect + for pin in self.pins: + g.ARDUINO.pinMode(pin, "Output") + g.ARDUINO.digitalWrite(pin, "LOW") + except Exception: + print("Connection to Arduino failed.") + self.connected = "Not Connected" + else: + g.arduino_connected = "Connected" + print("Arduino ready.") + + def safe(self): # sets output pins to low and closes serial connection + for pin in self.pins: + g.ARDUINO.digitalWrite(pin, "LOW") + + def setup_axes(): # creates device objects for all PSUs and sets their values print("Connecting to XY Device on %s..." % g.XY_PORT) try: g.XY_DEVICE = PS2000B.PS2000B(g.XY_PORT) # setup PSU print("Connection established.") - g.X_AXIS = Axis(0, g.XY_DEVICE, 0, g.RELAY_PINS[0]) # create axis objects - g.Y_AXIS = Axis(1, g.XY_DEVICE, 1, g.RELAY_PINS[1]) + g.X_AXIS = Axis(0, g.XY_DEVICE, 0, g.ARDUINO.pins[0]) # create axis objects + g.Y_AXIS = Axis(1, g.XY_DEVICE, 1, g.ARDUINO.pins[1]) except serial.serialutil.SerialException: - g.X_AXIS = Axis(0, None, 0, g.RELAY_PINS[0]) # create axis objects - g.Y_AXIS = Axis(1, None, 1, g.RELAY_PINS[1]) + g.X_AXIS = Axis(0, None, 0, g.ARDUINO.pins[0]) # create axis objects + g.Y_AXIS = Axis(1, None, 1, g.ARDUINO.pins[1]) print("XY Device not connected or incorrect port set.") - if g.Z_PORT == "NC": # check if device is connected - g.Z_AXIS = Axis(2, None, 0, g.RELAY_PINS[2]) - print("Z Device not connected or port not set.") - print("Connecting to Z Device on %s..." % g.XY_PORT) try: g.Z_DEVICE = PS2000B.PS2000B(g.Z_PORT) print("Connection established.") - g.Z_AXIS = Axis(2, g.Z_DEVICE, 0, g.RELAY_PINS[2]) + g.Z_AXIS = Axis(2, g.Z_DEVICE, 0, g.ARDUINO.pins[2]) except serial.serialutil.SerialException: - g.Z_AXIS = Axis(2, None, 0, g.RELAY_PINS[2]) + g.Z_AXIS = Axis(2, None, 0, g.ARDUINO.pins[2]) print("Z Device not connected or incorrect port set.") g.AXES.append(g.X_AXIS) @@ -174,23 +196,6 @@ def deactivate_all(): # disables remote control and output on all PSUs and chan g.Z_DEVICE.disable_all() -def setup_arduino(): - try: - g.ARDUINO = Arduino() # search for connected arduino and set handle - except Exception: - print("There seems to be no Arduino connected.") - else: - for pin in g.RELAY_PINS: - g.ARDUINO.pinMode(pin, "Output") - g.ARDUINO.digitalWrite(pin, "LOW") - print("Arduino ready.") - - -def safe_arduino(): # sets output pins to low and closes serial connection - for pin in g.RELAY_PINS: - g.ARDUINO.digitalWrite(pin, "LOW") - - def print_status_3(): print("X-Axis:") g.X_AXIS.print_status() @@ -210,7 +215,7 @@ def set_to_zero(device): # sets voltages and currents to 0 def power_down_all(): # temporary, set all outputs to 0 but keep connections enabled set_to_zero(g.XY_DEVICE) set_to_zero(g.Z_DEVICE) - safe_arduino() + g.ARDUINO.safe() def shut_down_all(): # shutdown at program end or on error, set outputs to 0 and disable connections @@ -219,18 +224,29 @@ def shut_down_all(): # shutdown at program end or on error, set outputs to 0 an try: set_to_zero(g.XY_DEVICE) except: print("PSU XY set to 0 unsuccessful.") + else: + print("PSU XY currents and voltages set to 0.") try: set_to_zero(g.Z_DEVICE) except: print("PSU Z set to 0 unsuccessful.") + else: + print("PSU Z currents and voltages set to 0.") try: deactivate_all() except: print("PSU deactivation unsuccessful.") - try: safe_arduino() + else: + print("PSUs deactivated.") + try: g.ARDUINO.safe() except: print("Arduino safing unsuccessful.") + # else: # commented out bc this throws no exception, even when arduino is not connected + # print("Arduino pins set to LOW.") # ToDo: figure out error handling for this try: g.ARDUINO.close() except: print("Closing Arduino connection failed.") + else: + print("Serial connection to Arduino closed.") + def set_field_simple(vector): # forms magnetic field as specified by vector, w/o cancelling ambient field for i in [0, 1, 2]: diff --git a/main.py b/main.py index f64f2a0..f75a627 100644 --- a/main.py +++ b/main.py @@ -4,12 +4,12 @@ import traceback import settings as g try: # start normal operations + # Connect to Arduino: + g.ARDUINO = func.ArduinoCtrl(g.RELAY_PINS) + print("Connecting to PSUs...") func.setup_axes() # initiate communication, set handles - print("Connecting to Arduino...") - func.setup_arduino() - print("\nOpening User Interface...") '''g.TestValuesX = ui.TestValues() g.TestValuesY = ui.TestValues()