py-feedback-controller 0.1.0__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- py_feedback_controller-0.1.2/PKG-INFO +83 -0
- py_feedback_controller-0.1.2/README.md +61 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/setup.py +16 -1
- py_feedback_controller-0.1.2/src/py_feedback_controller.egg-info/PKG-INFO +83 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/src/pyfc/__init__.py +1 -1
- py_feedback_controller-0.1.0/PKG-INFO +0 -5
- py_feedback_controller-0.1.0/README.md +0 -0
- py_feedback_controller-0.1.0/src/py_feedback_controller.egg-info/PKG-INFO +0 -5
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/LICENSE +0 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/MANIFEST.in +0 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/include/pyfc/fc_exceptions.hpp +0 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/include/pyfc/feedbackcontroller.hpp +0 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/include/pyfc/math/fc_math.hpp +0 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/include/pyfc/pid/autooptpid.hpp +0 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/include/pyfc/pid/pidcontroller.hpp +0 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/include/pyfc/timer/timer.hpp +0 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/setup.cfg +0 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/src/py_feedback_controller.egg-info/SOURCES.txt +0 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/src/py_feedback_controller.egg-info/dependency_links.txt +0 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/src/py_feedback_controller.egg-info/top_level.txt +0 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/src/pyfc/_core.cpp +0 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/src/pyfc/_core.pyi +0 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/src/pyfc/fc_exceptions.cpp +0 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/src/pyfc/feedbackcontroller.cpp +0 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/src/pyfc/math/fc_math.cpp +0 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/src/pyfc/pid/__init__.py +0 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/src/pyfc/pid/autooptpid.cpp +0 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/src/pyfc/pid/pidcontroller.cpp +0 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/src/pyfc/timer/__init__.py +0 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/src/pyfc/timer/timer.cpp +0 -0
- {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/test/test.py +0 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: py-feedback-controller
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: A Python package implementing feedback controllers in C++.
|
|
5
|
+
Home-page: https://github.com/Patrik-J/PyFC
|
|
6
|
+
Author: Patrik Jelic
|
|
7
|
+
License: MIT
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.13
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Dynamic: author
|
|
14
|
+
Dynamic: classifier
|
|
15
|
+
Dynamic: description
|
|
16
|
+
Dynamic: description-content-type
|
|
17
|
+
Dynamic: home-page
|
|
18
|
+
Dynamic: license
|
|
19
|
+
Dynamic: license-file
|
|
20
|
+
Dynamic: requires-python
|
|
21
|
+
Dynamic: summary
|
|
22
|
+
|
|
23
|
+
# py-feedback-controller
|
|
24
|
+
|
|
25
|
+
This library implements various feedback controllers in C++ to use in Python. As of latest, the implemented feedback controllers are:
|
|
26
|
+
* ordinary PID controller
|
|
27
|
+
* auto-optimizing PID controller
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
To install the package, you can either build directly of this repo or use pip:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install py-feedback-controller
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
While the test folder of this repo has a small test script, a similar example will be shown.
|
|
40
|
+
|
|
41
|
+
```Python
|
|
42
|
+
from pyfc.pid import AutoOptimizingPID
|
|
43
|
+
|
|
44
|
+
from matplotlib.animation import FuncAnimation
|
|
45
|
+
from matplotlib import pyplot as plt
|
|
46
|
+
import numpy as np
|
|
47
|
+
|
|
48
|
+
setpoint = 1.0
|
|
49
|
+
|
|
50
|
+
pid = AutoOptimizingPID(setpoint=setpoint, lr=1.0)
|
|
51
|
+
pid.init()
|
|
52
|
+
|
|
53
|
+
z = [0.0]
|
|
54
|
+
t = [0.0]
|
|
55
|
+
dt = 1e-3
|
|
56
|
+
|
|
57
|
+
fig, ax = plt.subplots()
|
|
58
|
+
line = ax.plot(t, z)[0]
|
|
59
|
+
|
|
60
|
+
def func(frame):
|
|
61
|
+
global setpoint
|
|
62
|
+
if (frame % 500) == 0:
|
|
63
|
+
if setpoint == 1.0:
|
|
64
|
+
setpoint = 2.0
|
|
65
|
+
elif setpoint == 2.0:
|
|
66
|
+
setpoint = 1.0
|
|
67
|
+
|
|
68
|
+
pid.setSetpoint(setpoint)
|
|
69
|
+
|
|
70
|
+
pid_out = pid.requestLoop(z[frame-1])
|
|
71
|
+
|
|
72
|
+
z.append(z[frame-1] + dt * pid_out)
|
|
73
|
+
t.append(t[frame-1] + dt)
|
|
74
|
+
|
|
75
|
+
line.set_xdata(t)
|
|
76
|
+
line.set_ydata(z)
|
|
77
|
+
ax.set_ylim(-0.1, 1.2*np.max(z))
|
|
78
|
+
ax.set_xlim(0, 1.2*np.max(t))
|
|
79
|
+
|
|
80
|
+
anim = FuncAnimation(fig, func, frames=10000, interval=1)
|
|
81
|
+
plt.grid()
|
|
82
|
+
plt.show()
|
|
83
|
+
```
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# py-feedback-controller
|
|
2
|
+
|
|
3
|
+
This library implements various feedback controllers in C++ to use in Python. As of latest, the implemented feedback controllers are:
|
|
4
|
+
* ordinary PID controller
|
|
5
|
+
* auto-optimizing PID controller
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
To install the package, you can either build directly of this repo or use pip:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pip install py-feedback-controller
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
While the test folder of this repo has a small test script, a similar example will be shown.
|
|
18
|
+
|
|
19
|
+
```Python
|
|
20
|
+
from pyfc.pid import AutoOptimizingPID
|
|
21
|
+
|
|
22
|
+
from matplotlib.animation import FuncAnimation
|
|
23
|
+
from matplotlib import pyplot as plt
|
|
24
|
+
import numpy as np
|
|
25
|
+
|
|
26
|
+
setpoint = 1.0
|
|
27
|
+
|
|
28
|
+
pid = AutoOptimizingPID(setpoint=setpoint, lr=1.0)
|
|
29
|
+
pid.init()
|
|
30
|
+
|
|
31
|
+
z = [0.0]
|
|
32
|
+
t = [0.0]
|
|
33
|
+
dt = 1e-3
|
|
34
|
+
|
|
35
|
+
fig, ax = plt.subplots()
|
|
36
|
+
line = ax.plot(t, z)[0]
|
|
37
|
+
|
|
38
|
+
def func(frame):
|
|
39
|
+
global setpoint
|
|
40
|
+
if (frame % 500) == 0:
|
|
41
|
+
if setpoint == 1.0:
|
|
42
|
+
setpoint = 2.0
|
|
43
|
+
elif setpoint == 2.0:
|
|
44
|
+
setpoint = 1.0
|
|
45
|
+
|
|
46
|
+
pid.setSetpoint(setpoint)
|
|
47
|
+
|
|
48
|
+
pid_out = pid.requestLoop(z[frame-1])
|
|
49
|
+
|
|
50
|
+
z.append(z[frame-1] + dt * pid_out)
|
|
51
|
+
t.append(t[frame-1] + dt)
|
|
52
|
+
|
|
53
|
+
line.set_xdata(t)
|
|
54
|
+
line.set_ydata(z)
|
|
55
|
+
ax.set_ylim(-0.1, 1.2*np.max(z))
|
|
56
|
+
ax.set_xlim(0, 1.2*np.max(t))
|
|
57
|
+
|
|
58
|
+
anim = FuncAnimation(fig, func, frames=10000, interval=1)
|
|
59
|
+
plt.grid()
|
|
60
|
+
plt.show()
|
|
61
|
+
```
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from pathlib import Path
|
|
1
2
|
from pybind11.setup_helpers import Pybind11Extension, build_ext
|
|
2
3
|
from setuptools import setup, find_packages
|
|
3
4
|
|
|
@@ -19,9 +20,23 @@ ext_modules = [
|
|
|
19
20
|
cxx_std=17),
|
|
20
21
|
]
|
|
21
22
|
|
|
23
|
+
this_directory = Path(__file__).parent
|
|
24
|
+
long_description = (this_directory / "README.md").read_text(encoding="utf-8")
|
|
25
|
+
|
|
22
26
|
setup(
|
|
23
27
|
name="py-feedback-controller",
|
|
24
|
-
version="0.1.
|
|
28
|
+
version="0.1.2",
|
|
29
|
+
author="Patrik Jelic",
|
|
30
|
+
description="A Python package implementing feedback controllers in C++.",
|
|
31
|
+
long_description=long_description,
|
|
32
|
+
long_description_content_type="text/markdown",
|
|
33
|
+
url="https://github.com/Patrik-J/PyFC",
|
|
34
|
+
licence="MIT",
|
|
35
|
+
classifiers= [
|
|
36
|
+
"Programming Language :: Python :: 3",
|
|
37
|
+
"Operating System :: OS Independent",
|
|
38
|
+
],
|
|
39
|
+
python_requires=">=3.13",
|
|
25
40
|
packages=find_packages(where="src"),
|
|
26
41
|
package_dir={"": "src"},
|
|
27
42
|
ext_modules=ext_modules,
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: py-feedback-controller
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: A Python package implementing feedback controllers in C++.
|
|
5
|
+
Home-page: https://github.com/Patrik-J/PyFC
|
|
6
|
+
Author: Patrik Jelic
|
|
7
|
+
License: MIT
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.13
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Dynamic: author
|
|
14
|
+
Dynamic: classifier
|
|
15
|
+
Dynamic: description
|
|
16
|
+
Dynamic: description-content-type
|
|
17
|
+
Dynamic: home-page
|
|
18
|
+
Dynamic: license
|
|
19
|
+
Dynamic: license-file
|
|
20
|
+
Dynamic: requires-python
|
|
21
|
+
Dynamic: summary
|
|
22
|
+
|
|
23
|
+
# py-feedback-controller
|
|
24
|
+
|
|
25
|
+
This library implements various feedback controllers in C++ to use in Python. As of latest, the implemented feedback controllers are:
|
|
26
|
+
* ordinary PID controller
|
|
27
|
+
* auto-optimizing PID controller
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
To install the package, you can either build directly of this repo or use pip:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install py-feedback-controller
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
While the test folder of this repo has a small test script, a similar example will be shown.
|
|
40
|
+
|
|
41
|
+
```Python
|
|
42
|
+
from pyfc.pid import AutoOptimizingPID
|
|
43
|
+
|
|
44
|
+
from matplotlib.animation import FuncAnimation
|
|
45
|
+
from matplotlib import pyplot as plt
|
|
46
|
+
import numpy as np
|
|
47
|
+
|
|
48
|
+
setpoint = 1.0
|
|
49
|
+
|
|
50
|
+
pid = AutoOptimizingPID(setpoint=setpoint, lr=1.0)
|
|
51
|
+
pid.init()
|
|
52
|
+
|
|
53
|
+
z = [0.0]
|
|
54
|
+
t = [0.0]
|
|
55
|
+
dt = 1e-3
|
|
56
|
+
|
|
57
|
+
fig, ax = plt.subplots()
|
|
58
|
+
line = ax.plot(t, z)[0]
|
|
59
|
+
|
|
60
|
+
def func(frame):
|
|
61
|
+
global setpoint
|
|
62
|
+
if (frame % 500) == 0:
|
|
63
|
+
if setpoint == 1.0:
|
|
64
|
+
setpoint = 2.0
|
|
65
|
+
elif setpoint == 2.0:
|
|
66
|
+
setpoint = 1.0
|
|
67
|
+
|
|
68
|
+
pid.setSetpoint(setpoint)
|
|
69
|
+
|
|
70
|
+
pid_out = pid.requestLoop(z[frame-1])
|
|
71
|
+
|
|
72
|
+
z.append(z[frame-1] + dt * pid_out)
|
|
73
|
+
t.append(t[frame-1] + dt)
|
|
74
|
+
|
|
75
|
+
line.set_xdata(t)
|
|
76
|
+
line.set_ydata(z)
|
|
77
|
+
ax.set_ylim(-0.1, 1.2*np.max(z))
|
|
78
|
+
ax.set_xlim(0, 1.2*np.max(t))
|
|
79
|
+
|
|
80
|
+
anim = FuncAnimation(fig, func, frames=10000, interval=1)
|
|
81
|
+
plt.grid()
|
|
82
|
+
plt.show()
|
|
83
|
+
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/include/pyfc/fc_exceptions.hpp
RENAMED
|
File without changes
|
{py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/include/pyfc/feedbackcontroller.hpp
RENAMED
|
File without changes
|
|
File without changes
|
{py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/include/pyfc/pid/autooptpid.hpp
RENAMED
|
File without changes
|
{py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/include/pyfc/pid/pidcontroller.hpp
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/src/pyfc/feedbackcontroller.cpp
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{py_feedback_controller-0.1.0 → py_feedback_controller-0.1.2}/src/pyfc/pid/pidcontroller.cpp
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|