Files
Helmholtz_Test_Bench/main.py
T
2021-01-21 13:37:46 +01:00

29 lines
991 B
Python

import numpy as np
import globals as g
from tkinter import *
from Arduino import Arduino
import cage_func as func
import User_Interface as ui
# User Inputs/Configuration----------------------------------
# Desired output:
mag_vec1 = np.array([10, 10, 5])*1e-6
# Constants:
g.COIL_CONST = np.array([38.6, 38.45, 37.9]) * 1e-9 # Coil constants [x,y,z] in T/A
g.AMBIENT_FIELD = np.array([80]) * 1e-6 # ambient magnetic field in measurement area, to be cancelled out
g.RESISTANCES = np.array([3.9, 1, 1]) # resistance of [x,y,z] circuits
g.MAX_WATTS = np.array([8, 0, 0]) # max. allowed power for [x,y,z] circuits
g.MAX_VOLTS = 16 # max. allowed voltage, limited to 16V by used diodes!
# COM-Ports for power supply units:
g.XY_PORT = "COM1" # placeholders
g.Z_PORT = "COM2"
# Code starts here------------------------------------------
g.MAX_AMPS = np.sqrt(g.MAX_WATTS / g.RESISTANCES) # calculate maximum currents in each axis
application = ui.HelmholtzGUI()
application.mainloop()