So, I'm about 95% done with the hotend/extruder PID tuning. I have 1 overshoot or undershoot with heating/cooling or other set point temperature change when the delta is > 10 ˚C. Following that, I get 2 or 3 undulations in current draw before the temperature is technically stable. I say technically because the average varies no more than 1 ˚C, aka +/- 0.5 ˚C. For the TL;DL folks, enter in this command using your preferred method of entry:
M301 P115 I0.28 D675 C0.03 L1
Use these at your own risk. Turns out that when under load, the PID control system doesn't play nice. I'm going to have to redo this a bit. Methinks that a really low P, a high I, and a D at or under 250-275 is required with the existing hardware.
- Pick a high an low temperature setting that you print at. Tuning should begin with the lowest temperature: I used 190 °C and 220 °C.
- A high temporal resolution method of monitoring average voltage or current over a long period of time is best. For example:
- I used a 65 second window is used on my Rigol DS2072 and a Hantek CC-65 current probe since I didn't need direct contact with any traces/leads.
- My scope was set to Roll mode, 5 seconds/div, and high resolution sampling mode was used.
- By default, the 300 Hz switching frequency of the MOSFET(s) is then 'averaged' making it easier to monitor changes you're making.
- Repetier-Host was used to monitor temperatures and pass GCODE commands.
- The goal is to have a stable temperature within 1 minute of the primary overshoot.
- Tune your lowest temperature first. Due to the lower current draw, creating instability at lower temperatures.
- The hotend has a time constant of ~1 second, thus there is about a 5 second delay between the heating element working and the thermistor showing the entire result. This is a function of the thermal gradient and te thermistor's TC.
- PID disables the current draw 5 °C before the target temperature but you *will* overshoot by ~3-5 ˚C due to the thermal gradients, time constants of thermistor, and temperature control.
- If off, the MOSFET will turn on once the thermistor reads 1-1.5 °C above the setpoint when cooling.
- If fully on, the MOSFET will turn off, once the thermistor reads 5 °C below the setpoint when heating.
- If trying to stabilize, the MOSFET will turn off if you exceed 1.5 ˚C above the setpoint, assuming your parameters are sane.
- Once your 'D' parameter is above ~250, the switching signal for teh MOSFET becomes a combination of PWM & PFM.
Now, some advice given the characteristics of the system:
- Tune it "live" but after you've made significant adjustments, say 3-5 parameter tweaks, turn the hot end off to create at least a 10 °C differential and then turn it back on to test stability. Or switch between both of your max and min temperatures.
- As for adjusting 'P', 'I', & 'D':
- Incriment 'P' in intervals no larger than 10.
- Decrement 'P' in intervals no larger than 5.
- Increment 'I' in intervals no larger than 0.03.
- Decrement 'I' in intervals no larger than 0.02.
- Increment 'D' in intervals no larger than 50.
- Decrement 'D' in intervals no larger than 25.
- Steady state peak-to-peak needs to be noisy otherwise temperature control will suffer once disturbed. This is due to the noise in the thermistor readout.
- Honestly, I'm not sure what the 'C' and 'L' parameters are... specifically.
- They do seem related to overshoot, switching frequency of the MOSFET, and overall duty cycle of the MOSFET. Effectively, they seem to be fine tune variables for overall stability.
- It appears that electronics nomeclature of 'C' for capacitance and 'L' for inductance is loosely associated with these variables.
- No significant difference were found at higher values, but an impact was discernible, barely amongst the noise, once these were reduced to their lower limits.
- The average frequency of the MOSFET increased as these were lowered and better over/under-shooting behavior was observed.
- 'C' is able to go from 0 to 10,000 with a resolution of 0.01.
- 'L' is able to go from 0 to 50 with a resolution of 1
- When I was working on fine tuning the parameters, I noticed some better characteristic behavior the closer to 300 Hz the MOSFET frequency was at. For a little while I tried to keep the frequency around this range, affected by 'D' mostly, but upon testing transient temperature changes, 190->220 & 220->190, and tweaking the PID for better responsiveness, the switching frequency of the MOSFET preferenced staying further away from 300 Hz.
Due to the slow cooling of the hotend as a result of the insulator on it, I opted to cut mine off in order to let it cool faster and let PID oscillate faster, thus allowing faster control. I'm going to do some additional testing to see if I can have the power cut or taper to the heating element before the "setpoint - 5 ˚C" mark. If this can be done, then it will be possible to eliminate overshoot with the stock hotend.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.