Skip to main content
Help us improve Python packaging – donate today!

A modular PID control library.

Project Description

This package provides general PID_ control software in Python with a
Melcor MTCA backend. The idea is that experimentalists interested in
temperature controlled experiments or other processes should not need
to learn the inner workings of their PID controller before they can
perform simple control tasks.

Module structure

This package provides both a high level controller that uses
per-device backend drivers. The controller handles auto-tuning the
PID feedback parameters and changing system temperatures, while the
backends communicate setpoint changes, temperature read requests,
etc. to the temperature control device.


The only physicsal backend that is supported at the moment is a Melcor
Series MTCA Thermoelectric Cooler Controller, which we communicate
with via Modbus_ packets over a `serial port`_. That's all I needed
for my experiments, but I tried to write a framework that was flexible
enough to swap in other backends. By subclassing `Backend` for your
particular device, you can take advantage of the high-level
`Controller` code that's already written.


Companies don't stay in business forever, but lab equipment does ;).
Our controller is still going strong since 1999, but Melcor has moved
around. According to their `2005 announcement`__ the Laird Group PLC
purchased Melcor from Fedders Corporation, and by 2009 (according to
the `Internet Archive Wayback Machine`__) they phased out the old
website at ``_ in favor of `their own thermal site`__, and
it looks like there is no longer support for the older MTCA
controllers. There seem to be a number of them on eBay_ though ;).

__ `Laird announcement`_
__ wayback_
__ `Laird thermal`_


To get a feel for driving a PID system, look atcheck out the
`TestBackend`, which simulates a standard first-order process with
dead time (FOPDT).




I've packaged `pypid` for Gentoo_. You need layman_ and my `wtk
overlay`_. Install with::

# emerge -av app-portage/layman
# layman --add wtk
# emerge -av dev-python/pypid


If you're installing by hand or packaging `pypid` for another
distribution, you'll need the following dependencies:

========= ===================== ================ ==========================
Package Purpose Debian_ Gentoo_
========= ===================== ================ ==========================
aubio_ Pitch detection python-aubio media-libs/aubio
nose_ testing python-nose dev-python/nose
NumPy_ Controller analysis python-numpy dev-python/numpy
pySerial_ serial comminication python-serial dev-python/pyserial
pymodbus_ Modbus stack python-modbus dev-python/twisted
SciPy_ Controller analysis python-scipy dev-python/scipy
========= ===================== ================ ==========================

Actually, `pymodbus` may (depending on your packaging system) depend
on `pySerial`_ via Twisted_, so `pymodbus` alone may be enough to get
you going.

The Debian package for `pymodbus` has not been accepted yet. `Debian
bug #578120`__ tracks the progress of the prospective package, but it
seems to have stalled out at the moment.

__ db578120_

Installing by hand

Pypid is available as a Git_ repository::

$ git clone git://

See the homepage_ for details. To install the checkout, run the

$ python install


See the examples in the `examples` directory.


Run the test suite with::

$ nosetests --with-doctest --doctest-tests pypid

Note that you should have your temperature control device connected to
your computer before running this command, as backend tests require a
connected backend.


This project is distributed under the `GNU General Public License
Version 3`_ or greater.


W. Trevor King
Copyright 2008-2012

.. _PID:
.. _Modbus:
.. _serial port:
.. _Laird announcement:
.. _wayback:
.. _Laird thermal:
.. _eBay:
.. _layman:
.. _wtk overlay:
.. _Debian:
.. _Gentoo:
.. _aubio:
.. _NumPy:
.. _pymodbus:
.. _pySerial:
.. _Twisted:
.. _SciPy:
.. _db578120:
.. _nose:
.. _Git:
.. _homepage:
.. _GNU General Public License Version 3:

Release history Release notifications

This version
History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pypid-0.4.tar.gz (38.0 kB) Copy SHA256 hash SHA256 Source None Jul 22, 2012

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page