Minor motion style changes

This commit is contained in:
Scott Lahteine 2020-03-01 16:59:04 -06:00
parent 6b5347ee39
commit 49c5f614c6
6 changed files with 28 additions and 29 deletions

View file

@ -650,7 +650,7 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) {
// travel moves have been received so enact them // travel moves have been received so enact them
delayed_move_time = 0xFFFFFFFFUL; // force moves to be done delayed_move_time = 0xFFFFFFFFUL; // force moves to be done
destination = current_position; destination = current_position;
prepare_move_to_destination(); prepare_line_to_destination();
} }
#endif #endif

View file

@ -65,7 +65,7 @@ void GcodeSuite::G61(void) {
SERIAL_EOL(); SERIAL_EOL();
// Move to the saved position // Move to the saved position
prepare_move_to_destination(); prepare_line_to_destination();
} }
#endif // SAVED_POSITIONS #endif // SAVED_POSITIONS

View file

@ -100,9 +100,9 @@ void GcodeSuite::G0_G1(
#endif // FWRETRACT #endif // FWRETRACT
#if IS_SCARA #if IS_SCARA
fast_move ? prepare_fast_move_to_destination() : prepare_move_to_destination(); fast_move ? prepare_fast_move_to_destination() : prepare_line_to_destination();
#else #else
prepare_move_to_destination(); prepare_line_to_destination();
#endif #endif
#ifdef G0_FEEDRATE #ifdef G0_FEEDRATE

View file

@ -34,7 +34,7 @@
inline void G38_single_probe(const uint8_t move_value) { inline void G38_single_probe(const uint8_t move_value) {
endstops.enable(true); endstops.enable(true);
G38_move = move_value; G38_move = move_value;
prepare_move_to_destination(); prepare_line_to_destination();
planner.synchronize(); planner.synchronize();
G38_move = 0; G38_move = 0;
endstops.hit_on_purpose(); endstops.hit_on_purpose();
@ -77,7 +77,7 @@ inline bool G38_run_probe() {
// Move away by the retract distance // Move away by the retract distance
destination = current_position + retract_mm; destination = current_position + retract_mm;
endstops.enable(false); endstops.enable(false);
prepare_move_to_destination(); prepare_line_to_destination();
planner.synchronize(); planner.synchronize();
REMEMBER(fr, feedrate_mm_s, feedrate_mm_s * 0.25); REMEMBER(fr, feedrate_mm_s, feedrate_mm_s * 0.25);

View file

@ -104,7 +104,7 @@ xyze_pos_t current_position = { X_HOME_POS, Y_HOME_POS, Z_HOME_POS };
/** /**
* Cartesian Destination * Cartesian Destination
* The destination for a move, filled in by G-code movement commands, * The destination for a move, filled in by G-code movement commands,
* and expected by functions like 'prepare_move_to_destination'. * and expected by functions like 'prepare_line_to_destination'.
* G-codes can set destination using 'get_destination_from_command' * G-codes can set destination using 'get_destination_from_command'
*/ */
xyze_pos_t destination; // {0} xyze_pos_t destination; // {0}
@ -340,7 +340,7 @@ void _internal_move_to_destination(const feedRate_t &fr_mm_s/*=0.0f*/
prepare_fast_move_to_destination(); prepare_fast_move_to_destination();
else else
#endif #endif
prepare_move_to_destination(); prepare_line_to_destination();
feedrate_mm_s = old_feedrate; feedrate_mm_s = old_feedrate;
feedrate_percentage = old_pct; feedrate_percentage = old_pct;
@ -660,6 +660,16 @@ void restore_feedrate_and_scaling() {
#endif // HAS_SOFTWARE_ENDSTOPS #endif // HAS_SOFTWARE_ENDSTOPS
#if !UBL_SEGMENTED #if !UBL_SEGMENTED
FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
const millis_t ms = millis();
thermalManager.manage_heater(); // This returns immediately if not really needed.
if (ELAPSED(ms, next_idle_ms)) {
next_idle_ms = ms + 200UL;
idle();
}
}
#if IS_KINEMATIC #if IS_KINEMATIC
#if IS_SCARA #if IS_SCARA
@ -679,7 +689,7 @@ void restore_feedrate_and_scaling() {
/** /**
* Prepare a linear move in a DELTA or SCARA setup. * Prepare a linear move in a DELTA or SCARA setup.
* *
* Called from prepare_move_to_destination as the * Called from prepare_line_to_destination as the
* default Delta/SCARA segmenter. * default Delta/SCARA segmenter.
* *
* This calls planner.buffer_line several times, adding * This calls planner.buffer_line several times, adding
@ -752,17 +762,10 @@ void restore_feedrate_and_scaling() {
xyze_pos_t raw = current_position; xyze_pos_t raw = current_position;
// Calculate and execute the segments // Calculate and execute the segments
millis_t next_idle_ms = millis() + 200UL;
while (--segments) { while (--segments) {
segment_idle(next_idle_ms);
static millis_t next_idle_ms = millis() + 200UL;
thermalManager.manage_heater(); // This returns immediately if not really needed.
if (ELAPSED(millis(), next_idle_ms)) {
next_idle_ms = millis() + 200UL;
idle();
}
raw += segment_distance; raw += segment_distance;
if (!planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, cartesian_segment_mm if (!planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, cartesian_segment_mm
#if ENABLED(SCARA_FEEDRATE_SCALING) #if ENABLED(SCARA_FEEDRATE_SCALING)
, inv_duration , inv_duration
@ -831,13 +834,9 @@ void restore_feedrate_and_scaling() {
xyze_pos_t raw = current_position; xyze_pos_t raw = current_position;
// Calculate and execute the segments // Calculate and execute the segments
millis_t next_idle_ms = millis() + 200UL;
while (--segments) { while (--segments) {
static millis_t next_idle_ms = millis() + 200UL; segment_idle(next_idle_ms);
thermalManager.manage_heater(); // This returns immediately if not really needed.
if (ELAPSED(millis(), next_idle_ms)) {
next_idle_ms = millis() + 200UL;
idle();
}
raw += segment_distance; raw += segment_distance;
if (!planner.buffer_line(raw, fr_mm_s, active_extruder, cartesian_segment_mm if (!planner.buffer_line(raw, fr_mm_s, active_extruder, cartesian_segment_mm
#if ENABLED(SCARA_FEEDRATE_SCALING) #if ENABLED(SCARA_FEEDRATE_SCALING)
@ -866,7 +865,7 @@ void restore_feedrate_and_scaling() {
* *
* Return true if 'current_position' was set to 'destination' * Return true if 'current_position' was set to 'destination'
*/ */
inline bool prepare_move_to_destination_cartesian() { inline bool line_to_destination_cartesian() {
const float scaled_fr_mm_s = MMS_SCALED(feedrate_mm_s); const float scaled_fr_mm_s = MMS_SCALED(feedrate_mm_s);
#if HAS_MESH #if HAS_MESH
if (planner.leveling_active && planner.leveling_active_at_z(destination.z)) { if (planner.leveling_active && planner.leveling_active_at_z(destination.z)) {
@ -1009,7 +1008,7 @@ void restore_feedrate_and_scaling() {
* *
* Before exit, current_position is set to destination. * Before exit, current_position is set to destination.
*/ */
void prepare_move_to_destination() { void prepare_line_to_destination() {
apply_motion_limits(destination); apply_motion_limits(destination);
#if EITHER(PREVENT_COLD_EXTRUSION, PREVENT_LENGTHY_EXTRUDE) #if EITHER(PREVENT_COLD_EXTRUSION, PREVENT_LENGTHY_EXTRUDE)
@ -1059,12 +1058,12 @@ void prepare_move_to_destination() {
#if IS_KINEMATIC // UBL using Kinematic / Cartesian cases as a workaround for now. #if IS_KINEMATIC // UBL using Kinematic / Cartesian cases as a workaround for now.
ubl.line_to_destination_segmented(MMS_SCALED(feedrate_mm_s)) ubl.line_to_destination_segmented(MMS_SCALED(feedrate_mm_s))
#else #else
prepare_move_to_destination_cartesian() line_to_destination_cartesian()
#endif #endif
#elif IS_KINEMATIC #elif IS_KINEMATIC
line_to_destination_kinematic() line_to_destination_kinematic()
#else #else
prepare_move_to_destination_cartesian() line_to_destination_cartesian()
#endif #endif
) return; ) return;

View file

@ -182,7 +182,7 @@ void sync_plan_position_e();
*/ */
void line_to_current_position(const feedRate_t &fr_mm_s=feedrate_mm_s); void line_to_current_position(const feedRate_t &fr_mm_s=feedrate_mm_s);
void prepare_move_to_destination(); void prepare_line_to_destination();
void _internal_move_to_destination(const feedRate_t &fr_mm_s=0.0f void _internal_move_to_destination(const feedRate_t &fr_mm_s=0.0f
#if IS_KINEMATIC #if IS_KINEMATIC