A Jupyter-based application and library to explore different control techniques for a simple temperature plant.
This project was written to showcase the Arduino-based Temperature Control Lab for lectures on advanced control techniques: Arduino Temperature Control Lab
The TCLab system has two temperature sensors and two heaters. This package provides two notebook entrypoints:
SimulationNotebookAppfor a simulated plant, so the app can be used without hardwareHardwareNotebookAppfor a real TCLab device
The project implements four control techniques:
- Manual
- On-Off
- PID
- MPC
It also includes a configuration window where simulation and controller parameters can be adjusted while the app is running.
The interface is built with ipywidgets and bqplot. The simulated plant uses SciPy, and MPC is implemented with GEKKO. For more information on MPC options, see the GEKKO documentation.
- Python
>=3.11
Core package dependencies:
numpyscipygekko
Optional extras:
notebook:ipywidgets,bqplot,jupyterhardware:tclab
For notebook use with the simulated plant:
pip install "tclab-jupyter[notebook]"For notebook use with real hardware:
pip install "tclab-jupyter[notebook,hardware]"Simulation mode:
from tclab_jupyter.ui.notebook import SimulationNotebookApp
demo = SimulationNotebookApp()
demo.app()
demo.config()Hardware mode:
from tclab_jupyter.ui.notebook import HardwareNotebookApp
demo = HardwareNotebookApp()
demo.app()
demo.config()Main app window:
Configuration window:
Set up the local environment with uv:
uv sync --group dev --extra notebookIf you are working with hardware too:
uv sync --group dev --extra notebook --extra hardwareUseful checks:
uv run ruff check .
uv run ruff format --check .
uv run ty check src/tclab_jupyter/runtime.py tests
uv run pytest -q