Skip to content

Commit

Permalink
handle e-only moves like moves with linear axes
Browse files Browse the repository at this point in the history
  • Loading branch information
DerAndere1 committed Aug 20, 2023
1 parent 7f4fc9a commit 810187a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
7 changes: 5 additions & 2 deletions Marlin/src/lcd/marlinui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,8 +821,11 @@ void MarlinUI::init() {

const feedRate_t fr_mm_s = (axis < LOGICAL_AXES) ? manual_feedrate_mm_s[axis] : XY_PROBE_FEEDRATE_MM_S;

// For a rotational axis convert the "inch" feedrate to "mm" before applying it
// TODO: Assert that all units on a rotational axis are expressed in degrees, not by distance
/**
* For a rotational axis apply the "inch" to "mm" conversion factor. This mimics behaviour of the G1 G-code
* implementation. For moves involving only rotational axes, the planner will convert back to the feedrate#
* in degrees per time unit.
*/
feedRate_t fr = fr_mm_s;
#if ENABLED(INCH_MODE_SUPPORT) && HAS_ROTATIONAL_AXES
if (parser.axis_is_rotational(axis) && parser.using_inch_units()) fr = IN_TO_MM(fr);
Expand Down
7 changes: 5 additions & 2 deletions Marlin/src/module/motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1159,10 +1159,13 @@ float get_move_distance(const xyze_pos_t &diff OPTARG(HAS_ROTATIONAL_AXES, bool

#if HAS_ROTATIONAL_AXES
if (UNEAR_ZERO(distance_sqr)) {
// Move involves only rotational axes. Calculate angular distance in accordance with LinuxCNC
is_cartesian_move = false;
// Move involves no linear axes. Calculate angular distance in accordance with LinuxCNC
distance_sqr = ROTATIONAL_AXIS_GANG(sq(diff.i), + sq(diff.j), + sq(diff.k), + sq(diff.u), + sq(diff.v), + sq(diff.w));
}
if (!UNEAR_ZERO(distance_sqr)) {
//Move involves rotational axes, not just the extruder
is_cartesian_move = false;
}
#endif

#endif
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/module/planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2300,6 +2300,10 @@ bool Planner::_populate_block(
// Example 2: At 120°/s a 60° move involving only rotational axes takes 0.5s. So this will give 2.0.
float inverse_secs = inverse_millimeters * (
#if ALL(HAS_ROTATIONAL_AXES, INCH_MODE_SUPPORT)
/**
* Work around for the premature feedrate conversion from
* inches/s to mm/s by the get_distance_from_command function.
*/
cartesian_move ? fr_mm_s : LINEAR_UNIT(fr_mm_s)
#else
fr_mm_s
Expand Down

0 comments on commit 810187a

Please sign in to comment.