-
Notifications
You must be signed in to change notification settings - Fork 114
Update motion_control.c #824
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
base: master
Are you sure you want to change the base?
Conversation
bug: cubic spline step is up to 2*BEZIER_MAX_STEP
AFAIKT your fix increases it to 4*BEZIER_MAX_STEP. Have you checked running code? |
I got this result by testing:
with BEZIER_MAX_STEP set to 0.1, 10 interpolation points are expected over t=0.0...1.0, but only 5 were generated. relevant link is : https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.1.x/Marlin/src/module/planner_bezier.cpp#L159 |
where you see 4*BEZIER_MAX_STEP ? Do you got it by running code? |
BTW I like "interp(position.z, target.z, t)" in the Marlin. Not ideal but it is much better then no Z interp. |
According to the description how many steps to expect depends on the curve straightness. When I run the code with double precision math I get four segments, not five. And with your change I get five vs. ten. And to add to float impreciseness |
description: "MAX_STEP is taken at the first iteration." 4 steps sounds buggy as per "2*MAX_STEP" rule from description. In this case 5 steps is minimum, not 4. I haven’t checked the double version yet.. |
My while loop produces the same steps as the Marlin for loop, so the linked Marlin code has the same bug? Or is Marlin using a different float library that has produces slightly different results that affects the loop exit condition? |
bug: cubic spline step is up to 2*BEZIER_MAX_STEP