MDT693B

From: Thorlabs

Class: herosdevices.hardware.thorlabs.mdt69xb.MDT693B

Driver Quality Index: beta

Additional Information Check before use

Thorlabs MDT69xx USB Configuration

Problem

The USB chip in the Thorlabs MDT69xx series (e.g., MDT693B) may identify as a Human Interface Device (HID). If the usbhid kernel driver binds to it, the device cannot be accessed via a serial interface, rendering it non-functional.

Solution: udev Rule

  1. Identify Vendor and Product IDs

    Run the following command to list all USB devices and locate the Thorlabs device:

    lsusb
    

    Example output:

    Bus 001 Device 003: ID xxxx:xxxx Thorlabs MDT693B
    

    Note the xxxx values for idVendor and idProduct.

  2. Find the USB Kernel Path

    Use udevadm to inspect the device attributes and locate the kernel path (e.g., 1-8:1.0):

    udevadm info -a -p $(udevadm info -q path -n /dev/bus/usb/XXX/YYY)
    

    Replace XXX and YYY with the bus and device numbers from lsusb. This command will print a lot of information. You are looking for a line like:

    looking at device '/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/0003:046A:B090.0002/hidraw/hidraw1':
    

    Here, the 1-8:1.0 is what you are looking for.

  3. Create the udev Rule

    Edit or create a new udev rules file (e.g., /etc/udev/rules.d/99-thorlabs-piezo.rules) and add the following rule:

    # Thorlabs piezo controller MDT693B
    ACTION=="add", DRIVERS=="usb", ATTRS{idVendor}=="xxxx", ATTRS{idProduct}=="xxxx", SYMLINK+="USB_PIEZO_CTRL_1", RUN+="echo -n 'kernel_path' > /sys/bus/usb/drivers/usbhid/unbind"
    

    Replace:

    • xxxx with the Vendor and Product IDs from Step 1.

    • kernel_path with the USB kernel path from Step 2 (e.g., 1-5.1.2.3:1.0).

  4. Reload udev Rules

    Apply the changes by reloading the udev rules:

    sudo udevadm control --reload-rules
    sudo udevadm trigger --action add
    

Device driver for the MDT693B 3-Channel, Open-Loop Piezo Controller.

Bold arguments are mandatory. For more information on the listed arguments refer to the class documentation: herosdevices.hardware.thorlabs.mdt69xb.MDT693B If parameters appear in this list but not in the class definition, please recursively check the linked base classes for the definition of the parameter.

Argument

Type

Default Value

Description

address

<class ‘str’>

Serial address of the device.

timeout

<class ‘float’>

1.0

timeout for read operations.

The following JSON strings can be used to start a HERO device representation of MDT693B using BOSS.

{
    "_id": "my-3channel-piezo-controller",
    "classname": "herosdevices.hardware.thorlabs.MDT693B",
    "active": false,
    "arguments": {
        "address": "/dev/ttyUSB0"
    }
}

from examples/thorlabs/mdt69xb.json

{
    "_id": "my_MDT693B",
    "classname": "herosdevices.hardware.thorlabs.mdt69xb.MDT693B",
    "arguments": {
        "address": "/dev/ttyUSB0",
        "timeout": 1.0
    }
}

generated from signature

digraph inheritancef41b859802 { bgcolor=transparent; rankdir=TB; size=""; "herosdevices.core.templates.serial.SerialDeviceTemplate" [URL="../../../autoapi/herosdevices/core/templates/serial/index.html#herosdevices.core.templates.serial.SerialDeviceTemplate",color="#5fabe8",fillcolor="#5fabe827",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,penwidth=2,shape=box,style="rounded,filled",target="_top",tooltip="Template (base class) for devices which are controlled or read out through a serial interface."]; "herosdevices.hardware.thorlabs.mdt69xb.MDT693B" [URL="../../../autoapi/herosdevices/hardware/thorlabs/mdt69xb/index.html#herosdevices.hardware.thorlabs.mdt69xb.MDT693B",color="#5fabe8",fillcolor="#5fabe827",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,penwidth=2,shape=box,style="rounded,filled",target="_top",tooltip="Device driver for the MDT693B 3-Channel, Open-Loop Piezo Controller."]; "herosdevices.hardware.thorlabs.mdt69xb.MDT694B" -> "herosdevices.hardware.thorlabs.mdt69xb.MDT693B" [arrowsize=1,color="#5fabe8",dir="back",penwidth=2,style="setlinewidth(0.5)"]; "herosdevices.hardware.thorlabs.mdt69xb.MDT694B" [URL="../../../autoapi/herosdevices/hardware/thorlabs/mdt69xb/index.html#herosdevices.hardware.thorlabs.mdt69xb.MDT694B",color="#5fabe8",fillcolor="#5fabe827",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,penwidth=2,shape=box,style="rounded,filled",target="_top",tooltip="Device driver for the MDT694B Single Channel, Open-Loop Piezo Controller."]; "herosdevices.core.templates.serial.SerialDeviceTemplate" -> "herosdevices.hardware.thorlabs.mdt69xb.MDT694B" [arrowsize=1,color="#5fabe8",dir="back",penwidth=2,style="setlinewidth(0.5)"]; }