Merge pull request 'Development_zietz' (#1) from Development_zietz into master

Reviewed-on: zietzm/Magnetfeldteststand#1
This commit is contained in:
zietzm committed 2021-02-20 18:12:15 +01:00
commit 5ebdccc4e9
25 files changed
+1893 -539

No files matched your search

+5
View File
@@ -98,3 +98,8 @@ ENV/
.idea/misc.xml
.idea/Python-PS2000B.iml
.idea/Python-PS2000B.iml
.idea/Python-PS2000B.iml
.idea/misc.xml
config.ini
*.ini
log.csv
+1 -1
View File
@@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.7 (MagnetEnv)" jdkType="Python SDK" />
<orderEntry type="jdk" jdkName="Python 3.7 (venv)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyDocumentationSettings">
+1 -1
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (MagnetEnv)" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (venv)" project-jdk-type="Python SDK" />
</project>
+1
View File
@@ -1,3 +1,4 @@
# This file enables control of a connected Arduino microcontroller.
#!/usr/bin/env python
import logging
import itertools
-29
View File
@@ -1,29 +0,0 @@
import time
from Arduino import Arduino
print("Searching for Arduino...")
board = Arduino()
print("Arduino found.")
board.pinMode(15, "Output")
board.pinMode(16, "Output")
board.pinMode(17, "Output")
board.digitalWrite(15, "LOW")
board.digitalWrite(16, "LOW")
board.digitalWrite(17, "LOW")
i = 0
while i <= 1:
print("running: ", i)
for var in [15,16,17]:
board.digitalWrite(var, "HIGH")
time.sleep(0.5)
time.sleep(5)
for var in [15,16,17]:
board.digitalWrite(var, "LOW")
time.sleep(0.5)
time.sleep(2)
i = i + 1
board.close()
-72
View File
@@ -1,72 +0,0 @@
# 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 = 1
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)'''
func.set_to_zero(g.XY_DEVICE)
#print_status()
t.sleep(3)
if Test1 == 1:
print("setting")
g.XY_DEVICE.voltage1 = 5
g.XY_DEVICE.current1 = 1
g.XY_DEVICE.enable_all()
t.sleep(1)
#print_status()
t.sleep(5)
print("setting to zero")
func.set_to_zero(g.XY_DEVICE)
if Test2 == 1:
print("setting current")
g.XY_DEVICE.set_current(0.2, 0)
g.XY_DEVICE.set_voltage(5, 0)
g.XY_DEVICE.enable_all()
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()
BIN
View File
Binary file not shown.
View File
File renamed without changes.
Internal Server Error - IRS git hosting
500 Internal Server Error

An error occurred:

An error occurred

Gitea Version: 28.1.0