-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Local loop verify #8
Conversation
self.err = self.df.apply(lambda t: self.err_flag(t), axis=1) | ||
self.result = pd.Series(index=self.df.index) | ||
err_start_time = None | ||
first_flag = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first_flag
does not seem to be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks good catch
err_start_time = None | ||
err_time = 0 | ||
|
||
if err_time > 1 and (not self.saturation.loc[cur_time]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
>= 1
instead of > 1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use > 1 to make it a tiny bit more difficult to fail
points = ["feedback_sensor", "set_point", "cmd", "cmd_max"] | ||
|
||
def saturation_flag(self, t): | ||
if 0 <= t["cmd_max"] - t["cmd"] <= 0.01: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the 0.01
be a "user-input" with a default value? Similarly to how we handle tolerances.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any circumstances where the command might be negative for some reason? In other words should we use abs(t["cmd_max"] - t["cmd"])
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for 1), my intention is to require as little user inputs / config as possible, so that 0.01 is used. We can certainly change it to a parameter later;
for 2), if it is negative, I would prefer to fail the verification or raise an error. For now, if it is negative, then this would be considered "not saturated", so it has a larger chance of reporting fail than pass.
return False | ||
|
||
def err_flag(self, t): | ||
if t["feedback_sensor"] > t["set_point"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above for the command. I doubt it but still wanted to raise the question in case you think that it might be an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me this is a different issue from the comment earlier. Because this is a direct acting controller, then saturating towards maximum is the expected behavior when the sensor reading is constantly above the set point, not the other way around.
from checklib import RuleCheckBase | ||
|
||
|
||
class LocalLoopSaturationDirectActingMin(RuleCheckBase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to have only one verification that would handle min/max? The logic is essentially the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar to above, I think min and max are for sensor reading on two sides of the set points separately.
from checklib import RuleCheckBase | ||
|
||
|
||
class LocalLoopSaturationReverseActingMax(RuleCheckBase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question as above for reverse/direct.
class LocalLoopSetPointTracking(RuleCheckBase): | ||
points = ["feedback_sensor", "set_point"] | ||
|
||
def error_below_5percent(self, t): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the percentages be defined through parameters (with a default value)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same intension as the "0.01", we can change it to parameter later for sure.
No description provided.