Browse Source

Fix: Junction Deviation calculates wrong cos(theta) on CoreXY (#12879)

pull/1/head
HackingGulliver 6 years ago
committed by Scott Lahteine
parent
commit
1fd8e2c649
  1. 9
      Marlin/src/module/planner.cpp

9
Marlin/src/module/planner.cpp

@ -2392,6 +2392,15 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
};
#endif
#if IS_CORE && ENABLED(JUNCTION_DEVIATION)
/**
* On CoreXY the length of the vector [A,B] is SQRT(2) times the length of the head movement vector [X,Y].
* So taking Z and E into account, we cannot scale to a unit vector with "inverse_millimeters".
* => normalize the complete junction vector
*/
normalize_junction_vector(unit_vec);
#endif
// Skip first block or when previous_nominal_speed is used as a flag for homing and offset cycles.
if (moves_queued && !UNEAR_ZERO(previous_nominal_speed_sqr)) {
// Compute cosine of angle between previous and current path. (prev_unit_vec is negative)

Loading…
Cancel
Save