Browse Source

Merge branch 'Development' into planner_oh_planner

Latest upstream commits
Scott Lahteine 10 years ago
parent
commit
34a41648ab

+ 0
- 6
Marlin/Configuration.h View File

@@ -417,12 +417,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
417 417
 
418 418
   #ifdef AUTO_BED_LEVELING_GRID
419 419
 
420
-    // Use one of these defines to specify the origin
421
-    // for a topographical map to be printed for your bed.
422
-    enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
423
-    #define TOPO_ORIGIN OriginFrontLeft
424
-
425
-    // The edges of the rectangle in which to probe
426 420
     #define LEFT_PROBE_BED_POSITION 15
427 421
     #define RIGHT_PROBE_BED_POSITION 170
428 422
     #define FRONT_PROBE_BED_POSITION 20

+ 7
- 7
Marlin/ConfigurationStore.cpp View File

@@ -18,7 +18,7 @@
18 18
  *  max_xy_jerk
19 19
  *  max_z_jerk
20 20
  *  max_e_jerk
21
- *  add_homing (x3)
21
+ *  home_offset (x3)
22 22
  *
23 23
  * Mesh bed leveling:
24 24
  *  active
@@ -136,7 +136,7 @@ void Config_StoreSettings()  {
136 136
   EEPROM_WRITE_VAR(i, max_xy_jerk);
137 137
   EEPROM_WRITE_VAR(i, max_z_jerk);
138 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 141
   uint8_t mesh_num_x = 3;
142 142
   uint8_t mesh_num_y = 3;
@@ -294,7 +294,7 @@ void Config_RetrieveSettings() {
294 294
     EEPROM_READ_VAR(i, max_xy_jerk);
295 295
     EEPROM_READ_VAR(i, max_z_jerk);
296 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 299
     uint8_t mesh_num_x = 0;
300 300
     uint8_t mesh_num_y = 0;
@@ -447,7 +447,7 @@ void Config_ResetDefault() {
447 447
   max_xy_jerk = DEFAULT_XYJERK;
448 448
   max_z_jerk = DEFAULT_ZJERK;
449 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 452
   #if defined(MESH_BED_LEVELING)
453 453
     mbl.active = 0;
@@ -607,9 +607,9 @@ void Config_PrintSettings(bool forReplay) {
607 607
     SERIAL_ECHOLNPGM("Home offset (mm):");
608 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 613
   SERIAL_EOL;
614 614
 
615 615
   #ifdef DELTA

+ 1
- 1
Marlin/Marlin.h View File

@@ -240,7 +240,7 @@ extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in per
240 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 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 242
 extern float current_position[NUM_AXIS] ;
243
-extern float add_homing[3];
243
+extern float home_offset[3];
244 244
 #ifdef DELTA
245 245
 extern float endstop_adj[3];
246 246
 extern float delta_radius;

+ 80
- 105
Marlin/Marlin_main.cpp View File

@@ -248,7 +248,7 @@ float volumetric_multiplier[EXTRUDERS] = {1.0
248 248
   #endif
249 249
 };
250 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 252
 #ifdef DELTA
253 253
   float endstop_adj[3] = { 0, 0, 0 };
254 254
 #endif
@@ -984,7 +984,7 @@ static int dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
984 984
 
985 985
 static float x_home_pos(int extruder) {
986 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 988
   else
989 989
     // In dual carriage mode the extruder offset provides an override of the
990 990
     // second X-carriage offset when homed - otherwise X2_HOME_POS is used.
@@ -1016,9 +1016,9 @@ static void axis_is_at_home(int axis) {
1016 1016
       return;
1017 1017
     }
1018 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 1022
                                   max(extruder_offset[X_AXIS][1], X2_MAX_POS) - duplicate_extruder_x_offset);
1023 1023
       return;
1024 1024
     }
@@ -1046,11 +1046,11 @@ static void axis_is_at_home(int axis) {
1046 1046
      
1047 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 1054
     // SERIAL_ECHOPGM(" addhome Theta="); SERIAL_ECHO(delta[X_AXIS]);
1055 1055
     // SERIAL_ECHOPGM(" addhome Psi+Theta="); SERIAL_ECHOLN(delta[Y_AXIS]);
1056 1056
       
@@ -1068,14 +1068,14 @@ static void axis_is_at_home(int axis) {
1068 1068
    } 
1069 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 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 1079
 #endif
1080 1080
 }
1081 1081
 
@@ -1309,7 +1309,13 @@ static void engage_z_probe() {
1309 1309
 static void retract_z_probe() {
1310 1310
   // Retract Z Servo endstop if enabled
1311 1311
   #ifdef SERVO_ENDSTOPS
1312
-    if (servo_endstops[Z_AXIS] > -1) {
1312
+    if (servo_endstops[Z_AXIS] > -1)
1313
+    {
1314
+      #if Z_RAISE_AFTER_PROBING > 0
1315
+        do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_AFTER_PROBING);
1316
+        st_synchronize();
1317
+      #endif
1318
+    
1313 1319
       #if SERVO_LEVELING
1314 1320
         servos[servo_endstops[Z_AXIS]].attach(0);
1315 1321
       #endif
@@ -1322,7 +1328,7 @@ static void retract_z_probe() {
1322 1328
   #elif defined(Z_PROBE_ALLEN_KEY)
1323 1329
     // Move up for safety
1324 1330
     feedrate = homing_feedrate[X_AXIS];
1325
-    destination[Z_AXIS] = current_position[Z_AXIS] + 20;
1331
+    destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING;
1326 1332
     prepare_move_raw();
1327 1333
 
1328 1334
     // Move to the start position to initiate retraction
@@ -1364,10 +1370,15 @@ static void retract_z_probe() {
1364 1370
 
1365 1371
 }
1366 1372
 
1367
-enum ProbeAction { ProbeStay, ProbeEngage, ProbeRetract, ProbeEngageRetract };
1373
+enum ProbeAction {
1374
+  ProbeStay             = 0,
1375
+  ProbeEngage           = BIT(0),
1376
+  ProbeRetract          = BIT(1),
1377
+  ProbeEngageAndRetract = (ProbeEngage | ProbeRetract)
1378
+};
1368 1379
 
1369 1380
 /// Probe bed height at position (x,y), returns the measured z value
1370
-static float probe_pt(float x, float y, float z_before, ProbeAction retract_action=ProbeEngageRetract, int verbose_level=1) {
1381
+static float probe_pt(float x, float y, float z_before, ProbeAction retract_action=ProbeEngageAndRetract, int verbose_level=1) {
1371 1382
   // move to right place
1372 1383
   do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before);
1373 1384
   do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);
@@ -1858,7 +1869,7 @@ inline void gcode_G28() {
1858 1869
       if (code_value_long() != 0) {
1859 1870
           current_position[X_AXIS] = code_value()
1860 1871
             #ifndef SCARA
1861
-              + add_homing[X_AXIS]
1872
+              + home_offset[X_AXIS]
1862 1873
             #endif
1863 1874
           ;
1864 1875
       }
@@ -1867,7 +1878,7 @@ inline void gcode_G28() {
1867 1878
     if (code_seen(axis_codes[Y_AXIS]) && code_value_long() != 0) {
1868 1879
       current_position[Y_AXIS] = code_value()
1869 1880
         #ifndef SCARA
1870
-          + add_homing[Y_AXIS]
1881
+          + home_offset[Y_AXIS]
1871 1882
         #endif
1872 1883
       ;
1873 1884
     }
@@ -1941,7 +1952,7 @@ inline void gcode_G28() {
1941 1952
 
1942 1953
 
1943 1954
     if (code_seen(axis_codes[Z_AXIS]) && code_value_long() != 0)
1944
-      current_position[Z_AXIS] = code_value() + add_homing[Z_AXIS];
1955
+      current_position[Z_AXIS] = code_value() + home_offset[Z_AXIS];
1945 1956
 
1946 1957
     #ifdef ENABLE_AUTO_BED_LEVELING
1947 1958
       if (home_all_axis || code_seen(axis_codes[Z_AXIS]))
@@ -2166,7 +2177,7 @@ inline void gcode_G28() {
2166 2177
     #ifdef AUTO_BED_LEVELING_GRID
2167 2178
 
2168 2179
     #ifndef DELTA
2169
-      bool topo_flag = verbose_level > 2 || code_seen('T') || code_seen('t');
2180
+      bool do_topography_map = verbose_level > 2 || code_seen('T') || code_seen('t');
2170 2181
     #endif
2171 2182
 
2172 2183
       if (verbose_level > 0)
@@ -2221,7 +2232,7 @@ inline void gcode_G28() {
2221 2232
 
2222 2233
     #ifdef Z_PROBE_SLED
2223 2234
       dock_sled(false); // engage (un-dock) the probe
2224
-    #elif not defined(SERVO_ENDSTOPS)
2235
+    #elif defined(Z_PROBE_ALLEN_KEY)
2225 2236
       engage_z_probe();
2226 2237
     #endif
2227 2238
 
@@ -2271,42 +2282,36 @@ inline void gcode_G28() {
2271 2282
       delta_grid_spacing[1] = yGridSpacing;
2272 2283
 
2273 2284
       float z_offset = Z_PROBE_OFFSET_FROM_EXTRUDER;
2274
-      if (code_seen(axis_codes[Z_AXIS])) {
2275
-        z_offset += code_value();
2276
-      }
2285
+      if (code_seen(axis_codes[Z_AXIS])) z_offset += code_value();
2277 2286
     #endif
2278 2287
 
2279 2288
       int probePointCounter = 0;
2280 2289
       bool zig = true;
2281 2290
 
2282
-      for (int yCount=0; yCount < auto_bed_leveling_grid_points; yCount++)
2283
-      {
2291
+      for (int yCount = 0; yCount < auto_bed_leveling_grid_points; yCount++) {
2284 2292
         double yProbe = front_probe_bed_position + yGridSpacing * yCount;
2285 2293
         int xStart, xStop, xInc;
2286 2294
 
2287
-        if (zig)
2288
-        {
2295
+        if (zig) {
2289 2296
           xStart = 0;
2290 2297
           xStop = auto_bed_leveling_grid_points;
2291 2298
           xInc = 1;
2292 2299
           zig = false;
2293 2300
         }
2294
-        else
2295
-        {
2301
+        else {
2296 2302
           xStart = auto_bed_leveling_grid_points - 1;
2297 2303
           xStop = -1;
2298 2304
           xInc = -1;
2299 2305
           zig = true;
2300 2306
         }
2301 2307
 
2302
-      #ifndef DELTA
2303
-        // If topo_flag is set then don't zig-zag. Just scan in one direction.
2304
-        // This gets the probe points in more readable order.
2305
-        if (!topo_flag) zig = !zig;
2306
-      #endif
2308
+        #ifndef DELTA
2309
+          // If do_topography_map is set then don't zig-zag. Just scan in one direction.
2310
+          // This gets the probe points in more readable order.
2311
+          if (!do_topography_map) zig = !zig;
2312
+        #endif
2307 2313
 
2308
-        for (int xCount=xStart; xCount != xStop; xCount += xInc)
2309
-        {
2314
+        for (int xCount = xStart; xCount != xStop; xCount += xInc) {
2310 2315
           double xProbe = left_probe_bed_position + xGridSpacing * xCount;
2311 2316
 
2312 2317
           // raise extruder
@@ -2331,7 +2336,7 @@ inline void gcode_G28() {
2331 2336
               act = ProbeStay;
2332 2337
           }
2333 2338
           else
2334
-            act = ProbeEngageRetract;
2339
+            act = ProbeEngageAndRetract;
2335 2340
 
2336 2341
           measured_z = probe_pt(xProbe, yProbe, z_before, act, verbose_level);
2337 2342
 
@@ -2373,49 +2378,31 @@ inline void gcode_G28() {
2373 2378
         }
2374 2379
       }
2375 2380
 
2376
-      if (topo_flag) {
2377
-
2378
-        int xx, yy;
2381
+      // Show the Topography map if enabled
2382
+      if (do_topography_map) {
2379 2383
 
2380 2384
         SERIAL_PROTOCOLPGM(" \nBed Height Topography: \n");
2381
-        #if TOPO_ORIGIN == OriginFrontLeft
2382
-          SERIAL_PROTOCOLPGM("+-----------+\n");
2383
-          SERIAL_PROTOCOLPGM("|...Back....|\n");
2384
-          SERIAL_PROTOCOLPGM("|Left..Right|\n");
2385
-          SERIAL_PROTOCOLPGM("|...Front...|\n");
2386
-          SERIAL_PROTOCOLPGM("+-----------+\n");
2387
-          for (yy = auto_bed_leveling_grid_points - 1; yy >= 0; yy--)
2388
-        #else
2389
-          for (yy = 0; yy < auto_bed_leveling_grid_points; yy++)
2390
-        #endif
2391
-          {
2392
-            #if TOPO_ORIGIN == OriginBackRight
2393
-              for (xx = 0; xx < auto_bed_leveling_grid_points; xx++)
2394
-            #else
2395
-              for (xx = auto_bed_leveling_grid_points - 1; xx >= 0; xx--)
2396
-            #endif
2397
-              {
2398
-                int ind =
2399
-                  #if TOPO_ORIGIN == OriginBackRight || TOPO_ORIGIN == OriginFrontLeft
2400
-                    yy * auto_bed_leveling_grid_points + xx
2401
-                  #elif TOPO_ORIGIN == OriginBackLeft
2402
-                    xx * auto_bed_leveling_grid_points + yy
2403
-                  #elif TOPO_ORIGIN == OriginFrontRight
2404
-                    abl2 - xx * auto_bed_leveling_grid_points - yy - 1
2405
-                  #endif
2406
-                ;
2407
-                float diff = eqnBVector[ind] - mean;
2408
-                if (diff >= 0.0)
2409
-                  SERIAL_PROTOCOLPGM(" +");   // Include + for column alignment
2410
-                else
2411
-                  SERIAL_PROTOCOLPGM(" ");
2412
-                SERIAL_PROTOCOL_F(diff, 5);
2413
-              } // xx
2414
-              SERIAL_EOL;
2415
-          } // yy
2385
+        SERIAL_PROTOCOLPGM("+-----------+\n");
2386
+        SERIAL_PROTOCOLPGM("|...Back....|\n");
2387
+        SERIAL_PROTOCOLPGM("|Left..Right|\n");
2388
+        SERIAL_PROTOCOLPGM("|...Front...|\n");
2389
+        SERIAL_PROTOCOLPGM("+-----------+\n");
2390
+
2391
+        for (int yy = auto_bed_leveling_grid_points - 1; yy >= 0; yy--) {
2392
+          for (int xx = auto_bed_leveling_grid_points - 1; xx >= 0; xx--) {
2393
+            int ind = yy * auto_bed_leveling_grid_points + xx;
2394
+            float diff = eqnBVector[ind] - mean;
2395
+            if (diff >= 0.0)
2396
+              SERIAL_PROTOCOLPGM(" +");   // Include + for column alignment
2397
+            else
2398
+              SERIAL_PROTOCOLPGM(" ");
2399
+            SERIAL_PROTOCOL_F(diff, 5);
2400
+          } // xx
2416 2401
           SERIAL_EOL;
2402
+        } // yy
2403
+        SERIAL_EOL;
2417 2404
 
2418
-      } //topo_flag
2405
+      } //do_topography_map
2419 2406
 
2420 2407
 
2421 2408
       set_bed_level_equation_lsq(plane_equation_coefficients);
@@ -2437,18 +2424,15 @@ inline void gcode_G28() {
2437 2424
         z_at_pt_3 = probe_pt(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, ProbeRetract, verbose_level);
2438 2425
       }
2439 2426
       else {
2440
-        z_at_pt_1 = probe_pt(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, Z_RAISE_BEFORE_PROBING, verbose_level=verbose_level);
2441
-        z_at_pt_2 = probe_pt(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, verbose_level=verbose_level);
2442
-        z_at_pt_3 = probe_pt(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, verbose_level=verbose_level);
2427
+        z_at_pt_1 = probe_pt(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, Z_RAISE_BEFORE_PROBING, ProbeEngageAndRetract, verbose_level);
2428
+        z_at_pt_2 = probe_pt(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, ProbeEngageAndRetract, verbose_level);
2429
+        z_at_pt_3 = probe_pt(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS, ProbeEngageAndRetract, verbose_level);
2443 2430
       }
2444 2431
       clean_up_after_endstop_move();
2445 2432
       set_bed_level_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3);
2446 2433
 
2447 2434
     #endif // !AUTO_BED_LEVELING_GRID
2448 2435
 
2449
-    do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_AFTER_PROBING);
2450
-    st_synchronize();
2451
-
2452 2436
   #ifndef DELTA
2453 2437
     if (verbose_level > 0)
2454 2438
       plan_bed_level_matrix.debug(" \n\nBed Level Correction Matrix:");
@@ -2468,7 +2452,7 @@ inline void gcode_G28() {
2468 2452
 
2469 2453
   #ifdef Z_PROBE_SLED
2470 2454
     dock_sled(true, -SLED_DOCKING_OFFSET); // dock the probe, correcting for over-travel
2471
-  #elif not defined(SERVO_ENDSTOPS)
2455
+  #elif defined(Z_PROBE_ALLEN_KEY)
2472 2456
     retract_z_probe();
2473 2457
   #endif
2474 2458
     
@@ -2513,22 +2497,13 @@ inline void gcode_G92() {
2513 2497
   if (!code_seen(axis_codes[E_AXIS]))
2514 2498
     st_synchronize();
2515 2499
 
2516
-  for (int i=0;i<NUM_AXIS;i++) {
2500
+  for (int i = 0; i < NUM_AXIS; i++) {
2517 2501
     if (code_seen(axis_codes[i])) {
2518
-      if (i == E_AXIS) {
2519
-        current_position[i] = code_value();
2502
+      current_position[i] = code_value();
2503
+      if (i == E_AXIS)
2520 2504
         plan_set_e_position(current_position[E_AXIS]);
2521
-      }
2522
-      else {
2523
-        current_position[i] = code_value() +
2524
-          #ifdef SCARA
2525
-            ((i != X_AXIS && i != Y_AXIS) ? add_homing[i] : 0)
2526
-          #else
2527
-            add_homing[i]
2528
-          #endif
2529
-        ;
2505
+      else
2530 2506
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
2531
-      }
2532 2507
     }
2533 2508
   }
2534 2509
 }
@@ -3465,9 +3440,9 @@ inline void gcode_M114() {
3465 3440
     SERIAL_PROTOCOLLN("");
3466 3441
     
3467 3442
     SERIAL_PROTOCOLPGM("SCARA Cal - Theta:");
3468
-    SERIAL_PROTOCOL(delta[X_AXIS]+add_homing[X_AXIS]);
3443
+    SERIAL_PROTOCOL(delta[X_AXIS]+home_offset[X_AXIS]);
3469 3444
     SERIAL_PROTOCOLPGM("   Psi+Theta (90):");
3470
-    SERIAL_PROTOCOL(delta[Y_AXIS]-delta[X_AXIS]-90+add_homing[Y_AXIS]);
3445
+    SERIAL_PROTOCOL(delta[Y_AXIS]-delta[X_AXIS]-90+home_offset[Y_AXIS]);
3471 3446
     SERIAL_PROTOCOLLN("");
3472 3447
     
3473 3448
     SERIAL_PROTOCOLPGM("SCARA step Cal - Theta:");
@@ -3685,12 +3660,12 @@ inline void gcode_M205() {
3685 3660
 inline void gcode_M206() {
3686 3661
   for (int8_t i=X_AXIS; i <= Z_AXIS; i++) {
3687 3662
     if (code_seen(axis_codes[i])) {
3688
-      add_homing[i] = code_value();
3663
+      home_offset[i] = code_value();
3689 3664
     }
3690 3665
   }
3691 3666
   #ifdef SCARA
3692
-    if (code_seen('T')) add_homing[X_AXIS] = code_value(); // Theta
3693
-    if (code_seen('P')) add_homing[Y_AXIS] = code_value(); // Psi
3667
+    if (code_seen('T')) home_offset[X_AXIS] = code_value(); // Theta
3668
+    if (code_seen('P')) home_offset[Y_AXIS] = code_value(); // Psi
3694 3669
   #endif
3695 3670
 }
3696 3671
 
@@ -5288,7 +5263,7 @@ void clamp_to_software_endstops(float target[3])
5288 5263
     float negative_z_offset = 0;
5289 5264
     #ifdef ENABLE_AUTO_BED_LEVELING
5290 5265
       if (Z_PROBE_OFFSET_FROM_EXTRUDER < 0) negative_z_offset = negative_z_offset + Z_PROBE_OFFSET_FROM_EXTRUDER;
5291
-      if (add_homing[Z_AXIS] < 0) negative_z_offset = negative_z_offset + add_homing[Z_AXIS];
5266
+      if (home_offset[Z_AXIS] < 0) negative_z_offset = negative_z_offset + home_offset[Z_AXIS];
5292 5267
     #endif
5293 5268
     
5294 5269
     if (target[Z_AXIS] < min_pos[Z_AXIS]+negative_z_offset) target[Z_AXIS] = min_pos[Z_AXIS]+negative_z_offset;

+ 0
- 6
Marlin/configurator/config/Configuration.h View File

@@ -457,12 +457,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
457 457
 
458 458
   #ifdef AUTO_BED_LEVELING_GRID
459 459
 
460
-    // Use one of these defines to specify the origin
461
-    // for a topographical map to be printed for your bed.
462
-    enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
463
-    #define TOPO_ORIGIN OriginFrontLeft
464
-
465
-    // The edges of the rectangle in which to probe
466 460
     #define LEFT_PROBE_BED_POSITION 15
467 461
     #define RIGHT_PROBE_BED_POSITION 170
468 462
     #define FRONT_PROBE_BED_POSITION 20

+ 1
- 6
Marlin/example_configurations/Felix/Configuration.h View File

@@ -403,12 +403,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
403 403
   // Note: this feature occupies 10'206 byte
404 404
   #ifdef AUTO_BED_LEVELING_GRID
405 405
 
406
-    // Use one of these defines to specify the origin
407
-    // for a topographical map to be printed for your bed.
408
-    enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
409
-    #define TOPO_ORIGIN OriginFrontLeft
410
-
411
-    // set the rectangle in which to probe
406
+home_offset    // set the rectangle in which to probe
412 407
     #define LEFT_PROBE_BED_POSITION 15
413 408
     #define RIGHT_PROBE_BED_POSITION 170
414 409
     #define BACK_PROBE_BED_POSITION 180

+ 1
- 6
Marlin/example_configurations/Felix/Configuration_DUAL.h View File

@@ -403,12 +403,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
403 403
   // Note: this feature occupies 10'206 byte
404 404
   #ifdef AUTO_BED_LEVELING_GRID
405 405
 
406
-    // Use one of these defines to specify the origin
407
-    // for a topographical map to be printed for your bed.
408
-    enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
409
-    #define TOPO_ORIGIN OriginFrontLeft
410
-
411
-    // set the rectangle in which to probe
406
+home_offset    // set the rectangle in which to probe
412 407
     #define LEFT_PROBE_BED_POSITION 15
413 408
     #define RIGHT_PROBE_BED_POSITION 170
414 409
     #define BACK_PROBE_BED_POSITION 180

+ 0
- 6
Marlin/example_configurations/Hephestos/Configuration.h View File

@@ -427,12 +427,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
427 427
 
428 428
   #ifdef AUTO_BED_LEVELING_GRID
429 429
 
430
-    // Use one of these defines to specify the origin
431
-    // for a topographical map to be printed for your bed.
432
-    enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
433
-    #define TOPO_ORIGIN OriginFrontLeft
434
-
435
-    // The edges of the rectangle in which to probe
436 430
     #define LEFT_PROBE_BED_POSITION 15
437 431
     #define RIGHT_PROBE_BED_POSITION 170
438 432
     #define FRONT_PROBE_BED_POSITION 20

+ 0
- 6
Marlin/example_configurations/K8200/Configuration.h View File

@@ -432,12 +432,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
432 432
 
433 433
   #ifdef AUTO_BED_LEVELING_GRID
434 434
 
435
-    // Use one of these defines to specify the origin
436
-    // for a topographical map to be printed for your bed.
437
-    enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
438
-    #define TOPO_ORIGIN OriginFrontLeft
439
-
440
-    // The edges of the rectangle in which to probe
441 435
     #define LEFT_PROBE_BED_POSITION 15
442 436
     #define RIGHT_PROBE_BED_POSITION 170
443 437
     #define FRONT_PROBE_BED_POSITION 20

+ 0
- 6
Marlin/example_configurations/SCARA/Configuration.h View File

@@ -456,12 +456,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
456 456
 
457 457
   #ifdef AUTO_BED_LEVELING_GRID
458 458
 
459
-    // Use one of these defines to specify the origin
460
-    // for a topographical map to be printed for your bed.
461
-    enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
462
-    #define TOPO_ORIGIN OriginFrontLeft
463
-
464
-    // The edges of the rectangle in which to probe
465 459
     #define LEFT_PROBE_BED_POSITION 15
466 460
     #define RIGHT_PROBE_BED_POSITION 170
467 461
     #define FRONT_PROBE_BED_POSITION 20

+ 0
- 6
Marlin/example_configurations/WITBOX/Configuration.h View File

@@ -426,12 +426,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
426 426
 
427 427
   #ifdef AUTO_BED_LEVELING_GRID
428 428
 
429
-    // Use one of these defines to specify the origin
430
-    // for a topographical map to be printed for your bed.
431
-    enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
432
-    #define TOPO_ORIGIN OriginFrontLeft
433
-
434
-    // The edges of the rectangle in which to probe
435 429
     #define LEFT_PROBE_BED_POSITION 15
436 430
     #define RIGHT_PROBE_BED_POSITION 170
437 431
     #define FRONT_PROBE_BED_POSITION 20

+ 0
- 6
Marlin/example_configurations/makibox/Configuration.h View File

@@ -424,12 +424,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
424 424
 
425 425
   #ifdef AUTO_BED_LEVELING_GRID
426 426
 
427
-    // Use one of these defines to specify the origin
428
-    // for a topographical map to be printed for your bed.
429
-    enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
430
-    #define TOPO_ORIGIN OriginFrontLeft
431
-
432
-    // The edges of the rectangle in which to probe
433 427
     #define LEFT_PROBE_BED_POSITION 15
434 428
     #define RIGHT_PROBE_BED_POSITION 170
435 429
     #define FRONT_PROBE_BED_POSITION 20

+ 0
- 6
Marlin/example_configurations/tvrrug/Round2/Configuration.h View File

@@ -426,12 +426,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
426 426
 
427 427
   #ifdef AUTO_BED_LEVELING_GRID
428 428
 
429
-    // Use one of these defines to specify the origin
430
-    // for a topographical map to be printed for your bed.
431
-    enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
432
-    #define TOPO_ORIGIN OriginFrontLeft
433
-
434
-    // The edges of the rectangle in which to probe
435 429
     #define LEFT_PROBE_BED_POSITION 15
436 430
     #define RIGHT_PROBE_BED_POSITION 170
437 431
     #define FRONT_PROBE_BED_POSITION 20

+ 7
- 13
Marlin/stepper.cpp View File

@@ -102,11 +102,8 @@ volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1 };
102 102
       X_DIR_WRITE(v); \
103 103
       X2_DIR_WRITE(v); \
104 104
     } \
105
-    else{ \
106
-      if (current_block->active_extruder) \
107
-        X2_DIR_WRITE(v); \
108
-      else \
109
-        X_DIR_WRITE(v); \
105
+    else { \
106
+      if (current_block->active_extruder) X2_DIR_WRITE(v); else X_DIR_WRITE(v); \
110 107
     }
111 108
   #define X_APPLY_STEP(v,ALWAYS) \
112 109
     if (extruder_duplication_enabled || ALWAYS) { \
@@ -114,10 +111,7 @@ volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1 };
114 111
       X2_STEP_WRITE(v); \
115 112
     } \
116 113
     else { \
117
-      if (current_block->active_extruder != 0) \
118
-        X2_STEP_WRITE(v); \
119
-      else \
120
-        X_STEP_WRITE(v); \
114
+      if (current_block->active_extruder != 0) X2_STEP_WRITE(v); else X_STEP_WRITE(v); \
121 115
     }
122 116
 #else
123 117
   #define X_APPLY_DIR(v,Q) X_DIR_WRITE(v)
@@ -125,16 +119,16 @@ volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1 };
125 119
 #endif
126 120
 
127 121
 #ifdef Y_DUAL_STEPPER_DRIVERS
128
-  #define Y_APPLY_DIR(v,Q) Y_DIR_WRITE(v), Y2_DIR_WRITE((v) != INVERT_Y2_VS_Y_DIR)
129
-  #define Y_APPLY_STEP(v,Q) Y_STEP_WRITE(v), Y2_STEP_WRITE(v)
122
+  #define Y_APPLY_DIR(v,Q) { Y_DIR_WRITE(v); Y2_DIR_WRITE((v) != INVERT_Y2_VS_Y_DIR); }
123
+  #define Y_APPLY_STEP(v,Q) { Y_STEP_WRITE(v); Y2_STEP_WRITE(v); }
130 124
 #else
131 125
   #define Y_APPLY_DIR(v,Q) Y_DIR_WRITE(v)
132 126
   #define Y_APPLY_STEP(v,Q) Y_STEP_WRITE(v)
133 127
 #endif
134 128
 
135 129
 #ifdef Z_DUAL_STEPPER_DRIVERS
136
-  #define Z_APPLY_DIR(v,Q) Z_DIR_WRITE(v), Z2_DIR_WRITE(v)
137
-  #define Z_APPLY_STEP(v,Q) Z_STEP_WRITE(v), Z2_STEP_WRITE(v)
130
+  #define Z_APPLY_DIR(v,Q) { Z_DIR_WRITE(v); Z2_DIR_WRITE(v); }
131
+  #define Z_APPLY_STEP(v,Q) { Z_STEP_WRITE(v); Z2_STEP_WRITE(v); }
138 132
 #else
139 133
   #define Z_APPLY_DIR(v,Q) Z_DIR_WRITE(v)
140 134
   #define Z_APPLY_STEP(v,Q) Z_STEP_WRITE(v)

+ 1
- 1
Marlin/ultralcd.cpp View File

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

Loading…
Cancel
Save