Close

'So it is true?' & more PID. No, the PID is not a lie

A project log for Monoprice Select Mini Electro-Mechanical Upgrades

Endeavoring to build upon the existing fanbase work of this $200-ish printer.

Michael O'BrienMichael O'Brien 08/04/2016 at 10:111 Comment

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:

The latter is due to the following characteristics:

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.

Discussions

mechaMecha wrote 09/12/2017 at 01:30 point

Thanks for sharing these PID values. My hot end temp was fluctuating quite a bit, and autotune was either failing (due to temp overshoot) or, when I was able to get it to work, not improving the situation. After plugging your numbers in, hot end temp is looking very stable.

  Are you sure? yes | no