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

[1.1.x] Operate in Native Machine Space #8229

Merged

Conversation

thinkyhead
Copy link
Member

@thinkyhead thinkyhead commented Nov 3, 2017

Background: Marlin operates internally using coordinates offset by the current workspace origin. As a result, in order to perform operations that are workspace-agnostic —such as moving to a machine-relative point, doing bed leveling, etc— Marlin must subtract the workspace origin first. This can significantly increase overhead, especially when using segmented moves, as we do with Delta (and as we will be doing more as a standard aspect of mesh leveling).

Proposal: Internally, always work in native machine space, but subtract the workspace offset in gcode_get_destination (and other parameters that take coordinates), and add the workspace offset when reporting current position to the LCD or host.

From the user perspective there will be no change whatsoever.

An extra advantage of this approach is that it will be possible to use the fixed-point planner (due to be added soon) even when custom workspaces are enabled.

Suggested by @GMagician in response to #8200.


@MagoKimbra — I think you'll approve of this one.
@MarlinFirmware/testers-cartesian-team
@MarlinFirmware/testers-corexy-team
@MarlinFirmware/testers-delta-team

@thinkyhead thinkyhead added T: Development Makefiles, PlatformIO, Python scripts, etc. PR: Improvement T: Design Concept Technical ideas about ways and methods. labels Nov 3, 2017
@RowanMeara
Copy link
Contributor

Looks like quite the improvement.

@AnHardt
Copy link
Member

AnHardt commented Nov 3, 2017

Looks like must be tested, tested, TESTED!

@thinkyhead
Copy link
Member Author

thinkyhead commented Nov 3, 2017

That's why it's here, instead of in my back pocket. 😉

The most likely issue I expect would be changes that got missed. Checking over the changes that have been made, they're all simplifications.

The key thing: Every function and all logic should now deal only with machine-native coordinates. Only when doing input/output with the outside world do we need to subtract/add workspace offsets. A true relief, as this has been a source of confusion and errors — some of which this PR repairs.

@thinkyhead thinkyhead added the Needs: Testing Testing is needed for this change label Nov 3, 2017
@thinkyhead thinkyhead force-pushed the bf1_native_operation branch 4 times, most recently from cefd900 to cca7fad Compare November 3, 2017 03:54
@thinkyhead thinkyhead force-pushed the bf1_native_operation branch 3 times, most recently from 91f69f3 to b38d04d Compare November 3, 2017 07:40
@MagoKimbra
Copy link
Contributor

Thank you for asking me. Yes i'm very interested...

@thinkyhead
Copy link
Member Author

Installed and tested, and it's working well. The amount of computational savings is essentially the same as using NO_WORKSPACE_OFFSETS, but without losing workspace offsets.

@thinkyhead thinkyhead merged commit 309890c into MarlinFirmware:bugfix-1.1.x Nov 4, 2017
@thinkyhead thinkyhead deleted the bf1_native_operation branch November 4, 2017 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Testing Testing is needed for this change PR: Bug Fix PR: Improvement T: Design Concept Technical ideas about ways and methods. T: Development Makefiles, PlatformIO, Python scripts, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants