|
@@ -162,6 +162,33 @@
|
162
|
162
|
|
163
|
163
|
#endif // Z_SAFE_HOMING
|
164
|
164
|
|
|
165
|
+#if ENABLED(IMPROVE_HOMING_RELIABILITY)
|
|
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],
|
|
170
|
+ planner.settings.max_acceleration_mm_per_s2[Y_AXIS]);
|
|
171
|
+ planner.settings.max_acceleration_mm_per_s2[X_AXIS] = 100;
|
|
172
|
+ planner.settings.max_acceleration_mm_per_s2[Y_AXIS] = 100;
|
|
173
|
+ #if HAS_CLASSIC_JERK
|
|
174
|
+ slow_homing.jerk_xy = planner.max_jerk;
|
|
175
|
+ planner.max_jerk.set(0, 0);
|
|
176
|
+ #endif
|
|
177
|
+ planner.reset_acceleration_rates();
|
|
178
|
+ return slow_homing;
|
|
179
|
+ }
|
|
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
|
+ #if HAS_CLASSIC_JERK
|
|
185
|
+ planner.max_jerk = slow_homing.jerk_xy;
|
|
186
|
+ #endif
|
|
187
|
+ planner.reset_acceleration_rates();
|
|
188
|
+ }
|
|
189
|
+
|
|
190
|
+#endif // IMPROVE_HOMING_RELIABILITY
|
|
191
|
+
|
165
|
192
|
/**
|
166
|
193
|
* G28: Home all axes according to settings
|
167
|
194
|
*
|
|
@@ -230,17 +257,7 @@ void GcodeSuite::G28(const bool always_home_all) {
|
230
|
257
|
#endif
|
231
|
258
|
|
232
|
259
|
#if ENABLED(IMPROVE_HOMING_RELIABILITY)
|
233
|
|
- slow_homing_t slow_homing{0};
|
234
|
|
- slow_homing.acceleration.set(planner.settings.max_acceleration_mm_per_s2[X_AXIS],
|
235
|
|
- planner.settings.max_acceleration_mm_per_s2[Y_AXIS]);
|
236
|
|
- planner.settings.max_acceleration_mm_per_s2[X_AXIS] = 100;
|
237
|
|
- planner.settings.max_acceleration_mm_per_s2[Y_AXIS] = 100;
|
238
|
|
- #if HAS_CLASSIC_JERK
|
239
|
|
- slow_homing.jerk_xy = planner.max_jerk;
|
240
|
|
- planner.max_jerk.set(0, 0);
|
241
|
|
- #endif
|
242
|
|
-
|
243
|
|
- planner.reset_acceleration_rates();
|
|
260
|
+ slow_homing_t slow_homing = begin_slow_homing();
|
244
|
261
|
#endif
|
245
|
262
|
|
246
|
263
|
// Always home with tool 0 active
|
|
@@ -264,6 +281,10 @@ void GcodeSuite::G28(const bool always_home_all) {
|
264
|
281
|
home_delta();
|
265
|
282
|
UNUSED(always_home_all);
|
266
|
283
|
|
|
284
|
+ #if ENABLED(IMPROVE_HOMING_RELIABILITY)
|
|
285
|
+ end_slow_homing(slow_homing);
|
|
286
|
+ #endif
|
|
287
|
+
|
267
|
288
|
#else // NOT DELTA
|
268
|
289
|
|
269
|
290
|
const bool homeX = parser.seen('X'), homeY = parser.seen('Y'), homeZ = parser.seen('Z'),
|
|
@@ -348,6 +369,10 @@ void GcodeSuite::G28(const bool always_home_all) {
|
348
|
369
|
if (doY) homeaxis(Y_AXIS);
|
349
|
370
|
#endif
|
350
|
371
|
|
|
372
|
+ #if ENABLED(IMPROVE_HOMING_RELIABILITY)
|
|
373
|
+ end_slow_homing(slow_homing);
|
|
374
|
+ #endif
|
|
375
|
+
|
351
|
376
|
// Home Z last if homing towards the bed
|
352
|
377
|
#if Z_HOME_DIR < 0
|
353
|
378
|
if (doZ) {
|
|
@@ -381,6 +406,10 @@ void GcodeSuite::G28(const bool always_home_all) {
|
381
|
406
|
|
382
|
407
|
if (dxc_is_duplicating()) {
|
383
|
408
|
|
|
409
|
+ #if ENABLED(IMPROVE_HOMING_RELIABILITY)
|
|
410
|
+ slow_homing = begin_slow_homing();
|
|
411
|
+ #endif
|
|
412
|
+
|
384
|
413
|
// Always home the 2nd (right) extruder first
|
385
|
414
|
active_extruder = 1;
|
386
|
415
|
homeaxis(X_AXIS);
|
|
@@ -401,6 +430,10 @@ void GcodeSuite::G28(const bool always_home_all) {
|
401
|
430
|
|
402
|
431
|
dual_x_carriage_mode = IDEX_saved_mode;
|
403
|
432
|
stepper.set_directions();
|
|
433
|
+
|
|
434
|
+ #if ENABLED(IMPROVE_HOMING_RELIABILITY)
|
|
435
|
+ end_slow_homing(slow_homing);
|
|
436
|
+ #endif
|
404
|
437
|
}
|
405
|
438
|
|
406
|
439
|
#endif // DUAL_X_CARRIAGE
|
|
@@ -433,15 +466,6 @@ void GcodeSuite::G28(const bool always_home_all) {
|
433
|
466
|
tool_change(old_tool_index, NO_FETCH);
|
434
|
467
|
#endif
|
435
|
468
|
|
436
|
|
- #if ENABLED(IMPROVE_HOMING_RELIABILITY)
|
437
|
|
- planner.settings.max_acceleration_mm_per_s2[X_AXIS] = slow_homing.acceleration.x;
|
438
|
|
- planner.settings.max_acceleration_mm_per_s2[Y_AXIS] = slow_homing.acceleration.y;
|
439
|
|
- #if HAS_CLASSIC_JERK
|
440
|
|
- planner.max_jerk = slow_homing.jerk_xy;
|
441
|
|
- #endif
|
442
|
|
- planner.reset_acceleration_rates();
|
443
|
|
- #endif
|
444
|
|
-
|
445
|
469
|
ui.refresh();
|
446
|
470
|
|
447
|
471
|
report_current_position();
|