Simple wrapper for the Thorlabs MTD415T OEM temperature controller module.
This module requires Python >= 3.5. It may also still work with Python 2.7 but is not explicitely tested for that environment.
pyserial
>= 3.4
Install with pip
$ pip install git+https://github.com/nelsond/thorlabs-mtd415t.git
from thorlabs_mtd415t import MTD415TDevice
from time import sleep
# create a new temperature controller instance with auto save enabled
temp_controller = MTD415TDevice('/dev/ttyUSB0', auto_save=True)
# set tec current limit
temp_controller.tec_current_limit = 0.5
# set pid gains
temp_controller.p_gain = 1
temp_controller.i_gain = 0.1
temp_controller.d_gain = 0
# clear any errors
temp_controller.clear_errors()
# set temperature setpoint
temp_controller.temp_setpoint = 15.025
# check current temperature after 10s
sleep(10)
temp_controler.temp # => 15.020
# close serial port
temp_controller.close()
temp_controller.is_open # => False
Install requirements for development environment
$ pip install -r requirements/dev.txt
Run tests
$ py.test tests/
Generate coverage report
$ py.test --cov=thorlabs_mtd415t tests/
MIT License, see file LICENSE
.
Thorlabs is registered trademark of Thorlabs, Inc.