PID_autotune #41
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "PID_autotune"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Working auto tune PID.
Apologies for the messy commits to the other files and reversing it, should I rebase and squash everything together, or should I leave it as is?
@ -0,0 +260,4 @@
tec.set_param("pwm", channel, "i_set" , tunerOut)
except:
pass
What is this for? Don't we want to at least log errors here? Otherwise this can lead to confusing behavior.
The gitea interface can squash so you can just leave it as it is and add commits.
@ -0,0 +211,4 @@
return True
return False
def init_tuner(self, inputValue, timestamp):
the inputValue parameter is not used. Remove.
Also, since this method is quite similar to
__init__
, place it below it for easy comparison.@ -0,0 +255,4 @@
tec.set_param("pwm", channel, "i_set", tuner_out)
except KeyError:
Where would a KeyError be acceptable and why?
Can only this one code path be covered by this try/except? Your code also catches and suppresses KeyError raised e.g. by tuner.output() which is most likely not what ought to be done.
@ -0,0 +245,4 @@
for data in tec.report_mode():
try:
ch = data[channel]
remove blank line
@ -0,0 +246,4 @@
try:
ch = data[channel]
# Sometimes report_mode may yeild empty object
When and why?
Once every few seconds, haven't dug out the issue in client.py yet.
Ok, the comment should clearly state that it's a workaround then.
And let's file an issue about the client.py behavior
@ -0,0 +248,4 @@
# Sometimes report_mode may yeild empty object
except KeyError:
pass
If this happens in the first iteration of the loop,
ch
won't exist and the code below will crash.