-
Notifications
You must be signed in to change notification settings - Fork 13
/
setup_optotune_mre2.py
39 lines (31 loc) · 1.13 KB
/
setup_optotune_mre2.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
"""
Setup Optotune MRE2 mirror using their python SDK
Tested with version MR-E-2_PythonSDK_1.2.4065
After downloading the SDK from the Optotune website, navigate to the folder and install using
pip install optoKummenberg-0.18.3974-py3-none-any.whl
pip install optoMDC-1.2.4065-py3-none-any.whl
"""
import optoMDC
def initialize_mre2():
mre2 = optoMDC.connect()
mre2.reset()
# set up x-channel
ch0 = mre2.Mirror.Channel_0
ch0.InputConditioning.SetGain(0.04)
# ch0.InputConditioning.GetGain()
ch0.InputConditioning.SetOffset(0.)
# ch0.InputConditioning.GetOffset()
ch0.Analog.SetAsInput()
ch0.SetControlMode(optoMDC.Units.XY) # XY = "Closed Loop", Current = "Open Loop"
# ch0.GetControlMode()
# ch0.Manager.CheckSignalFlow()
# set up y-channel
ch1 = mre2.Mirror.Channel_1
ch1.InputConditioning.SetGain(0.01)
ch1.InputConditioning.SetOffset(0.)
ch1.Analog.SetAsInput()
ch1.SetControlMode(optoMDC.Units.XY) # XY = "Closed Loop", Current = "Open Loop"
# ch1.Manager.CheckSignalFlow()
if __name__ == "__main__":
initialize_mre2()
print("initialized voice coil mirror")