-
Notifications
You must be signed in to change notification settings - Fork 0
/
galvo_tests.py
78 lines (61 loc) · 1.57 KB
/
galvo_tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
from galvo import *
def saturation_test_point():
p = Point("x", 0)
print(p.pos)
print(p.pos_comp)
print(p.voltage)
print(p.bit)
print("")
p = Point("x", 100000)
print(p.pos)
print(p.pos_comp)
print(p.voltage)
print(p.bit)
print("")
p = Point("x", voltage=5)
print(p.pos)
print(p.pos_comp)
print(p.voltage)
print(p.bit)
print("")
p = Point("x", voltage=0)
print(p.pos)
print(p.pos_comp)
print(p.voltage)
print(p.bit)
print("")
def sat_test_galvo():
driver = GalvoDriver('x', "DAC0", pos_init=0, daq=False)
def general_test():
driver = GalvoDriver('x', "DAC0", pos_init=0, daq=False)
for pos in [-1, 6, 2000, 12300, 1500, 900]:
driver.go_to(pos, 0)
print(driver.pos)
print(driver.pos_history)
driver.set_origin(900)
print(driver.rel_pos)
driver.go_to(100, 10)
print(driver.pos)
print("multi-drivers")
drivers = GalvoDrivers(
axis=("x", "z"),
dac_name={"x": "DAC0", "z": "DAC1"},
pos_init={"x": 0, "z": 0},
daq=False
)
drivers.go_to(x=100, z=300, speed=0)
print(drivers.pos)
print(drivers.pos_history)
print(drivers.rel_pos)
print(drivers.origin)
drivers.set_origin(x=300, z=1000)
print(drivers.pos)
print(drivers.origin)
drivers.go_to(x=1000, z=3000, speed=0)
print(drivers.pos)
print(drivers.origin)
drivers.reset_pos()
print(drivers.pos)
print(drivers.origin)
if __name__ == '__main__':
driver = GalvoDriver('x', "DAC0", pos_init=0, daq=False)