Metadata-Version: 2.1
Name: nqontrol
Version: 1.2.1b0
Summary: Python program for digital control-loops.
Home-page: https://gitlab.com/las-nq/nqontrol
Author: Christian Darsow-Fromm
Author-email: cdarsowf@physnet.uni-hamburg.de
Requires-Python: >=3.6.1,<4.0.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: ADwin (>=0.16.2,<0.17.0)
Requires-Dist: Flask (>=1.1.2,<2.0.0)
Requires-Dist: dash (>=1.11.0,<2.0.0)
Requires-Dist: dash_daq (>=0.5.0,<0.6.0)
Requires-Dist: fastnumbers (>=3.0.0,<4.0.0)
Requires-Dist: gunicorn (>=20.0.4,<21.0.0)
Requires-Dist: importlib-metadata (>=1.6,<2.0); python_version <= "3.7"
Requires-Dist: jsonpickle (>=1.4,<2.0)
Requires-Dist: matplotlib (>=3.2.1,<4.0.0)
Requires-Dist: numpy (>=1.14,<2.0)
Requires-Dist: openqlab (>=0.3.0,<0.4.0)
Requires-Dist: pandas (>=1.0,<2.0)
Requires-Dist: plotly (>=4.3,<5.0)
Requires-Dist: scipy (>=1.0,<2.0)
Requires-Dist: websocket_client (>=0.57.0,<0.58.0)
Project-URL: Documentation, https://las-nq-serv.physnet.uni-hamburg.de/python/nqontrol/
Project-URL: Repository, https://gitlab.com/las-nq/nqontrol
Description-Content-Type: text/markdown

# NQontrol Servo Controller

[![pipeline status](https://gitlab.com/las-nq/nqontrol/badges/master/pipeline.svg)](https://gitlab.com/las-nq/nqontrol/commits/master)
[![coverage report](https://gitlab.com/las-nq/nqontrol/badges/master/coverage.svg)](https://gitlab.com/las-nq/nqontrol/commits/master)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

<img src="doc/_static/system_overview.png" align="right">

`NQontrol` is a Python project aiming the replacement of analog PID controllers in the lab.

The project is a solution based on the ADwin real-time platform that is able to deliver in excess of 8 simultaneous locking loops running with 200 kHz sampling frequency, and offers five second-order filtering sections per channel for optimal control performance. 
It can be used up to a control bandwidth of about 12 kHz.
This Python package, together with a web-based GUI, makes the system easy to use and adapt for a wide range of control tasks in quantum-optical experiments.

The source code can be found on [GitLab](https://gitlab.com/las-nq/nqontrol).

Read the latest changes in our [changelog](CHANGELOG.md).


## Paper Version

A fixed state of this project is [version 1.1](https://gitlab.com/las-nq/nqontrol/tree/v1.1).
The publicated paper about this project is available [here](https://doi.org/10.1063/1.5135873).
The preprint version of the paper describing can be found on [arXiv](https://arxiv.org/abs/1911.08824).


## Usage Example

Here is a short example for the Python API (see the [full example](https://las-nq-serv.physnet.uni-hamburg.de/python/nqontrol/usage.html) in the docs):

```python
# Importing a ServoDevice is enough
from nqontrol import ServoDevice

# Create a new servo device object, connecting to ADwin with the device number 0.
# Number 0 is reserved for a virtual mock device for testing.
sd = ServoDevice(0)

# Print the timestamp
print(f'Uptime {sd.timestamp}s')

# Get a servo object to control it.
s = sd.servo(1)

# Enable in and output
s.inputSw = True
s.outputSw = True

# Run a threshold analysis for locking
s.lockAnalysis()
# Enable the autolock
s.autolock(relock=True)
```


## Graphical User Interface

`NQontrol` can also be used with a responsive graphical user interface that runs in a browser (more details in the [docs](https://las-nq-serv.physnet.uni-hamburg.de/python/nqontrol/gui.html)):

![NQontrol GUI](doc/_static/entry.png)


## Autolock Feature

An [autolock feature](https://las-nq-serv.physnet.uni-hamburg.de/python/nqontrol/features.html#autolock) makes it simple to lock all the control loops.
It scans the output until a threshold value of the `aux` signal is reached, then it activates the lock.


## Documentation

For more information please read the online documentation:

* Current documentation of the [latest release](https://las-nq-serv.physnet.uni-hamburg.de/python/nqontrol)
* Current documentation of the [latest development version](https://las-nq-serv.physnet.uni-hamburg.de/python/nqontrol)


## NQontrol Installation

It's as simple as
```bash
pip install nqontrol
```
But additionally you need to install the ADwin library.
For complete installation instructions please refer to the [documentation page](https://las-nq-serv.physnet.uni-hamburg.de/python/nqontrol/install.html).


## Contribution

If you want to make changes for yourself or contribute to the project, take a look on [this page](https://las-nq-serv.physnet.uni-hamburg.de/python/nqontrol/dev_install.html) to see how to setup the environment.

