Driver for Thorlabs BBD302/PRM1Z8/K10CR​1 motorized stages

version 1.0.3 (7.75 KB) by Andriy Chmyrov
Matlab class to control Thorlabs motorized translation/rotation stages such as MLS203/BBD30X/PRM1Z8/K10CR1


Updated 25 Jul 2022

View License

This is a Matlab driver to control Thorlabs motorized rotation stages PRM1Z8/K10CR1 and a translation stage MLS302 with a BBD302 controller.
It is a class wrapper which calls the Kinesis .NET DLL library provided free from the Thorlabs.
Based on a code of Julan A.J. Fells - "Driver for Thorlabs motorized stages", which is acknowledged.
Check the GitHub page for possible updates.
Example of usage for Thorlabs K10CR1 rotational stage:
mlist=motor.listdevices % List connected devices
mot=motor % Create a motor object
mot.connect(mlist{1}) % Connect the first devce in the list of devices
mot.enable() % Enable the device (if needed)
mot.home() % Home the device
mot.moveto(45) % Move the device to the 45 degree setting
mot.moverel_deviceunit(-100000) % Move 100000 'clicks' backwards
mot.disable() % Disable the device (if needed)
mot.disconnect % Disconnect device
clear mot % Clear device object from memory
Example of usage for Thorlabs MLS203 translational stage with BBD302 controller:
motXY = motor; % create a motor object
motXY.connect('103205624') % connect to a controller with a serial number 103205624
motXY.enable % enable all channels
motXY.ishomed % check if channels are homed
motXY.home % perform homing for all channels
motXY.position % get the current position for all channels
motXY.moveto([15,25]) % move to position 15 mm on Ch1 and 25 mm on Ch2
motXY.maxvelocity = [10,50]; % set maxvelocity for movement to 10 mm/s for Ch1 and 50 mm/s for Ch2
motXY.acceleration = [500,500];% set acceleration to 500 mm/s2 for both channels
motXY.moveto([55,37.5]) % move to position [55 mm, 37.5], which is the center
motXY.disconnect % disconnect the device
clear motXY % Clear device object from memory

Cite As

Andriy Chmyrov (2022). Driver for Thorlabs BBD302/PRM1Z8/K10CR1 motorized stages (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2021b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: Driver for Thorlabs motorized stages

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!