AlexShkarin / pyLabLib

Python package for device control and experiment automation
http://pylablib.readthedocs.io
GNU General Public License v3.0
130 stars 30 forks source link

Thorlabs Kinesis trigger mode out_maxvel is inconsistent #51

Open davidcurie opened 1 year ago

davidcurie commented 1 year ago

The following function setup_kcube_trigio(trig1_mode="out_maxvel", trig1_pol=1) should declare a trigger output pulse when the stage reaches its maximum velocity.

Currently, the motor sends a trigger when the stage is in motion, not necessarily when the stage is at its maximum velocity.

This comes from a mapping in the kinesis.py file:

_p_kcube_trigio_mode=interface.EnumParameterClass("kcube_trigio_mode",{"off":0x00,
    "in_gpio":0x01,"in_relmove":0x02,"in_absmove":0x03,"in_home":0x04,
    "out_gpio":0x0A,"out_maxvel":0x0B,"out_pulse_fw":0x0D,"out_pulse_bk":0x0E,"out_pulse_move":0x0F,
    "out_lim_fw":0x10,"out_lim_bk":0x11,"out_lim_both":0x12})

According to the Thorlabs Communication Protocol (Issue 37) p 141, the relevant trigger mode for "max velocity" should be 0x0C, but it is currently implemented in pylablib as 0x0B. The Thorlabs manual suggests to me that 0x0B is for "in motion", which is consistent with what I am observing.

Is the mapping implemented in pylablib a deliberate override, or is this a simple typo?

Unit: KDC101 Ref: https://www.thorlabs.com/Software/Motion%20Control/APT_Communications_Protocol.pdf

AlexShkarin commented 1 year ago

Thank you for pointing it out!

This is indeed a typo. It will be fixed in the next pylablib release.