diff --git a/pyAPT/__init__.py b/pyAPT/__init__.py index 27aa681..7d6183a 100644 --- a/pyAPT/__init__.py +++ b/pyAPT/__init__.py @@ -1,18 +1,19 @@ from __future__ import absolute_import import pylibftdi -from pyAPT import message, controller, mts50, prm1 +from pyAPT import message, controller, mts50, prm1, kdc101 __version__ = "0.01" __author__ = "Shuning Bian" __all__ = ['Message', 'Controller', 'MTS50', 'OutOfRangeError', 'PRM1', - 'add_PID'] + "KDC101", 'add_PID'] Message = message.Message Controller = controller.Controller MTS50 = mts50.MTS50 PRM1 = prm1.PRM1 +KDC101 = kdc101.KDC101 OutOfRangeError = controller.OutOfRangeError _PRODUCT_IDS = pylibftdi.USB_PID_LIST diff --git a/pyAPT/kdc101.py b/pyAPT/kdc101.py new file mode 100644 index 0000000..b0f64a8 --- /dev/null +++ b/pyAPT/kdc101.py @@ -0,0 +1,25 @@ +from __future__ import absolute_import, division +from .controller import Controller + +class KDC101(Controller): + """ + A controller for a KDC101 linear translation stage. + """ + def __init__(self,*args, **kwargs): + super(KDC101, self).__init__(*args, **kwargs) + + # can be set manually in the menu of the KDC101 + self.max_velocity = 0.48 + self.max_acceleration = 0.48 + + # see manual https://www.thorlabs.com/drawings/7edd686f3ac5c5ad-097D682C-AA42-53E4-3C7EB522A4840171/KDC101-KDC101ManualforAPT.pdf + enccnt = 34304 + T = 2048/6e6 + + # these equations are taken from the APT protocol manual + self.position_scale = enccnt + self.velocity_scale = enccnt * T * 65536 + self.acceleration_scale = enccnt * T * T * 65536 + + self.linear_range = (0,50) +