MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
15.97k stars 19.09k forks source link

Fix unstable temperature on HC32 #27085

Closed shadow578 closed 2 weeks ago

shadow578 commented 2 weeks ago

Description

When using MPCTEMP on HC32-based boards and setting the hotend temperature high (240C), strong oscillations of the hotend temperature occur.

While i'm not quite sure what causes this, i've found that reducing the ADC's operating frequency (PCLK2) to 25MHz eliminates the issue.

Other findings:

All testing was done over ~5 Minutes at 240C, followed by ~5 Minutes at 220C, with a fresh MPC autotune before each test.

See Fig. A and Fig. B for before and after.

Requirements

HC32-based mainboard with MPCTEMP enabled.

Benefits

Makes hotend temperature much more stable.

Configurations

N/A

Related Issues

N/A

Screenshots

temp-no-fix_annotated temp-with-fix_annotated
Fig. A: Hotend temperature oscillations at 240C, on current bugfix-2.1.x branch Fig. B: Stable hotend temperatures on this PR's branch