https://github.com/rvarago/cpppid
A composable library to implement contol loops in C++
https://github.com/rvarago/cpppid
control-engineering control-systems cpp cpp17 modern-cpp pid-controller
Last synced: about 1 year ago
JSON representation
A composable library to implement contol loops in C++
- Host: GitHub
- URL: https://github.com/rvarago/cpppid
- Owner: rvarago
- License: mit
- Created: 2019-01-01T16:25:19.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-20T14:39:12.000Z (almost 7 years ago)
- Last Synced: 2025-02-10T00:41:21.778Z (about 1 year ago)
- Topics: control-engineering, control-systems, cpp, cpp17, modern-cpp, pid-controller
- Language: C++
- Homepage:
- Size: 29.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cpppid
A composable library based on templates to implement control loops in C++17.
[](https://travis-ci.org/rvarago/cpppid)
## Description
By composing basic control functions, for instance:
* Proportional
* Integral
* Derivative
With a suitable composer, for instance:
* Adder
You can obtain complex controllers, in particular, the classic PID controller as something like this:
```cpp
cpppid::composers::adder {
cpppid::controllers::proportional,
cpppid::controllers::integral,
cpppid::controllers::derivatite
}
```
## Build
The _Makefile_ wraps the commands to download dependencies (Conan), generate the build configuration, build, run the unit tests, and clear the build folder.
* Compile (currently, it also compiles the unit tests):
```
make
```
It assumes that the default profile (*profiles/x86_64*) applies to your build, if not, then you can specify your profile by appending _PROFILE=_.
* Run the unit tests:
```
make test
```
* Clear the _build_ folder:
```
make clean
```
## Run tests inside a Docker container
Optionally, it's possible to run the tests for cpppid inside a Docker container by running:
```
make env-x86_64 # create docker image for x86_64
make env-x86_64-run # logs in the container
make test
```
Or:
```
make env-x86_64-test # the same as: make env-x86_64 env-x86_64-run make test
```
Or you can build and test for armv7 by simply changing the mentions to *x86_64* to *armv7* in the command above.