Prusa MINI Firmware overview
motion.h
Go to the documentation of this file.
1 /**
2  * Marlin 3D Printer Firmware
3  * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4  *
5  * Based on Sprinter and grbl.
6  * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 #pragma once
23 
24 /**
25  * motion.h
26  *
27  * High-level motion commands to feed the planner
28  * Some of these methods may migrate to the planner class.
29  */
30 
31 #include "../inc/MarlinConfig.h"
32 
33 #if HAS_BED_PROBE
34  #include "probe.h"
35 #endif
36 
37 #if IS_SCARA
38  #include "scara.h"
39 #endif
40 
41 // Axis homed and known-position states
48 
50  return !(
51  #if ENABLED(HOME_AFTER_DEACTIVATE)
53  #else
55  #endif
56  );
57 }
58 
59 // Error margin to work around float imprecision
60 constexpr float slop = 0.0001;
61 
62 extern bool relative_mode;
63 
64 extern xyze_pos_t current_position, // High-level current tool position
65  destination; // Destination for a move
66 
67 // Scratch space for a cartesian result
68 extern xyz_pos_t cartes;
69 
70 // Until kinematics.cpp is created, declare this here
71 #if IS_KINEMATIC
72  extern abc_pos_t delta;
73 #endif
74 
75 #if HAS_ABL_NOT_UBL
76  extern float xy_probe_feedrate_mm_s;
77  #define XY_PROBE_FEEDRATE_MM_S xy_probe_feedrate_mm_s
78 #elif defined(XY_PROBE_SPEED)
79  #define XY_PROBE_FEEDRATE_MM_S MMM_TO_MMS(XY_PROBE_SPEED)
80 #else
81  #define XY_PROBE_FEEDRATE_MM_S PLANNER_XY_FEEDRATE()
82 #endif
83 
84 #if ENABLED(Z_SAFE_HOMING)
85  constexpr xy_float_t safe_homing_xy = { Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT };
86 #endif
87 
88 /**
89  * Feed rates are often configured with mm/m
90  * but the planner and stepper like mm/s units.
91  */
92 extern const feedRate_t homing_feedrate_mm_s[XYZ];
95 
97 
98 /**
99  * Feedrate scaling
100  */
101 extern int16_t feedrate_percentage;
102 
103 // The active extruder (tool). Set with T<extruder> command.
104 #if EXTRUDERS > 1
105  extern uint8_t active_extruder;
106 #else
107  constexpr uint8_t active_extruder = 0;
108 #endif
109 
110 FORCE_INLINE float pgm_read_any(const float *p) { return pgm_read_float(p); }
111 FORCE_INLINE signed char pgm_read_any(const signed char *p) { return pgm_read_byte(p); }
112 
113 #define XYZ_DEFS(T, NAME, OPT) \
114  extern const XYZval<T> NAME##_P; \
115  FORCE_INLINE T NAME(AxisEnum axis) { return pgm_read_any(&NAME##_P[axis]); }
116 
117 XYZ_DEFS(float, base_min_pos, MIN_POS);
118 XYZ_DEFS(float, base_max_pos, MAX_POS);
119 XYZ_DEFS(float, base_home_pos, HOME_POS);
120 XYZ_DEFS(float, max_length, MAX_LENGTH);
121 XYZ_DEFS(float, home_bump_mm, HOME_BUMP_MM);
122 XYZ_DEFS(signed char, home_dir, HOME_DIR);
123 
124 #if HAS_WORKSPACE_OFFSET
125  void update_workspace_offset(const AxisEnum axis);
126 #else
127  #define update_workspace_offset(x) NOOP
128 #endif
129 
130 #if HAS_HOTEND_OFFSET
132  void reset_hotend_offsets();
133 #elif HOTENDS
134  constexpr xyz_pos_t hotend_offset[HOTENDS] = { { 0 } };
135 #else
136  constexpr xyz_pos_t hotend_offset[1] = { { 0 } };
137 #endif
138 
139 typedef struct { xyz_pos_t min, max; } axis_limits_t;
140 #if HAS_SOFTWARE_ENDSTOPS
141  extern bool soft_endstops_enabled;
143  void apply_motion_limits(xyz_pos_t &target);
144  void update_software_endstops(const AxisEnum axis
146  , const uint8_t old_tool_index=0, const uint8_t new_tool_index=0
147  #endif
148  );
149 #else
150  constexpr bool soft_endstops_enabled = false;
151  //constexpr axis_limits_t soft_endstop = {
152  // { X_MIN_POS, Y_MIN_POS, Z_MIN_POS },
153  // { X_MAX_POS, Y_MAX_POS, Z_MAX_POS } };
154  #define apply_motion_limits(V) NOOP
155  #define update_software_endstops(...) NOOP
156 #endif
157 
159 
162 
163 /**
164  * sync_plan_position
165  *
166  * Set the planner/stepper positions directly from current_position with
167  * no kinematic translation. Used for homing axes and cartesian/core syncing.
168  */
169 void sync_plan_position();
170 void sync_plan_position_e();
171 
172 /**
173  * Move the planner to the current position from wherever it last moved
174  * (or from wherever it has been told it is located).
175  */
177 
179 
180 void _internal_move_to_destination(const feedRate_t &fr_mm_s=0.0f
181  #if IS_KINEMATIC
182  , const bool is_fast=false
183  #endif
184 );
185 
186 inline void prepare_internal_move_to_destination(const feedRate_t &fr_mm_s=0.0f) {
188 }
189 
190 #if IS_KINEMATIC
191  void prepare_fast_move_to_destination(const feedRate_t &scaled_fr_mm_s=MMS_SCALED(feedrate_mm_s));
192 
193  inline void prepare_internal_fast_move_to_destination(const feedRate_t &fr_mm_s=0.0f) {
194  _internal_move_to_destination(fr_mm_s, true);
195  }
196 #endif
197 
198 /**
199  * Blocking movement and shorthand functions
200  */
201 void do_blocking_move_to(const float rx, const float ry, const float rz, const feedRate_t &fr_mm_s=0.0f);
202 void do_blocking_move_to(const xy_pos_t &raw, const feedRate_t &fr_mm_s=0.0f);
203 void do_blocking_move_to(const xyz_pos_t &raw, const feedRate_t &fr_mm_s=0.0f);
204 void do_blocking_move_to(const xyze_pos_t &raw, const feedRate_t &fr_mm_s=0.0f);
205 
206 void do_blocking_move_to_x(const float &rx, const feedRate_t &fr_mm_s=0.0f);
207 void do_blocking_move_to_y(const float &ry, const feedRate_t &fr_mm_s=0.0f);
208 void do_blocking_move_to_z(const float &rz, const feedRate_t &fr_mm_s=0.0f);
209 
210 void do_blocking_move_to_xy(const float &rx, const float &ry, const feedRate_t &fr_mm_s=0.0f);
211 void do_blocking_move_to_xy(const xy_pos_t &raw, const feedRate_t &fr_mm_s=0.0f);
212 FORCE_INLINE void do_blocking_move_to_xy(const xyz_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) { do_blocking_move_to_xy(xy_pos_t(raw), fr_mm_s); }
213 FORCE_INLINE void do_blocking_move_to_xy(const xyze_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) { do_blocking_move_to_xy(xy_pos_t(raw), fr_mm_s); }
214 
215 void do_blocking_move_to_xy_z(const xy_pos_t &raw, const float &z, const feedRate_t &fr_mm_s=0.0f);
216 FORCE_INLINE void do_blocking_move_to_xy_z(const xyz_pos_t &raw, const float &z, const feedRate_t &fr_mm_s=0.0f) { do_blocking_move_to_xy_z(xy_pos_t(raw), z, fr_mm_s); }
217 FORCE_INLINE void do_blocking_move_to_xy_z(const xyze_pos_t &raw, const float &z, const feedRate_t &fr_mm_s=0.0f) { do_blocking_move_to_xy_z(xy_pos_t(raw), z, fr_mm_s); }
218 
222 
223 //
224 // Homing
225 //
226 
227 uint8_t axes_need_homing(uint8_t axis_bits=0x07);
228 bool axis_unhomed_error(uint8_t axis_bits=0x07);
229 
230 #if ENABLED(NO_MOTION_BEFORE_HOMING)
231  #define MOTION_CONDITIONS (IsRunning() && !axis_unhomed_error())
232 #else
233  #define MOTION_CONDITIONS IsRunning()
234 #endif
235 
236 void set_axis_is_at_home(const AxisEnum axis);
237 
238 void set_axis_is_not_at_home(const AxisEnum axis);
239 
240 void homeaxis(const AxisEnum axis);
241 
242 /**
243  * Workspace offsets
244  */
245 #if HAS_HOME_OFFSET || HAS_POSITION_SHIFT
246  #if HAS_HOME_OFFSET
247  extern xyz_pos_t home_offset;
248  #endif
249  #if HAS_POSITION_SHIFT
250  extern xyz_pos_t position_shift;
251  #endif
252  #if HAS_HOME_OFFSET && HAS_POSITION_SHIFT
253  extern xyz_pos_t workspace_offset;
254  #define _WS workspace_offset
255  #elif HAS_HOME_OFFSET
256  #define _WS home_offset
257  #else
258  #define _WS position_shift
259  #endif
260  #define NATIVE_TO_LOGICAL(POS, AXIS) ((POS) + _WS[AXIS])
261  #define LOGICAL_TO_NATIVE(POS, AXIS) ((POS) - _WS[AXIS])
262  FORCE_INLINE void toLogical(xy_pos_t &raw) { raw += _WS; }
263  FORCE_INLINE void toLogical(xyz_pos_t &raw) { raw += _WS; }
264  FORCE_INLINE void toLogical(xyze_pos_t &raw) { raw += _WS; }
265  FORCE_INLINE void toNative(xy_pos_t &raw) { raw -= _WS; }
266  FORCE_INLINE void toNative(xyz_pos_t &raw) { raw -= _WS; }
267  FORCE_INLINE void toNative(xyze_pos_t &raw) { raw -= _WS; }
268 #else
269  #define NATIVE_TO_LOGICAL(POS, AXIS) (POS)
270  #define LOGICAL_TO_NATIVE(POS, AXIS) (POS)
277 #endif
278 #define LOGICAL_X_POSITION(POS) NATIVE_TO_LOGICAL(POS, X_AXIS)
279 #define LOGICAL_Y_POSITION(POS) NATIVE_TO_LOGICAL(POS, Y_AXIS)
280 #define LOGICAL_Z_POSITION(POS) NATIVE_TO_LOGICAL(POS, Z_AXIS)
281 #define RAW_X_POSITION(POS) LOGICAL_TO_NATIVE(POS, X_AXIS)
282 #define RAW_Y_POSITION(POS) LOGICAL_TO_NATIVE(POS, Y_AXIS)
283 #define RAW_Z_POSITION(POS) LOGICAL_TO_NATIVE(POS, Z_AXIS)
284 
285 /**
286  * position_is_reachable family of functions
287  */
288 
289 #if IS_KINEMATIC // (DELTA or SCARA)
290  #if HAS_SCARA_OFFSET
291  extern abc_pos_t scara_home_offset; // A and B angular offsets, Z mm offset
292  #endif
293 
294  // Return true if the given point is within the printable area
295  inline bool position_is_reachable(const float &rx, const float &ry, const float inset=0) {
296  #if ENABLED(DELTA)
297  return HYPOT2(rx, ry) <= sq(DELTA_PRINTABLE_RADIUS - inset);
298  #elif IS_SCARA
299  const float R2 = HYPOT2(rx - SCARA_OFFSET_X, ry - SCARA_OFFSET_Y);
300  return (
301  R2 <= sq(L1 + L2) - inset
302  #if MIDDLE_DEAD_ZONE_R > 0
303  && R2 >= sq(float(MIDDLE_DEAD_ZONE_R))
304  #endif
305  );
306  #endif
307  }
308 
309  inline bool position_is_reachable(const xy_pos_t &pos, const float inset=0) {
310  return position_is_reachable(pos.x, pos.y, inset);
311  }
312 
313  #if HAS_BED_PROBE
314  // Return true if the both nozzle and the probe can reach the given point.
315  // Note: This won't work on SCARA since the probe offset rotates with the arm.
316  inline bool position_is_reachable_by_probe(const float &rx, const float &ry) {
319  }
320  #endif
321 
322 #else // CARTESIAN
323 
324  // Return true if the given position is within the machine bounds.
325  inline bool position_is_reachable(const float &rx, const float &ry) {
326  if (!WITHIN(ry, Y_MIN_POS - slop, Y_MAX_POS + slop)) return false;
327  #if ENABLED(DUAL_X_CARRIAGE)
328  if (active_extruder)
329  return WITHIN(rx, X2_MIN_POS - slop, X2_MAX_POS + slop);
330  else
331  return WITHIN(rx, X1_MIN_POS - slop, X1_MAX_POS + slop);
332  #else
333  return WITHIN(rx, X_MIN_POS - slop, X_MAX_POS + slop);
334  #endif
335  }
336  inline bool position_is_reachable(const xy_pos_t &pos) { return position_is_reachable(pos.x, pos.y); }
337 
338  #if HAS_BED_PROBE
339  /**
340  * Return whether the given position is within the bed, and whether the nozzle
341  * can reach the position required to put the probe at the given position.
342  *
343  * Example: For a probe offset of -10,+10, then for the probe to reach 0,0 the
344  * nozzle must be be able to reach +10,-10.
345  */
346  inline bool position_is_reachable_by_probe(const float &rx, const float &ry) {
348  && WITHIN(rx, probe_min_x() - slop, probe_max_x() + slop)
349  && WITHIN(ry, probe_min_y() - slop, probe_max_y() + slop);
350  }
351  #endif
352 
353 #endif // CARTESIAN
354 
355 #if !HAS_BED_PROBE
356  FORCE_INLINE bool position_is_reachable_by_probe(const float &rx, const float &ry) { return position_is_reachable(rx, ry); }
357 #endif
360 
361 /**
362  * Duplication mode
363  */
364 #if HAS_DUPLICATION_MODE
365  extern bool extruder_duplication_enabled, // Used in Dual X mode 2
366  mirrored_duplication_mode; // Used in Dual X mode 3
367  #if ENABLED(MULTI_NOZZLE_DUPLICATION)
368  extern uint8_t duplication_e_mask;
369  #endif
370 #endif
371 
372 /**
373  * Dual X Carriage
374  */
375 #if ENABLED(DUAL_X_CARRIAGE)
376 
377  enum DualXMode : char {
378  DXC_FULL_CONTROL_MODE,
379  DXC_AUTO_PARK_MODE,
380  DXC_DUPLICATION_MODE,
381  DXC_MIRRORED_MODE
382  };
383 
384  extern DualXMode dual_x_carriage_mode;
385  extern float inactive_extruder_x_pos, // Used in mode 0 & 1
386  duplicate_extruder_x_offset; // Used in mode 2 & 3
387  extern xyz_pos_t raised_parked_position; // Used in mode 1
388  extern bool active_extruder_parked; // Used in mode 1, 2 & 3
389  extern millis_t delayed_move_time; // Used in mode 1
390  extern int16_t duplicate_extruder_temp_offset; // Used in mode 2 & 3
391 
392  FORCE_INLINE bool dxc_is_duplicating() { return dual_x_carriage_mode >= DXC_DUPLICATION_MODE; }
393 
394  float x_home_pos(const int extruder);
395 
396  FORCE_INLINE int x_home_dir(const uint8_t extruder) { return extruder ? X2_HOME_DIR : X_HOME_DIR; }
397 
398 #elif ENABLED(MULTI_NOZZLE_DUPLICATION)
399 
400  enum DualXMode : char {
401  DXC_DUPLICATION_MODE = 2
402  };
403 
404 #endif
405 
406 #if HAS_M206_COMMAND
407  void set_home_offset(const AxisEnum axis, const float v);
408 #endif
delta_clip_start_height
float delta_clip_start_height
planner.h
WITHIN
#define WITHIN(N, L, H)
Definition: macros.h:195
XYZval::z
T z
Definition: types.h:286
Planner::set_machine_position_mm
static void set_machine_position_mm(const float &a, const float &b, const float &c, const float &e)
Definition: planner.cpp:2721
GET_TEXT
#define GET_TEXT(MSG)
Definition: multi_language.h:72
do_blocking_move_to
void do_blocking_move_to(const float rx, const float ry, const float rz, const feedRate_t &fr_mm_s=0.0f)
Definition: motion.cpp:344
Temperature::tooColdToExtrude
static FORCE_INLINE bool tooColdToExtrude(const uint8_t)
Definition: temperature.h:314
bilinear_line_to_destination
void bilinear_line_to_destination(const feedRate_t &scaled_fr_mm_s, uint16_t x_splits=0xFFFF, uint16_t y_splits=0xFFFF)
Y_MIN_POS
#define Y_MIN_POS
Definition: Configuration_A3ides_2209_MINI.h:985
endstops.h
delta_segments_per_second
float delta_segments_per_second
NOLESS
#define NOLESS(v, n)
Definition: macros.h:127
HOMING_Z_WITH_PROBE
#define HOMING_Z_WITH_PROBE
Definition: Conditionals_LCD.h:505
XYZEval
Definition: types.h:101
Stepper::report_positions
static void report_positions()
Definition: stepper.cpp:2276
sq
#define sq(x)
Definition: wiring_constants.h:83
XYZEval::z
T z
Definition: types.h:383
Planner::synchronize
static void synchronize()
Definition: planner.cpp:1556
temperature.h
mbl
mesh_bed_leveling mbl
report_current_position
void report_current_position()
Definition: motion.cpp:199
axis_limits_t::max
xyz_pos_t max
Definition: motion.h:139
L1
constexpr float L1
Definition: scara.h:33
scara.h
extruder_duplication_enabled
bool extruder_duplication_enabled
Definition: motion.cpp:876
mixer
Mixer mixer
XYZval::x
T x
Definition: types.h:286
DEPLOY_PROBE
#define DEPLOY_PROBE()
Definition: probe.h:60
axis_limits_t::min
xyz_pos_t min
Definition: motion.h:139
axis_limits_t
Definition: motion.h:139
stepper.h
planner_settings_t::max_feedrate_mm_s
feedRate_t max_feedrate_mm_s[XYZE_N]
Definition: planner.h:182
MSG_ERR_COLD_EXTRUDE_STOP
#define MSG_ERR_COLD_EXTRUDE_STOP
Definition: language.h:242
probe_offset
constexpr xyz_pos_t probe_offset
Definition: probe.h:58
XYZEval::magnitude
FI T magnitude() const
Definition: types.h:388
prepare_move_to_destination
void prepare_move_to_destination()
Definition: motion.cpp:984
Z_PROBE_SPEED_FAST
#define Z_PROBE_SPEED_FAST
Definition: Configuration_A3ides_2209_MINI.h:868
feedrate_mm_s
feedRate_t feedrate_mm_s
Definition: motion.cpp:138
Z_MIN_POS
#define Z_MIN_POS
Definition: Configuration_A3ides_2209_MINI.h:986
X_AXIS
Definition: types.h:37
RECIPROCAL
#define RECIPROCAL(x)
Definition: macros.h:273
update_software_endstops
void update_software_endstops(const AxisEnum axis)
Definition: motion.cpp:503
DEBUG_ECHOLNPGM
#define DEBUG_ECHOLNPGM(...)
Definition: debug_out.h:79
toNative
FORCE_INLINE void toNative(xy_pos_t &)
Definition: motion.h:274
XYZEval::asLogical
FI XYZEval< float > asLogical() const
Definition: types.h:410
soft_endstops_enabled
bool soft_endstops_enabled
Definition: motion.cpp:486
DEBUG_XYZ
#define DEBUG_XYZ(...)
Definition: debug_out.h:88
UNEAR_ZERO
#define UNEAR_ZERO(x)
Definition: macros.h:269
stepper
Stepper stepper
Definition: stepper.cpp:82
remember_feedrate_scaling_off
void remember_feedrate_scaling_off()
Definition: motion.cpp:475
Planner::buffer_segment
static bool buffer_segment(const float &a, const float &b, const float &c, const float &e, const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0)
Definition: planner.cpp:2568
_MAX
#define _MAX(V...)
Definition: macros.h:346
Planner::get_axis_position_mm
static float get_axis_position_mm(const AxisEnum axis)
Definition: planner.cpp:1526
do_blocking_move_to_z
void do_blocking_move_to_z(const float &rz, const feedRate_t &fr_mm_s)
Definition: motion.cpp:450
Planner::leveling_active
static bool leveling_active
Definition: planner.h:276
axis_homed
uint8_t axis_homed
Definition: motion.cpp:91
SERIAL_ECHOPAIR
#define SERIAL_ECHOPAIR(V...)
Definition: serial.h:114
MIN_STEPS_PER_SEGMENT
#define MIN_STEPS_PER_SEGMENT
Definition: Configuration_A3ides_2209_MINI_adv.h:1108
do_blocking_move_to_xy_z
void do_blocking_move_to_xy_z(const xy_pos_t &raw, const float &z, const feedRate_t &fr_mm_s)
Definition: motion.cpp:461
UBL_SEGMENTED
#define UBL_SEGMENTED
Definition: Conditionals_post.h:1403
do_blocking_move_to_xy
void do_blocking_move_to_xy(const float &rx, const float &ry, const feedRate_t &fr_mm_s)
Definition: motion.cpp:454
HOMED_FLAGS
#define HOMED_FLAGS
sync_plan_position_e
void sync_plan_position_e()
Definition: motion.cpp:221
Z_HOME_DIR
#define Z_HOME_DIR
Definition: Configuration_A3ides_2209_MINI.h:975
C_AXIS
Definition: types.h:39
Endstops::validate_homing_move
static FORCE_INLINE void validate_homing_move()
Definition: endstops.h:144
Stepper::set_z2_lock
static FORCE_INLINE void set_z2_lock(const bool state)
Definition: stepper.h:422
PGM_P
#define PGM_P
Definition: pgmspace.h:30
XYZEval::e
T e
Definition: types.h:383
set_axis_is_at_home
void set_axis_is_at_home(const AxisEnum axis)
Definition: motion.cpp:1361
I2CPEM
I2CPositionEncodersMgr I2CPEM
HYPOT2
#define HYPOT2(x, y)
Definition: macros.h:100
babystep
Babystep babystep
_MIN
#define _MIN(V...)
Definition: macros.h:333
max
#define max(a, b)
Definition: wiring_constants.h:40
AxisEnum
AxisEnum
Definition: types.h:36
saved_feedrate_mm_s
static float saved_feedrate_mm_s
Definition: motion.cpp:469
unified_bed_leveling::line_to_destination_cartesian
static void line_to_destination_cartesian(const feedRate_t &scaled_fr_mm_s, const uint8_t e)
millis
uint32_t millis(void)
Definition: wiring_time.c:29
get_homing_bump_feedrate
feedRate_t get_homing_bump_feedrate(const AxisEnum axis)
Definition: motion.cpp:1076
Temperature::manage_heater
static void manage_heater() _O2
Definition: temperature.cpp:975
forward_kinematics_SCARA
void forward_kinematics_SCARA(const float &a, const float &b)
xy_pos_t
xy_float_t xy_pos_t
Definition: types.h:159
soft_endstop
axis_limits_t soft_endstop
Definition: motion.cpp:489
PLANNER_XY_FEEDRATE
#define PLANNER_XY_FEEDRATE()
Definition: planner.h:969
DEBUG_ECHOLNPAIR
#define DEBUG_ECHOLNPAIR(...)
Definition: debug_out.h:82
IS_KINEMATIC
#define IS_KINEMATIC
Definition: Conditionals_LCD.h:545
SERIAL_ECHO_START
#define SERIAL_ECHO_START()
Definition: serial.h:179
motion.h
SERIAL_ECHOLN
#define SERIAL_ECHOLN(x)
Definition: serial.h:72
I2CPositionEncodersMgr::unhomed
static void unhomed(const AxisEnum axis)
Definition: I2CPositionEncoder.h:230
do_blocking_move_to_x
void do_blocking_move_to_x(const float &rx, const feedRate_t &fr_mm_s=0.0f)
Definition: motion.cpp:444
remember_feedrate_and_scaling
void remember_feedrate_and_scaling()
Definition: motion.cpp:471
delta_height
float delta_height
feedRate_t
float feedRate_t
Definition: types.h:80
sprintf_P
#define sprintf_P(s,...)
Definition: pgmspace.h:72
XYZval::set
FI void set(const T px)
Definition: types.h:290
update_workspace_offset
#define update_workspace_offset(x)
Definition: motion.h:127
soft_endstops_enabled
bool soft_endstops_enabled
Definition: motion.cpp:486
extruder_duplication_enabled
bool extruder_duplication_enabled
Definition: motion.cpp:876
strlen_P
#define strlen_P(s)
Definition: pgmspace.h:61
delta_endstop_adj
abc_float_t delta_endstop_adj
F
#define F(str)
Definition: UHS_macros.h:164
XYZ
#define XYZ
Definition: macros.h:27
homing_needed
FORCE_INLINE bool homing_needed()
Definition: motion.h:49
Planner::unapply_modifiers
static FORCE_INLINE void unapply_modifiers(xyze_pos_t &pos, bool leveling=false)
Definition: planner.h:520
set_all_unknown
FORCE_INLINE void set_all_unknown()
Definition: motion.h:47
BLTouch::deploy
static FORCE_INLINE bool deploy()
Definition: bltouch.h:72
prepare_move_to_destination_cartesian
bool prepare_move_to_destination_cartesian()
Definition: motion.cpp:841
_internal_move_to_destination
void _internal_move_to_destination(const feedRate_t &fr_mm_s)
Definition: motion.cpp:311
X_MIN_POS
#define X_MIN_POS
Definition: Configuration_A3ides_2209_MINI.h:984
NOMORE
#define NOMORE(v, n)
Definition: macros.h:133
destination
xyze_pos_t destination
Definition: motion.cpp:110
Z_MAX_POS
#define Z_MAX_POS
Definition: Configuration_A3ides_2209_MINI.h:989
MIN_PROBE_EDGE
#define MIN_PROBE_EDGE
Definition: Configuration_A3ides_2209_MINI.h:862
ABS
#define ABS(a)
Definition: macros.h:266
Z_PROBE_SPEED_SLOW
#define Z_PROBE_SPEED_SLOW
Definition: Configuration_A3ides_2209_MINI.h:871
all_axes_known
FORCE_INLINE bool all_axes_known()
Definition: motion.h:45
pgm_read_byte
#define pgm_read_byte(addr)
Definition: pgmspace.h:95
homing_feedrate_mm_s
const feedRate_t homing_feedrate_mm_s[XYZ]
bltouch
BLTouch bltouch
prepare_internal_move_to_destination
void prepare_internal_move_to_destination(const feedRate_t &fr_mm_s=0.0f)
Definition: motion.h:186
FORCE_INLINE
#define FORCE_INLINE
Definition: macros.h:40
Y_MAX_POS
#define Y_MAX_POS
Definition: Configuration_A3ides_2209_MINI.h:988
SERIAL_ECHO_MSG
#define SERIAL_ECHO_MSG(S)
Definition: serial.h:183
current_position
xyze_pos_t current_position
Definition: motion.cpp:102
feedrate_percentage
int16_t feedrate_percentage
Definition: motion.cpp:139
position_is_reachable
bool position_is_reachable(const float &rx, const float &ry)
Definition: motion.h:325
Z_CLEARANCE_BETWEEN_PROBES
#define Z_CLEARANCE_BETWEEN_PROBES
Definition: Configuration_A3ides_2209_MINI.h:893
Planner::leveling_active_at_z
static FORCE_INLINE bool leveling_active_at_z(const float &)
Definition: planner.h:447
HAS_LEVELING
#define HAS_LEVELING
Definition: Conditionals_post.h:1408
remember_feedrate_and_scaling
void remember_feedrate_and_scaling()
Definition: motion.cpp:471
PROGMEM
const feedRate_t homing_feedrate_mm_s[XYZ] PROGMEM
Definition: motion.cpp:142
set_axis_is_not_at_home
void set_axis_is_not_at_home(const AxisEnum axis)
Definition: motion.cpp:1425
line_to_current_position
void line_to_current_position(const feedRate_t &fr_mm_s)
Definition: motion.cpp:285
set_current_from_steppers_for_axis
void set_current_from_steppers_for_axis(const AxisEnum axis)
Definition: motion.cpp:263
X_HOME_POS
#define X_HOME_POS
Definition: Conditionals_post.h:156
do_blocking_move_to
void do_blocking_move_to(const float rx, const float ry, const float rz, const feedRate_t &fr_mm_s)
Definition: motion.cpp:344
cartes
xyz_pos_t cartes
Definition: motion.cpp:152
scara_set_axis_is_at_home
void scara_set_axis_is_at_home(const AxisEnum axis)
Stepper::set_directions
static void set_directions()
Definition: stepper.cpp:354
sync_plan_position
void sync_plan_position()
Definition: motion.cpp:216
LOOP_XYZ
#define LOOP_XYZ(VAR)
Definition: types.h:60
REMEMBER
#define REMEMBER(N, X, V...)
Definition: utility.h:76
Y_HOME_POS
#define Y_HOME_POS
Definition: Conditionals_post.h:172
DISABLED
#define DISABLED(V...)
Definition: macros.h:178
sync_plan_position_e
void sync_plan_position_e()
Definition: motion.cpp:221
position_is_reachable_by_probe
FORCE_INLINE bool position_is_reachable_by_probe(const xy_int_t &pos)
Definition: motion.h:358
XYZ_CONSTS
#define XYZ_CONSTS(T, NAME, OPT)
Definition: motion.cpp:73
void
void
Definition: png.h:1083
probe_min_x
float probe_min_x()
Definition: probe.h:103
delta_safe_distance_from_top
float delta_safe_distance_from_top()
XY_PROBE_SPEED
#define XY_PROBE_SPEED
Definition: Configuration_A3ides_2209_MINI.h:865
Mixer::refresh_collector
static void refresh_collector(const float proportion=1.0, const uint8_t t=selected_vtool, float(&c)[MIXING_STEPPERS]=collector)
XYZEval::x
T x
Definition: types.h:383
ALL_AXES
Definition: types.h:48
current_position
xyze_pos_t current_position
Definition: motion.cpp:102
pgm_read_float
#define pgm_read_float(addr)
Definition: pgmspace.h:109
XY_PROBE_FEEDRATE_MM_S
#define XY_PROBE_FEEDRATE_MM_S
Definition: motion.h:77
Planner::buffer_line
static bool buffer_line(const float &rx, const float &ry, const float &rz, const float &e, const feedRate_t &fr_mm_s, const uint8_t extruder, const float millimeters=0.0)
Definition: planner.cpp:2663
feedrate_mm_s
feedRate_t feedrate_mm_s
Definition: motion.cpp:138
HOMING_FEEDRATE_Z
#define HOMING_FEEDRATE_Z
Definition: Configuration_A3ides_2209_MINI.h:1269
CAN_HOME_X
#define CAN_HOME_X
line_to_current_position
void line_to_current_position(const feedRate_t &fr_mm_s=feedrate_mm_s)
Definition: motion.cpp:285
do_blocking_move_to_xy
void do_blocking_move_to_xy(const float &rx, const float &ry, const feedRate_t &fr_mm_s=0.0f)
Definition: motion.cpp:454
SERIAL_ECHOLNPAIR
#define SERIAL_ECHOLNPAIR(V...)
Definition: serial.h:144
get_homing_bump_feedrate
feedRate_t get_homing_bump_feedrate(const AxisEnum axis)
Definition: motion.cpp:1076
XYval
Definition: types.h:99
createSpeedLookupTable.a
list a
Definition: createSpeedLookupTable.py:29
relative_mode
bool relative_mode
Definition: motion.cpp:94
HOTEND_LOOP
#define HOTEND_LOOP()
Definition: Conditionals_LCD.h:436
scara_report_positions
void scara_report_positions()
probe_max_x
float probe_max_x()
Definition: probe.h:104
Z_HOME_BUMP_MM
#define Z_HOME_BUMP_MM
Definition: Configuration_A3ides_2209_MINI_adv.h:457
Stepper::set_separate_multi_axis
static FORCE_INLINE void set_separate_multi_axis(const bool state)
Definition: stepper.h:410
axis_known_position
uint8_t axis_known_position
Definition: motion.cpp:91
XYZEval::set
FI void set(const T px)
Definition: types.h:391
SQRT
#define SQRT(x)
Definition: macros.h:281
XYval::x
T x
Definition: types.h:185
MIXER_STEPPER_LOOP
#define MIXER_STEPPER_LOOP(VAR)
Definition: mixing.h:68
DEBUG_POS
#define DEBUG_POS(...)
Definition: debug_out.h:87
ELAPSED
#define ELAPSED(NOW, SOON)
Definition: millis_t.h:29
do_homing_move
void do_homing_move(const AxisEnum axis, const float distance, const feedRate_t fr_mm_s=0.0)
Definition: motion.cpp:1232
Endstops::z2_endstop_adj
static float z2_endstop_adj
Definition: endstops.h:51
get_cartesian_from_steppers
void get_cartesian_from_steppers()
Definition: motion.cpp:232
probe_min_y
float probe_min_y()
Definition: probe.h:105
uint8_t
const uint8_t[]
Definition: 404_html.c:3
mirrored_duplication_mode
bool mirrored_duplication_mode
Definition: motion.cpp:876
xy_probe_feedrate_mm_s
float xy_probe_feedrate_mm_s
Definition: motion.cpp:193
axis_unhomed_error
bool axis_unhomed_error(uint8_t axis_bits)
Definition: motion.cpp:1054
ui
MarlinUI ui
update_software_endstops
void update_software_endstops(const AxisEnum axis)
Definition: motion.cpp:503
_BV
#define _BV(bit)
Definition: wiring_constants.h:99
DEBUG_ECHO
#define DEBUG_ECHO(...)
Definition: debug_out.h:75
XYZval::y
T y
Definition: types.h:286
Planner::steps_to_mm
static float steps_to_mm[XYZE_N]
Definition: planner.h:254
restore_feedrate_and_scaling
void restore_feedrate_and_scaling()
Definition: motion.cpp:479
axis_unhomed_error
bool axis_unhomed_error(uint8_t axis_bits=0x07)
Definition: motion.cpp:1054
destination
xyze_pos_t destination
Definition: motion.cpp:110
do_blocking_move_to_x
void do_blocking_move_to_x(const float &rx, const feedRate_t &fr_mm_s)
Definition: motion.cpp:444
homeaxis
void homeaxis(const AxisEnum axis)
Definition: motion.cpp:1449
restore_feedrate_and_scaling
void restore_feedrate_and_scaling()
Definition: motion.cpp:479
homing_feedrate
FORCE_INLINE feedRate_t homing_feedrate(const AxisEnum a)
Definition: motion.h:93
X_MAX_POS
#define X_MAX_POS
Definition: Configuration_A3ides_2209_MINI.h:987
Y_AXIS
Definition: types.h:38
CBI
#define CBI(A, B)
Definition: macros.h:89
HAS_HOTEND_OFFSET
#define HAS_HOTEND_OFFSET
Definition: Conditionals_LCD.h:441
xyz_bits
constexpr uint8_t xyz_bits
Definition: motion.h:43
hotend_offset
constexpr xyz_pos_t hotend_offset[1]
Definition: motion.h:136
Planner::set_e_position_mm
static void set_e_position_mm(const float &e)
Definition: planner.cpp:2764
ubl
unified_bed_leveling ubl
MSG_ERR_LONG_EXTRUDE_STOP
#define MSG_ERR_LONG_EXTRUDE_STOP
Definition: language.h:243
prepare_move_to_destination
void prepare_move_to_destination()
Definition: motion.cpp:984
apply_motion_limits
void apply_motion_limits(xyz_pos_t &target)
Definition: motion.cpp:589
do_blocking_move_to_z
void do_blocking_move_to_z(const float &rz, const feedRate_t &fr_mm_s=0.0f)
Definition: motion.cpp:450
set_axis_is_at_home
void set_axis_is_at_home(const AxisEnum axis)
Definition: motion.cpp:1361
cartes
xyz_pos_t cartes
Definition: motion.cpp:152
Z_AXIS
Definition: types.h:39
apply_motion_limits
void apply_motion_limits(xyz_pos_t &target)
Definition: motion.cpp:589
DEBUGGING
#define DEBUGGING(F)
Definition: serial.h:47
do_blocking_move_to_y
void do_blocking_move_to_y(const float &ry, const feedRate_t &fr_mm_s=0.0f)
Definition: motion.cpp:447
report_current_position
void report_current_position()
Definition: motion.cpp:199
R2
unsigned R2
Definition: masstorage.h:306
A_AXIS
Definition: types.h:37
axes_need_homing
uint8_t axes_need_homing(uint8_t axis_bits=0x07)
Definition: motion.cpp:1041
feedrate_percentage
int16_t feedrate_percentage
Definition: motion.cpp:139
axes_need_homing
uint8_t axes_need_homing(uint8_t axis_bits)
Definition: motion.cpp:1041
STOW_PROBE
#define STOW_PROBE()
Definition: probe.h:61
DEBUG_ECHOPAIR
#define DEBUG_ECHOPAIR(...)
Definition: debug_out.h:80
TEST
#define TEST(n, b)
Definition: macros.h:81
MMM_TO_MMS
#define MMM_TO_MMS(MM_M)
Definition: types.h:83
sync_plan_position
void sync_plan_position()
Definition: motion.cpp:216
I2CPositionEncodersMgr::homed
static void homed(const AxisEnum axis)
Definition: I2CPositionEncoder.h:225
XYval::y
T y
Definition: types.h:185
HOTENDS
#define HOTENDS
Definition: Conditionals_LCD.h:425
do_blocking_move_to_xy_z
void do_blocking_move_to_xy_z(const xy_pos_t &raw, const float &z, const feedRate_t &fr_mm_s=0.0f)
Definition: motion.cpp:461
HOMING_FEEDRATE_XY
#define HOMING_FEEDRATE_XY
Definition: Configuration_A3ides_2209_MINI.h:1268
HOMING_BUMP_DIVISOR
#define HOMING_BUMP_DIVISOR
Definition: Configuration_A3ides_2209_MINI_adv.h:458
forward_kinematics_DELTA
void forward_kinematics_DELTA(const float &z1, const float &z2, const float &z3)
XYZval< float >
pgm_read_any
FORCE_INLINE float pgm_read_any(const float *p)
Definition: motion.h:110
slop
constexpr float slop
Definition: motion.h:60
E_AXIS
Definition: types.h:40
CAN_HOME_Z
#define CAN_HOME_Z
homeaxis
void homeaxis(const AxisEnum axis)
Definition: motion.cpp:1449
relative_mode
bool relative_mode
Definition: motion.cpp:94
mirrored_duplication_mode
bool mirrored_duplication_mode
Definition: motion.cpp:876
serialprintPGM
void serialprintPGM(PGM_P str)
Definition: serial.cpp:35
B_AXIS
Definition: types.h:38
SBI
#define SBI(A, B)
Definition: macros.h:85
axis_codes
const xyze_char_t axis_codes
Definition: types.h:486
Planner::settings
static planner_settings_t settings
Definition: planner.h:251
axis_homed
uint8_t axis_homed
Definition: motion.cpp:91
_internal_move_to_destination
void _internal_move_to_destination(const feedRate_t &fr_mm_s=0.0f)
Definition: motion.cpp:311
Planner::set_position_mm
static void set_position_mm(const float &rx, const float &ry, const float &rz, const float &e)
Definition: planner.cpp:2741
axis_known_position
uint8_t axis_known_position
Definition: motion.cpp:91
remember_feedrate_scaling_off
void remember_feedrate_scaling_off()
Definition: motion.cpp:475
X_HOME_DIR
#define X_HOME_DIR
Definition: Configuration_A3ides_2209_MINI.h:973
MMS_SCALED
#define MMS_SCALED(V)
Definition: types.h:85
idle
void idle()
Definition: Marlin.cpp:629
get_cartesian_from_steppers
void get_cartesian_from_steppers()
Definition: motion.cpp:232
soft_endstop
axis_limits_t soft_endstop
Definition: motion.cpp:489
toLogical
FORCE_INLINE void toLogical(xy_pos_t &)
Definition: motion.h:271
probe.h
Z_HOME_POS
#define Z_HOME_POS
Definition: Conditionals_post.h:179
xy_probe_feedrate_mm_s
float xy_probe_feedrate_mm_s
Definition: motion.cpp:193
thermalManager
Temperature thermalManager
Definition: temperature.cpp:89
endstops
Endstops endstops
Definition: endstops.cpp:51
millis_t
uint32_t millis_t
Definition: millis_t.h:26
set_axis_is_not_at_home
void set_axis_is_not_at_home(const AxisEnum axis)
Definition: motion.cpp:1425
CAN_HOME_Y
#define CAN_HOME_Y
L2
constexpr float L2
Definition: scara.h:33
Mixer::get_current_vtool
static FORCE_INLINE uint8_t get_current_vtool()
Definition: mixing.h:111
do_blocking_move_to_y
void do_blocking_move_to_y(const float &ry, const feedRate_t &fr_mm_s)
Definition: motion.cpp:447
BUZZ
#define BUZZ(d, f)
Definition: buzzer.h:126
mesh_bed_leveling::line_to_destination
static void line_to_destination(const feedRate_t &scaled_fr_mm_s, uint8_t x_splits=0xFF, uint8_t y_splits=0xFF)
active_extruder
constexpr uint8_t active_extruder
Definition: motion.h:107
XYZ_DEFS
#define XYZ_DEFS(T, NAME, OPT)
Definition: motion.h:113
Stepper::set_z_lock
static FORCE_INLINE void set_z_lock(const bool state)
Definition: stepper.h:421
ENABLED
#define ENABLED(V...)
Definition: macros.h:177
planner
Planner planner
Definition: planner.cpp:111
all_axes_homed
FORCE_INLINE bool all_axes_homed()
Definition: motion.h:44
XYZEval::y
T y
Definition: types.h:383
saved_feedrate_percentage
static int16_t saved_feedrate_percentage
Definition: motion.cpp:470
probe_max_y
float probe_max_y()
Definition: probe.h:106
BLTouch::stow
static FORCE_INLINE bool stow()
Definition: bltouch.h:73
set_all_unhomed
FORCE_INLINE void set_all_unhomed()
Definition: motion.h:46
EXTRUDE_MAXLENGTH
#define EXTRUDE_MAXLENGTH
Definition: Configuration_A3ides_2209_MINI.h:524
set_current_from_steppers_for_axis
void set_current_from_steppers_for_axis(const AxisEnum axis)
Definition: motion.cpp:263