py-feedback-controller 0.1.0__cp313-cp313-win_amd64.whl
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.0.dist-info/METADATA +5 -0
- py_feedback_controller-0.1.0.dist-info/RECORD +10 -0
- py_feedback_controller-0.1.0.dist-info/WHEEL +5 -0
- py_feedback_controller-0.1.0.dist-info/licenses/LICENSE +21 -0
- py_feedback_controller-0.1.0.dist-info/top_level.txt +1 -0
- pyfc/__init__.py +11 -0
- pyfc/_core.cp313-win_amd64.pyd +0 -0
- pyfc/_core.pyi +101 -0
- pyfc/pid/__init__.py +4 -0
- pyfc/timer/__init__.py +4 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
py_feedback_controller-0.1.0.dist-info/licenses/LICENSE,sha256=ZeaUNPVVyknEeHj39vIoGzfUyZ-ZQrzpNAEIfyTZ80Y,1086
|
|
2
|
+
pyfc/__init__.py,sha256=cxJ6zyYlFtj0VhnA2MMyXK4xUa-eZZlPsn2nIWATkVo,232
|
|
3
|
+
pyfc/_core.cp313-win_amd64.pyd,sha256=HDwozFxtW9VQac-1VytIxNhHYi1vEIjIxV6UKettGgQ,238080
|
|
4
|
+
pyfc/_core.pyi,sha256=4NLxKupNMVJu2hKMCQYQVMHY8AYDmme0ZDtCjd58ldY,3972
|
|
5
|
+
pyfc/pid/__init__.py,sha256=L_YP9Ljz_Z32-CYZz1fkk5iPvBnr2CDiOlz1D_zCJ-g,125
|
|
6
|
+
pyfc/timer/__init__.py,sha256=bJWAgNoFiHcYiDmhcnbirQNxwJvbJS8sWlNJGjBUFzg,69
|
|
7
|
+
py_feedback_controller-0.1.0.dist-info/METADATA,sha256=LsrGJaLvWX28DFMlZVlyv05hxyhZeHqg_5cyFVtVovk,115
|
|
8
|
+
py_feedback_controller-0.1.0.dist-info/WHEEL,sha256=0LUNoHxLvcpw9db_x0XozE5jW73-_GOAO7fDDJ4Xt4Q,101
|
|
9
|
+
py_feedback_controller-0.1.0.dist-info/top_level.txt,sha256=4sqJeaC4Egdk59eh1l9GudJUf1AUTfjO1Y-WTKz7lTU,5
|
|
10
|
+
py_feedback_controller-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Patrik-J
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pyfc
|
pyfc/__init__.py
ADDED
|
Binary file
|
pyfc/_core.pyi
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Bindings for the PyFC module.
|
|
3
|
+
"""
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
import collections.abc
|
|
6
|
+
import typing
|
|
7
|
+
__all__: list[str] = ['AutoOptimizingPID', 'FeedbackController', 'FeedbackControllerException', 'PIDController', 'Timer', 'VectorMathException']
|
|
8
|
+
class AutoOptimizingPID(FeedbackController):
|
|
9
|
+
@typing.overload
|
|
10
|
+
def __init__(self, params: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], setpoint: typing.SupportsFloat | typing.SupportsIndex, lr: typing.SupportsFloat | typing.SupportsIndex = 0.001) -> None:
|
|
11
|
+
...
|
|
12
|
+
@typing.overload
|
|
13
|
+
def __init__(self, setpoint: typing.SupportsFloat | typing.SupportsIndex, lr: typing.SupportsFloat | typing.SupportsIndex = 0.001) -> None:
|
|
14
|
+
...
|
|
15
|
+
def getAsPID(self) -> PIDController:
|
|
16
|
+
"""
|
|
17
|
+
Get the auto-optimizing PID controller as a simple PID controller.
|
|
18
|
+
"""
|
|
19
|
+
def getCaps(self) -> list[float]:
|
|
20
|
+
"""
|
|
21
|
+
Get the upper and lower caps of the integral and derivative.
|
|
22
|
+
"""
|
|
23
|
+
def getLearningRate(self) -> float:
|
|
24
|
+
"""
|
|
25
|
+
Get the learning rate of the gradient descent algorithm.
|
|
26
|
+
"""
|
|
27
|
+
def init(self) -> None:
|
|
28
|
+
"""
|
|
29
|
+
Initialize the auto-optimizing PID controller
|
|
30
|
+
"""
|
|
31
|
+
def requestLoop(self, input: typing.SupportsFloat | typing.SupportsIndex) -> float:
|
|
32
|
+
"""
|
|
33
|
+
Request a single loop of the auto-optimizing PID controller.
|
|
34
|
+
"""
|
|
35
|
+
def setCaps(self, time_integral: typing.SupportsFloat | typing.SupportsIndex, derivative: typing.SupportsFloat | typing.SupportsIndex) -> None:
|
|
36
|
+
"""
|
|
37
|
+
Set the upper and lower caps of the integral and derivative.
|
|
38
|
+
"""
|
|
39
|
+
def setLearningRate(self, lr: typing.SupportsFloat | typing.SupportsIndex) -> None:
|
|
40
|
+
"""
|
|
41
|
+
Set the learning rate of the gradient descent algorithm.
|
|
42
|
+
"""
|
|
43
|
+
class FeedbackController:
|
|
44
|
+
def __repr__(self) -> str:
|
|
45
|
+
...
|
|
46
|
+
def getSetpoint(self) -> float:
|
|
47
|
+
"""
|
|
48
|
+
Get the setpoint of the feedback controller.
|
|
49
|
+
"""
|
|
50
|
+
def setSetpoint(self, setpoint: typing.SupportsFloat | typing.SupportsIndex) -> None:
|
|
51
|
+
"""
|
|
52
|
+
Set the setpoint of the feedback controller.
|
|
53
|
+
"""
|
|
54
|
+
class FeedbackControllerException(Exception):
|
|
55
|
+
pass
|
|
56
|
+
class PIDController(FeedbackController):
|
|
57
|
+
def __init__(self, params: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], setpoint: typing.SupportsFloat | typing.SupportsIndex) -> None:
|
|
58
|
+
...
|
|
59
|
+
def getCaps(self) -> list[float]:
|
|
60
|
+
"""
|
|
61
|
+
Get the upper and lower caps of the integral and derivative.
|
|
62
|
+
"""
|
|
63
|
+
def getGains(self) -> list[float]:
|
|
64
|
+
"""
|
|
65
|
+
Get the parameter gains of the PID controller.
|
|
66
|
+
"""
|
|
67
|
+
def init(self) -> None:
|
|
68
|
+
"""
|
|
69
|
+
Initialize the PID controller
|
|
70
|
+
"""
|
|
71
|
+
def requestLoop(self, input: typing.SupportsFloat | typing.SupportsIndex) -> float:
|
|
72
|
+
"""
|
|
73
|
+
Request a single loop of the PID controller.
|
|
74
|
+
"""
|
|
75
|
+
def setCaps(self, time_integral: typing.SupportsFloat | typing.SupportsIndex, derivative: typing.SupportsFloat | typing.SupportsIndex) -> None:
|
|
76
|
+
"""
|
|
77
|
+
Set the upper and lower caps of the integral and derivative.
|
|
78
|
+
"""
|
|
79
|
+
def setGains(self, gains: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex]) -> None:
|
|
80
|
+
"""
|
|
81
|
+
Set the parameter gains of the PID controller.
|
|
82
|
+
"""
|
|
83
|
+
class Timer:
|
|
84
|
+
def __init__(self) -> None:
|
|
85
|
+
"""
|
|
86
|
+
Create an instance of the Timer class
|
|
87
|
+
"""
|
|
88
|
+
def micros(self) -> int:
|
|
89
|
+
"""
|
|
90
|
+
Get the microseconds since the timer was started
|
|
91
|
+
"""
|
|
92
|
+
def millis(self) -> int:
|
|
93
|
+
"""
|
|
94
|
+
Get the milliseconds since the timer was started
|
|
95
|
+
"""
|
|
96
|
+
def start(self) -> None:
|
|
97
|
+
"""
|
|
98
|
+
Set the start time of the timer.
|
|
99
|
+
"""
|
|
100
|
+
class VectorMathException(Exception):
|
|
101
|
+
pass
|
pyfc/pid/__init__.py
ADDED
pyfc/timer/__init__.py
ADDED