Hotend heater fine tuning
Printer specs are in my signature.
I used the M303 automated PID tuning, transferred the constants into config.g, ending up with:
M307 H1 B0 R3.200 C160.8 D9.84 S1.00 V26.2
It does pretty well, but consistently overshoots by roughly 8-9 deg C (using a test target temperature of 205C).
Found this reference: Tuning heater temperature control
In the above reference, it says, in part:
The above R value is "3.2", and first I tried 2.5, then 1.5, and, well, it keeps overshooting by about 8 degrees C regardless of what I change it to. Is the tuning guide wrong? The Gcode Dictionary is of little use, other than saying about R: "Rnnn Heating rate, supported in RRF 3.2beta3.2 and later"
@kb58 Though probably not related directly to the above, twice now I've attempted an M303 PID tuning, and it runs for a long time, then reports that it's seeing inconsistent readings. Meanwhile, the temperature graph looks perfect, with no spikes or irregularities, just a nice smooth and consistent saw tooth pattern during the calibration cycles. FWIW, the hotend heater and sensor are both on a v1.1 tool board. I haven't seen any issues like the above being reported, though.
@phaedrux That is what the supply is, 26V or so. I purposely adjusted it on the high side to lessen the current requirements. I think that voltage was "auto appended" to the calculated values and was accurate, so I let it be.
Well that over voltage on your 24v heater is probably making it heat up faster than predicted.
I would try reducing your voltage to 24v and tuning again to see if the behaviour is different.
What command did you use to tune? Are you tuning as a tool (M303 T), or plain heater (M303 H)? When tuning as a tool, the part cooling fan will be engaged to take it's cooling power into account.
@kb58 I think that text is incorrect. If the temperature overshoots, increase the R parameter. Don't increase it too much, or you will get "temperature rising too slowly" heating faults. Try an increase of 20% above the value reported when you ran M303.
@dc42 Thanks, guys, I'll try both.
@phaedrux I haven't been interpreting the voltage value in M307 the way you're describing it. I understood it to mean that I'm telling the system what voltage is normally being used, and if the voltage later drifts from that value, the PID routine will adjust for it. The description in the Gcode Dictionary appears to back that up:
Vnnn VIN supply voltage at which the A parameter was calibrated (RepRapFirmware 1.20 and later). This allows the PID controller to compensate for changes in supply voltage. A value of zero disables compensation for changes in supply voltage. Use V0 for AC mains powered heaters. (V0 is the default. Leaving off V is the same as V0)
To answer your other question, I was using M303 H and am now running an M303 T to see what happens.
@kb58 Here's what I meant about the reported inconsistent heater warning during the M303 calibration, yet it sure looks consistent to me. FWIW, this never happened when the hot end heater and sensor were controlled by the 6HC board.
@kb58 Still failing for the same reasons:
@kb58 Increasing the "R" parameter in the M307 heater PID config has no effect, much like decreasing it. It makes me wonder if somehow the entire PID control is disabled, yet when I command it to a temperature, it does go there. In this thread, it consistently peaks 8 deg C above the set point before falling back. How the PID terms are not affecting has me puzzled.
Here's the relevant part of config.g:
; Nozzle heater and sensor M308 S1 P"121.temp0" Y"pt1000" A"Hot end" L-25 ; define hot end temperature sensor on toolboard temp0 M950 H1 C"121.out0" T1 ; create nozzle heater output on toolboard out0 M307 H1 B0 R3.200 C160.8 D9.84 S1.00 V26.2 ; set PID constants (from autotune, M303) M143 H1 S280 ; set temperature limit for heater 1 to 280C
LeckieTech last edited by
@kb58 I had the exact same overshoot problem. Im running the same hotend as you too and 27.00volts on our buss being distributed to the entire rack holding 36 printers. I was able to solve it by running my tuning with less power determined by the
M303and also running
F255accounting for the cooling fan. Set your temp for the highest you will go and start with a 20% reduction on your
@leckietech Interesting. I will try that, and thank you!
This is both amusing and annoying...
Tried the 0.8 trick above, which worked, and it successfully completed the M303 calibration. Loaded the new calibration values:
M307 H1 B0 R4.479 C161.3:92.0 D8.69 S0.80 V26.3
The hotend was allowed to cool, then set it to 205C. Irritatingly, it again overshot by 8C, exactly as before. It's almost as if the tuning parameters are being ignored.
It works well enough that I can get on with printing, but it's annoying that the tuning parameters seemingly have little or no effect.
Hmm, I wonder what's going on here. Aside from the hotend heater issue, the bed heater has always had a bit of the opposite problem: being a bit casual about achieving the target temperature (60C). It gets there eventually and maintains temperature well, but it's very slow to get there. I would expect a small amount of overshoot given that it's a PID-tuned 750W 115VAC heater.
The top line is what the parameters were, and the bottom line shows what the R factor was changed to. Again, just like the hotend heater, it made no difference. I'm wondering why no one else has experienced this, so it's probably something I've set wrong.
;M307 H0 B0 R0.394 C847.1 D16.26 S1.00 ; set PID constants (from autotune, M303) M307 H0 B0 R0.47 C847.1 D16.26 S1.00 ; set PID constants (from autotune, M303)
It's almost as if the tuning parameters are being ignored.
How are you saving the tuned parameters? M500 after tuning and having M501 at the end of config.g? Or are you manually entering them in config.g? And if you're manually entering them, do you also have M501 at the end of config.g and a config-override.g file?
@phaedrux Thank you for the reply.
I manually copy/pasted the results produced by the PID tuning process into config.g. I do not have an M501 at the end of config.g, and was expecting that the printer would use the values in config.g. Since it doesn't work though, I'm not understanding something.
As a test, could you send M500 after tuning so that a config-override.g file gets generated and then compare the resulting line to what you had manually entered?
@phaedrux Performed "M303 P0.8 S200 T0", and it failed with the same claim that the heater was inconsistent yet the plot appears okay:
Regardless, an M500 was commanded and the printer reported:
The contents of config-override.g:
; config-override.g file generated in response to M500 at 2021-08-06 14:03 ; This is a system-generated file - do not edit ; Heater model parameters M307 H0 R0.470 C847.100:847.100 D16.26 S1.00 V0.0 B0 I0 M307 H1 R4.613 C146.384:98.384 D8.03 S0.80 V26.3 B0 I0 ; Workplace coordinates...
Comparing the two:
M307 H1 R4.613 C146.384:98.384 D8.03 S0.80 V26.3 B0 I0 ; recommended by the PID tuning routine to be stored in config.g
M307 H1 B0 R4.613 C146.4:98.4 D8.03 S0.80 V26.3 ; created by M500
Where do I go from here?
@phaedrux Before I post pictures, what does this actually mean:
What makes the firmware post this? I'd assume it's that it's seeing different temperature changes even though the heater is enabled for the same period of time, but my M303 temperature plots look good, so what is it looking at that makes it unable to succeed?
It means that the heating and cooling rates didn't settle down to consistent values after several cycles. One possible reason is noise in the temperature sensor readings, which would be apparent in temperature graph. However, your graph appears to be stable, at least in the time scale it can display.