Bed_Distance_sensor icon indicating copy to clipboard operation
Bed_Distance_sensor copied to clipboard

getting MCU 'mcu' shutdown: Timer too close when running realtime Z Adjust.

Open drupi79 opened this issue 1 year ago • 23 comments

I'm getting a MCU 'mcu' shutdown: Timer too close when running real-time Z Adjust. if I go back to just using KAMP or the bed mesh I don't have the issues. this happens with my BDSensor 1.1 and 1.2 running on Ender 3's with 4.2.7 Creality MCU's and Pi 4 4GB

drupi79 avatar May 25 '24 06:05 drupi79

you can increase the communication speed by reduce the delay value in section [BDsensor] from 20 to 8 for BDsensor V1.2, and also try to slow down the printing speed of first layer or the max_accel value.

markniu avatar May 25 '24 07:05 markniu

here I just added a variables for the sample time,need to update and compile&reflash klipper.bin image

markniu avatar May 25 '24 12:05 markniu

so did the update for this and added the rt_sample_time line to my config and now I get a "Unable to obtain 'I2CBDr' response" during homing when starting a print.

drupi79 avatar May 26 '24 05:05 drupi79

seems that you have updated the code, but need to compile and reflash the firmware.

markniu avatar May 26 '24 06:05 markniu

you mean flash the BDsensor or klipper? because I reflashed the printer this morning and still have the same error after it homes for printer start

drupi79 avatar May 26 '24 19:05 drupi79

flash the klipper.bin. you can try again. maybe you forget to recompile or the flash not success. the mcu can't recognize this new command rt_sample_time if the firmware is not updated.

markniu avatar May 27 '24 02:05 markniu

recompiled and reflashed the printer. again only getting the Unable to obtain 'I2CBDr when the printer tries to home after starting the print. if I go back to doing KAMP I have zero issues. it's only when I try to use realtime Z

drupi79 avatar May 27 '24 06:05 drupi79

could you check if the BD_sensor.c is the latest as the shown below, and how about remove the rt_sample_time in the cfg file? you can test it just send BDSENSOR_SET REAL_TIME_HEIGHT=0.3 and no need to start a print. image

markniu avatar May 27 '24 07:05 markniu

Also try this My klipper says dirty after installing bdsensor If it does... Log in SSH Run ./Bed_Distance_sensor/klipper/uninstall.sh (If this doesn't work. Run Sudo chmod +X ./Bed_Distance_sensor/klipper/uninstall.sh) Sudo rm -r ./Bed_Distance_sensor Go back to Mainsail Do soft recovery on klipper Make sure everything is updated Reboot Now start marks install guide again When you run make and the list scrolls through make sure BD Sensor is in the list.

Townie-au avatar May 27 '24 10:05 Townie-au

This script does not seem to like Kiauh. So you will need to flash it at command prompt.

Billy-d-Kidd avatar May 27 '24 13:05 Billy-d-Kidd

I'm getting this issue again. I had it working for a bit and then updated klipper, BD sensor, Moonraker etc and now I get it again. I've added rt_sample time and reduced delay to 8. The before layer change gcode is in the sliced. I've removed all bed mesh related settings and data from my config.

Townie-au avatar Aug 14 '24 18:08 Townie-au

How about the CPU loading while printing with SSH command htop? and maybe need to slow down the printing speed of first layer.

I'm getting this issue again. I had it working for a bit and then updated klipper, BD sensor, Moonraker etc and now I get it again. I've added rt_sample time and reduced delay to 8. The before layer change gcode is in the sliced. I've removed all bed mesh related settings and data from my config.

markniu avatar Aug 16 '24 07:08 markniu

How about the CPU loading while printing with SSH command htop? and maybe need to slow down the printing speed of first layer.

I'm getting this issue again. I had it working for a bit and then updated klipper, BD sensor, Moonraker etc and now I get it again. I've added rt_sample time and reduced delay to 8. The before layer change gcode is in the sliced. I've removed all bed mesh related settings and data from my config.

Thanks Mark

Ok. I'll give that a go.

Townie-au avatar Aug 16 '24 08:08 Townie-au

I slowed down 80% Screenshot_20240816-191234 Screenshot_20240816-191314 Screenshot_20240816-191414

Townie-au avatar Aug 16 '24 09:08 Townie-au

If I enable it manually without printing the bed does move up and down.

Townie-au avatar Aug 16 '24 09:08 Townie-au

Screenshot_20240816-192105

Townie-au avatar Aug 16 '24 09:08 Townie-au

I just did a print of a different gcode and worked correctly. This wasn't sliced and uploaded recently.

Townie-au avatar Aug 16 '24 10:08 Townie-au

or continue to increase the value rt_sample_time. if still happen, you can disable the real time level to see if it caused that problem.

markniu avatar Aug 16 '24 15:08 markniu

I tried all different values for that went up to 32. Yes it completed with realtime levelling disabled. I just tried reslicing again but same result. 🤔

Townie-au avatar Aug 17 '24 08:08 Townie-au

Hi any solutions to this problem?

StiviSVK avatar Feb 27 '25 16:02 StiviSVK

It will create a new software task in the firmware mcu to read sensor data and adjust the z height if the real time level is enabled. That task will consume some MCU time, if the time is too long while the printing is too fast, then it will cause this timer too close.

The solution is to increase the interval process time( modify the value rt_sample_time ) or slow down the first layer print speed.

BTW, This task of real_time_level runs only in the first layer printing.

markniu avatar Feb 28 '25 03:02 markniu