Configurable ADC update rate

I have tried several hotend with very low heat capacity and realized that klipper cannot handle them well

Example: Bambulab X1 series hotend will increase by 3-5 degree/s at maximun power(50w) and cooling at similar speed.

This resulted in sustained temperature fluctuations (1-2degrees near the target temperature) and M109 commnad wait forever.

klipper/klippy/extras/adc_temperature.py
line 15: REPORT_TIME = 0.300

change to

REPORT_TIEM=0.100

It solves the problem but not very elegant, I don’t have the ability to move this value to printer.cfg file, but I think it might be a good idea to do so

I’m surprised this has an effect. While I do agree that these types of hot ends with little thermal mass need a faster PID controller. I would have thought that reading the ADC faster would have little to no effect since the default behavior of klipper is to average out the readings of the last second.

Have you also tried lowering the smooth_time parameter in combination with this change? I found, with my rapido, that lowering this from 1.0 to 0.3 greatly reduced the fluctuations I observed.

Can’t confirm that at all. I’m running these hotends on 2, previously 3 printers, in one case even with an 88W Rapido 2 heater, with absolutely no issue… after running a PID tune, the temp goes up, overshoots very slightly just once, then settles and the print starts.

Stats 89545.2: gcodein=0  mcu: mcu_awake=0.003 mcu_task_avg=0.000007 mcu_task_stddev=0.000007 bytes_write=81114 bytes_read=109627 bytes_retransmit=9 bytes_invalid=0 send_seq=5225 receive_seq=5225 retransmit_seq=2 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=120008339 sht36: mcu_awake=0.002 mcu_task_avg=0.000016 mcu_task_stddev=0.000016 bytes_write=42244 bytes_read=89063 bytes_retransmit=0 bytes_invalid=0 send_seq=3583 receive_seq=3583 retransmit_seq=0 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=48000386 adj=47997540 FLY-SHT36: temp=40.8 heater_bed: target=80 temp=80.1 pwm=0.427 sd_pos=44461 raspberry_pi: temp=48.3 chamber: temp=28.3 sysload=0.75 cputime=647.401 memavail=686300 print_time=206.121 buffer_time=0.000 print_stall=0 extruder: target=250 temp=247.2 pwm=0.416
Heater extruder within range of 250.000
Stats 89546.2: gcodein=0  mcu: mcu_awake=0.003 mcu_task_avg=0.000007 mcu_task_stddev=0.000007 bytes_write=81220 bytes_read=109891 bytes_retransmit=9 bytes_invalid=0 send_seq=5233 receive_seq=5233 retransmit_seq=2 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=120008341 sht36: mcu_awake=0.002 mcu_task_avg=0.000016 mcu_task_stddev=0.000016 bytes_write=42250 bytes_read=89180 bytes_retransmit=0 bytes_invalid=0 send_seq=3584 receive_seq=3584 retransmit_seq=0 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=48000373 adj=47997223 FLY-SHT36: temp=40.9 heater_bed: target=80 temp=80.0 pwm=0.487 sd_pos=44461 raspberry_pi: temp=48.9 chamber: temp=28.3 sysload=0.75 cputime=647.461 memavail=686172 print_time=207.122 buffer_time=0.000 print_stall=0 extruder: target=250 temp=248.6 pwm=0.416
Stats 89547.2: gcodein=0  mcu: mcu_awake=0.003 mcu_task_avg=0.000007 mcu_task_stddev=0.000007 bytes_write=81310 bytes_read=110165 bytes_retransmit=9 bytes_invalid=0 send_seq=5240 receive_seq=5240 retransmit_seq=2 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=120008340 sht36: mcu_awake=0.002 mcu_task_avg=0.000016 mcu_task_stddev=0.000016 bytes_write=42256 bytes_read=89312 bytes_retransmit=0 bytes_invalid=0 send_seq=3585 receive_seq=3585 retransmit_seq=0 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=48000372 adj=47996954 FLY-SHT36: temp=40.8 heater_bed: target=80 temp=79.9 pwm=0.487 sd_pos=44461 raspberry_pi: temp=48.3 chamber: temp=28.2 sysload=0.75 cputime=647.516 memavail=686364 print_time=208.123 buffer_time=0.000 print_stall=0 extruder: target=250 temp=249.7 pwm=0.416
Stats 89548.2: gcodein=0  mcu: mcu_awake=0.003 mcu_task_avg=0.000007 mcu_task_stddev=0.000007 bytes_write=81400 bytes_read=110409 bytes_retransmit=9 bytes_invalid=0 send_seq=5247 receive_seq=5247 retransmit_seq=2 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=120008339 sht36: mcu_awake=0.002 mcu_task_avg=0.000016 mcu_task_stddev=0.000016 bytes_write=42278 bytes_read=89420 bytes_retransmit=0 bytes_invalid=0 send_seq=3587 receive_seq=3587 retransmit_seq=0 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=48000373 adj=47996968 FLY-SHT36: temp=40.9 heater_bed: target=80 temp=79.8 pwm=0.487 sd_pos=44461 raspberry_pi: temp=48.3 chamber: temp=28.2 sysload=0.75 cputime=647.571 memavail=686204 print_time=209.123 buffer_time=0.000 print_stall=0 extruder: target=250 temp=250.3 pwm=0.341
Stats 89549.2: gcodein=0  mcu: mcu_awake=0.003 mcu_task_avg=0.000007 mcu_task_stddev=0.000007 bytes_write=81490 bytes_read=110653 bytes_retransmit=9 bytes_invalid=0 send_seq=5254 receive_seq=5254 retransmit_seq=2 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=120008338 sht36: mcu_awake=0.002 mcu_task_avg=0.000016 mcu_task_stddev=0.000016 bytes_write=42299 bytes_read=89528 bytes_retransmit=0 bytes_invalid=0 send_seq=3589 receive_seq=3589 retransmit_seq=0 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=48000360 adj=47997007 FLY-SHT36: temp=40.9 heater_bed: target=80 temp=79.9 pwm=0.487 sd_pos=44461 raspberry_pi: temp=48.3 chamber: temp=28.3 sysload=0.69 cputime=647.630 memavail=686364 print_time=210.124 buffer_time=0.000 print_stall=0 extruder: target=250 temp=250.9 pwm=0.244
Stats 89550.2: gcodein=0  mcu: mcu_awake=0.003 mcu_task_avg=0.000007 mcu_task_stddev=0.000007 bytes_write=81591 bytes_read=110927 bytes_retransmit=9 bytes_invalid=0 send_seq=5261 receive_seq=5261 retransmit_seq=2 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=120008340 sht36: mcu_awake=0.002 mcu_task_avg=0.000016 mcu_task_stddev=0.000016 bytes_write=42305 bytes_read=89660 bytes_retransmit=0 bytes_invalid=0 send_seq=3590 receive_seq=3590 retransmit_seq=0 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=48000349 adj=47996820 FLY-SHT36: temp=40.8 heater_bed: target=80 temp=79.9 pwm=0.431 sd_pos=44461 raspberry_pi: temp=48.3 chamber: temp=28.2 sysload=0.69 cputime=647.686 memavail=686692 print_time=211.125 buffer_time=0.000 print_stall=0 extruder: target=250 temp=251.0 pwm=0.244
Stats 89551.2: gcodein=0  mcu: mcu_awake=0.002 mcu_task_avg=0.000007 mcu_task_stddev=0.000007 bytes_write=82032 bytes_read=111211 bytes_retransmit=9 bytes_invalid=0 send_seq=5273 receive_seq=5273 retransmit_seq=2 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=120008342 sht36: mcu_awake=0.005 mcu_task_avg=0.000017 mcu_task_stddev=0.000017 bytes_write=42807 bytes_read=90203 bytes_retransmit=0 bytes_invalid=0 send_seq=3617 receive_seq=3617 retransmit_seq=0 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=48000339 adj=47996680 FLY-SHT36: temp=40.8 heater_bed: target=80 temp=79.9 pwm=0.431 sd_pos=44461 raspberry_pi: temp=48.3 chamber: temp=28.3 sysload=0.69 cputime=647.847 memavail=686280 print_time=216.733 buffer_time=4.442 print_stall=0 extruder: target=250 temp=250.9 pwm=0.301
Stats 89552.2: gcodein=0  mcu: mcu_awake=0.002 mcu_task_avg=0.000007 mcu_task_stddev=0.000007 bytes_write=82154 bytes_read=111465 bytes_retransmit=9 bytes_invalid=0 send_seq=5282 receive_seq=5282 retransmit_seq=2 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=120008340 sht36: mcu_awake=0.005 mcu_task_avg=0.000017 mcu_task_stddev=0.000017 bytes_write=42857 bytes_read=90357 bytes_retransmit=0 bytes_invalid=0 send_seq=3621 receive_seq=3621 retransmit_seq=0 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=48000328 adj=47996982 FLY-SHT36: temp=41.2 heater_bed: target=80 temp=80.1 pwm=0.297 sd_pos=44461 raspberry_pi: temp=49.4 chamber: temp=28.2 sysload=0.69 cputime=647.905 memavail=686244 print_time=216.733 buffer_time=3.441 print_stall=0 extruder: target=250 temp=250.6 pwm=0.370
Stats 89553.2: gcodein=0  mcu: mcu_awake=0.002 mcu_task_avg=0.000007 mcu_task_stddev=0.000007 bytes_write=82260 bytes_read=111740 bytes_retransmit=9 bytes_invalid=0 send_seq=5290 receive_seq=5290 retransmit_seq=2 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=120008339 sht36: mcu_awake=0.005 mcu_task_avg=0.000017 mcu_task_stddev=0.000017 bytes_write=42906 bytes_read=90540 bytes_retransmit=0 bytes_invalid=0 send_seq=3625 receive_seq=3625 retransmit_seq=0 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=48000351 adj=47996913 FLY-SHT36: temp=40.7 heater_bed: target=80 temp=80.2 pwm=0.225 sd_pos=44461 raspberry_pi: temp=48.9 chamber: temp=28.3 sysload=0.69 cputime=647.959 memavail=686316 print_time=216.733 buffer_time=2.440 print_stall=0 extruder: target=250 temp=250.9 pwm=0.287
Stats 89554.2: gcodein=0  mcu: mcu_awake=0.002 mcu_task_avg=0.000007 mcu_task_stddev=0.000007 bytes_write=82605 bytes_read=111997 bytes_retransmit=9 bytes_invalid=0 send_seq=5301 receive_seq=5301 retransmit_seq=2 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=120008340 sht36: mcu_awake=0.005 mcu_task_avg=0.000017 mcu_task_stddev=0.000017 bytes_write=43032 bytes_read=90699 bytes_retransmit=0 bytes_invalid=0 send_seq=3630 receive_seq=3630 retransmit_seq=0 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=48000360 adj=47997068 FLY-SHT36: temp=40.4 heater_bed: target=80 temp=80.3 pwm=0.225 sd_pos=44461 raspberry_pi: temp=48.3 chamber: temp=28.2 sysload=0.63 cputime=648.074 memavail=686092 print_time=220.933 buffer_time=5.639 print_stall=0 extruder: target=250 temp=250.7 pwm=0.234
Stats 89555.2: gcodein=0  mcu: mcu_awake=0.002 mcu_task_avg=0.000007 mcu_task_stddev=0.000007 bytes_write=82695 bytes_read=112234 bytes_retransmit=9 bytes_invalid=0 send_seq=5308 receive_seq=5308 retransmit_seq=2 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=120008340 sht36: mcu_awake=0.005 mcu_task_avg=0.000017 mcu_task_stddev=0.000017 bytes_write=43081 bytes_read=90853 bytes_retransmit=0 bytes_invalid=0 send_seq=3634 receive_seq=3634 retransmit_seq=0 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=48000349 adj=47997087 FLY-SHT36: temp=40.7 heater_bed: target=80 temp=80.3 pwm=0.225 sd_pos=44461 raspberry_pi: temp=48.9 chamber: temp=28.2 sysload=0.63 cputime=648.136 memavail=686476 print_time=220.933 buffer_time=4.633 print_stall=0 extruder: target=250 temp=250.4 pwm=0.298
Stats 89556.2: gcodein=0  mcu: mcu_awake=0.003 mcu_task_avg=0.000008 mcu_task_stddev=0.000009 bytes_write=82801 bytes_read=112528 bytes_retransmit=9 bytes_invalid=0 send_seq=5316 receive_seq=5316 retransmit_seq=2 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=120008338 sht36: mcu_awake=0.003 mcu_task_avg=0.000017 mcu_task_stddev=0.000017 bytes_write=43131 bytes_read=91050 bytes_retransmit=0 bytes_invalid=0 send_seq=3638 receive_seq=3638 retransmit_seq=0 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=48000344 adj=47997026 FLY-SHT36: temp=41.2 heater_bed: target=80 temp=80.3 pwm=0.281 sd_pos=44461 raspberry_pi: temp=48.3 chamber: temp=28.3 sysload=0.63 cputime=648.207 memavail=686472 print_time=220.933 buffer_time=3.631 print_stall=0 extruder: target=250 temp=250.1 pwm=0.376
Stats 89557.2: gcodein=0  mcu: mcu_awake=0.003 mcu_task_avg=0.000008 mcu_task_stddev=0.000009 bytes_write=82902 bytes_read=112772 bytes_retransmit=9 bytes_invalid=0 send_seq=5323 receive_seq=5323 retransmit_seq=2 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=120008336 sht36: mcu_awake=0.003 mcu_task_avg=0.000017 mcu_task_stddev=0.000017 bytes_write=43165 bytes_read=91199 bytes_retransmit=0 bytes_invalid=0 send_seq=3641 receive_seq=3641 retransmit_seq=0 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=48000337 adj=47997006 FLY-SHT36: temp=40.9 heater_bed: target=80 temp=80.1 pwm=0.379 sd_pos=44461 raspberry_pi: temp=48.3 chamber: temp=28.3 sysload=0.63 cputime=648.269 memavail=686224 print_time=220.933 buffer_time=2.630 print_stall=0 extruder: target=250 temp=250.1 pwm=0.376
Stats 89558.2: gcodein=0  mcu: mcu_awake=0.003 mcu_task_avg=0.000008 mcu_task_stddev=0.000009 bytes_write=83350 bytes_read=113041 bytes_retransmit=9 bytes_invalid=0 send_seq=5335 receive_seq=5335 retransmit_seq=2 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=120008337 sht36: mcu_awake=0.003 mcu_task_avg=0.000017 mcu_task_stddev=0.000017 bytes_write=43267 bytes_read=91368 bytes_retransmit=0 bytes_invalid=0 send_seq=3645 receive_seq=3645 retransmit_seq=0 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=48000329 adj=47996970 FLY-SHT36: temp=40.7 heater_bed: target=80 temp=80.1 pwm=0.379 sd_pos=44461 raspberry_pi: temp=48.3 chamber: temp=28.3 sysload=0.63 cputime=648.355 memavail=685968 print_time=222.543 buffer_time=3.235 print_stall=0 extruder: target=250 temp=250.3 pwm=0.299
Stats 89559.2: gcodein=0  mcu: mcu_awake=0.003 mcu_task_avg=0.000008 mcu_task_stddev=0.000009 bytes_write=83456 bytes_read=113320 bytes_retransmit=9 bytes_invalid=0 send_seq=5343 receive_seq=5343 retransmit_seq=2 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=120008337 sht36: mcu_awake=0.003 mcu_task_avg=0.000017 mcu_task_stddev=0.000017 bytes_write=43316 bytes_read=91536 bytes_retransmit=0 bytes_invalid=0 send_seq=3649 receive_seq=3649 retransmit_seq=0 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=48000319 adj=47996919 FLY-SHT36: temp=40.8 heater_bed: target=80 temp=80.0 pwm=0.431 sd_pos=44461 raspberry_pi: temp=48.3 chamber: temp=28.2 sysload=0.66 cputime=648.416 memavail=686384 print_time=222.543 buffer_time=2.232 print_stall=0 extruder: target=250 temp=250.5 pwm=0.230
Stats 89560.2: gcodein=0  mcu: mcu_awake=0.003 mcu_task_avg=0.000008 mcu_task_stddev=0.000009 bytes_write=83639 bytes_read=113569 bytes_retransmit=9 bytes_invalid=0 send_seq=5351 receive_seq=5351 retransmit_seq=2 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=120008340 sht36: mcu_awake=0.003 mcu_task_avg=0.000017 mcu_task_stddev=0.000017 bytes_write=43389 bytes_read=91690 bytes_retransmit=0 bytes_invalid=0 send_seq=3653 receive_seq=3653 retransmit_seq=0 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=48000310 adj=47996861 FLY-SHT36: temp=41.5 heater_bed: target=80 temp=80.0 pwm=0.431 sd_pos=44461 raspberry_pi: temp=48.3 chamber: temp=28.3 sysload=0.66 cputime=648.491 memavail=685984 print_time=223.943 buffer_time=2.632 print_stall=0 extruder: target=250 temp=250.3 pwm=0.285
extruder: pressure_advance: 0.045000
pressure_advance_smooth_time: 0.030000

Overshot by exactly 1° here.

I’m sorry I didn’t provide all the information. In fact, I did modify smooth_time, It’s effective but not good enough, here is my config.

smooth_time: 0.2
pwm_cycle_time: 0.01

Follow the Bambulab maintenance guide, I should " Apply the thermal grease generously on both sides of the ceramic heater and around the small thermistor hole".
My experience is “Do not let themal grease get on the thermistor”. I think the lower thermal conductivity smoothes temperature of the sensor, deceived Klipper and prevented M109 fall into permanent waiting. Of course, this is not a “real” solution.

You might start a search for the “right” thermal grease here https://klipper.discourse.group

I’m very sure you get the right hit.

Good luck, hcet14