-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
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
Optimize planner with precalculation, etc. #4389
Merged
thinkyhead
merged 6 commits into
MarlinFirmware:RCBugFix
from
thinkyhead:rc_optimize_planner
Jul 25, 2016
Merged
Optimize planner with precalculation, etc. #4389
thinkyhead
merged 6 commits into
MarlinFirmware:RCBugFix
from
thinkyhead:rc_optimize_planner
Jul 25, 2016
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
thinkyhead
added
PR: Improvement
Needs: Testing
Testing is needed for this change
T: Design Concept
Technical ideas about ways and methods.
Needs: Discussion
Discussion is needed
Bug: Confirmed !
PR: Bug Fix
labels
Jul 24, 2016
thinkyhead
force-pushed
the
rc_optimize_planner
branch
from
July 24, 2016 02:50
99d5c59
to
aa97b03
Compare
thinkyhead
changed the title
Optimize block->millimeters for DELTA
Optimize planner with precalculation, etc.
Jul 24, 2016
#endif | ||
delta_mm[E_AXIS] = (de / axis_steps_per_mm[E_AXIS]) * volumetric_multiplier[extruder] * extruder_multiplier[extruder] / 100.0; | ||
delta_mm[E_AXIS] = (de * steps_to_mm[E_AXIS]) * volumetric_multiplier[extruder] * extruder_multiplier[extruder] / 100.0; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 0.01 ?
thinkyhead
force-pushed
the
rc_optimize_planner
branch
3 times, most recently
from
July 24, 2016 19:31
1d429b8
to
fe0c5bc
Compare
You don't need to shift 32, 512 or similar. The compiler will do this for you. This will not save anything. |
thinkyhead
force-pushed
the
rc_optimize_planner
branch
from
July 24, 2016 20:27
fe0c5bc
to
d8f2876
Compare
This was referenced Jul 25, 2016
Closed
drewmoseley
pushed a commit
to drewmoseley/Marlin
that referenced
this pull request
May 31, 2024
…_whitespace Cleanup: whitespace in nProbeRetryCount var
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug: Confirmed !
Needs: Discussion
Discussion is needed
Needs: Testing
Testing is needed for this change
PR: Bug Fix
PR: Improvement
T: Design Concept
Technical ideas about ways and methods.
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.
Assuming all steps-per-mm are set to equal values on a DELTA (the usual case) we can reduce overhead by two float divisions and three float squarings. The key is to first calculate the distance moved
sqrt(sq(dx) + sq(dy) + sq(dz))
in steps, and only afterward divide bysteps_per_mm
.This PR applies this approach to optimize the planner for
DELTA
, and also generally fixes and optimizes the planner with the following changes:Planner::steps_to_mm[4]
to contain1.0 / axis_steps_per_mm[]
.Planner::refresh_positioning()
to handle any change ofaxis_steps_per_mm
:steps_to_mm
,planner.position
, andstepper.count
planner.refresh_positioning()
inConfig_Postprocess()
andgcode_M92()
.planner.refresh_positioning()
for menu items that alteraxis_steps_per_mm
Other math optimizations:
@Wurstnase has also suggested using the inverse-sqrt from the Quake source code. I'm investigating that next.