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.
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:
enabling hardware averaging of the ADC channels dampens the oscillations slightly
increasing or decreasing the sampling times does not affect oscillations
using HAL_ADC_RESOLUTION of 12 bit while PCLK2=50MHz makes the oscillations stronger than 10 bit, but with PCLK2=25MHz 12 bit yields slightly more stable temperatures
with 8-bit adc, marlin fails to boot
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
Fig. A: Hotend temperature oscillations at 240C, on current bugfix-2.1.x branch
Fig. B: Stable hotend temperatures on this PR's branch
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:
HAL_ADC_RESOLUTION
of 12 bit while PCLK2=50MHz makes the oscillations stronger than 10 bit, but with PCLK2=25MHz 12 bit yields slightly more stable temperaturesAll 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