Sfoglia il codice sorgente

Get upstream commits

Scott Lahteine 10 anni fa
parent
commit
4fbb80567e

+ 0
- 6
Marlin/Configuration.h Vedi File

413
 
413
 
414
   #ifdef AUTO_BED_LEVELING_GRID
414
   #ifdef AUTO_BED_LEVELING_GRID
415
 
415
 
416
-    // Use one of these defines to specify the origin
417
-    // for a topographical map to be printed for your bed.
418
-    enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
419
-    #define TOPO_ORIGIN OriginFrontLeft
420
-
421
-    // The edges of the rectangle in which to probe
422
     #define LEFT_PROBE_BED_POSITION 15
416
     #define LEFT_PROBE_BED_POSITION 15
423
     #define RIGHT_PROBE_BED_POSITION 170
417
     #define RIGHT_PROBE_BED_POSITION 170
424
     #define FRONT_PROBE_BED_POSITION 20
418
     #define FRONT_PROBE_BED_POSITION 20

+ 7
- 7
Marlin/ConfigurationStore.cpp Vedi File

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 Vedi File

235
 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.
235
 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.
236
 extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
236
 extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
237
 extern float current_position[NUM_AXIS] ;
237
 extern float current_position[NUM_AXIS] ;
238
-extern float add_homing[3];
238
+extern float home_offset[3];
239
 #ifdef DELTA
239
 #ifdef DELTA
240
   extern float endstop_adj[3];
240
   extern float endstop_adj[3];
241
   extern float delta_radius;
241
   extern float delta_radius;

+ 83
- 107
Marlin/Marlin_main.cpp Vedi File

245
   #endif
245
   #endif
246
 };
246
 };
247
 float current_position[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0 };
247
 float current_position[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0 };
248
-float add_homing[3] = { 0, 0, 0 };
248
+float home_offset[3] = { 0, 0, 0 };
249
 #ifdef DELTA
249
 #ifdef DELTA
250
   float endstop_adj[3] = { 0, 0, 0 };
250
   float endstop_adj[3] = { 0, 0, 0 };
251
 #endif
251
 #endif
1006
       return;
1006
       return;
1007
     }
1007
     }
1008
     else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) {
1008
     else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) {
1009
-      current_position[X_AXIS] = base_home_pos(X_AXIS) + add_homing[X_AXIS];
1010
-      min_pos[X_AXIS] =          base_min_pos(X_AXIS) + add_homing[X_AXIS];
1011
-      max_pos[X_AXIS] =          min(base_max_pos(X_AXIS) + add_homing[X_AXIS],
1009
+      current_position[X_AXIS] = base_home_pos(X_AXIS) + home_offset[X_AXIS];
1010
+      min_pos[X_AXIS] =          base_min_pos(X_AXIS) + home_offset[X_AXIS];
1011
+      max_pos[X_AXIS] =          min(base_max_pos(X_AXIS) + home_offset[X_AXIS],
1012
                                   max(extruder_offset[X_AXIS][1], X2_MAX_POS) - duplicate_extruder_x_offset);
1012
                                   max(extruder_offset[X_AXIS][1], X2_MAX_POS) - duplicate_extruder_x_offset);
1013
       return;
1013
       return;
1014
     }
1014
     }
1036
      
1036
      
1037
      for (i=0; i<2; i++)
1037
      for (i=0; i<2; i++)
1038
      {
1038
      {
1039
-        delta[i] -= add_homing[i];
1039
+        delta[i] -= home_offset[i];
1040
      } 
1040
      } 
1041
      
1041
      
1042
-    // SERIAL_ECHOPGM("addhome X="); SERIAL_ECHO(add_homing[X_AXIS]);
1043
-  // SERIAL_ECHOPGM(" addhome Y="); SERIAL_ECHO(add_homing[Y_AXIS]);
1042
+    // SERIAL_ECHOPGM("addhome X="); SERIAL_ECHO(home_offset[X_AXIS]);
1043
+  // SERIAL_ECHOPGM(" addhome Y="); SERIAL_ECHO(home_offset[Y_AXIS]);
1044
     // SERIAL_ECHOPGM(" addhome Theta="); SERIAL_ECHO(delta[X_AXIS]);
1044
     // SERIAL_ECHOPGM(" addhome Theta="); SERIAL_ECHO(delta[X_AXIS]);
1045
     // SERIAL_ECHOPGM(" addhome Psi+Theta="); SERIAL_ECHOLN(delta[Y_AXIS]);
1045
     // SERIAL_ECHOPGM(" addhome Psi+Theta="); SERIAL_ECHOLN(delta[Y_AXIS]);
1046
       
1046
       
1058
    } 
1058
    } 
1059
    else
1059
    else
1060
    {
1060
    {
1061
-      current_position[axis] = base_home_pos(axis) + add_homing[axis];
1062
-      min_pos[axis] =          base_min_pos(axis) + add_homing[axis];
1063
-      max_pos[axis] =          base_max_pos(axis) + add_homing[axis];
1061
+      current_position[axis] = base_home_pos(axis) + home_offset[axis];
1062
+      min_pos[axis] =          base_min_pos(axis) + home_offset[axis];
1063
+      max_pos[axis] =          base_max_pos(axis) + home_offset[axis];
1064
    }
1064
    }
1065
 #else
1065
 #else
1066
-  current_position[axis] = base_home_pos(axis) + add_homing[axis];
1067
-  min_pos[axis] =          base_min_pos(axis) + add_homing[axis];
1068
-  max_pos[axis] =          base_max_pos(axis) + add_homing[axis];
1066
+  current_position[axis] = base_home_pos(axis) + home_offset[axis];
1067
+  min_pos[axis] =          base_min_pos(axis) + home_offset[axis];
1068
+  max_pos[axis] =          base_max_pos(axis) + home_offset[axis];
1069
 #endif
1069
 #endif
1070
 }
1070
 }
1071
 
1071
 
1299
 static void retract_z_probe() {
1299
 static void retract_z_probe() {
1300
   // Retract Z Servo endstop if enabled
1300
   // Retract Z Servo endstop if enabled
1301
   #ifdef SERVO_ENDSTOPS
1301
   #ifdef SERVO_ENDSTOPS
1302
-    if (servo_endstops[Z_AXIS] > -1) {
1302
+    if (servo_endstops[Z_AXIS] > -1)
1303
+    {
1304
+      #if Z_RAISE_AFTER_PROBING > 0
1305
+        do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_AFTER_PROBING);
1306
+        st_synchronize();
1307
+      #endif
1308
+    
1303
       #if SERVO_LEVELING
1309
       #if SERVO_LEVELING
1304
         servos[servo_endstops[Z_AXIS]].attach(0);
1310
         servos[servo_endstops[Z_AXIS]].attach(0);
1305
       #endif
1311
       #endif
1312
   #elif defined(Z_PROBE_ALLEN_KEY)
1318
   #elif defined(Z_PROBE_ALLEN_KEY)
1313
     // Move up for safety
1319
     // Move up for safety
1314
     feedrate = homing_feedrate[X_AXIS];
1320
     feedrate = homing_feedrate[X_AXIS];
1315
-    destination[Z_AXIS] = current_position[Z_AXIS] + 20;
1321
+    destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING;
1316
     prepare_move_raw();
1322
     prepare_move_raw();
1317
 
1323
 
1318
     // Move to the start position to initiate retraction
1324
     // Move to the start position to initiate retraction
1354
 
1360
 
1355
 }
1361
 }
1356
 
1362
 
1357
-enum ProbeAction { ProbeStay, ProbeEngage, ProbeRetract, ProbeEngageRetract };
1363
+enum ProbeAction {
1364
+  ProbeStay             = 0,
1365
+  ProbeEngage           = BIT(0),
1366
+  ProbeRetract          = BIT(1),
1367
+  ProbeEngageAndRetract = (ProbeEngage | ProbeRetract)
1368
+};
1358
 
1369
 
1359
 /// Probe bed height at position (x,y), returns the measured z value
1370
 /// Probe bed height at position (x,y), returns the measured z value
1360
-static float probe_pt(float x, float y, float z_before, ProbeAction retract_action=ProbeEngageRetract, int verbose_level=1) {
1371
+static float probe_pt(float x, float y, float z_before, ProbeAction retract_action=ProbeEngageAndRetract, int verbose_level=1) {
1361
   // move to right place
1372
   // move to right place
1362
   do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before);
1373
   do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before);
1363
   do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);
1374
   do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);
1848
       if (code_value_long() != 0) {
1859
       if (code_value_long() != 0) {
1849
           current_position[X_AXIS] = code_value()
1860
           current_position[X_AXIS] = code_value()
1850
             #ifndef SCARA
1861
             #ifndef SCARA
1851
-              + add_homing[X_AXIS]
1862
+              + home_offset[X_AXIS]
1852
             #endif
1863
             #endif
1853
           ;
1864
           ;
1854
       }
1865
       }
1857
     if (code_seen(axis_codes[Y_AXIS]) && code_value_long() != 0) {
1868
     if (code_seen(axis_codes[Y_AXIS]) && code_value_long() != 0) {
1858
       current_position[Y_AXIS] = code_value()
1869
       current_position[Y_AXIS] = code_value()
1859
         #ifndef SCARA
1870
         #ifndef SCARA
1860
-          + add_homing[Y_AXIS]
1871
+          + home_offset[Y_AXIS]
1861
         #endif
1872
         #endif
1862
       ;
1873
       ;
1863
     }
1874
     }
1931
 
1942
 
1932
 
1943
 
1933
     if (code_seen(axis_codes[Z_AXIS]) && code_value_long() != 0)
1944
     if (code_seen(axis_codes[Z_AXIS]) && code_value_long() != 0)
1934
-      current_position[Z_AXIS] = code_value() + add_homing[Z_AXIS];
1945
+      current_position[Z_AXIS] = code_value() + home_offset[Z_AXIS];
1935
 
1946
 
1936
     #ifdef ENABLE_AUTO_BED_LEVELING
1947
     #ifdef ENABLE_AUTO_BED_LEVELING
1937
       if (home_all_axis || code_seen(axis_codes[Z_AXIS]))
1948
       if (home_all_axis || code_seen(axis_codes[Z_AXIS]))
2118
     #ifdef AUTO_BED_LEVELING_GRID
2129
     #ifdef AUTO_BED_LEVELING_GRID
2119
 
2130
 
2120
     #ifndef DELTA
2131
     #ifndef DELTA
2121
-      bool topo_flag = verbose_level > 2 || code_seen('T') || code_seen('t');
2132
+      bool do_topography_map = verbose_level > 2 || code_seen('T') || code_seen('t');
2122
     #endif
2133
     #endif
2123
 
2134
 
2124
       if (verbose_level > 0)
2135
       if (verbose_level > 0)
2173
 
2184
 
2174
     #ifdef Z_PROBE_SLED
2185
     #ifdef Z_PROBE_SLED
2175
       dock_sled(false); // engage (un-dock) the probe
2186
       dock_sled(false); // engage (un-dock) the probe
2176
-    #elif not defined(SERVO_ENDSTOPS)
2187
+    #elif defined(Z_PROBE_ALLEN_KEY)
2177
       engage_z_probe();
2188
       engage_z_probe();
2178
     #endif
2189
     #endif
2179
 
2190
 
2180
     st_synchronize();
2191
     st_synchronize();
2181
 
2192
 
2182
-  #ifdef DELTA
2183
-    reset_bed_level();
2184
-  #else
2193
+    #ifdef DELTA
2194
+      reset_bed_level();
2195
+    #else
2196
+
2185
     // make sure the bed_level_rotation_matrix is identity or the planner will get it incorectly
2197
     // make sure the bed_level_rotation_matrix is identity or the planner will get it incorectly
2186
     //vector_3 corrected_position = plan_get_position_mm();
2198
     //vector_3 corrected_position = plan_get_position_mm();
2187
     //corrected_position.debug("position before G29");
2199
     //corrected_position.debug("position before G29");
2222
       delta_grid_spacing[1] = yGridSpacing;
2234
       delta_grid_spacing[1] = yGridSpacing;
2223
 
2235
 
2224
       float z_offset = Z_PROBE_OFFSET_FROM_EXTRUDER;
2236
       float z_offset = Z_PROBE_OFFSET_FROM_EXTRUDER;
2225
-      if (code_seen(axis_codes[Z_AXIS])) {
2226
-        z_offset += code_value();
2227
-      }
2237
+      if (code_seen(axis_codes[Z_AXIS])) z_offset += code_value();
2228
     #endif
2238
     #endif
2229
 
2239
 
2230
       int probePointCounter = 0;
2240
       int probePointCounter = 0;
2231
       bool zig = true;
2241
       bool zig = true;
2232
 
2242
 
2233
-      for (int yCount=0; yCount < auto_bed_leveling_grid_points; yCount++)
2234
-      {
2243
+      for (int yCount = 0; yCount < auto_bed_leveling_grid_points; yCount++) {
2235
         double yProbe = front_probe_bed_position + yGridSpacing * yCount;
2244
         double yProbe = front_probe_bed_position + yGridSpacing * yCount;
2236
         int xStart, xStop, xInc;
2245
         int xStart, xStop, xInc;
2237
 
2246
 
2238
-        if (zig)
2239
-        {
2247
+        if (zig) {
2240
           xStart = 0;
2248
           xStart = 0;
2241
           xStop = auto_bed_leveling_grid_points;
2249
           xStop = auto_bed_leveling_grid_points;
2242
           xInc = 1;
2250
           xInc = 1;
2243
           zig = false;
2251
           zig = false;
2244
         }
2252
         }
2245
-        else
2246
-        {
2253
+        else {
2247
           xStart = auto_bed_leveling_grid_points - 1;
2254
           xStart = auto_bed_leveling_grid_points - 1;
2248
           xStop = -1;
2255
           xStop = -1;
2249
           xInc = -1;
2256
           xInc = -1;
2250
           zig = true;
2257
           zig = true;
2251
         }
2258
         }
2252
 
2259
 
2253
-      #ifndef DELTA
2254
-        // If topo_flag is set then don't zig-zag. Just scan in one direction.
2255
-        // This gets the probe points in more readable order.
2256
-        if (!topo_flag) zig = !zig;
2257
-      #endif
2260
+        #ifndef DELTA
2261
+          // If do_topography_map is set then don't zig-zag. Just scan in one direction.
2262
+          // This gets the probe points in more readable order.
2263
+          if (!do_topography_map) zig = !zig;
2264
+        #endif
2258
 
2265
 
2259
-        for (int xCount=xStart; xCount != xStop; xCount += xInc)
2260
-        {
2266
+        for (int xCount = xStart; xCount != xStop; xCount += xInc) {
2261
           double xProbe = left_probe_bed_position + xGridSpacing * xCount;
2267
           double xProbe = left_probe_bed_position + xGridSpacing * xCount;
2262
 
2268
 
2263
           // raise extruder
2269
           // raise extruder
2282
               act = ProbeStay;
2288
               act = ProbeStay;
2283
           }
2289
           }
2284
           else
2290
           else
2285
-            act = ProbeEngageRetract;
2291
+            act = ProbeEngageAndRetract;
2286
 
2292
 
2287
           measured_z = probe_pt(xProbe, yProbe, z_before, act, verbose_level);
2293
           measured_z = probe_pt(xProbe, yProbe, z_before, act, verbose_level);
2288
 
2294
 
2324
         }
2330
         }
2325
       }
2331
       }
2326
 
2332
 
2327
-      if (topo_flag) {
2328
-
2329
-        int xx, yy;
2333
+      // Show the Topography map if enabled
2334
+      if (do_topography_map) {
2330
 
2335
 
2331
         SERIAL_PROTOCOLPGM(" \nBed Height Topography: \n");
2336
         SERIAL_PROTOCOLPGM(" \nBed Height Topography: \n");
2332
-        #if TOPO_ORIGIN == OriginFrontLeft
2333
-          SERIAL_PROTOCOLPGM("+-----------+\n");
2334
-          SERIAL_PROTOCOLPGM("|...Back....|\n");
2335
-          SERIAL_PROTOCOLPGM("|Left..Right|\n");
2336
-          SERIAL_PROTOCOLPGM("|...Front...|\n");
2337
-          SERIAL_PROTOCOLPGM("+-----------+\n");
2338
-          for (yy = auto_bed_leveling_grid_points - 1; yy >= 0; yy--)
2339
-        #else
2340
-          for (yy = 0; yy < auto_bed_leveling_grid_points; yy++)
2341
-        #endif
2342
-          {
2343
-            #if TOPO_ORIGIN == OriginBackRight
2344
-              for (xx = 0; xx < auto_bed_leveling_grid_points; xx++)
2345
-            #else
2346
-              for (xx = auto_bed_leveling_grid_points - 1; xx >= 0; xx--)
2347
-            #endif
2348
-              {
2349
-                int ind =
2350
-                  #if TOPO_ORIGIN == OriginBackRight || TOPO_ORIGIN == OriginFrontLeft
2351
-                    yy * auto_bed_leveling_grid_points + xx
2352
-                  #elif TOPO_ORIGIN == OriginBackLeft
2353
-                    xx * auto_bed_leveling_grid_points + yy
2354
-                  #elif TOPO_ORIGIN == OriginFrontRight
2355
-                    abl2 - xx * auto_bed_leveling_grid_points - yy - 1
2356
-                  #endif
2357
-                ;
2358
-                float diff = eqnBVector[ind] - mean;
2359
-                if (diff >= 0.0)
2360
-                  SERIAL_PROTOCOLPGM(" +");   // Include + for column alignment
2361
-                else
2362
-                  SERIAL_PROTOCOLPGM(" ");
2363
-                SERIAL_PROTOCOL_F(diff, 5);
2364
-              } // xx
2365
-              SERIAL_EOL;
2366
-          } // yy
2337
+        SERIAL_PROTOCOLPGM("+-----------+\n");
2338
+        SERIAL_PROTOCOLPGM("|...Back....|\n");
2339
+        SERIAL_PROTOCOLPGM("|Left..Right|\n");
2340
+        SERIAL_PROTOCOLPGM("|...Front...|\n");
2341
+        SERIAL_PROTOCOLPGM("+-----------+\n");
2342
+
2343
+        for (int yy = auto_bed_leveling_grid_points - 1; yy >= 0; yy--) {
2344
+          for (int xx = auto_bed_leveling_grid_points - 1; xx >= 0; xx--) {
2345
+            int ind = yy * auto_bed_leveling_grid_points + xx;
2346
+            float diff = eqnBVector[ind] - mean;
2347
+            if (diff >= 0.0)
2348
+              SERIAL_PROTOCOLPGM(" +");   // Include + for column alignment
2349
+            else
2350
+              SERIAL_PROTOCOLPGM(" ");
2351
+            SERIAL_PROTOCOL_F(diff, 5);
2352
+          } // xx
2367
           SERIAL_EOL;
2353
           SERIAL_EOL;
2354
+        } // yy
2355
+        SERIAL_EOL;
2368
 
2356
 
2369
-      } //topo_flag
2357
+      } //do_topography_map
2370
 
2358
 
2371
 
2359
 
2372
       set_bed_level_equation_lsq(plane_equation_coefficients);
2360
       set_bed_level_equation_lsq(plane_equation_coefficients);
2388
         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);
2376
         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);
2389
       }
2377
       }
2390
       else {
2378
       else {
2391
-        z_at_pt_1 = probe_pt(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, Z_RAISE_BEFORE_PROBING, verbose_level=verbose_level);
2392
-        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);
2393
-        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);
2379
+        z_at_pt_1 = probe_pt(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, Z_RAISE_BEFORE_PROBING, ProbeEngageAndRetract, verbose_level);
2380
+        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);
2381
+        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);
2394
       }
2382
       }
2395
       clean_up_after_endstop_move();
2383
       clean_up_after_endstop_move();
2396
       set_bed_level_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3);
2384
       set_bed_level_equation_3pts(z_at_pt_1, z_at_pt_2, z_at_pt_3);
2397
 
2385
 
2398
     #endif // !AUTO_BED_LEVELING_GRID
2386
     #endif // !AUTO_BED_LEVELING_GRID
2399
 
2387
 
2400
-    do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_AFTER_PROBING);
2401
-    st_synchronize();
2402
-
2403
   #ifndef DELTA
2388
   #ifndef DELTA
2404
     if (verbose_level > 0)
2389
     if (verbose_level > 0)
2405
       plan_bed_level_matrix.debug(" \n\nBed Level Correction Matrix:");
2390
       plan_bed_level_matrix.debug(" \n\nBed Level Correction Matrix:");
2419
 
2404
 
2420
   #ifdef Z_PROBE_SLED
2405
   #ifdef Z_PROBE_SLED
2421
     dock_sled(true, -SLED_DOCKING_OFFSET); // dock the probe, correcting for over-travel
2406
     dock_sled(true, -SLED_DOCKING_OFFSET); // dock the probe, correcting for over-travel
2422
-  #elif not defined(SERVO_ENDSTOPS)
2407
+  #elif defined(Z_PROBE_ALLEN_KEY)
2423
     retract_z_probe();
2408
     retract_z_probe();
2424
   #endif
2409
   #endif
2425
     
2410
     
2464
   if (!code_seen(axis_codes[E_AXIS]))
2449
   if (!code_seen(axis_codes[E_AXIS]))
2465
     st_synchronize();
2450
     st_synchronize();
2466
 
2451
 
2467
-  for (int i=0;i<NUM_AXIS;i++) {
2452
+  for (int i = 0; i < NUM_AXIS; i++) {
2468
     if (code_seen(axis_codes[i])) {
2453
     if (code_seen(axis_codes[i])) {
2469
-      if (i == E_AXIS) {
2470
-        current_position[i] = code_value();
2454
+      current_position[i] = code_value();
2455
+      if (i == E_AXIS)
2471
         plan_set_e_position(current_position[E_AXIS]);
2456
         plan_set_e_position(current_position[E_AXIS]);
2472
-      }
2473
-      else {
2474
-        current_position[i] = code_value() +
2475
-          #ifdef SCARA
2476
-            ((i != X_AXIS && i != Y_AXIS) ? add_homing[i] : 0)
2477
-          #else
2478
-            add_homing[i]
2479
-          #endif
2480
-        ;
2457
+      else
2481
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
2458
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
2482
-      }
2483
     }
2459
     }
2484
   }
2460
   }
2485
 }
2461
 }
3416
     SERIAL_PROTOCOLLN("");
3392
     SERIAL_PROTOCOLLN("");
3417
     
3393
     
3418
     SERIAL_PROTOCOLPGM("SCARA Cal - Theta:");
3394
     SERIAL_PROTOCOLPGM("SCARA Cal - Theta:");
3419
-    SERIAL_PROTOCOL(delta[X_AXIS]+add_homing[X_AXIS]);
3395
+    SERIAL_PROTOCOL(delta[X_AXIS]+home_offset[X_AXIS]);
3420
     SERIAL_PROTOCOLPGM("   Psi+Theta (90):");
3396
     SERIAL_PROTOCOLPGM("   Psi+Theta (90):");
3421
-    SERIAL_PROTOCOL(delta[Y_AXIS]-delta[X_AXIS]-90+add_homing[Y_AXIS]);
3397
+    SERIAL_PROTOCOL(delta[Y_AXIS]-delta[X_AXIS]-90+home_offset[Y_AXIS]);
3422
     SERIAL_PROTOCOLLN("");
3398
     SERIAL_PROTOCOLLN("");
3423
     
3399
     
3424
     SERIAL_PROTOCOLPGM("SCARA step Cal - Theta:");
3400
     SERIAL_PROTOCOLPGM("SCARA step Cal - Theta:");
3636
 inline void gcode_M206() {
3612
 inline void gcode_M206() {
3637
   for (int8_t i=X_AXIS; i <= Z_AXIS; i++) {
3613
   for (int8_t i=X_AXIS; i <= Z_AXIS; i++) {
3638
     if (code_seen(axis_codes[i])) {
3614
     if (code_seen(axis_codes[i])) {
3639
-      add_homing[i] = code_value();
3615
+      home_offset[i] = code_value();
3640
     }
3616
     }
3641
   }
3617
   }
3642
   #ifdef SCARA
3618
   #ifdef SCARA
3643
-    if (code_seen('T')) add_homing[X_AXIS] = code_value(); // Theta
3644
-    if (code_seen('P')) add_homing[Y_AXIS] = code_value(); // Psi
3619
+    if (code_seen('T')) home_offset[X_AXIS] = code_value(); // Theta
3620
+    if (code_seen('P')) home_offset[Y_AXIS] = code_value(); // Psi
3645
   #endif
3621
   #endif
3646
 }
3622
 }
3647
 
3623
 
5239
     float negative_z_offset = 0;
5215
     float negative_z_offset = 0;
5240
     #ifdef ENABLE_AUTO_BED_LEVELING
5216
     #ifdef ENABLE_AUTO_BED_LEVELING
5241
       if (Z_PROBE_OFFSET_FROM_EXTRUDER < 0) negative_z_offset = negative_z_offset + Z_PROBE_OFFSET_FROM_EXTRUDER;
5217
       if (Z_PROBE_OFFSET_FROM_EXTRUDER < 0) negative_z_offset = negative_z_offset + Z_PROBE_OFFSET_FROM_EXTRUDER;
5242
-      if (add_homing[Z_AXIS] < 0) negative_z_offset = negative_z_offset + add_homing[Z_AXIS];
5218
+      if (home_offset[Z_AXIS] < 0) negative_z_offset = negative_z_offset + home_offset[Z_AXIS];
5243
     #endif
5219
     #endif
5244
     
5220
     
5245
     if (target[Z_AXIS] < min_pos[Z_AXIS]+negative_z_offset) target[Z_AXIS] = min_pos[Z_AXIS]+negative_z_offset;
5221
     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 Vedi File

434
 
434
 
435
   #ifdef AUTO_BED_LEVELING_GRID
435
   #ifdef AUTO_BED_LEVELING_GRID
436
 
436
 
437
-    // Use one of these defines to specify the origin
438
-    // for a topographical map to be printed for your bed.
439
-    enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
440
-    #define TOPO_ORIGIN OriginFrontLeft
441
-
442
-    // The edges of the rectangle in which to probe
443
     #define LEFT_PROBE_BED_POSITION 15
437
     #define LEFT_PROBE_BED_POSITION 15
444
     #define RIGHT_PROBE_BED_POSITION 170
438
     #define RIGHT_PROBE_BED_POSITION 170
445
     #define FRONT_PROBE_BED_POSITION 20
439
     #define FRONT_PROBE_BED_POSITION 20

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

382
   // Note: this feature occupies 10'206 byte
382
   // Note: this feature occupies 10'206 byte
383
   #ifdef AUTO_BED_LEVELING_GRID
383
   #ifdef AUTO_BED_LEVELING_GRID
384
 
384
 
385
-    // Use one of these defines to specify the origin
386
-    // for a topographical map to be printed for your bed.
387
-    enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
388
-    #define TOPO_ORIGIN OriginFrontLeft
389
-
390
-    // set the rectangle in which to probe
385
+home_offset    // set the rectangle in which to probe
391
     #define LEFT_PROBE_BED_POSITION 15
386
     #define LEFT_PROBE_BED_POSITION 15
392
     #define RIGHT_PROBE_BED_POSITION 170
387
     #define RIGHT_PROBE_BED_POSITION 170
393
     #define BACK_PROBE_BED_POSITION 180
388
     #define BACK_PROBE_BED_POSITION 180

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

382
   // Note: this feature occupies 10'206 byte
382
   // Note: this feature occupies 10'206 byte
383
   #ifdef AUTO_BED_LEVELING_GRID
383
   #ifdef AUTO_BED_LEVELING_GRID
384
 
384
 
385
-    // Use one of these defines to specify the origin
386
-    // for a topographical map to be printed for your bed.
387
-    enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
388
-    #define TOPO_ORIGIN OriginFrontLeft
389
-
390
-    // set the rectangle in which to probe
385
+home_offset    // set the rectangle in which to probe
391
     #define LEFT_PROBE_BED_POSITION 15
386
     #define LEFT_PROBE_BED_POSITION 15
392
     #define RIGHT_PROBE_BED_POSITION 170
387
     #define RIGHT_PROBE_BED_POSITION 170
393
     #define BACK_PROBE_BED_POSITION 180
388
     #define BACK_PROBE_BED_POSITION 180

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

406
 
406
 
407
   #ifdef AUTO_BED_LEVELING_GRID
407
   #ifdef AUTO_BED_LEVELING_GRID
408
 
408
 
409
-    // Use one of these defines to specify the origin
410
-    // for a topographical map to be printed for your bed.
411
-    enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
412
-    #define TOPO_ORIGIN OriginFrontLeft
413
-
414
-    // The edges of the rectangle in which to probe
415
     #define LEFT_PROBE_BED_POSITION 15
409
     #define LEFT_PROBE_BED_POSITION 15
416
     #define RIGHT_PROBE_BED_POSITION 170
410
     #define RIGHT_PROBE_BED_POSITION 170
417
     #define FRONT_PROBE_BED_POSITION 20
411
     #define FRONT_PROBE_BED_POSITION 20

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

411
 
411
 
412
   #ifdef AUTO_BED_LEVELING_GRID
412
   #ifdef AUTO_BED_LEVELING_GRID
413
 
413
 
414
-    // Use one of these defines to specify the origin
415
-    // for a topographical map to be printed for your bed.
416
-    enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
417
-    #define TOPO_ORIGIN OriginFrontLeft
418
-
419
-    // The edges of the rectangle in which to probe
420
     #define LEFT_PROBE_BED_POSITION 15
414
     #define LEFT_PROBE_BED_POSITION 15
421
     #define RIGHT_PROBE_BED_POSITION 170
415
     #define RIGHT_PROBE_BED_POSITION 170
422
     #define FRONT_PROBE_BED_POSITION 20
416
     #define FRONT_PROBE_BED_POSITION 20

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

435
 
435
 
436
   #ifdef AUTO_BED_LEVELING_GRID
436
   #ifdef AUTO_BED_LEVELING_GRID
437
 
437
 
438
-    // Use one of these defines to specify the origin
439
-    // for a topographical map to be printed for your bed.
440
-    enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
441
-    #define TOPO_ORIGIN OriginFrontLeft
442
-
443
-    // The edges of the rectangle in which to probe
444
     #define LEFT_PROBE_BED_POSITION 15
438
     #define LEFT_PROBE_BED_POSITION 15
445
     #define RIGHT_PROBE_BED_POSITION 170
439
     #define RIGHT_PROBE_BED_POSITION 170
446
     #define FRONT_PROBE_BED_POSITION 20
440
     #define FRONT_PROBE_BED_POSITION 20

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

405
 
405
 
406
   #ifdef AUTO_BED_LEVELING_GRID
406
   #ifdef AUTO_BED_LEVELING_GRID
407
 
407
 
408
-    // Use one of these defines to specify the origin
409
-    // for a topographical map to be printed for your bed.
410
-    enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
411
-    #define TOPO_ORIGIN OriginFrontLeft
412
-
413
-    // The edges of the rectangle in which to probe
414
     #define LEFT_PROBE_BED_POSITION 15
408
     #define LEFT_PROBE_BED_POSITION 15
415
     #define RIGHT_PROBE_BED_POSITION 170
409
     #define RIGHT_PROBE_BED_POSITION 170
416
     #define FRONT_PROBE_BED_POSITION 20
410
     #define FRONT_PROBE_BED_POSITION 20

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

403
 
403
 
404
   #ifdef AUTO_BED_LEVELING_GRID
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
-    // The edges of the rectangle in which to probe
412
     #define LEFT_PROBE_BED_POSITION 15
406
     #define LEFT_PROBE_BED_POSITION 15
413
     #define RIGHT_PROBE_BED_POSITION 170
407
     #define RIGHT_PROBE_BED_POSITION 170
414
     #define FRONT_PROBE_BED_POSITION 20
408
     #define FRONT_PROBE_BED_POSITION 20

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

405
 
405
 
406
   #ifdef AUTO_BED_LEVELING_GRID
406
   #ifdef AUTO_BED_LEVELING_GRID
407
 
407
 
408
-    // Use one of these defines to specify the origin
409
-    // for a topographical map to be printed for your bed.
410
-    enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
411
-    #define TOPO_ORIGIN OriginFrontLeft
412
-
413
-    // The edges of the rectangle in which to probe
414
     #define LEFT_PROBE_BED_POSITION 15
408
     #define LEFT_PROBE_BED_POSITION 15
415
     #define RIGHT_PROBE_BED_POSITION 170
409
     #define RIGHT_PROBE_BED_POSITION 170
416
     #define FRONT_PROBE_BED_POSITION 20
410
     #define FRONT_PROBE_BED_POSITION 20

+ 7
- 13
Marlin/stepper.cpp Vedi File

102
       X_DIR_WRITE(v); \
102
       X_DIR_WRITE(v); \
103
       X2_DIR_WRITE(v); \
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
   #define X_APPLY_STEP(v,ALWAYS) \
108
   #define X_APPLY_STEP(v,ALWAYS) \
112
     if (extruder_duplication_enabled || ALWAYS) { \
109
     if (extruder_duplication_enabled || ALWAYS) { \
114
       X2_STEP_WRITE(v); \
111
       X2_STEP_WRITE(v); \
115
     } \
112
     } \
116
     else { \
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
 #else
116
 #else
123
   #define X_APPLY_DIR(v,Q) X_DIR_WRITE(v)
117
   #define X_APPLY_DIR(v,Q) X_DIR_WRITE(v)
125
 #endif
119
 #endif
126
 
120
 
127
 #ifdef Y_DUAL_STEPPER_DRIVERS
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
 #else
124
 #else
131
   #define Y_APPLY_DIR(v,Q) Y_DIR_WRITE(v)
125
   #define Y_APPLY_DIR(v,Q) Y_DIR_WRITE(v)
132
   #define Y_APPLY_STEP(v,Q) Y_STEP_WRITE(v)
126
   #define Y_APPLY_STEP(v,Q) Y_STEP_WRITE(v)
133
 #endif
127
 #endif
134
 
128
 
135
 #ifdef Z_DUAL_STEPPER_DRIVERS
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
 #else
132
 #else
139
   #define Z_APPLY_DIR(v,Q) Z_DIR_WRITE(v)
133
   #define Z_APPLY_DIR(v,Q) Z_DIR_WRITE(v)
140
   #define Z_APPLY_STEP(v,Q) Z_STEP_WRITE(v)
134
   #define Z_APPLY_STEP(v,Q) Z_STEP_WRITE(v)

+ 1
- 1
Marlin/ultralcd.cpp Vedi File

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

Loading…
Annulla
Salva