|
@@ -104,7 +104,7 @@ xyze_pos_t current_position = { X_HOME_POS, Y_HOME_POS, Z_HOME_POS };
|
104
|
104
|
/**
|
105
|
105
|
* Cartesian Destination
|
106
|
106
|
* The destination for a move, filled in by G-code movement commands,
|
107
|
|
- * and expected by functions like 'prepare_move_to_destination'.
|
|
107
|
+ * and expected by functions like 'prepare_line_to_destination'.
|
108
|
108
|
* G-codes can set destination using 'get_destination_from_command'
|
109
|
109
|
*/
|
110
|
110
|
xyze_pos_t destination; // {0}
|
|
@@ -340,7 +340,7 @@ void _internal_move_to_destination(const feedRate_t &fr_mm_s/*=0.0f*/
|
340
|
340
|
prepare_fast_move_to_destination();
|
341
|
341
|
else
|
342
|
342
|
#endif
|
343
|
|
- prepare_move_to_destination();
|
|
343
|
+ prepare_line_to_destination();
|
344
|
344
|
|
345
|
345
|
feedrate_mm_s = old_feedrate;
|
346
|
346
|
feedrate_percentage = old_pct;
|
|
@@ -660,6 +660,16 @@ void restore_feedrate_and_scaling() {
|
660
|
660
|
#endif // HAS_SOFTWARE_ENDSTOPS
|
661
|
661
|
|
662
|
662
|
#if !UBL_SEGMENTED
|
|
663
|
+
|
|
664
|
+FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
|
|
665
|
+ const millis_t ms = millis();
|
|
666
|
+ thermalManager.manage_heater(); // This returns immediately if not really needed.
|
|
667
|
+ if (ELAPSED(ms, next_idle_ms)) {
|
|
668
|
+ next_idle_ms = ms + 200UL;
|
|
669
|
+ idle();
|
|
670
|
+ }
|
|
671
|
+}
|
|
672
|
+
|
663
|
673
|
#if IS_KINEMATIC
|
664
|
674
|
|
665
|
675
|
#if IS_SCARA
|
|
@@ -679,7 +689,7 @@ void restore_feedrate_and_scaling() {
|
679
|
689
|
/**
|
680
|
690
|
* Prepare a linear move in a DELTA or SCARA setup.
|
681
|
691
|
*
|
682
|
|
- * Called from prepare_move_to_destination as the
|
|
692
|
+ * Called from prepare_line_to_destination as the
|
683
|
693
|
* default Delta/SCARA segmenter.
|
684
|
694
|
*
|
685
|
695
|
* This calls planner.buffer_line several times, adding
|
|
@@ -752,17 +762,10 @@ void restore_feedrate_and_scaling() {
|
752
|
762
|
xyze_pos_t raw = current_position;
|
753
|
763
|
|
754
|
764
|
// Calculate and execute the segments
|
|
765
|
+ millis_t next_idle_ms = millis() + 200UL;
|
755
|
766
|
while (--segments) {
|
756
|
|
-
|
757
|
|
- static millis_t next_idle_ms = millis() + 200UL;
|
758
|
|
- thermalManager.manage_heater(); // This returns immediately if not really needed.
|
759
|
|
- if (ELAPSED(millis(), next_idle_ms)) {
|
760
|
|
- next_idle_ms = millis() + 200UL;
|
761
|
|
- idle();
|
762
|
|
- }
|
763
|
|
-
|
|
767
|
+ segment_idle(next_idle_ms);
|
764
|
768
|
raw += segment_distance;
|
765
|
|
-
|
766
|
769
|
if (!planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, cartesian_segment_mm
|
767
|
770
|
#if ENABLED(SCARA_FEEDRATE_SCALING)
|
768
|
771
|
, inv_duration
|
|
@@ -831,13 +834,9 @@ void restore_feedrate_and_scaling() {
|
831
|
834
|
xyze_pos_t raw = current_position;
|
832
|
835
|
|
833
|
836
|
// Calculate and execute the segments
|
|
837
|
+ millis_t next_idle_ms = millis() + 200UL;
|
834
|
838
|
while (--segments) {
|
835
|
|
- static millis_t next_idle_ms = millis() + 200UL;
|
836
|
|
- thermalManager.manage_heater(); // This returns immediately if not really needed.
|
837
|
|
- if (ELAPSED(millis(), next_idle_ms)) {
|
838
|
|
- next_idle_ms = millis() + 200UL;
|
839
|
|
- idle();
|
840
|
|
- }
|
|
839
|
+ segment_idle(next_idle_ms);
|
841
|
840
|
raw += segment_distance;
|
842
|
841
|
if (!planner.buffer_line(raw, fr_mm_s, active_extruder, cartesian_segment_mm
|
843
|
842
|
#if ENABLED(SCARA_FEEDRATE_SCALING)
|
|
@@ -866,7 +865,7 @@ void restore_feedrate_and_scaling() {
|
866
|
865
|
*
|
867
|
866
|
* Return true if 'current_position' was set to 'destination'
|
868
|
867
|
*/
|
869
|
|
- inline bool prepare_move_to_destination_cartesian() {
|
|
868
|
+ inline bool line_to_destination_cartesian() {
|
870
|
869
|
const float scaled_fr_mm_s = MMS_SCALED(feedrate_mm_s);
|
871
|
870
|
#if HAS_MESH
|
872
|
871
|
if (planner.leveling_active && planner.leveling_active_at_z(destination.z)) {
|
|
@@ -1009,7 +1008,7 @@ void restore_feedrate_and_scaling() {
|
1009
|
1008
|
*
|
1010
|
1009
|
* Before exit, current_position is set to destination.
|
1011
|
1010
|
*/
|
1012
|
|
-void prepare_move_to_destination() {
|
|
1011
|
+void prepare_line_to_destination() {
|
1013
|
1012
|
apply_motion_limits(destination);
|
1014
|
1013
|
|
1015
|
1014
|
#if EITHER(PREVENT_COLD_EXTRUSION, PREVENT_LENGTHY_EXTRUDE)
|
|
@@ -1059,12 +1058,12 @@ void prepare_move_to_destination() {
|
1059
|
1058
|
#if IS_KINEMATIC // UBL using Kinematic / Cartesian cases as a workaround for now.
|
1060
|
1059
|
ubl.line_to_destination_segmented(MMS_SCALED(feedrate_mm_s))
|
1061
|
1060
|
#else
|
1062
|
|
- prepare_move_to_destination_cartesian()
|
|
1061
|
+ line_to_destination_cartesian()
|
1063
|
1062
|
#endif
|
1064
|
1063
|
#elif IS_KINEMATIC
|
1065
|
1064
|
line_to_destination_kinematic()
|
1066
|
1065
|
#else
|
1067
|
|
- prepare_move_to_destination_cartesian()
|
|
1066
|
+ line_to_destination_cartesian()
|
1068
|
1067
|
#endif
|
1069
|
1068
|
) return;
|
1070
|
1069
|
|