瀏覽代碼

Don't add home offsets in G29

- Address #1262 by leaving values as set
- Rename `add_homing` to `home_offset`
Scott Lahteine 10 年之前
父節點
當前提交
691e753cc3
共有 4 個檔案被更改,包括 36 行新增45 行删除
  1. 7
    7
      Marlin/ConfigurationStore.cpp
  2. 1
    1
      Marlin/Marlin.h
  3. 27
    36
      Marlin/Marlin_main.cpp
  4. 1
    1
      Marlin/ultralcd.cpp

+ 7
- 7
Marlin/ConfigurationStore.cpp 查看文件

18
  *  max_xy_jerk
18
  *  max_xy_jerk
19
  *  max_z_jerk
19
  *  max_z_jerk
20
  *  max_e_jerk
20
  *  max_e_jerk
21
- *  add_homing (x3)
21
+ *  home_offset (x3)
22
  *
22
  *
23
  * Mesh bed leveling:
23
  * Mesh bed leveling:
24
  *  active
24
  *  active
136
   EEPROM_WRITE_VAR(i, max_xy_jerk);
136
   EEPROM_WRITE_VAR(i, max_xy_jerk);
137
   EEPROM_WRITE_VAR(i, max_z_jerk);
137
   EEPROM_WRITE_VAR(i, max_z_jerk);
138
   EEPROM_WRITE_VAR(i, max_e_jerk);
138
   EEPROM_WRITE_VAR(i, max_e_jerk);
139
-  EEPROM_WRITE_VAR(i, add_homing);
139
+  EEPROM_WRITE_VAR(i, home_offset);
140
 
140
 
141
   uint8_t mesh_num_x = 3;
141
   uint8_t mesh_num_x = 3;
142
   uint8_t mesh_num_y = 3;
142
   uint8_t mesh_num_y = 3;
294
     EEPROM_READ_VAR(i, max_xy_jerk);
294
     EEPROM_READ_VAR(i, max_xy_jerk);
295
     EEPROM_READ_VAR(i, max_z_jerk);
295
     EEPROM_READ_VAR(i, max_z_jerk);
296
     EEPROM_READ_VAR(i, max_e_jerk);
296
     EEPROM_READ_VAR(i, max_e_jerk);
297
-    EEPROM_READ_VAR(i, add_homing);
297
+    EEPROM_READ_VAR(i, home_offset);
298
 
298
 
299
     uint8_t mesh_num_x = 0;
299
     uint8_t mesh_num_x = 0;
300
     uint8_t mesh_num_y = 0;
300
     uint8_t mesh_num_y = 0;
447
   max_xy_jerk = DEFAULT_XYJERK;
447
   max_xy_jerk = DEFAULT_XYJERK;
448
   max_z_jerk = DEFAULT_ZJERK;
448
   max_z_jerk = DEFAULT_ZJERK;
449
   max_e_jerk = DEFAULT_EJERK;
449
   max_e_jerk = DEFAULT_EJERK;
450
-  add_homing[X_AXIS] = add_homing[Y_AXIS] = add_homing[Z_AXIS] = 0;
450
+  home_offset[X_AXIS] = home_offset[Y_AXIS] = home_offset[Z_AXIS] = 0;
451
 
451
 
452
   #if defined(MESH_BED_LEVELING)
452
   #if defined(MESH_BED_LEVELING)
453
     mbl.active = 0;
453
     mbl.active = 0;
607
     SERIAL_ECHOLNPGM("Home offset (mm):");
607
     SERIAL_ECHOLNPGM("Home offset (mm):");
608
     SERIAL_ECHO_START;
608
     SERIAL_ECHO_START;
609
   }
609
   }
610
-  SERIAL_ECHOPAIR("  M206 X", add_homing[X_AXIS] );
611
-  SERIAL_ECHOPAIR(" Y", add_homing[Y_AXIS] );
612
-  SERIAL_ECHOPAIR(" Z", add_homing[Z_AXIS] );
610
+  SERIAL_ECHOPAIR("  M206 X", home_offset[X_AXIS] );
611
+  SERIAL_ECHOPAIR(" Y", home_offset[Y_AXIS] );
612
+  SERIAL_ECHOPAIR(" Z", home_offset[Z_AXIS] );
613
   SERIAL_EOL;
613
   SERIAL_EOL;
614
 
614
 
615
   #ifdef DELTA
615
   #ifdef DELTA

+ 1
- 1
Marlin/Marlin.h 查看文件

240
 extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder.
240
 extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder.
241
 extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
241
 extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
242
 extern float current_position[NUM_AXIS] ;
242
 extern float current_position[NUM_AXIS] ;
243
-extern float add_homing[3];
243
+extern float home_offset[3];
244
 #ifdef DELTA
244
 #ifdef DELTA
245
 extern float endstop_adj[3];
245
 extern float endstop_adj[3];
246
 extern float delta_radius;
246
 extern float delta_radius;

+ 27
- 36
Marlin/Marlin_main.cpp 查看文件

248
   #endif
248
   #endif
249
 };
249
 };
250
 float current_position[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0 };
250
 float current_position[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0 };
251
-float add_homing[3] = { 0, 0, 0 };
251
+float home_offset[3] = { 0, 0, 0 };
252
 #ifdef DELTA
252
 #ifdef DELTA
253
   float endstop_adj[3] = { 0, 0, 0 };
253
   float endstop_adj[3] = { 0, 0, 0 };
254
 #endif
254
 #endif
984
 
984
 
985
 static float x_home_pos(int extruder) {
985
 static float x_home_pos(int extruder) {
986
   if (extruder == 0)
986
   if (extruder == 0)
987
-    return base_home_pos(X_AXIS) + add_homing[X_AXIS];
987
+    return base_home_pos(X_AXIS) + home_offset[X_AXIS];
988
   else
988
   else
989
     // In dual carriage mode the extruder offset provides an override of the
989
     // In dual carriage mode the extruder offset provides an override of the
990
     // second X-carriage offset when homed - otherwise X2_HOME_POS is used.
990
     // second X-carriage offset when homed - otherwise X2_HOME_POS is used.
1016
       return;
1016
       return;
1017
     }
1017
     }
1018
     else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) {
1018
     else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) {
1019
-      current_position[X_AXIS] = base_home_pos(X_AXIS) + add_homing[X_AXIS];
1020
-      min_pos[X_AXIS] =          base_min_pos(X_AXIS) + add_homing[X_AXIS];
1021
-      max_pos[X_AXIS] =          min(base_max_pos(X_AXIS) + add_homing[X_AXIS],
1019
+      current_position[X_AXIS] = base_home_pos(X_AXIS) + home_offset[X_AXIS];
1020
+      min_pos[X_AXIS] =          base_min_pos(X_AXIS) + home_offset[X_AXIS];
1021
+      max_pos[X_AXIS] =          min(base_max_pos(X_AXIS) + home_offset[X_AXIS],
1022
                                   max(extruder_offset[X_AXIS][1], X2_MAX_POS) - duplicate_extruder_x_offset);
1022
                                   max(extruder_offset[X_AXIS][1], X2_MAX_POS) - duplicate_extruder_x_offset);
1023
       return;
1023
       return;
1024
     }
1024
     }
1046
      
1046
      
1047
      for (i=0; i<2; i++)
1047
      for (i=0; i<2; i++)
1048
      {
1048
      {
1049
-        delta[i] -= add_homing[i];
1049
+        delta[i] -= home_offset[i];
1050
      } 
1050
      } 
1051
      
1051
      
1052
-    // SERIAL_ECHOPGM("addhome X="); SERIAL_ECHO(add_homing[X_AXIS]);
1053
-  // SERIAL_ECHOPGM(" addhome Y="); SERIAL_ECHO(add_homing[Y_AXIS]);
1052
+    // SERIAL_ECHOPGM("addhome X="); SERIAL_ECHO(home_offset[X_AXIS]);
1053
+  // SERIAL_ECHOPGM(" addhome Y="); SERIAL_ECHO(home_offset[Y_AXIS]);
1054
     // SERIAL_ECHOPGM(" addhome Theta="); SERIAL_ECHO(delta[X_AXIS]);
1054
     // SERIAL_ECHOPGM(" addhome Theta="); SERIAL_ECHO(delta[X_AXIS]);
1055
     // SERIAL_ECHOPGM(" addhome Psi+Theta="); SERIAL_ECHOLN(delta[Y_AXIS]);
1055
     // SERIAL_ECHOPGM(" addhome Psi+Theta="); SERIAL_ECHOLN(delta[Y_AXIS]);
1056
       
1056
       
1068
    } 
1068
    } 
1069
    else
1069
    else
1070
    {
1070
    {
1071
-      current_position[axis] = base_home_pos(axis) + add_homing[axis];
1072
-      min_pos[axis] =          base_min_pos(axis) + add_homing[axis];
1073
-      max_pos[axis] =          base_max_pos(axis) + add_homing[axis];
1071
+      current_position[axis] = base_home_pos(axis) + home_offset[axis];
1072
+      min_pos[axis] =          base_min_pos(axis) + home_offset[axis];
1073
+      max_pos[axis] =          base_max_pos(axis) + home_offset[axis];
1074
    }
1074
    }
1075
 #else
1075
 #else
1076
-  current_position[axis] = base_home_pos(axis) + add_homing[axis];
1077
-  min_pos[axis] =          base_min_pos(axis) + add_homing[axis];
1078
-  max_pos[axis] =          base_max_pos(axis) + add_homing[axis];
1076
+  current_position[axis] = base_home_pos(axis) + home_offset[axis];
1077
+  min_pos[axis] =          base_min_pos(axis) + home_offset[axis];
1078
+  max_pos[axis] =          base_max_pos(axis) + home_offset[axis];
1079
 #endif
1079
 #endif
1080
 }
1080
 }
1081
 
1081
 
1858
       if (code_value_long() != 0) {
1858
       if (code_value_long() != 0) {
1859
           current_position[X_AXIS] = code_value()
1859
           current_position[X_AXIS] = code_value()
1860
             #ifndef SCARA
1860
             #ifndef SCARA
1861
-              + add_homing[X_AXIS]
1861
+              + home_offset[X_AXIS]
1862
             #endif
1862
             #endif
1863
           ;
1863
           ;
1864
       }
1864
       }
1867
     if (code_seen(axis_codes[Y_AXIS]) && code_value_long() != 0) {
1867
     if (code_seen(axis_codes[Y_AXIS]) && code_value_long() != 0) {
1868
       current_position[Y_AXIS] = code_value()
1868
       current_position[Y_AXIS] = code_value()
1869
         #ifndef SCARA
1869
         #ifndef SCARA
1870
-          + add_homing[Y_AXIS]
1870
+          + home_offset[Y_AXIS]
1871
         #endif
1871
         #endif
1872
       ;
1872
       ;
1873
     }
1873
     }
1941
 
1941
 
1942
 
1942
 
1943
     if (code_seen(axis_codes[Z_AXIS]) && code_value_long() != 0)
1943
     if (code_seen(axis_codes[Z_AXIS]) && code_value_long() != 0)
1944
-      current_position[Z_AXIS] = code_value() + add_homing[Z_AXIS];
1944
+      current_position[Z_AXIS] = code_value() + home_offset[Z_AXIS];
1945
 
1945
 
1946
     #ifdef ENABLE_AUTO_BED_LEVELING
1946
     #ifdef ENABLE_AUTO_BED_LEVELING
1947
       if (home_all_axis || code_seen(axis_codes[Z_AXIS]))
1947
       if (home_all_axis || code_seen(axis_codes[Z_AXIS]))
2512
   if (!code_seen(axis_codes[E_AXIS]))
2512
   if (!code_seen(axis_codes[E_AXIS]))
2513
     st_synchronize();
2513
     st_synchronize();
2514
 
2514
 
2515
-  for (int i=0;i<NUM_AXIS;i++) {
2515
+  for (int i = 0; i < NUM_AXIS; i++) {
2516
     if (code_seen(axis_codes[i])) {
2516
     if (code_seen(axis_codes[i])) {
2517
-      if (i == E_AXIS) {
2518
-        current_position[i] = code_value();
2517
+      current_position[i] = code_value();
2518
+      if (i == E_AXIS)
2519
         plan_set_e_position(current_position[E_AXIS]);
2519
         plan_set_e_position(current_position[E_AXIS]);
2520
-      }
2521
-      else {
2522
-        current_position[i] = code_value() +
2523
-          #ifdef SCARA
2524
-            ((i != X_AXIS && i != Y_AXIS) ? add_homing[i] : 0)
2525
-          #else
2526
-            add_homing[i]
2527
-          #endif
2528
-        ;
2520
+      else
2529
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
2521
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
2530
-      }
2531
     }
2522
     }
2532
   }
2523
   }
2533
 }
2524
 }
3464
     SERIAL_PROTOCOLLN("");
3455
     SERIAL_PROTOCOLLN("");
3465
     
3456
     
3466
     SERIAL_PROTOCOLPGM("SCARA Cal - Theta:");
3457
     SERIAL_PROTOCOLPGM("SCARA Cal - Theta:");
3467
-    SERIAL_PROTOCOL(delta[X_AXIS]+add_homing[X_AXIS]);
3458
+    SERIAL_PROTOCOL(delta[X_AXIS]+home_offset[X_AXIS]);
3468
     SERIAL_PROTOCOLPGM("   Psi+Theta (90):");
3459
     SERIAL_PROTOCOLPGM("   Psi+Theta (90):");
3469
-    SERIAL_PROTOCOL(delta[Y_AXIS]-delta[X_AXIS]-90+add_homing[Y_AXIS]);
3460
+    SERIAL_PROTOCOL(delta[Y_AXIS]-delta[X_AXIS]-90+home_offset[Y_AXIS]);
3470
     SERIAL_PROTOCOLLN("");
3461
     SERIAL_PROTOCOLLN("");
3471
     
3462
     
3472
     SERIAL_PROTOCOLPGM("SCARA step Cal - Theta:");
3463
     SERIAL_PROTOCOLPGM("SCARA step Cal - Theta:");
3684
 inline void gcode_M206() {
3675
 inline void gcode_M206() {
3685
   for (int8_t i=X_AXIS; i <= Z_AXIS; i++) {
3676
   for (int8_t i=X_AXIS; i <= Z_AXIS; i++) {
3686
     if (code_seen(axis_codes[i])) {
3677
     if (code_seen(axis_codes[i])) {
3687
-      add_homing[i] = code_value();
3678
+      home_offset[i] = code_value();
3688
     }
3679
     }
3689
   }
3680
   }
3690
   #ifdef SCARA
3681
   #ifdef SCARA
3691
-    if (code_seen('T')) add_homing[X_AXIS] = code_value(); // Theta
3692
-    if (code_seen('P')) add_homing[Y_AXIS] = code_value(); // Psi
3682
+    if (code_seen('T')) home_offset[X_AXIS] = code_value(); // Theta
3683
+    if (code_seen('P')) home_offset[Y_AXIS] = code_value(); // Psi
3693
   #endif
3684
   #endif
3694
 }
3685
 }
3695
 
3686
 
5287
     float negative_z_offset = 0;
5278
     float negative_z_offset = 0;
5288
     #ifdef ENABLE_AUTO_BED_LEVELING
5279
     #ifdef ENABLE_AUTO_BED_LEVELING
5289
       if (Z_PROBE_OFFSET_FROM_EXTRUDER < 0) negative_z_offset = negative_z_offset + Z_PROBE_OFFSET_FROM_EXTRUDER;
5280
       if (Z_PROBE_OFFSET_FROM_EXTRUDER < 0) negative_z_offset = negative_z_offset + Z_PROBE_OFFSET_FROM_EXTRUDER;
5290
-      if (add_homing[Z_AXIS] < 0) negative_z_offset = negative_z_offset + add_homing[Z_AXIS];
5281
+      if (home_offset[Z_AXIS] < 0) negative_z_offset = negative_z_offset + home_offset[Z_AXIS];
5291
     #endif
5282
     #endif
5292
     
5283
     
5293
     if (target[Z_AXIS] < min_pos[Z_AXIS]+negative_z_offset) target[Z_AXIS] = min_pos[Z_AXIS]+negative_z_offset;
5284
     if (target[Z_AXIS] < min_pos[Z_AXIS]+negative_z_offset) target[Z_AXIS] = min_pos[Z_AXIS]+negative_z_offset;

+ 1
- 1
Marlin/ultralcd.cpp 查看文件

437
 void lcd_set_home_offsets() {
437
 void lcd_set_home_offsets() {
438
   for(int8_t i=0; i < NUM_AXIS; i++) {
438
   for(int8_t i=0; i < NUM_AXIS; i++) {
439
     if (i != E_AXIS) {
439
     if (i != E_AXIS) {
440
-      add_homing[i] -= current_position[i];
440
+      home_offset[i] -= current_position[i];
441
       current_position[i] = 0.0;
441
       current_position[i] = 0.0;
442
     }
442
     }
443
   }
443
   }

Loading…
取消
儲存