- 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user