Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Don't apply settings during validation #26935

Merged

Conversation

sjasonsmith
Copy link
Contributor

Description

Several settings were being applied during the validation stage. In most cases this is benign, as it will be replaced in a subsequent step.

In the case of BACKLASH_COMPENSATION, the initial configuration with invalid data caused corruption of the Backlash::residual_error member. Do to the behavior of the backlash compensation mechanisms, this persists even beyond the loading or resetting of proper values, leading to undefined printer behavior and often physical crashes.

After identifying that issue the settings file was reviewed for other similar issues that needed to be fixed.

Requirements

For the most drastic results, enable BACKLASH_COMPENSATION with BACKLASH_CORRECTION set to zero. On firmware boot this will often result in an overflowed residual_error member, resulting in doubled movements in one direction of one or more axis. The Z axis is where this is most often seen, since steps/mm is much higher on this axis.

Benefits

Don't crash your printhead.

Configurations

N/A

Related Issues

N/A

Copy link
Contributor

@tombrazier tombrazier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks correct to me.

@InsanityAutomation
Copy link
Contributor

Got everything we discussed on Discord and found 1 more I missed, so all good here too!

@sjasonsmith sjasonsmith merged commit 390f1f7 into MarlinFirmware:bugfix-2.1.x Apr 6, 2024
61 checks passed
@sjasonsmith sjasonsmith deleted the PR/settings_validation branch April 21, 2024 16:44
RPGFabi pushed a commit to RPGFabi/Marlin that referenced this pull request Jun 15, 2024
Check the `validating` variable before applying settings for several features.
This specifically avoids settings corruption for BACKLASH_PREVENTION, which has side-effects when first applied using incorrect values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants