Browse Source

Merge pull request #4303 from AnHardt/delta-g28

DELTA: Move out of the clip-zone after G28
Scott Lahteine 9 years ago
parent
commit
59ae1811c2
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 };
1441
     sw_endstop_min[axis] = base_min_pos(axis) + offs;
1444
     sw_endstop_min[axis] = base_min_pos(axis) + offs;
1442
     sw_endstop_max[axis] = base_max_pos(axis) + offs;
1445
     sw_endstop_max[axis] = base_max_pos(axis) + offs;
1443
   }
1446
   }
1447
+
1444
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1448
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1445
     if (DEBUGGING(LEVELING)) {
1449
     if (DEBUGGING(LEVELING)) {
1446
       SERIAL_ECHOPAIR("For ", axis_codes[axis]);
1450
       SERIAL_ECHOPAIR("For ", axis_codes[axis]);
1451
       SERIAL_EOL;
1455
       SERIAL_EOL;
1452
     }
1456
     }
1453
   #endif
1457
   #endif
1458
+
1459
+  #if ENABLED(DELTA)
1460
+    if (axis == Z_AXIS) {
1461
+      delta_clip_start_height = sw_endstop_max[axis] - delta_safe_distance_from_top();
1462
+    }
1463
+  #endif
1464
+
1454
 }
1465
 }
1455
 
1466
 
1456
 /**
1467
 /**
3101
     }
3112
     }
3102
   #endif
3113
   #endif
3103
 
3114
 
3115
+  #if ENABLED(DELTA)
3116
+    // move to a height where we can use the full xy-area
3117
+    do_blocking_move_to_z(delta_clip_start_height);
3118
+  #endif
3119
+
3104
   clean_up_after_endstop_or_probe_move();
3120
   clean_up_after_endstop_or_probe_move();
3105
 
3121
 
3106
   #if ENABLED(DEBUG_LEVELING_FEATURE)
3122
   #if ENABLED(DEBUG_LEVELING_FEATURE)
7541
     */
7557
     */
7542
   }
7558
   }
7543
 
7559
 
7560
+  float delta_safe_distance_from_top() {
7561
+    float cartesian[3] = { 0 };
7562
+    calculate_delta(cartesian);
7563
+    float distance = delta[TOWER_3];
7564
+    cartesian[Y_AXIS] = DELTA_PRINTABLE_RADIUS;
7565
+    calculate_delta(cartesian);
7566
+    return abs(distance - delta[TOWER_3]);
7567
+  }
7568
+
7544
   #if ENABLED(AUTO_BED_LEVELING_FEATURE)
7569
   #if ENABLED(AUTO_BED_LEVELING_FEATURE)
7545
 
7570
 
7546
     // Adjust print surface height by linear interpolation over the bed_level array.
7571
     // Adjust print surface height by linear interpolation over the bed_level array.

Loading…
Cancel
Save