Skip to content

Simple Python wrapper for the Thorlabs MTD415T OEM temperature controller module

License

Notifications You must be signed in to change notification settings

nelsond/thorlabs-mtd415t

Repository files navigation

Python library for Thorlabs MTD415 OEM temperature controller Build Status Build status

Simple wrapper for the Thorlabs MTD415T OEM temperature controller module.

Requirements

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

Install with pip

$ pip install git+https://github.com/nelsond/thorlabs-mtd415t.git

Example usage

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

Development

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/

License

MIT License, see file LICENSE.

Helpful links


Thorlabs is registered trademark of Thorlabs, Inc.