For the hotend, 'I' has a resolution of 1/1000th, not the displayed 1/100th. Credit goes to Ethan Anderson for that bit, though I'm not sure where it was figured out and it doesn't really matter 'cause I can confirm it in 3 screen shots.
PID with 'I' = 0.01
PID with 'I' = 0.015
PID with 'I' = 0.022
Hint: this is where note taking helps since when you M501 the printer, it won't tell you what your thousandths place was ;)
This was the first problem that it took time to adjust with. The second was how aggressive the heater was; at 40W with the thermal gradient in the bock, this system didn't respond quickly so just about any "reasonable" means of setting 'P' & 'I' was pushing things past where they should be. Then when you add in the fact that a high 'D' would then need to be coupled with the very very very fast temperature rise, the noise in the ground plane just made everything unusable.
Let me be clear right now: I'm not done. I will post PID values, but there are some gotchas with them and I need to do some bumping of the setpoint like I did with the bed temps. With that said, I *think* it is possible to quicken things up a bit and smooth out some duty cycle jitter, plus I still have 'C' and 'L' values to look at. If you wish to test these PID values, treat them as experimental:
M301 P13.37 I0.009 D30.52
Nope, I didn't do that on purpose, but I saw it fit to keep 1337. I was having such a difficult time adjusting and picking new 'P' & 'D' values that I bumped over to a logarithmic increase and decrease of each and in such a way that I wouldn't repeat values.
I promise that these will take a bit of time to get to your target temperature.
I promise that when lowering your temperature by a significant margin, you can undershoot by 10 ˚C.
I promise that these are experimental and need some fine tuning but so far allow for a controlled response.
I promise that if I were not monitoring current on the hotend with my scope, this wouldn't have been possible. Well, voltage would've worked too, but a clamp-on probe is a heck of a lot more robust in this regard and you won't accidentally short something with a bump.
My next problem is weird and is two-fold. I track it to weird thermal "harmonics". I typically do testing between 190 ˚C and 210 ˚C, but since the applicable working temperature is up to 250 ˚C, I push up to 230 ˚C usually. Since I stated before that the PID auto tuning was better because it gave results close to what I've come up with, I figured it was worth looking at even though they were a bit aggressive. From 180 ˚C to 260 ˚C, I ran a 20 count PID auto tune routine every 10 ˚C. I tried 270 ˚C, but the scope confirmed what I saw on the output graph and stability wasn't able to be reached; so I did 265 ˚C to round things off. I then grep'd and awk'd the data and dropped it into LibreOffice Calc (Excel for those Windows folk) to see what I could make of it.
If you read HAD.com, then you may have caught a Bill Herd video about ADCs and the sampling types that exist. Effectively what the auto tune routine was doing was a SAR approach as it went over-under several times. WIth a count of 20, it tosses out the first 2 outputs since they're pretty far off. This gave me 18 to deal with so I averaged them all together; both the 'Classic' and 'Overshoot' models it provided. Here is the end plot with a 3-order poly fit to each one. The left axis is for 'P' & 'D' and the right is for 'I':
Notice how at 190 ˚C and 230 ˚C the values are lower. Strange right? I do need to do 4 other plots, 5 ˚C to the left and right of both of those to see what's up. My guess is that there is some trickery in the firmware that gives ideal average duty cycle average and the PID is supposed to correct for inaccuracies.
Since 230 ˚C was an anomaly, I opted to do my testing at 235 ˚C. Guess what I found:
Those flat spots are weird. they happen right at 232.6 ˚C and I'm not sure why. First I though it was an ADC resolution switch and offset error. Then I grabbed a spare bead-tipped thermocouple and ran it down the neck of the hotend until it was at the orifice of the nozzle. My UT171C gave me output readings that more of less, an offset less than 0.5 ˚C, that of what you see on the graph. Call it what you like, this block has a thing for ~232 ˚C and it's freaky.
More or less I then opted to tune between 210 ˚C & 240 ˚C. The higher are better as they'll show problems with 'D' and help determine how stable the system will stay.
The aformentioned PID values need to be tested under the following criteria:
- How much time does it take to increase temperature by 5 ˚C? 10 ˚C?
- How much time does it take to decrease temp by 5 ˚C? 10 ˚C?
- How much of a temperature drop will drop the system out of control and cause an undershoot?
- Can the 10 ˚C undershoot be lessened or removed?
- Is modification of the hotend required for stable PID control?
The latter is due to the following characteristics:
- With higher 'P' & 'I' values, heating power is turned off momentarily before reaching setpoint
- This results in a 5 ˚C overshoot in most cases and a 5 ˚C undershoot without a really high 'D'
- With moderate 'P' & 'I' values, heating power is turned off 5-10 ˚C before setpoint
- This results in no less than a 5 ˚C undershoot
- With lower 'P' & 'I' heating power is turned off no sooner than 10 ˚C before the setpoint
- The output the peaks at the setpoint - 5 ˚C and then drops another 5 ˚C
- With higher 'P' & 'I' values, a falling temperature will reengage heating power up to ~1.5 ˚C above the setpoint
- With anything lower, heating power is not reengaged until at the setpoint leading to significant undershoot.
Basically, if you overshoot the setpoint ,you're guaranteed to undershoot on the way back down with this control mechanism. The observable 'window' for the setpoint temperature control is only higher than the setpoint itself when PID is too aggressive to be controlled due to the noise in the system and needing a high 'D'. The only response is to detune and lessen the aggressive system. That and a healthy layer of insulation on the heating block to minimize temperature loss, wich I incorrectly assumed was a hindrance. Don't worry, I've been tuning with it on.