This Thorlabs KBD101 Brushless DC Motor can be controlled via USB communication.
Please download and install the Thorlabs Kinesis Software, which installs .dll files necessary to communicate with the motor. This means you'll also need a computer running on Windows OS. Make sure to choose the right 32-bit or 64-bit version.
Below, we provide an example showing you how to communicate with your brushless motor controller. The API is implemented as a wrapper on top of Thorlabs .dll.
from tlkbd101 import TLKBD101
def main():
serial_number = "12345678" # Replace with your KBD101 device's serial number
dll_path = "path/to/your/dll/files" # Replace with the folder path name where the Thorlabs Kinesis DLL files are located
motor = TLKBD101(serial_number, dll_path)
# Connect to the KBD101 device
motor.connect()
# Home the KBD101 device
motor.home()
# Set velocity parameters in real units (acceleration and max velocity)
motor.set_velocity_parameters_real_units(5.0, 20.0)
# Move the motor to the given position in real units
target_position = 10.0
motor.move_to_position_real_units(target_position)
# Get the current position of the motor
current_position = motor.get_position()
print(f"Current position: {current_position}")
# Disconnect from the KBD101 device
motor.disconnect()
if __name__ == "__main__":
main()
This example code does the following:
Make sure to replace the serial_number variable with your KBD101 device's serial number and dll_path with the correct path to your Thorlabs Kinesis DLL files. Typically the dll files are located in C:\Program Files\Thorlabs\Kinesis
.