|
@@ -164,24 +164,24 @@
|
164
|
164
|
|
165
|
165
|
#if ENABLED(IMPROVE_HOMING_RELIABILITY)
|
166
|
166
|
|
167
|
|
- slow_homing_t begin_slow_homing() {
|
168
|
|
- slow_homing_t slow_homing{0};
|
169
|
|
- slow_homing.acceleration.set(planner.settings.max_acceleration_mm_per_s2[X_AXIS],
|
|
167
|
+ motion_state_t begin_slow_homing() {
|
|
168
|
+ motion_state_t motion_state{0};
|
|
169
|
+ motion_state.acceleration.set(planner.settings.max_acceleration_mm_per_s2[X_AXIS],
|
170
|
170
|
planner.settings.max_acceleration_mm_per_s2[Y_AXIS]);
|
171
|
171
|
planner.settings.max_acceleration_mm_per_s2[X_AXIS] = 100;
|
172
|
172
|
planner.settings.max_acceleration_mm_per_s2[Y_AXIS] = 100;
|
173
|
173
|
#if HAS_CLASSIC_JERK
|
174
|
|
- slow_homing.jerk_xy = planner.max_jerk;
|
|
174
|
+ motion_state.jerk_state = planner.max_jerk;
|
175
|
175
|
planner.max_jerk.set(0, 0);
|
176
|
176
|
#endif
|
177
|
177
|
planner.reset_acceleration_rates();
|
178
|
|
- return slow_homing;
|
|
178
|
+ return motion_state;
|
179
|
179
|
}
|
180
|
180
|
|
181
|
|
- void end_slow_homing(const slow_homing_t &slow_homing) {
|
182
|
|
- planner.settings.max_acceleration_mm_per_s2[X_AXIS] = slow_homing.acceleration.x;
|
183
|
|
- planner.settings.max_acceleration_mm_per_s2[Y_AXIS] = slow_homing.acceleration.y;
|
184
|
|
- TERN_(HAS_CLASSIC_JERK, planner.max_jerk = slow_homing.jerk_xy);
|
|
181
|
+ void end_slow_homing(const motion_state_t &motion_state) {
|
|
182
|
+ planner.settings.max_acceleration_mm_per_s2[X_AXIS] = motion_state.acceleration.x;
|
|
183
|
+ planner.settings.max_acceleration_mm_per_s2[Y_AXIS] = motion_state.acceleration.y;
|
|
184
|
+ TERN_(HAS_CLASSIC_JERK, planner.max_jerk = motion_state.jerk_state);
|
185
|
185
|
planner.reset_acceleration_rates();
|
186
|
186
|
}
|
187
|
187
|
|
|
@@ -289,7 +289,9 @@ void GcodeSuite::G28() {
|
289
|
289
|
#endif
|
290
|
290
|
#endif
|
291
|
291
|
|
292
|
|
- TERN_(IMPROVE_HOMING_RELIABILITY, slow_homing_t slow_homing = begin_slow_homing());
|
|
292
|
+ #if ENABLED(IMPROVE_HOMING_RELIABILITY)
|
|
293
|
+ motion_state_t saved_motion_state = begin_slow_homing();
|
|
294
|
+ #endif
|
293
|
295
|
|
294
|
296
|
// Always home with tool 0 active
|
295
|
297
|
#if HAS_MULTI_HOTEND
|
|
@@ -315,7 +317,7 @@ void GcodeSuite::G28() {
|
315
|
317
|
|
316
|
318
|
home_delta();
|
317
|
319
|
|
318
|
|
- TERN_(IMPROVE_HOMING_RELIABILITY, end_slow_homing(slow_homing));
|
|
320
|
+ TERN_(IMPROVE_HOMING_RELIABILITY, end_slow_homing(saved_motion_state));
|
319
|
321
|
|
320
|
322
|
#elif ENABLED(AXEL_TPARA)
|
321
|
323
|
|
|
@@ -401,7 +403,7 @@ void GcodeSuite::G28() {
|
401
|
403
|
if (DISABLED(HOME_Y_BEFORE_X) && doY)
|
402
|
404
|
homeaxis(Y_AXIS);
|
403
|
405
|
|
404
|
|
- TERN_(IMPROVE_HOMING_RELIABILITY, end_slow_homing(slow_homing));
|
|
406
|
+ TERN_(IMPROVE_HOMING_RELIABILITY, end_slow_homing(saved_motion_state));
|
405
|
407
|
|
406
|
408
|
// Home Z last if homing towards the bed
|
407
|
409
|
#if HAS_Z_AXIS && DISABLED(HOME_Z_FIRST)
|
|
@@ -440,7 +442,7 @@ void GcodeSuite::G28() {
|
440
|
442
|
|
441
|
443
|
if (idex_is_duplicating()) {
|
442
|
444
|
|
443
|
|
- TERN_(IMPROVE_HOMING_RELIABILITY, slow_homing = begin_slow_homing());
|
|
445
|
+ TERN_(IMPROVE_HOMING_RELIABILITY, saved_motion_state = begin_slow_homing());
|
444
|
446
|
|
445
|
447
|
// Always home the 2nd (right) extruder first
|
446
|
448
|
active_extruder = 1;
|
|
@@ -459,7 +461,7 @@ void GcodeSuite::G28() {
|
459
|
461
|
dual_x_carriage_mode = IDEX_saved_mode;
|
460
|
462
|
set_duplication_enabled(IDEX_saved_duplication_state);
|
461
|
463
|
|
462
|
|
- TERN_(IMPROVE_HOMING_RELIABILITY, end_slow_homing(slow_homing));
|
|
464
|
+ TERN_(IMPROVE_HOMING_RELIABILITY, end_slow_homing(saved_motion_state));
|
463
|
465
|
}
|
464
|
466
|
|
465
|
467
|
#endif // DUAL_X_CARRIAGE
|