forked from zietzm/Helmholtz_Test_Bench
8d1870956f
file is now only written when explicitly wanted, e.g. on button press. global config stored instead as config object
43 lines
1.6 KiB
Python
43 lines
1.6 KiB
Python
import numpy as np
|
|
|
|
# global variables set in other files
|
|
XY_DEVICE = None
|
|
Z_DEVICE = None
|
|
ARDUINO = None
|
|
|
|
X_AXIS = None
|
|
Y_AXIS = None
|
|
Z_AXIS = None
|
|
|
|
AXES = None # list containing [X_AXIS, Y_AXIS, Z_AXIS]
|
|
|
|
app = None
|
|
|
|
AXIS_NAMES = ["X-Axis", "Y-Axis", "Z-Axis"]
|
|
|
|
CONFIG_FILE = None
|
|
CONFIG_OBJECT = None
|
|
|
|
global XY_PORT
|
|
global Z_PORT
|
|
|
|
global PORTS
|
|
|
|
# Default Constants and maximum/minimum values (warning messages will be generated if these are exceeded)
|
|
# format: [[default values], [maximum values], [minimum values]]
|
|
# ToDo: check actual maximum ratings
|
|
# ToDo: Add maximum current: 5A (BA Blessing page 30), remove max_watts (there for testing with resistors)
|
|
# ToDo: put this into a config file
|
|
default_arrays = {
|
|
"coil_const": np.array([[38.6, 38.45, 37.9], [50, 50, 50], [0, 0, 0]]) * 1e-6, # Coil constants [x,y,z] [T/A]
|
|
"ambient_field": np.array([[30, 30, 30], [200, 200, 200], [0, 0, 0]]) * 1e-6, # background magnetic field [T]
|
|
"resistance": np.array([[1.7, 1.7, 1.7], [5, 5, 5], [1, 1, 1]], dtype=float), # resistance of circuits [Ohm]
|
|
"max_watts": np.array([[15, 15, 15], [50, 50, 50], [0, 0, 0]], dtype=float), # max. allowed power for circuits [W]
|
|
"max_volts": np.array([[14, 14, 14], [16, 16, 16], [0, 0, 0]], dtype=float), # max. allowed voltage, limited to 16V by used diodes! [V]
|
|
"relay_pin": [[15, 16, 17], [15, 16, 17], [15, 16, 17]] # pins on the arduino for reversing [x,y,z] polarity
|
|
}
|
|
default_ports = {
|
|
"xy_port": "COM1", # Serial port where PSU for X- and Y-Axes is connected
|
|
"z_port": "COM2", # Serial port where PSU for Z-Axis is connected
|
|
}
|