Browse Source

DELTA: Move out of the clip-zone after G28

Move down to a safe height after G28 for DELTAs.
AnHardt 8 years ago
parent
commit
d2a49c016d
2 changed files with 26 additions and 0 deletions
  1. 1
    0
      Marlin/Marlin.h
  2. 25
    0
      Marlin/Marlin_main.cpp

+ 1
- 0
Marlin/Marlin.h View File

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

+ 25
- 0
Marlin/Marlin_main.cpp View File

322
 // Software Endstops. Default to configured limits.
322
 // Software Endstops. Default to configured limits.
323
 float sw_endstop_min[3] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS };
323
 float sw_endstop_min[3] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS };
324
 float sw_endstop_max[3] = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS };
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
 #if FAN_COUNT > 0
329
 #if FAN_COUNT > 0
327
   int fanSpeeds[FAN_COUNT] = { 0 };
330
   int fanSpeeds[FAN_COUNT] = { 0 };
1435
     sw_endstop_min[axis] = base_min_pos(axis) + offs;
1438
     sw_endstop_min[axis] = base_min_pos(axis) + offs;
1436
     sw_endstop_max[axis] = base_max_pos(axis) + offs;
1439
     sw_endstop_max[axis] = base_max_pos(axis) + offs;
1437
   }
1440
   }
1441
+
1438
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1442
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1439
     if (DEBUGGING(LEVELING)) {
1443
     if (DEBUGGING(LEVELING)) {
1440
       SERIAL_ECHOPAIR("For ", axis_codes[axis]);
1444
       SERIAL_ECHOPAIR("For ", axis_codes[axis]);
1445
       SERIAL_EOL;
1449
       SERIAL_EOL;
1446
     }
1450
     }
1447
   #endif
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
     }
3106
     }
3096
   #endif
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
   clean_up_after_endstop_or_probe_move();
3114
   clean_up_after_endstop_or_probe_move();
3099
 
3115
 
3100
   #if ENABLED(DEBUG_LEVELING_FEATURE)
3116
   #if ENABLED(DEBUG_LEVELING_FEATURE)
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
   #if ENABLED(AUTO_BED_LEVELING_FEATURE)
7563
   #if ENABLED(AUTO_BED_LEVELING_FEATURE)
7539
 
7564
 
7540
     // Adjust print surface height by linear interpolation over the bed_level array.
7565
     // Adjust print surface height by linear interpolation over the bed_level array.

Loading…
Cancel
Save