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

Protect pulse generation timing by disabling interrupts for longer #27131

Open
wants to merge 1 commit into
base: bugfix-2.1.x
Choose a base branch
from

Conversation

mh-dm
Copy link
Contributor

@mh-dm mh-dm commented May 27, 2024

Description

Protect pulse generation timing by disabling interrupts within Stepper::isr() for longer.

This is a mitigation for the stepper isr jitter seen in #27115 and other sources of stepper isr jitter on other platforms. On microcontrollers with ISR prioritization, note that only higher priority ISRs can ever interrupt the stepper ISR.

Benefits

More consistent pulse timings. I've tested on LPC176x and here's some before/after logic analyzer captures:

Before:
jitter-interrupt-before

After (edit, recaptured due to forgotten local changes):
jitter-interrupt-after

Basically no improvements in actual printing quality/noise unless ADAPTIVE_STEP_SMOOTHING is enabled since ADAPTIVE_STEP_SMOOTHING reduces a larger source of speed jitter, namely bresenham aliasing for the minor axes.

Related Issues

Mostly mitigates #27115

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.

[BUG] SysTick_Callback interferes with timing critical code - causes speed jitter - LPC176x
2 participants