- added stirrer

- many other improvements

git-svn-id: http://moon:8086/svn/projects/HendiControl@116 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
2019-03-21 17:55:37 +00:00
parent 75b920047a
commit 08d8c32106
10 changed files with 213 additions and 71 deletions
+7 -2
View File
@@ -6,6 +6,7 @@ class Smoother:
def process(self, x):
self.y = self.b*self.y + self.a*x
return self.y
def get_y(self):
return self.y
@@ -15,6 +16,7 @@ class Stable:
self.stable_time = stable_count
self.count = stable_count
self.err_max = err_max
self.is_stable = 0
self.x = 0
def process(self, x):
@@ -24,6 +26,9 @@ class Stable:
if abs(x - self.x) >= self.err_max:
self.count = self.stable_time
is_stable = (self.count == 0)
self.is_stable = (self.count == 0)
return is_stable
return self.is_stable
def is_stable(self):
return self.is_stable