-
-
Notifications
You must be signed in to change notification settings - Fork 745
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
PID Rework #1043
PID Rework #1043
Conversation
@Ralim
Entries marked with a setup
|
Pinecil, B2 tip, QC charger 19V 33W. |
@Ralim Have tested the last build and I have to say, that
By the way: Why is the full potential (30 W) not used at all? Would this not speed up the heating? (chart for reference) Here is a capture (23 s) of the temp ramp-up sequence: DELETED due to false data resulting from bad tip!
|
Hello Gentlemen/Hello discip, |
@sandmanRO
Since I am only testing (regular user, no programming), you have to approach @Ralim to discuss the hows and whys of the coding. kind regards |
...you are right, discip, my bad...it should have been obvious to anybody. I should go to bed I suppose (here is 2:38AM). |
For the calibration issue: index 1d5c2821..c4ffa8c3 100644
--- i/source/Core/Src/gui.cpp
+++ w/source/Core/Src/gui.cpp
@@ -641,7 +641,7 @@ static void setTipOffset() {
OLED::refresh();
osDelay(100);
}
- setoffset = TipThermoModel::convertTipRawADCTouV(offset / 16);
+ setoffset = TipThermoModel::convertTipRawADCTouV(offset / 16, true);
}
setSettingValue(SettingsOptions::CalibrationOffset, setoffset);
OLED::clearScreen(); |
@Firebie
thanks in advance |
Ah looks like my late night ticket writing wasn't quite up to scratch. Thanks @Firebie , will need to figure out why that broke. In regards to your power table, can you confirm you are measuring those values external to the iron? Otherwise still trying to figure out why we are getting the little overshoot at the end. |
Hi @discip |
Okay PID overshoot should be better now.. Well it is for me 😓 |
If I may suggest an additional change that would improve the after setpoint behavior...once we exceed the setpoint, the delta temperature becomes negative. However, the micro volts - temperature lookup table does not handle negative values so it would return zero instead of a negative value. This would delay the reaction of the PID after setpoint as it would rely only on power store decay rather than both decay and active update. In my implementation I added to the Hakko lookup table something like this: |
@sandmanRO |
Ok, just give me a minute to grab a camera and improvise a video fixture. |
Hmm interesting that the time difference is that big. In my testing both are similar enough I'm happy to go with a gain of |
Now the big question...how do I upload a video here?...I tried as zip file but github complained that "is not included in the list" |
I see...they accept MOV, MP4 not GP...let me try to convert it. |
This is ridiculous...as I converted to MP4 now they complain it is too big and it should be under 10MB while the file is 14MB. Let's see what I can do. |
@Ralim |
@sandmanRO |
Ah heck, yeah it's a bit messy. Compress it as much as you can or throw it on a different host if you need to. If that's too messy you can also throw it to my email inbox (up to 25MB) and I can rehost it here I'm easy to find at ralim@ ralimtek.com |
Ok...I will send to your email as mpg as the smallest format I have available (about 5MB...of course this format is not accepted by github) |
@discip definitely keen to hear your thoughts on the two builds. |
@Ralim One more thing, which I just now stumbled over, is that the real temperature (external measurement) is off by ~15°C. |
I sent the email like 10 minutes ago. @discip, you sure you did not mix-up the builds? You get shorter to setpoint time with gain=1 as opposed to longer to reach setpoint time with gain=2? That does not make any sense. |
@sandmanRO |
I see...so you are counting for the time the temperature stabilizes around setpoint not when the temperature reaches / exceeds the setpoint. |
Video is still processing (whatever that really means) but should appear here at some point soon : https://youtu.be/O68aObWneFk @discip |
I feel like I'm missing the point. With the video I sent, you will see that with gain=1 the PID is actually "struggling" to reach the setpoint (the PID spends un unnecessarily long time to cope with the remaining 2-3C) |
It gets there eventually but much slower than it could. Now I'm curious what could be so different at hardware level that would lead to such totally opposed results. |
Not that is it really matters. As Ralim pointed out earlier, it's just a pure academic curiosity. |
@Ralim & @sandmanRO Will test the TS-J02.mp4TS_B02.mp4TS-K04.mp4EDIT: |
@discip, please humor me. Could you please also check that you are using the very latest update that Ralim put out (the one that includes the limits on PID?). Your earlier results just throwed my brains into the bushes so please help me get them back. |
Now I can see them all. Indeed, that TS-J02 looks bad... definitely something is not right with that tip. Just don't put it aside though. If it's brand new, apparently the brand new tips are "temperamental". I recall when we purchased the TS100s, each unit came with a collection of 10 tips. At the first run it was scary... with something like +30 out of 40 tips, the temperature readings were jumping all over the place. Luckily the seller advised us to run the tips for a while at +300C then cool them off and retry. It's almost like something needs to meltdown inside the tip in order for it to work correctly afterwards (this is just a supposition as I could not find out how the inner connections between the connector, heater and thermcouple are done inside the tip). |
@Ralim & @sandmanRO Thanks for the effort! ❤Since the temp ramp-up chart resulted from the bad tip, I am going to remove it, to not confuse people reading this. @Ralim |
@sandmanRO Also very interesting to catch up on this. I'm thinking I'll merge it in since it seems to be working with the gain of |
Hello Ralim, definitely it's a pleasure to see our minds interacting in real time. In a sense, the process is like a PID. We oscillate, we tune, sometimes we go baloney and overshoot....and yet, eventually we reach the best solution our minds could come up with. It might not be THE BEST solution in absolute terms (assuming such a thing exists) but as long as we are honest with the nature, and listen what it tells us, it can not be too far. |
Yeah absolutely, its very pleasurable to be working through these problems. I think much like most controller systems we converge on the best solution known at the time... Then a random @sandmanRO comes along and disturbs the whole system with new information and a better solution is converged on 🙃 (That is meant as a compliment) |
Thank you, Sir! (I think I'm blushing right now) |
Please try and fill out this template where possible, not all fields are required and can be removed.
What kind of change does this PR introduce?
Lots of PID rework, basically taking the ideas from Major issue in TS100 code - Chapter 1. ADC #1038 and also giving a lot of stuff a once over
Cleaned up timings to be 10/5Hz update rates
Cleaned up a second pass on making sure adc is only run by pid loop
What is the current behavior?
Other information:
Probably need to re-check all devices are correctly reaching 100% max power draw that they can reach.
Seems to be working here on my tester units but need to do more testing before merge
@Firebie and @discip you may want to give this a try since I know your following along the issue and see what you make of it.