-
-
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
Move cruise LASER_POWER_TRAP code to cruise block. #27031
Conversation
More succint comments.
I think the problems with Another problem is that the laser power ramps are linear with respect to step count whereas the speed is proportional to the square root of the step count. This is because speed is increasing linearly with time but the earlier steps in the acceleration ramp take longer than the later steps and mutatis mutandis for deceleration. |
Did a review pass on this one, I think it is Ok, Instead of having the laser trap calc'd based on it's own step tracking for nominal you are moving it to the assumed cruise (nominal) rate if else position. I do not see any negative impacts and there is one less compare to do. This is of course with the multi step adjustment :) +1 Tom! |
I support that. For reference, I think a solution that adds a multiple of |
@mh-dm / @tombrazier does this change stand on its own, or does it need to be consumed at the same time as the other planner changes in flight? |
It stands on its own. |
However it will conflict with the much discussed variable rename. But that's easy to resolve as this PR simply removes the one reference to |
If there are no more concerns, can this be merged to unblock #27013? |
I mistakenly thought at least someone in this thread had bugfix merge privileges so looks like I need to call on @thinkyhead. |
Move cruise
LASER_POWER_TRAP
code into stepper cruise block. Small cleanup that fixes some potential issues:events_to_do
is not 1 (like ifMULTISTEPPING_LIMIT
is not 1) then the laser cruise update may not get run at allLASER_POWER_TRAP
deceleration and cruise blocks run, which is not intentionalOnly affects code using
LASER_POWER_TRAP
.Lightly tested by hooking up a logic analyzer to the laser pwm pin. The ramp up/cruise/down look ok and quite similar as to before this change. Here's just an example of what I've looked at (snapshot of acceleration->cruise at 80% power):
This change comes as a result of discussions on #27013