Selaa lähdekoodia

DELTA: Move out of the clip-zone after G28

Move down to a safe height after G28 for DELTAs.
AnHardt 8 vuotta sitten
vanhempi
commit
d2a49c016d
2 muutettua tiedostoa jossa 26 lisäystä ja 0 poistoa
  1. 1
    0
      Marlin/Marlin.h
  2. 25
    0
      Marlin/Marlin_main.cpp

+ 1
- 0
Marlin/Marlin.h Näytä tiedosto

@@ -301,6 +301,7 @@ float code_value_temp_diff();
301 301
   extern float delta_diagonal_rod_trim_tower_3;
302 302
   void calculate_delta(float cartesian[3]);
303 303
   void recalc_delta_settings(float radius, float diagonal_rod);
304
+  float delta_safe_distance_from_top();
304 305
   #if ENABLED(AUTO_BED_LEVELING_FEATURE)
305 306
     extern int delta_grid_spacing[2];
306 307
     void adjust_delta(float cartesian[3]);

+ 25
- 0
Marlin/Marlin_main.cpp Näytä tiedosto

@@ -322,6 +322,9 @@ float home_offset[3] = { 0 };
322 322
 // Software Endstops. Default to configured limits.
323 323
 float sw_endstop_min[3] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS };
324 324
 float sw_endstop_max[3] = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS };
325
+#if ENABLED(DELTA)
326
+  float delta_clip_start_height = Z_MAX_POS;
327
+#endif
325 328
 
326 329
 #if FAN_COUNT > 0
327 330
   int fanSpeeds[FAN_COUNT] = { 0 };
@@ -1435,6 +1438,7 @@ static void update_software_endstops(AxisEnum axis) {
1435 1438
     sw_endstop_min[axis] = base_min_pos(axis) + offs;
1436 1439
     sw_endstop_max[axis] = base_max_pos(axis) + offs;
1437 1440
   }
1441
+
1438 1442
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1439 1443
     if (DEBUGGING(LEVELING)) {
1440 1444
       SERIAL_ECHOPAIR("For ", axis_codes[axis]);
@@ -1445,6 +1449,13 @@ static void update_software_endstops(AxisEnum axis) {
1445 1449
       SERIAL_EOL;
1446 1450
     }
1447 1451
   #endif
1452
+
1453
+  #if ENABLED(DELTA)
1454
+    if (axis == Z_AXIS) {
1455
+      delta_clip_start_height = sw_endstop_max[axis] - delta_safe_distance_from_top();
1456
+    }
1457
+  #endif
1458
+
1448 1459
 }
1449 1460
 
1450 1461
 /**
@@ -3095,6 +3106,11 @@ inline void gcode_G28() {
3095 3106
     }
3096 3107
   #endif
3097 3108
 
3109
+  #if ENABLED(DELTA)
3110
+    // move to a height where we can use the full xy-area
3111
+    do_blocking_move_to_z(delta_clip_start_height);
3112
+  #endif
3113
+
3098 3114
   clean_up_after_endstop_or_probe_move();
3099 3115
 
3100 3116
   #if ENABLED(DEBUG_LEVELING_FEATURE)
@@ -7535,6 +7551,15 @@ void clamp_to_software_endstops(float target[3]) {
7535 7551
     */
7536 7552
   }
7537 7553
 
7554
+  float delta_safe_distance_from_top() {
7555
+    float cartesian[3] = { 0 };
7556
+    calculate_delta(cartesian);
7557
+    float distance = delta[TOWER_3];
7558
+    cartesian[Y_AXIS] = DELTA_PRINTABLE_RADIUS;
7559
+    calculate_delta(cartesian);
7560
+    return abs(distance - delta[TOWER_3]);
7561
+  }
7562
+
7538 7563
   #if ENABLED(AUTO_BED_LEVELING_FEATURE)
7539 7564
 
7540 7565
     // Adjust print surface height by linear interpolation over the bed_level array.

Loading…
Peruuta
Tallenna