Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
toolhead: Fixed junction deviation calculation for straight segments …
…(#6747) (#471) * toolhead: Use delta_v2 when calculating centripetal force As a minor math optimization, it's possible to calculate: .5 * self.move_d * self.accel * tan_theta_d2 using: self.delta_v2 * .25 * tan_theta_d2 because self.delta_v2 is "2. * self.move_d * self.accel". Signed-off-by: Dmitry Butyugin <[email protected]> Signed-off-by: Kevin O'Connor <[email protected]> * toolhead: Remove arbitrary constants controlling junction deviation When calculating the junction speed between two moves the code checked for angles greater than 0.999999 or less than -0.999999 to avoid math issues (sqrt of a negative number and/or divide by zero). However, these arbitrary constants could unnecessarily pessimize junction speeds when angles are close to 180 or 0 degrees. Change the code to explicitly check for negative numbers during sqrt and to explicilty check for zero values prior to division. This simplifies the code and avoids unnecessarily reducing some junction speeds. Signed-off-by: Dmitry Butyugin <[email protected]> Signed-off-by: Kevin O'Connor <[email protected]> --------- Signed-off-by: Dmitry Butyugin <[email protected]> Signed-off-by: Kevin O'Connor <[email protected]> Co-authored-by: Kevin O'Connor <[email protected]>
- Loading branch information