py-feedback-controller 0.1.0__tar.gz → 0.1.1__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.
Files changed (29) hide show
  1. {py_feedback_controller-0.1.0/src/py_feedback_controller.egg-info → py_feedback_controller-0.1.1}/PKG-INFO +1 -1
  2. py_feedback_controller-0.1.1/README.md +61 -0
  3. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/setup.py +1 -1
  4. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1/src/py_feedback_controller.egg-info}/PKG-INFO +1 -1
  5. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/src/pyfc/__init__.py +1 -1
  6. py_feedback_controller-0.1.0/README.md +0 -0
  7. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/LICENSE +0 -0
  8. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/MANIFEST.in +0 -0
  9. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/include/pyfc/fc_exceptions.hpp +0 -0
  10. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/include/pyfc/feedbackcontroller.hpp +0 -0
  11. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/include/pyfc/math/fc_math.hpp +0 -0
  12. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/include/pyfc/pid/autooptpid.hpp +0 -0
  13. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/include/pyfc/pid/pidcontroller.hpp +0 -0
  14. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/include/pyfc/timer/timer.hpp +0 -0
  15. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/setup.cfg +0 -0
  16. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/src/py_feedback_controller.egg-info/SOURCES.txt +0 -0
  17. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/src/py_feedback_controller.egg-info/dependency_links.txt +0 -0
  18. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/src/py_feedback_controller.egg-info/top_level.txt +0 -0
  19. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/src/pyfc/_core.cpp +0 -0
  20. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/src/pyfc/_core.pyi +0 -0
  21. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/src/pyfc/fc_exceptions.cpp +0 -0
  22. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/src/pyfc/feedbackcontroller.cpp +0 -0
  23. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/src/pyfc/math/fc_math.cpp +0 -0
  24. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/src/pyfc/pid/__init__.py +0 -0
  25. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/src/pyfc/pid/autooptpid.cpp +0 -0
  26. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/src/pyfc/pid/pidcontroller.cpp +0 -0
  27. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/src/pyfc/timer/__init__.py +0 -0
  28. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/src/pyfc/timer/timer.cpp +0 -0
  29. {py_feedback_controller-0.1.0 → py_feedback_controller-0.1.1}/test/test.py +0 -0
@@ -1,5 +1,5 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: py-feedback-controller
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  License-File: LICENSE
5
5
  Dynamic: license-file
@@ -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
+ ```
@@ -21,7 +21,7 @@ ext_modules = [
21
21
 
22
22
  setup(
23
23
  name="py-feedback-controller",
24
- version="0.1.0",
24
+ version="0.1.1",
25
25
  packages=find_packages(where="src"),
26
26
  package_dir={"": "src"},
27
27
  ext_modules=ext_modules,
@@ -1,5 +1,5 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: py-feedback-controller
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  License-File: LICENSE
5
5
  Dynamic: license-file
@@ -8,4 +8,4 @@ __all__ = [
8
8
  "FeedbackControllerException"
9
9
  ]
10
10
 
11
- __version__ = "0.1.0"
11
+ __version__ = "0.1.1"
File without changes