Ver código fonte

Merge pull request #4584 from thinkyhead/rc_delta_cal_more

Use configured feedrates, center in DELTA_CALIBRATION_MENU
Scott Lahteine 8 anos atrás
pai
commit
d6a7ca6553
4 arquivos alterados com 17 adições e 15 exclusões
  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 arquivo

79
     #endif
79
     #endif
80
   #else
80
   #else
81
     #if ENABLED(DELTA)
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
     #else
83
     #else
84
       #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS)
84
       #define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS)
85
     #endif
85
     #endif
95
     #endif
95
     #endif
96
   #else
96
   #else
97
     #if ENABLED(DELTA)
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
     #else
99
     #else
100
       #define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS)
100
       #define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS)
101
     #endif
101
     #endif

+ 4
- 4
Marlin/Marlin.h Ver arquivo

390
 /**
390
 /**
391
  * Blocking movement and shorthand functions
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
 #endif //MARLIN_H
398
 #endif //MARLIN_H

+ 4
- 4
Marlin/Marlin_main.cpp Ver arquivo

1673
  *  Plan a move to (X, Y, Z) and set the current_position
1673
  *  Plan a move to (X, Y, Z) and set the current_position
1674
  *  The final current_position may not be the one that was requested
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
   float old_feedrate_mm_s = feedrate_mm_s;
1677
   float old_feedrate_mm_s = feedrate_mm_s;
1678
 
1678
 
1679
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1679
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1765
 
1765
 
1766
   feedrate_mm_s = old_feedrate_mm_s;
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
   do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], fr_mm_s);
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
   do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, fr_mm_s);
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
   do_blocking_move_to(x, y, current_position[Z_AXIS], fr_mm_s);
1775
   do_blocking_move_to(x, y, current_position[Z_AXIS], fr_mm_s);
1776
 }
1776
 }
1777
 
1777
 

+ 7
- 5
Marlin/ultralcd.cpp Ver arquivo

1261
   #if ENABLED(DELTA_CALIBRATION_MENU)
1261
   #if ENABLED(DELTA_CALIBRATION_MENU)
1262
 
1262
 
1263
     static void _goto_tower_pos(const float &a) {
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
     static void _goto_tower_x() { _goto_tower_pos(RADIANS(120)); }
1271
     static void _goto_tower_x() { _goto_tower_pos(RADIANS(120)); }
1271
     static void _goto_tower_y() { _goto_tower_pos(RADIANS(240)); }
1272
     static void _goto_tower_y() { _goto_tower_pos(RADIANS(240)); }
1272
     static void _goto_tower_z() { _goto_tower_pos(0); }
1273
     static void _goto_tower_z() { _goto_tower_pos(0); }
1274
+    static void _goto_center()  { _goto_tower_pos(-1); }
1273
 
1275
 
1274
     static void lcd_delta_calibrate_menu() {
1276
     static void lcd_delta_calibrate_menu() {
1275
       START_MENU();
1277
       START_MENU();
1278
       MENU_ITEM(function, MSG_DELTA_CALIBRATE_X, _goto_tower_x);
1280
       MENU_ITEM(function, MSG_DELTA_CALIBRATE_X, _goto_tower_x);
1279
       MENU_ITEM(function, MSG_DELTA_CALIBRATE_Y, _goto_tower_y);
1281
       MENU_ITEM(function, MSG_DELTA_CALIBRATE_Y, _goto_tower_y);
1280
       MENU_ITEM(function, MSG_DELTA_CALIBRATE_Z, _goto_tower_z);
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
       END_MENU();
1284
       END_MENU();
1283
     }
1285
     }
1284
 
1286
 

Carregando…
Cancelar
Salvar