Explorar el Código

Merge pull request #4584 from thinkyhead/rc_delta_cal_more

Use configured feedrates, center in DELTA_CALIBRATION_MENU
Scott Lahteine hace 8 años
padre
commit
d6a7ca6553
Se han modificado 4 ficheros con 17 adiciones y 15 borrados
  1. 2
    2
      Marlin/Conditionals_post.h
  2. 4
    4
      Marlin/Marlin.h
  3. 4
    4
      Marlin/Marlin_main.cpp
  4. 7
    5
      Marlin/ultralcd.cpp

+ 2
- 2
Marlin/Conditionals_post.h Ver fichero

@@ -79,7 +79,7 @@
79 79
     #endif
80 80
   #else
81 81
     #if ENABLED(DELTA)
82
-      #define X_HOME_POS ((X_MAX_LENGTH) * 0.5)
82
+      #define X_HOME_POS (X_MIN_POS + (X_MAX_LENGTH) * 0.5)
83 83
     #else
84 84
       #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS)
85 85
     #endif
@@ -95,7 +95,7 @@
95 95
     #endif
96 96
   #else
97 97
     #if ENABLED(DELTA)
98
-      #define Y_HOME_POS ((Y_MAX_LENGTH) * 0.5)
98
+      #define Y_HOME_POS (Y_MIN_POS + (Y_MAX_LENGTH) * 0.5)
99 99
     #else
100 100
       #define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS)
101 101
     #endif

+ 4
- 4
Marlin/Marlin.h Ver fichero

@@ -390,9 +390,9 @@ void calculate_volumetric_multipliers();
390 390
 /**
391 391
  * Blocking movement and shorthand functions
392 392
  */
393
-inline void do_blocking_move_to(float x, float y, float z, float fr_mm_s=0.0);
394
-inline void do_blocking_move_to_x(float x, float fr_mm_s=0.0);
395
-inline void do_blocking_move_to_z(float z, float fr_mm_s=0.0);
396
-inline void do_blocking_move_to_xy(float x, float y, float fr_mm_s=0.0);
393
+void do_blocking_move_to(const float &x, const float &y, const float &z, const float &fr_mm_s=0.0);
394
+void do_blocking_move_to_x(const float &x, const float &fr_mm_s=0.0);
395
+void do_blocking_move_to_z(const float &z, const float &fr_mm_s=0.0);
396
+void do_blocking_move_to_xy(const float &x, const float &y, const float &fr_mm_s=0.0);
397 397
 
398 398
 #endif //MARLIN_H

+ 4
- 4
Marlin/Marlin_main.cpp Ver fichero

@@ -1673,7 +1673,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position,
1673 1673
  *  Plan a move to (X, Y, Z) and set the current_position
1674 1674
  *  The final current_position may not be the one that was requested
1675 1675
  */
1676
-void do_blocking_move_to(float x, float y, float z, float fr_mm_s /*=0.0*/) {
1676
+void do_blocking_move_to(const float &x, const float &y, const float &z, const float &fr_mm_s /*=0.0*/) {
1677 1677
   float old_feedrate_mm_s = feedrate_mm_s;
1678 1678
 
1679 1679
   #if ENABLED(DEBUG_LEVELING_FEATURE)
@@ -1765,13 +1765,13 @@ void do_blocking_move_to(float x, float y, float z, float fr_mm_s /*=0.0*/) {
1765 1765
 
1766 1766
   feedrate_mm_s = old_feedrate_mm_s;
1767 1767
 }
1768
-void do_blocking_move_to_x(float x, float fr_mm_s/*=0.0*/) {
1768
+void do_blocking_move_to_x(const float &x, const float &fr_mm_s/*=0.0*/) {
1769 1769
   do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], fr_mm_s);
1770 1770
 }
1771
-void do_blocking_move_to_z(float z, float fr_mm_s/*=0.0*/) {
1771
+void do_blocking_move_to_z(const float &z, const float &fr_mm_s/*=0.0*/) {
1772 1772
   do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, fr_mm_s);
1773 1773
 }
1774
-void do_blocking_move_to_xy(float x, float y, float fr_mm_s/*=0.0*/) {
1774
+void do_blocking_move_to_xy(const float &x, const float &y, const float &fr_mm_s/*=0.0*/) {
1775 1775
   do_blocking_move_to(x, y, current_position[Z_AXIS], fr_mm_s);
1776 1776
 }
1777 1777
 

+ 7
- 5
Marlin/ultralcd.cpp Ver fichero

@@ -1261,15 +1261,17 @@ void kill_screen(const char* lcd_msg) {
1261 1261
   #if ENABLED(DELTA_CALIBRATION_MENU)
1262 1262
 
1263 1263
     static void _goto_tower_pos(const float &a) {
1264
-      char cmd[26];
1265
-      sprintf_P(cmd, PSTR("G1 F4000 X%i Y%i"), int(-(DELTA_PRINTABLE_RADIUS) * sin(a)), int((DELTA_PRINTABLE_RADIUS) * cos(a)));
1266
-      enqueue_and_echo_commands_P(PSTR("G1 F8000 Z4"));
1267
-      enqueue_and_echo_command(cmd);
1264
+      do_blocking_move_to(
1265
+        a < 0 ? X_HOME_POS : sin(a) * -(DELTA_PRINTABLE_RADIUS),
1266
+        a < 0 ? Y_HOME_POS : cos(a) *  (DELTA_PRINTABLE_RADIUS),
1267
+        4
1268
+      );
1268 1269
     }
1269 1270
 
1270 1271
     static void _goto_tower_x() { _goto_tower_pos(RADIANS(120)); }
1271 1272
     static void _goto_tower_y() { _goto_tower_pos(RADIANS(240)); }
1272 1273
     static void _goto_tower_z() { _goto_tower_pos(0); }
1274
+    static void _goto_center()  { _goto_tower_pos(-1); }
1273 1275
 
1274 1276
     static void lcd_delta_calibrate_menu() {
1275 1277
       START_MENU();
@@ -1278,7 +1280,7 @@ void kill_screen(const char* lcd_msg) {
1278 1280
       MENU_ITEM(function, MSG_DELTA_CALIBRATE_X, _goto_tower_x);
1279 1281
       MENU_ITEM(function, MSG_DELTA_CALIBRATE_Y, _goto_tower_y);
1280 1282
       MENU_ITEM(function, MSG_DELTA_CALIBRATE_Z, _goto_tower_z);
1281
-      MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_CENTER, PSTR("G1 F8000 Z4\nG1 F4000 X0 Y0"));
1283
+      MENU_ITEM(function, MSG_DELTA_CALIBRATE_CENTER, _goto_center);
1282 1284
       END_MENU();
1283 1285
     }
1284 1286
 

Loading…
Cancelar
Guardar