# import platform import time as t import numpy as np import settings as g import cage_func as func from pyps2000b import PS2000B # User Inputs/Configuration---------------------------------- Test1 = 0 Test2 = 0 Test3 = 0 Test4 = 0 # 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, 3.9, 1]) # resistance of [x,y,z] circuits g.MAX_WATTS = np.array([8, 8, 0]) # max. allowed power for [x,y,z] circuits # COM-Ports for power supply units: XY_PORT = "COM7" g.XY_DEVICE = PS2000B.PS2000B(XY_PORT) g.MAX_AMPS = np.sqrt(g.MAX_WATTS / g.RESISTANCES) print(g.MAX_AMPS) def print_status(): print("Output 1:") func.print_status(g.X_AXIS) print("Output 2:") func.print_status(g.Y_AXIS) g.XY_DEVICE.enable_all() func.set_to_zero(g.XY_DEVICE) print_status() t.sleep(3) if Test1 == 1: g.XY_DEVICE.voltage1 = 5 t.sleep(1) print_status() t.sleep(5) func.set_to_zero(g.XY_DEVICE) if Test2 == 1: g.XY_DEVICE.current1 = 0.2 t.sleep(1) print_status() t.sleep(5) func.set_to_zero(g.XY_DEVICE) if Test4 == 1: func.set_axis_current(g.XY_DEVICE, 0.2) t.sleep(1) print_status() t.sleep(10) func.set_to_zero(g.XY_DEVICE) t.sleep(1) print_status() g.XY_DEVICE.disable_all() print_status()