Fix unstable temperature on HC32 #27085
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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