I PM’d the changes to Marcio about 2 weeks ago (in response to the similar troubles that others are having), but he seems pretty busy at the moment. I am currently using a modded (bltouch and a couple of custom toolheads) 1.1.8.8. The changes are all in temperature.cpp. Here’s a trimmed down version of the PM:
If you look at the extruder temperature dynamics, the system is only capable of producing about 1 degC/second of temperature slew. Anything faster than this almost certainly came from measurement noise. The noise itself usually looks spiky (i.e. the occasional noisy reading on top of small PID wander), but the large errors cause the control loop to try really hard. When I was printing polycarbonate I couldn’t go above 275C because the glitches would invariably trigger a shutdown.
I was lazy and didn’t characterize the temperature update rate with diagnostic messages. I just poked around in the code (I am currently fiddling with 1.1.8.4) and gleaned/guessed that the cycle time was 164 mS. So I made a slew limiter based on that value. I tried limiting the rate to 1 deg/second which kills off everything including ringing in the PID controller (too filtered) and 5 deg/second which lets through more noise than I like. I verified that autotune produces very similar gain numbers with the filter disabled and with it set to 3 deg/second, so the PID controller shouldn’t be too irritated. The filter will probably allow a bit higher D gain since it is no longer chasing shadows.
Anyway, here’s the code (in temperature.cpp), do whatever you want with it.
Gordon
#define TEMP_UPDATE_PERIOD 0.164
#define TEMP_SLEW_RATE 3.0
float tempslew(float last, float next)
{
static int init = 100;
if(init)
init–;
// updates at 164mS or ??
if(init)
return next; // default nop behavior
if(next > last) // upslew
{
last += TEMP_UPDATE_PERIOD * TEMP_SLEW_RATE; // x deg/sec slew
if(last > next)
last = next;
}
else if(next < last) // downslew
{
last -= TEMP_UPDATE_PERIOD * TEMP_SLEW_RATE;
if(last < next)
last = next;
}
return last;
}
void Temperature::updateTemperaturesFromRawValues() {
#if ENABLED(HEATER_0_USES_MAX6675)
current_temperature_raw[0] = read_max6675();
#endif
HOTEND_LOOP()
current_temperature[e] = tempslew(current_temperature[e], Temperature::analog2temp(current_temperature_raw[e], e));
// current_temperature[e] = Temperature::analog2temp(current_temperature_raw[e], e);