MCU crashing when heating bed

Basic Information:

Printer Model: Anet ET4
MCU / Printerboard: Anet ET4 silent board(STM32F407)
klippy (8).log (162.4 KB)

Hey, I have some sporadic issue where the printer crashes when I set the bed temperature, basically whenever the bed heat is starting, the MCU will just hard crash, personally I don’t think there is anything in the logs regarding this. If you check the logs, you can see that after the Unknown command:"TEST" line I set the bed temperature then it just crashes without much info.

It sounds a lot like hardware issues, but I believe this is only/partially related to software as well. This issue happens just whenever, it could work for a week then happen, it could happen after 2 days, or basically whenever, I don’t have a way to reproduce it and usually I don’t even touch the printer before it happens.

When it happens, in order to solve it I just re-flash the klipper firmware and then it just works again. Anything else I tried besides that failed. I have done this close to 10 times already, and each time I re-flashed the klipper firmware the issue was resolved.

I don’t know why re-flash solves it or why it happens to begin with.
The reason I don’t think it’s entirely hardware related(if at all) is because I don’t even touch the printer when this happens or when I solve it via re-flash, I also know that marlin worked for me for 3 years without any such issues.
I don’t really know if it’s a combination of hardware + software, only hardware or only software, but I hope for some ideas on how to understand which it is.

Since the issue could happen any day or not happen for weeks, it might be pretty hard to debug. Would love to hear some ideas, maybe there is some trace/verbose/debug option to have in the klipper logs.

Thanks.

Hello @msacco !

My bets go on a hardware issue.

Do you have a low voltage bead (24V) or a high voltage one (mains connected)

Disconnect the bed from the printer board and try again.
Usually you should get a thermal runaway issue reported after some time.

If that happens, it appears, that something between the board and the bed is not quite right. Maybe within the cable loom to the bed.

The printer uses 24V. If I disconnect the bed cable and try to run the printer I will get the following error right away:
Screenshot_490

Also, the bed heats fine now as I already fixed it by re-flashing the firmware.
I’ll gather suggestions probably but no idea whether it will happen again tomorrow or next week :slight_smile:

I did try to replace the cable that goes from the hotbed to the main board so that’s probably not it.
I do wonder tho, if it’s hardware issue, why re-flashing the firmware solves the issue, why flashing to marlin also solves the issue, and why it never happened on marlin for 3 years? Even though it could be a new issue.

Thanks :slight_smile:

Looks a bit strange.
One of the last lines in your log shows the following:

heater_bed: target=0 temp=0.0 pwm=0.000  extruder: target=0 temp=0.0 pwm=0.000

A second later its quite normal again:

heater_bed: target=0 temp=39.2 pwm=0.000  extruder: target=0 temp=30.0 pwm=0.000

If this shows the error the bed is checked first hence mentioned in the error message.
But as both thermistors seem to report 0 °C here I can’t explain it.
Do bed and hotend thermistors directly connect to the board or is there an additional daughter board where both are connected to?

Actually close, so on the Anet ET4 there is the main board and an adapter board, but the extruder/hotbed aren’t connected to the same one.
The hotbed is connected directly to the main board, while the extruder is connected to the adapter board which then connects to the main board.
Here are some pictures:


https://shop.anet3d.com/cdn/shop/products/ET4-__04_543x700.jpg?v=1610688283 (seems like I can embed only 1 picture in a post)

In general, I’m not sure if these logs should have values?
Whenever I restart the printer these are the logs I see:

Starting heater checks for extruder
Stats 317465.9: gcodein=0  mcu: mcu_awake=0.000 mcu_task_avg=0.000000 mcu_task_stddev=0.000000 bytes_write=1119 bytes_read=4483 bytes_retransmit=54 bytes_invalid=0 send_seq=125 receive_seq=125 retransmit_seq=2 srtt=0.003 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=167997421  heater_bed: target=0 temp=0.0 pwm=0.000 sysload=0.04 cputime=0.679 memavail=7735088 print_time=0.000 buffer_time=0.000 print_stall=0 extruder: target=0 temp=0.0 pwm=0.000
webhooks: registering remote method 'shutdown_machine' for connection id: 548553284304
webhooks: registering remote method 'reboot_machine' for connection id: 548553284304
webhooks: registering remote method 'pause_job_queue' for connection id: 548553284304
webhooks: registering remote method 'start_job_queue' for connection id: 548553284304
Stats 317466.9: gcodein=0  mcu: mcu_awake=0.000 mcu_task_avg=0.000000 mcu_task_stddev=0.000000 bytes_write=1125 bytes_read=4499 bytes_retransmit=54 bytes_invalid=0 send_seq=126 receive_seq=126 retransmit_seq=2 srtt=0.003 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=168005008  heater_bed: target=0 temp=0.0 pwm=0.000 sysload=0.04 cputime=0.698 memavail=7734864 print_time=0.000 buffer_time=0.000 print_stall=0 extruder: target=0 temp=0.0 pwm=0.000
Stats 317467.9: gcodein=0  mcu: mcu_awake=0.000 mcu_task_avg=0.000000 mcu_task_stddev=0.000000 bytes_write=1139 bytes_read=4620 bytes_retransmit=54 bytes_invalid=0 send_seq=128 receive_seq=128 retransmit_seq=2 srtt=0.003 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=168005502  heater_bed: target=0 temp=21.3 pwm=0.000 sysload=0.04 cputime=0.723 memavail=7734864 print_time=0.000 buffer_time=0.000 print_stall=0 extruder: target=0 temp=21.1 pwm=0.000
Stats 317468.9: gcodein=0  mcu: mcu_awake=0.000 mcu_task_avg=0.000000 mcu_task_stddev=0.000000 bytes_write=1145 bytes_read=4726 bytes_retransmit=54 bytes_invalid=0 send_seq=129 receive_seq=129 retransmit_seq=2 srtt=0.003 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=168005340  heater_bed: target=0 temp=21.4 pwm=0.000 sysload=0.04 cputime=0.741 memavail=7734864 print_time=0.000 buffer_time=0.000 print_stall=0 extruder: target=0 temp=20.9 pwm=0.000
Stats 317469.9: gcodein=0  mcu: mcu_awake=0.000 mcu_task_avg=0.000000 mcu_task_stddev=0.000000 bytes_write=1151 bytes_read=4847 bytes_retransmit=54 bytes_invalid=0 send_seq=130 receive_seq=130 retransmit_seq=2 srtt=0.003 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=168005185  heater_bed: target=0 temp=21.3 pwm=0.000 sysload=0.04 cputime=0.752 memavail=7734864 print_time=0.000 buffer_time=0.000 print_stall=0 extruder: target=0 temp=21.1 pwm=0.000
Stats 317470.9: gcodein=0  mcu: mcu_awake=0.002 mcu_task_avg=0.000010 mcu_task_stddev=0.000015 bytes_write=1157 bytes_read=4983 bytes_retransmit=54 bytes_invalid=0 send_seq=131 receive_seq=131 retransmit_seq=2 srtt=0.003 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=168005027  heater_bed: target=0 temp=21.3 pwm=0.000 sysload=0.04 cputime=0.763 memavail=7734864 print_time=0.000 buffer_time=0.000 print_stall=0 extruder: target=0 temp=21.0 pwm=0.000
Stats 317471.9: gcodein=0  mcu: mcu_awake=0.002 mcu_task_avg=0.000010 mcu_task_stddev=0.000015 bytes_write=1163 bytes_read=5089 bytes_retransmit=54 bytes_invalid=0 send_seq=132 receive_seq=132 retransmit_seq=2 srtt=0.003 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=168004700  heater_bed: target=0 temp=21.3 pwm=0.000 sysload=0.04 cputime=0.773 memavail=7734864 print_time=0.000 buffer_time=0.000 print_stall=0 extruder: target=0 temp=21.0 pwm=0.000
Stats 317472.9: gcodein=0  mcu: mcu_awake=0.002 mcu_task_avg=0.000010 mcu_task_stddev=0.000015 bytes_write=1169 bytes_read=5210 bytes_retransmit=54 bytes_invalid=0 send_seq=133 receive_seq=133 retransmit_seq=2 srtt=0.003 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=168004505  heater_bed: target=0 temp=21.3 pwm=0.000 sysload=0.04 cputime=0.784 memavail=7734864 print_time=0.000 buffer_time=0.000 print_stall=0 extruder: target=0 temp=21.2 pwm=0.000

Regardless if my bed heating works or not, so while I don’t know if it’s “normal”, I don’t think it should be related to the issue?

Thanks.

I guess it’s your 24V power supply.

From your klippy.log it starts in line 1028.

Stats 1000.5: gcodein=0  mcu: mcu_awake=0.000 mcu_task_avg=0.000005 mcu_task_stddev=0.000003 bytes_write=1253 bytes_read=6460 bytes_retransmit=9 bytes_invalid=0 send_seq=147 receive_seq=147 retransmit_seq=2 srtt=0.003 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=168003179   : target=0 temp=40.1 pwm=0.000 sysload=0.20 cputime=1.243 memavail=7749540 print_time=0.000 buffer_time=0.000 print_stall=0 extruder: target=0 temp=32.9 pwm=0.000
Stats 1001.5: gcodein=0  mcu: mcu_awake=0.000 mcu_task_avg=0.000005 mcu_task_stddev=0.000004 bytes_write=1270 bytes_read=6594 bytes_retransmit=9 bytes_invalid=0 send_seq=148 receive_seq=148 retransmit_seq=2 srtt=0.003 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=168003164  heater_bed: target=45 temp=40.1 pwm=1.000 sysload=0.18 cputime=1.256 memavail=7749540 print_time=19.955 buffer_time=0.000 print_stall=0 extruder: target=0 temp=32.9 pwm=0.000
Stats 1002.5: gcodein=0  mcu: mcu_awake=0.000 mcu_task_avg=0.000005 mcu_task_stddev=0.000004 bytes_write=1276 bytes_read=6594 bytes_retransmit=30 bytes_invalid=0 send_seq=149 receive_seq=148 retransmit_seq=149 srtt=0.003 rttvar=0.000 rto=0.200 ready_bytes=0 upcoming_bytes=0 freq=168003164  heater_bed: target=45 temp=40.1 pwm=1.000 sysload=0.18 cputime=1.264 memavail=7749548 print_time=19.955 buffer_time=0.000 print_stall=0 extruder: target=0 temp=32.9 pwm=0.000
Stats 1003.5: gcodein=0  mcu: mcu_awake=0.000 mcu_task_avg=0.000005 mcu_task_stddev=0.000004 bytes_write=1282 bytes_read=6594 bytes_retransmit=44 bytes_invalid=0 send_seq=150 receive_seq=148 retransmit_seq=149 srtt=0.003 rttvar=0.000 rto=0.800 ready_bytes=0 upcoming_bytes=0 freq=168003164  heater_bed: target=45 temp=40.1 pwm=1.000 sysload=0.18 cputime=1.272 memavail=7749548 print_time=19.955 buffer_time=0.000 print_stall=0 extruder: target=0 temp=32.9 pwm=0.000
Stats 1004.5: gcodein=0  mcu: mcu_awake=0.000 mcu_task_avg=0.000005 mcu_task_stddev=0.000004 bytes_write=1288 bytes_read=6594 bytes_retransmit=57 bytes_invalid=0 send_seq=151 receive_seq=148 retransmit_seq=150 srtt=0.003 rttvar=0.000 rto=1.600 ready_bytes=0 upcoming_bytes=0 freq=168003164  heater_bed: target=45 temp=40.1 pwm=1.000 sysload=0.18 cputime=1.281 memavail=7749552 print_time=19.955 buffer_time=0.000 print_stall=0 extruder: target=0 temp=32.9 pwm=0.000
Stats 1005.5: gcodein=0  mcu: mcu_awake=0.000 mcu_task_avg=0.000005 mcu_task_stddev=0.000004 bytes_write=1294 bytes_read=6594 bytes_retransmit=82 bytes_invalid=0 send_seq=152 receive_seq=148 retransmit_seq=152 srtt=0.003 rttvar=0.000 rto=3.200 ready_bytes=0 upcoming_bytes=0 freq=168003164  heater_bed: target=45 temp=40.1 pwm=1.000 sysload=0.18 cputime=1.289 memavail=7749552 print_time=19.955 buffer_time=0.000 print_stall=0 extruder: target=0 temp=32.9 pwm=0.000
Timeout with MCU 'mcu' (eventtime=1006.455857)
Transition to shutdown state: Lost communication with MCU 'mcu'
Dumping gcode input 0 blocks
Dumping 20 requests for client 547694501264
Received 983.515164: b'{"id": 548041342480, "method": "objects/subscribe", "params": {"objects": {"webhooks": null}, "response_template": {"method": "process_status_update"}}}'
Received 983.516760: b'{"id": 548041340688, "method": "gcode/subscribe_output", "params": {"response_template": {"method": "process_gcode_response"}}}'
Received 983.519519: b'{"id": 548041278928, "method": "list_endpoints", "params": {}}'
Received 983.521720: b'{"id": 548041334288, "method": "objects/subscribe", "params": {"objects": {"webhooks": null, "print_stats": null}, "response_template": {"method": "process_status_update"}}}'
Received 983.768598: b'{"id": 548041281808, "method": "objects/list", "params": {}}'
Received 983.770955: b'{"id": 548041281808, "method": "objects/query", "params": {"objects": {"configfile": null}}}'
Received 984.023140: b'{"id": 548041341456, "method": "register_remote_method", "params": {"response_template": {"method": "shutdown_machine"}, "remote_method": "shutdown_machine"}}'
Received 984.025226: b'{"id": 548039963856, "method": "register_remote_method", "params": {"response_template": {"method": "reboot_machine"}, "remote_method": "reboot_machine"}}'
Received 984.026873: b'{"id": 548039963856, "method": "register_remote_method", "params": {"response_template": {"method": "pause_job_queue"}, "remote_method": "pause_job_queue"}}'
Received 984.028484: b'{"id": 548039963856, "method": "register_remote_method", "params": {"response_template": {"method": "start_job_queue"}, "remote_method": "start_job_queue"}}'
Received 984.032838: b'{"id": 548039958672, "method": "objects/query", "params": {"objects": {"heaters": null}}}'
Received 984.033239: b'{"id": 548039965904, "method": "objects/query", "params": {"objects": {"heaters": null}}}'
Received 984.039960: b'{"id": 548039951056, "method": "info", "params": {}}'
Received 984.040560: b'{"id": 548039966224, "method": "objects/list", "params": {}}'
Received 984.040560: b'{"id": 548039961616, "method": "gcode/help", "params": {}}'
Received 984.052892: b'{"id": 548039950672, "method": "objects/subscribe", "params": {"objects": {"gcode": null, "webhooks": null, "configfile": null, "mcu": null, "gcode_move": null, "print_stats": null, "virtual_sdcard": null, "pause_resume": null, "display_status": null, "gcode_macro CANCEL_PRINT": null, "gcode_macro PAUSE": null, "gcode_macro RESUME": null, "gcode_macro SET_PAUSE_NEXT_LAYER": null, "gcode_macro SET_PAUSE_AT_LAYER": null, "gcode_macro SET_PRINT_STATS_INFO": null, "gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL": null, "gcode_macro _CLIENT_EXTRUDE": null, "gcode_macro _CLIENT_RETRACT": null, "heaters": null, "heater_bed": null, "fan": null, "heater_fan fan1": null, "filament_switch_sensor filament_sensor": null, "probe": null, "screws_tilt_adjust": null, "bed_mesh": null, "bed_screws": null, "stepper_enable": null, "motion_report": null, "query_endstops": null, "idle_timeout": null, "system_stats": null, "manual_probe": null, "toolhead": null, "extruder": null}, "response_template": {"method": "process_status_update"}}}'
Received 984.282165: b'{"id": 548039961232, "method": "objects/subscribe", "params": {"objects": {"webhooks": null, "print_stats": null, "heater_bed": null, "extruder": null, "gcode": null, "configfile": null, "mcu": null, "gcode_move": null, "virtual_sdcard": null, "pause_resume": null, "display_status": null, "gcode_macro CANCEL_PRINT": null, "gcode_macro PAUSE": null, "gcode_macro RESUME": null, "gcode_macro SET_PAUSE_NEXT_LAYER": null, "gcode_macro SET_PAUSE_AT_LAYER": null, "gcode_macro SET_PRINT_STATS_INFO": null, "gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL": null, "gcode_macro _CLIENT_EXTRUDE": null, "gcode_macro _CLIENT_RETRACT": null, "heaters": null, "fan": null, "heater_fan fan1": null, "filament_switch_sensor filament_sensor": null, "probe": null, "screws_tilt_adjust": null, "bed_mesh": null, "bed_screws": null, "stepper_enable": null, "motion_report": null, "query_endstops": null, "idle_timeout": null, "system_stats": null, "manual_probe": null, "toolhead": null}, "response_template": {"method": "process_status_update"}}}'
Received 984.497700: b'{"id": 548040085328, "method": "objects/query", "params": {"objects": {"extruder": ["can_extrude"]}}}'
Received 984.532095: b'{"id": 548041278928, "method": "objects/subscribe", "params": {"objects": {"webhooks": null, "print_stats": null, "heater_bed": null, "extruder": null, "gcode": null, "configfile": null, "mcu": null, "gcode_move": null, "virtual_sdcard": null, "pause_resume": null, "display_status": null, "gcode_macro CANCEL_PRINT": null, "gcode_macro PAUSE": null, "gcode_macro RESUME": null, "gcode_macro SET_PAUSE_NEXT_LAYER": null, "gcode_macro SET_PAUSE_AT_LAYER": null, "gcode_macro SET_PRINT_STATS_INFO": null, "gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL": null, "gcode_macro _CLIENT_EXTRUDE": null, "gcode_macro _CLIENT_RETRACT": null, "heaters": null, "fan": null, "heater_fan fan1": null, "filament_switch_sensor filament_sensor": null, "probe": null, "screws_tilt_adjust": null, "bed_mesh": null, "bed_screws": null, "stepper_enable": null, "motion_report": null, "query_endstops": null, "idle_timeout": null, "system_stats": null, "manual_probe": null, "toolhead": null}, "response_template": {"method": "process_status_update"}}}'
Received 1000.890837: b'{"id": 548041733648, "method": "gcode/script", "params": {"script": "SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET=45"}}'
gcode state: absolute_coord=True absolute_extrude=True base_position=[0.0, 0.0, 0.0, 0.0] last_position=[0.0, 0.0, 0.0, 0.0] homing_position=[0.0, 0.0, 0.0, 0.0] speed_factor=0.016666666666666666 extrude_factor=1.0 speed=25.0
Reactor garbage collection: (984.273917413, 0.0, 0.0)
Stats 1006.5: gcodein=0  mcu: mcu_awake=0.000 mcu_task_avg=0.000005 mcu_task_stddev=0.000004 bytes_write=1300 bytes_read=6594 bytes_retransmit=82 bytes_invalid=0 send_seq=153 receive_seq=148 retransmit_seq=152 srtt=0.003 rttvar=0.000 rto=3.200 ready_bytes=0 upcoming_bytes=0 freq=168003164  heater_bed: target=45 temp=40.1 pwm=1.000 sysload=0.17 cputime=1.297 memavail=7749552 print_time=19.955 buffer_time=0.000 print_stall=0 extruder: target=0 temp=32.9 pwm=0.000
Stats 1007.5: gcodein=0  mcu: mcu_awake=0.000 mcu_task_avg=0.000005 mcu_task_stddev=0.000004 bytes_write=1312 bytes_read=6594 bytes_retransmit=82 bytes_invalid=0 send_seq=155 receive_seq=148 retransmit_seq=152 srtt=0.003 rttvar=0.000 rto=3.200 ready_bytes=0 upcoming_bytes=0 freq=168003164  heater_bed: target=45 temp=40.1 pwm=1.000 sysload=0.17 cputime=1.309 memavail=7749552 print_time=19.955 buffer_time=0.000 print_stall=0 extruder: target=0 temp=32.9 pwm=0.000
Unable to issue reset command on MCU 'mcu'
webhooks client 547694501264: Disconnected
Restarting printer

Your “heater_bed” turns on and your power supply drops the voltage.
Easy to measure with a scope. Also a multimeter which is able logging measurements might work.

I think your power supply is too weak or worn out.

Good luck, hcet14

Where in the logs you see that the power supply drops the voltage?

1 Like

I never stated the voltage drop is mentioned in the klippy.log!

If you want to read a voltage (tracked in klippy.log) you need an ADC which measures the voltage and is hooked up to the system.

My impression is, that is obvious.

Ok, but that still doesn’t explain why a re-flash of the firmware solves the issue, and why heating the extruder to 250C works without issues while any bed heating causes the MCU to crash?

You may think about it. What is the starting current of an extruder compared to a heat bed?

I don’t know, and what about the other thing I mentioned?

I didn’t read that. I’m just following your klippy.log.

U=RxI
P=UxI

An hotend heater cartridge draws about 40-80W
A heat bed draws 250-300W or more.

When you draw too much current from your power supply it’s overloaded!

Two things may happen:

  • The voltage drops significant
  • The voltage is gone (just if your power supply measures the current and reacts to that → shut down 24V until the current is lower)
1 Like

So it’s possible that the extruder works and the heat bed doesn’t, but why would a re-flash of the firmware solve that?

No (no extruder or heat bed problem), sorry but I don’t think you get the main problem!

7.23b

Sorry, very quick search.

You “have to accept”! (Ohm’s Law)

U = R x I

Resistor! (your printer!) ((R))
Your power supply 24V ((U))
Current: my question to you?

Please google Ohm - Wikipedia

No rocket science! Even I got it!

That is more or less a restart of your printer (please understand! Just for your issue!)!

Thanks, you don’t have to further reply :slight_smile:

What is your fix for your problem?

What @hcet14 is saying is that your main power supply isn’t or is no longer capable or supplying enough power when the bed is being heated to maintain proper operation of your controller.

The heated bed takes a lot more current than the extruder and when you run the bed the power sags, causing the controller to momentarily shut down.

I looked up the power supply of the Anet ET4 (which you indicate that you are using) and it is specified as being a 240W supply which I personally would consider a bit low for the size of heated bed. Going back to the formulas that @hcet14 gave you, this means that the power supply is nominally capable of supplying 10A at 24V.

A heated bed of this size will draw around 9A at full power (ie when you are initially heating up the bed) and will probably drop down to 3A-4A during normal operation. The extruder will probably draw around 2A at 250C - note that you can’t start both the bed and the extruder heating at the same time as the current draw will be more than the power supply can handle: this is why I said I consider it to be a bit low.

Now, if the power supply is older, it may not be able to supply full power and when you get a full 9A draw plus the current required by the controller and other parts, its overcurrent protection will cut in and reset/shutdown which is why your MCU is crashing.

I suggest that you measure the output of the power supply while the bed is heating and see if the voltage sags (from a normal 24V). If it does, then you should replace the power supply with something at least the same power rating and, ideally, a bit larger (I would recommend 350W or so) to make sure you can heat both the bed and the extruder at the same time and still have some margin.

1 Like

I understand that, but I fail to see how that could make sense when it works with no issues for weeks, then all of a sudden happens, and will continue to happen until I either re-flash the klipper firmware or just flash marlin which then makes it work as normal as before. Restarting the printer will not make it work, and restarting the klipper firmware/system will also not make it work.

Screenshot_493

I can heat both extruder and bed with no issues, if the issue would’ve been the power supply, a firmware change shouldn’t fix that, and I should see it happening and not happening with no correlation to the firmware change.

Power supplies (especially cheap ones) go bad over time.

The best way to check @hcet14, @EddyMI3D and my hypothesis is to measure the voltage output of your power supply while the bed is heating.

1 Like

Sorry, that was my starting point with @msacco’ problem.

1 Like