MCU crashing when heating bed

The PSU outputs stable 24V, doesn’t change at all when I power the bed, the extruder or both.
I understand that it makes sense that it’s a cheap power supply and that it might be the issue, and it surely could be, but doesn’t it sound odd to anyone that a firmware change fixes the issue? I just don’t understand why everyone tries that hard to ignore it without even trying to explain it. I’ve been working with software and hardware for decades, when software changes makes something work or not, that doesn’t make me think right away that it’s a hardware issue.

Here are 2 videos recorded with klipper and marlin, hope it’s clear enough.
klipper - klipper.mp4 - Google Drive
marlin - marlin.mp4 - Google Drive

The bed uses around 7.5A when starting out, when I started heating both bed and extruder at 70C/245C it peaked at 9A, then gradually decreased.

Once again the only change here is changing firmware, everything else remains untouched. Now it’s possible that it’s some hardware issue that klipper detects and marlin doesn’t, but I’m not sure why a re-flash of klipper would make it go away for a while, and also if it is that, I think we should’ve seen some logs of that.

Edit - I can’t reply further as a new user, will reply with the logs in a few hours when I’m able to again.

I just went through the thread again and one thing jumps out at me - where do you run this printer?

I’m asking because when I look at the logs, the temperature of the bed and the extruder are suspiciously high. If you look at the temperature for heater_bed and extruder once 'start_job_queue' finishes (which should be at the start of the print, when everything is at ambient temperatures), their values are:

... heater_bed: target=0 temp=40.4 ... extruder: target=0 temp=33.0 ...

In comparison, I just pulled a klippy.log from one of my printers and, at the start of print, for the same parameters, I get:

heater_bed: target=0 temp=23.4 ... extruder: target=0 temp=23.5 ...

Could you run a print after including the statement into printer.cfg:

[temperature_sensor mcu_temp]
sensor_type = temperature_mcu

as well as similar information for your host (and state what it is) and post the new klippy.log when the print is complete?

I’m wondering if your MCU (or host) is overheating which is causing the MCU crash when the power supply is working at maximum capacity (and putting out maximum heat in the compartment with your main controller board and/or host SBC).

The printer runs in my room, this is probably just a result of trying to heat both of them multiple times, it does start heating, but just crashes and stops short after, so if I’m starting at ambient temp of around 20C for example, trying over and over will make it go higher to around 30C-40C.

I’ve added 3 new clean logs of before/after adding this:

[temperature_sensor mcu_temp]
sensor_type = temperature_mcu

klippy (15).log (41.6 KB)
klippy (16).log (62.2 KB)
klippy (17).log (43.5 KB)

The first one is without that command, the second one is with the command, which as you can see the bed and extruder temps are a bit higher, the third one is trying to start a print without preheating.

By host I assume you mean the computer/computer board, so that would be a raspberry pi 4 with 4GB ram.
Running vcgencmd measure_temp on the RPI4 in various cases, I don’t see it reaching 40C.

Based on the logs the MCU temps slightly increases but not even going above 27C which sounds just reasonable.

Try again by disconnecting the bed heater - not the thermistor - from the printer board and see what happens when you try to head the bed.

Just to make sure, do you refer to the 24V lines and GND lines?
Because the cable from the main board to the hotbed is a single 6P cable, so not sure I’d want to mess with removing single lines from this cable.

Could you please make a image of that board and post it here?

I’m not near it atm but this is what it looks like:


The main board is like that, the cable is slightly different but at the end pretty much the same, I just have 2 cables going into the 6pin connector instead of 2 connectors from the PSU that goes into a single 24V and GND connectors.
I don’t think I have such 6 pin connector available to create a new cable without the power lines.

Thank you for the three klippy.log files and adding the MCU temperature check. Based on what I see here, its temperature never reaches any kind of critical level.

However, in each klippy.log you just posted, there is a “Lost communication with MCU ‘mcu’” and in each case, just before the event, I see:

... heater_bed: target=70 temp=19.7 pwm=1.000 ... extruder: target=150 temp=19.8 pwm=1.000
Timeout with MCU 'mcu' (eventtime=370610.324017)
Transition to shutdown state: Lost communication with MCU 'mcu'

Power to the heated bed and extruder are at 100% just before the printer shuts down.

Honestly, that’s the signature of a power supply problem and it repeats.

Is there any way in which you can swap out the power supply with another one?

It often runs at 100% until it reaches the target temp so I don’t think it should be related even if the issue is in the PSU. It always starts at 100% based on what I can see and then goes down.

E.g:
partial_klippy.log (84.1 KB)

Sadly I don’t have any available 24V PSU to try.

I tried to set the temperature just above current bed temp, was around 24C, and I’ve set it to 25C. The pwm goes to around 25% and then as usual just crashes.
klippy (19).log (17.6 KB)

Just looking at the logs again, and the number of bytes_retransmit jumps out at me. The number increases as you approach the “Timeout with MCU ‘mcu’”.

When you ran Marlin, did you use anything like Octoprint?

Looking around, it looks like your firmware came from something like:

Now, you’re [mcu] statement is:

[mcu]
baud = 250000
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

but, when I look around, I usually see something like:

[mcu]
serial: /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0
baud: 115200
restart_method: command

Could you rebuild and try at 115,200bps rather than 250,000? It could be the USART in the controller board can’t keep up with the faster datarate that you have specified.

Yes, I’ve been using 250000 baud rate with marlin as well, and the klipper docs states:
The recommended baud rate for Klipper is 250000. This baud rate works well on all micro-controller boards that Klipper supports. If you've found an online guide recommending a different baud rate, then ignore that part of the guide and continue with the default value of 250000

So I decided to just continue with 250000. I have tried to flash a firmware with 115200 baud rate, but unfortunately it’s pretty much the same.

Logs:
klippy (23).log (47.3 KB)

Thanks.

It’s “pretty much the same” but look at lines 565 onward in the klippy.log you just sent.

Up to this point, the bytes_retransmit is stable at 9 and then jumps up from there.

What type of cable are you using to connect the main controller board to your host? How long is it?

How did you measure? Scope or multimeter?

I use just a generic USB B cable, usually those that comes with arduino uno etc, it’s about 80cm long I’d assume.
Next time heating wouldn’t work I’ll maybe try to switch to a different cable.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.