浏览代码

Merge remote-tracking branch 'MarlinFirmware/Development' into Development

Conflicts:
	Marlin/Marlin_main.cpp
Chris Roadfeldt 10 年前
父节点
当前提交
c89b8368ee

+ 7
- 7
Marlin/Configuration.h 查看文件

@@ -72,6 +72,12 @@ Here are some standard links for getting your machine calibrated:
72 72
 // This defines the number of extruders
73 73
 #define EXTRUDERS 1
74 74
 
75
+// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
76
+// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
77
+// For the other hotends it is their distance from the extruder 0 hotend.
78
+//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
79
+//#define EXTRUDER_OFFSET_Y {0.0, 5.00}  // (in mm) for each extruder, offset of the hotend on the Y axis
80
+
75 81
 //// The following define selects which power supply you have. Please choose the one that matches your setup
76 82
 // 1 = ATX
77 83
 // 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
@@ -536,12 +542,6 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
536 542
 #define DEFAULT_RETRACT_ACCELERATION  3000   // E acceleration in mm/s^2 for retracts
537 543
 #define DEFAULT_TRAVEL_ACCELERATION   3000    // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
538 544
 
539
-// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
540
-// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
541
-// For the other hotends it is their distance from the extruder 0 hotend.
542
-// #define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
543
-// #define EXTRUDER_OFFSET_Y {0.0, 5.00}  // (in mm) for each extruder, offset of the hotend on the Y axis
544
-
545 545
 // The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
546 546
 #define DEFAULT_XYJERK                20.0    // (mm/sec)
547 547
 #define DEFAULT_ZJERK                 0.4     // (mm/sec)
@@ -716,7 +716,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
716 716
 // Servo Endstops
717 717
 //
718 718
 // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
719
-// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500.
719
+// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500.
720 720
 //
721 721
 //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
722 722
 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles

+ 56
- 180
Marlin/Marlin_main.cpp 查看文件

@@ -226,21 +226,21 @@ float min_pos[3] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS };
226 226
 float max_pos[3] = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS };
227 227
 bool axis_known_position[3] = { false };
228 228
 
229
-// Extruder offset
229
+// Extruder offsets
230 230
 #if EXTRUDERS > 1
231 231
   #ifndef EXTRUDER_OFFSET_X
232
-    #define EXTRUDER_OFFSET_X 0
232
+    #define EXTRUDER_OFFSET_X { 0 }
233 233
   #endif
234 234
   #ifndef EXTRUDER_OFFSET_Y
235
-    #define EXTRUDER_OFFSET_Y 0
235
+    #define EXTRUDER_OFFSET_Y { 0 }
236 236
   #endif
237
-  #ifndef DUAL_X_CARRIAGE
238
-    #define NUM_EXTRUDER_OFFSETS 2 // only in XY plane
239
-  #else
240
-    #define NUM_EXTRUDER_OFFSETS 3 // supports offsets in XYZ plane
241
-  #endif
242
-  #define _EXY { EXTRUDER_OFFSET_X, EXTRUDER_OFFSET_Y }
243
-  float extruder_offset[EXTRUDERS][NUM_EXTRUDER_OFFSETS] = ARRAY_BY_EXTRUDERS(_EXY, _EXY, _EXY, _EXY);
237
+  float extruder_offset[][EXTRUDERS] = {
238
+    EXTRUDER_OFFSET_X,
239
+    EXTRUDER_OFFSET_Y
240
+    #ifdef DUAL_X_CARRIAGE
241
+      , { 0 } // supports offsets in XYZ plane
242
+    #endif
243
+  };
244 244
 #endif
245 245
 
246 246
 uint8_t active_extruder = 0;
@@ -935,7 +935,7 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir,  HOME_DIR);
935 935
       // second X-carriage offset when homed - otherwise X2_HOME_POS is used.
936 936
       // This allow soft recalibration of the second extruder offset position without firmware reflash
937 937
       // (through the M218 command).
938
-      return (extruder_offset[1][X_AXIS] > 0) ? extruder_offset[1][X_AXIS] : X2_HOME_POS;
938
+      return (extruder_offset[X_AXIS][1] > 0) ? extruder_offset[X_AXIS][1] : X2_HOME_POS;
939 939
   }
940 940
 
941 941
   static int x_home_dir(int extruder) {
@@ -959,14 +959,14 @@ static void axis_is_at_home(int axis) {
959 959
       if (active_extruder != 0) {
960 960
         current_position[X_AXIS] = x_home_pos(active_extruder);
961 961
                  min_pos[X_AXIS] = X2_MIN_POS;
962
-                 max_pos[X_AXIS] = max(extruder_offset[1][X_AXIS], X2_MAX_POS);
962
+                 max_pos[X_AXIS] = max(extruder_offset[X_AXIS][1], X2_MAX_POS);
963 963
         return;
964 964
       }
965 965
       else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE) {
966 966
         float xoff = home_offset[X_AXIS];
967 967
         current_position[X_AXIS] = base_home_pos(X_AXIS) + xoff;
968 968
                  min_pos[X_AXIS] = base_min_pos(X_AXIS) + xoff;
969
-                 max_pos[X_AXIS] = min(base_max_pos(X_AXIS) + xoff, max(extruder_offset[1][X_AXIS], X2_MAX_POS) - duplicate_extruder_x_offset);
969
+                 max_pos[X_AXIS] = min(base_max_pos(X_AXIS) + xoff, max(extruder_offset[X_AXIS][1], X2_MAX_POS) - duplicate_extruder_x_offset);
970 970
         return;
971 971
       }
972 972
     }
@@ -1055,7 +1055,7 @@ inline void sync_plan_position() {
1055 1055
         //corrected_position.debug("position after");
1056 1056
         current_position[X_AXIS] = corrected_position.x;
1057 1057
         current_position[Y_AXIS] = corrected_position.y;
1058
-        current_position[Z_AXIS] = zprobe_zoffset; // was: corrected_position.z
1058
+        current_position[Z_AXIS] = corrected_position.z;
1059 1059
 
1060 1060
         sync_plan_position();
1061 1061
       }
@@ -1084,7 +1084,7 @@ inline void sync_plan_position() {
1084 1084
       vector_3 corrected_position = plan_get_position();
1085 1085
       current_position[X_AXIS] = corrected_position.x;
1086 1086
       current_position[Y_AXIS] = corrected_position.y;
1087
-      current_position[Z_AXIS] = zprobe_zoffset; // was: corrected_position.z
1087
+      current_position[Z_AXIS] = corrected_position.z;
1088 1088
 
1089 1089
       sync_plan_position();
1090 1090
     }
@@ -1202,58 +1202,6 @@ inline void sync_plan_position() {
1202 1202
     previous_millis_cmd = millis();
1203 1203
   }
1204 1204
 
1205
-<<<<<<< HEAD
1206
-static void engage_z_probe() {
1207
-  // Engage Z Servo endstop if enabled
1208
-  #ifdef SERVO_ENDSTOPS
1209
-    if (servo_endstops[Z_AXIS] > -1) {
1210
-      #if SERVO_LEVELING
1211
-        servos[servo_endstops[Z_AXIS]].attach(0);
1212
-      #endif
1213
-      servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2]);
1214
-      #if SERVO_LEVELING
1215
-        delay(PROBE_SERVO_DEACTIVATION_DELAY);
1216
-        servos[servo_endstops[Z_AXIS]].detach();
1217
-      #endif
1218
-    }
1219
-  #elif defined(Z_PROBE_ALLEN_KEY)
1220
-    feedrate = homing_feedrate[X_AXIS];
1221
-    
1222
-    // Move to the start position to initiate deployment
1223
-    destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_X;
1224
-    destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_Y;
1225
-    destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_Z;
1226
-    prepare_move_raw();
1227
-
1228
-    // Home X to touch the belt
1229
-    feedrate = homing_feedrate[X_AXIS]/10;
1230
-    destination[X_AXIS] = 0;
1231
-    prepare_move_raw();
1232
-    
1233
-    // Home Y for safety
1234
-    feedrate = homing_feedrate[X_AXIS]/2;
1235
-    destination[Y_AXIS] = 0;
1236
-    prepare_move_raw();
1237
-    
1238
-    st_synchronize();
1239
-    
1240
-    // If Z_PROBE_AND_ENDSTOP is changed to completely break it's bonds from Z_MIN_ENDSTOP and become
1241
-    // it's own unique entity, then the following logic will need to be modified
1242
-    // so it only uses the Z_PROBE
1243
-    #if defined(Z_PROBE_AND_ENDSTOP)
1244
-    bool z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING);
1245
-    if (z_probe_endstop)
1246
-    #else
1247
-    bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
1248
-    if (z_min_endstop)
1249
-    #endif
1250
-    {
1251
-        if (!Stopped)
1252
-        {
1253
-            SERIAL_ERROR_START;
1254
-            SERIAL_ERRORLNPGM("Z-Probe failed to engage!");
1255
-            LCD_ALERTMESSAGEPGM("Err: ZPROBE");
1256
-=======
1257 1205
   static void engage_z_probe() {
1258 1206
 
1259 1207
     #ifdef SERVO_ENDSTOPS
@@ -1292,107 +1240,43 @@ static void engage_z_probe() {
1292 1240
 
1293 1241
       st_synchronize();
1294 1242
 
1243
+    #if defined(Z_PROBE_AND_ENDSTOP)
1244
+      bool z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING);
1245
+      if (z_probe_endstop) {
1246
+    #else
1295 1247
       bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
1296
-      if (z_min_endstop) {
1248
+      if (!z_min_endstop) {
1249
+    #endif
1297 1250
         if (!Stopped) {
1298 1251
           SERIAL_ERROR_START;
1299 1252
           SERIAL_ERRORLNPGM("Z-Probe failed to engage!");
1300 1253
           LCD_ALERTMESSAGEPGM("Err: ZPROBE");
1301
->>>>>>> MarlinFirmware/Development
1302 1254
         }
1303 1255
         Stop();
1304 1256
       }
1305 1257
 
1306 1258
     #endif // Z_PROBE_ALLEN_KEY
1307
-
1308
-<<<<<<< HEAD
1309
-static void retract_z_probe() {
1310
-  // Retract Z Servo endstop if enabled
1311
-  #ifdef SERVO_ENDSTOPS
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
-    
1319
-      #if SERVO_LEVELING
1320
-        servos[servo_endstops[Z_AXIS]].attach(0);
1321
-      #endif
1322
-      servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2 + 1]);
1323
-      #if SERVO_LEVELING
1324
-        delay(PROBE_SERVO_DEACTIVATION_DELAY);
1325
-        servos[servo_endstops[Z_AXIS]].detach();
1326
-      #endif
1327
-    }
1328
-  #elif defined(Z_PROBE_ALLEN_KEY)
1329
-    // Move up for safety
1330
-    feedrate = homing_feedrate[X_AXIS];
1331
-    destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING;
1332
-    prepare_move_raw();
1333
-
1334
-    // Move to the start position to initiate retraction
1335
-    destination[X_AXIS] = Z_PROBE_ALLEN_KEY_RETRACT_X;
1336
-    destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_RETRACT_Y;
1337
-    destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_RETRACT_Z;
1338
-    prepare_move_raw();
1339
-
1340
-    // Move the nozzle down to push the probe into retracted position
1341
-    feedrate = homing_feedrate[Z_AXIS]/10;
1342
-    destination[Z_AXIS] = current_position[Z_AXIS] - Z_PROBE_ALLEN_KEY_RETRACT_DEPTH;
1343
-    prepare_move_raw();
1344
-    
1345
-    // Move up for safety
1346
-    feedrate = homing_feedrate[Z_AXIS]/2;
1347
-    destination[Z_AXIS] = current_position[Z_AXIS] + Z_PROBE_ALLEN_KEY_RETRACT_DEPTH * 2;
1348
-    prepare_move_raw();
1349
-    
1350
-    // Home XY for safety
1351
-    feedrate = homing_feedrate[X_AXIS]/2;
1352
-    destination[X_AXIS] = 0;
1353
-    destination[Y_AXIS] = 0;
1354
-    prepare_move_raw();
1355
-    
1356
-    st_synchronize();
1357
-    
1358
-    // If Z_PROBE_AND_ENDSTOP is changed to completely break it's bonds from Z_MIN_ENDSTOP and become
1359
-    // it's own unique entity, then the following logic will need to be modified
1360
-    // so it only uses the Z_PROBE
1361
-    #if defined(Z_PROBE_AND_ENDSTOP)
1362
-    bool z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING);
1363
-    if (z_probe_endstop)
1364
-    #else
1365
-    bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
1366
-    if (z_min_endstop)
1367
-    #endif
1368
-    {
1369
-        if (!Stopped)
1370
-        {
1371
-            SERIAL_ERROR_START;
1372
-            SERIAL_ERRORLNPGM("Z-Probe failed to retract!");
1373
-            LCD_ALERTMESSAGEPGM("Err: ZPROBE");
1374
-=======
1259
+      
1375 1260
   }
1376 1261
 
1377
-  static void retract_z_probe(const float z_after=Z_RAISE_AFTER_PROBING) {
1262
+  static void retract_z_probe() {
1378 1263
 
1379 1264
     #ifdef SERVO_ENDSTOPS
1380 1265
 
1381 1266
       // Retract Z Servo endstop if enabled
1382 1267
       if (servo_endstops[Z_AXIS] >= 0) {
1383 1268
 
1384
-        if (z_after > 0) {
1385
-          do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_after);
1269
+        #if Z_RAISE_AFTER_PROBING > 0
1270
+          do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_AFTER_PROBING);
1386 1271
           st_synchronize();
1387
->>>>>>> MarlinFirmware/Development
1388
-        }
1272
+        #endif
1389 1273
 
1390 1274
         #if SERVO_LEVELING
1391 1275
           servos[servo_endstops[Z_AXIS]].attach(0);
1392 1276
         #endif
1393
-
1394
-        servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2 + 1]);
1395
-
1277
+          
1278
+          servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2 + 1]);
1279
+          
1396 1280
         #if SERVO_LEVELING
1397 1281
           delay(PROBE_SERVO_DEACTIVATION_DELAY);
1398 1282
           servos[servo_endstops[Z_AXIS]].detach();
@@ -1430,11 +1314,13 @@ static void retract_z_probe() {
1430 1314
 
1431 1315
       st_synchronize();
1432 1316
 
1433
-      // If Z_PROBE_AND_ENDSTOP is changed to completely break it's bonds from Z_MIN_ENDSTOP and become
1434
-      // it's own unique entity, then the following logic will need to be modified
1435
-      // so it only uses the Z_PROBE
1317
+    #if defined(Z_PROBE_AND_ENDSTOP)
1318
+      bool z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING);
1319
+      if (z_probe_endstop) {
1320
+    #else
1436 1321
       bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
1437 1322
       if (!z_min_endstop) {
1323
+    #endif
1438 1324
         if (!Stopped) {
1439 1325
           SERIAL_ERROR_START;
1440 1326
           SERIAL_ERRORLNPGM("Z-Probe failed to retract!");
@@ -1467,8 +1353,15 @@ static void retract_z_probe() {
1467 1353
     run_z_probe();
1468 1354
     float measured_z = current_position[Z_AXIS];
1469 1355
 
1356
+    #if Z_RAISE_BETWEEN_PROBINGS > 0
1357
+      if (retract_action == ProbeStay) {
1358
+        do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_BETWEEN_PROBINGS);
1359
+        st_synchronize();
1360
+      }
1361
+    #endif
1362
+
1470 1363
     #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY)
1471
-      if (retract_action & ProbeRetract) retract_z_probe(z_before);
1364
+      if (retract_action & ProbeRetract) retract_z_probe();
1472 1365
     #endif
1473 1366
 
1474 1367
     if (verbose_level > 2) {
@@ -1583,23 +1476,6 @@ static void homeaxis(int axis) {
1583 1476
 
1584 1477
     #endif // Z_PROBE_SLED
1585 1478
 
1586
-<<<<<<< HEAD
1587
-#ifndef Z_PROBE_SLED
1588
-    // Engage Servo endstop if enabled and we are not using Z_PROBE_AND_ENDSTOP unless we are using Z_SAFE_HOMING
1589
-    #ifdef SERVO_ENDSTOPS && (defined (Z_SAFE_HOMING) || ! defined (Z_PROBE_AND_ENDSTOP))
1590
-      #if SERVO_LEVELING
1591
-        if (axis==Z_AXIS) {
1592
-          engage_z_probe();
1593
-        }
1594
-      else
1595
-      #endif
1596
-      if (servo_endstops[axis] > -1) {
1597
-        servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]);
1598
-      }
1599
-    #endif
1600
-#endif // Z_PROBE_SLED
1601
-=======
1602
->>>>>>> MarlinFirmware/Development
1603 1479
     #ifdef Z_DUAL_ENDSTOPS
1604 1480
       if (axis == Z_AXIS) In_Homing_Process(true);
1605 1481
     #endif
@@ -3921,23 +3797,23 @@ inline void gcode_M206() {
3921 3797
   inline void gcode_M218() {
3922 3798
     if (setTargetedHotend(218)) return;
3923 3799
 
3924
-    if (code_seen('X')) extruder_offset[tmp_extruder][X_AXIS] = code_value();
3925
-    if (code_seen('Y')) extruder_offset[tmp_extruder][Y_AXIS] = code_value();
3800
+    if (code_seen('X')) extruder_offset[X_AXIS][tmp_extruder] = code_value();
3801
+    if (code_seen('Y')) extruder_offset[Y_AXIS][tmp_extruder] = code_value();
3926 3802
 
3927 3803
     #ifdef DUAL_X_CARRIAGE
3928
-      if (code_seen('Z')) extruder_offset[tmp_extruder][Z_AXIS] = code_value();
3804
+      if (code_seen('Z')) extruder_offset[Z_AXIS][tmp_extruder] = code_value();
3929 3805
     #endif
3930 3806
 
3931 3807
     SERIAL_ECHO_START;
3932 3808
     SERIAL_ECHOPGM(MSG_HOTEND_OFFSET);
3933 3809
     for (tmp_extruder = 0; tmp_extruder < EXTRUDERS; tmp_extruder++) {
3934 3810
       SERIAL_ECHO(" ");
3935
-      SERIAL_ECHO(extruder_offset[tmp_extruder][X_AXIS]);
3811
+      SERIAL_ECHO(extruder_offset[X_AXIS][tmp_extruder]);
3936 3812
       SERIAL_ECHO(",");
3937
-      SERIAL_ECHO(extruder_offset[tmp_extruder][Y_AXIS]);
3813
+      SERIAL_ECHO(extruder_offset[Y_AXIS][tmp_extruder]);
3938 3814
       #ifdef DUAL_X_CARRIAGE
3939 3815
         SERIAL_ECHO(",");
3940
-        SERIAL_ECHO(extruder_offset[tmp_extruder][Z_AXIS]);
3816
+        SERIAL_ECHO(extruder_offset[Z_AXIS][tmp_extruder]);
3941 3817
       #endif
3942 3818
     }
3943 3819
     SERIAL_EOL;
@@ -4628,13 +4504,13 @@ inline void gcode_M503() {
4628 4504
         SERIAL_ECHO_START;
4629 4505
         SERIAL_ECHOPGM(MSG_HOTEND_OFFSET);
4630 4506
         SERIAL_ECHO(" ");
4631
-        SERIAL_ECHO(extruder_offset[0][X_AXIS]);
4507
+        SERIAL_ECHO(extruder_offset[X_AXIS][0]);
4632 4508
         SERIAL_ECHO(",");
4633
-        SERIAL_ECHO(extruder_offset[0][Y_AXIS]);
4509
+        SERIAL_ECHO(extruder_offset[Y_AXIS][0]);
4634 4510
         SERIAL_ECHO(" ");
4635 4511
         SERIAL_ECHO(duplicate_extruder_x_offset);
4636 4512
         SERIAL_ECHO(",");
4637
-        SERIAL_ECHOLN(extruder_offset[1][Y_AXIS]);
4513
+        SERIAL_ECHOLN(extruder_offset[Y_AXIS][1]);
4638 4514
         break;
4639 4515
       case DXC_FULL_CONTROL_MODE:
4640 4516
       case DXC_AUTO_PARK_MODE:
@@ -4769,11 +4645,11 @@ inline void gcode_T() {
4769 4645
 
4770 4646
           // apply Y & Z extruder offset (x offset is already used in determining home pos)
4771 4647
           current_position[Y_AXIS] = current_position[Y_AXIS] -
4772
-                       extruder_offset[active_extruder][Y_AXIS] +
4773
-                       extruder_offset[tmp_extruder][Y_AXIS];
4648
+                       extruder_offset[Y_AXIS][active_extruder] +
4649
+                       extruder_offset[Y_AXIS][tmp_extruder];
4774 4650
           current_position[Z_AXIS] = current_position[Z_AXIS] -
4775
-                       extruder_offset[active_extruder][Z_AXIS] +
4776
-                       extruder_offset[tmp_extruder][Z_AXIS];
4651
+                       extruder_offset[Z_AXIS][active_extruder] +
4652
+                       extruder_offset[Z_AXIS][tmp_extruder];
4777 4653
 
4778 4654
           active_extruder = tmp_extruder;
4779 4655
 
@@ -4803,7 +4679,7 @@ inline void gcode_T() {
4803 4679
         #else // !DUAL_X_CARRIAGE
4804 4680
           // Offset extruder (only by XY)
4805 4681
           for (int i=X_AXIS; i<=Y_AXIS; i++)
4806
-            current_position[i] += extruder_offset[tmp_extruder][i] - extruder_offset[active_extruder][i];
4682
+            current_position[i] += extruder_offset[i][tmp_extruder] - extruder_offset[i][active_extruder];
4807 4683
           // Set the new active extruder and position
4808 4684
           active_extruder = tmp_extruder;
4809 4685
         #endif // !DUAL_X_CARRIAGE

+ 1
- 1
Marlin/configurator/config/Configuration.h 查看文件

@@ -740,7 +740,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
740 740
 // Servo Endstops
741 741
 //
742 742
 // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
743
-// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500.
743
+// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500.
744 744
 //
745 745
 //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
746 746
 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles

+ 1
- 1
Marlin/example_configurations/Felix/Configuration.h 查看文件

@@ -680,7 +680,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
680 680
 // Servo Endstops
681 681
 //
682 682
 // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
683
-// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500.
683
+// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500.
684 684
 //
685 685
 //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
686 686
 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles

+ 1
- 1
Marlin/example_configurations/Felix/Configuration_DUAL.h 查看文件

@@ -680,7 +680,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
680 680
 // Servo Endstops
681 681
 //
682 682
 // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
683
-// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500.
683
+// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500.
684 684
 //
685 685
 //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
686 686
 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles

+ 1
- 1
Marlin/example_configurations/Hephestos/Configuration.h 查看文件

@@ -702,7 +702,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
702 702
 // Servo Endstops
703 703
 //
704 704
 // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
705
-// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500.
705
+// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500.
706 706
 //
707 707
 //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
708 708
 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles

+ 1
- 1
Marlin/example_configurations/K8200/Configuration.h 查看文件

@@ -708,7 +708,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
708 708
 // Servo Endstops
709 709
 //
710 710
 // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
711
-// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500.
711
+// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500.
712 712
 //
713 713
 //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
714 714
 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles

+ 1
- 1
Marlin/example_configurations/SCARA/Configuration.h 查看文件

@@ -731,7 +731,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
731 731
 // Servo Endstops
732 732
 //
733 733
 // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
734
-// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500.
734
+// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500.
735 735
 //
736 736
 //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
737 737
 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles

+ 1
- 1
Marlin/example_configurations/WITBOX/Configuration.h 查看文件

@@ -701,7 +701,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
701 701
 // Servo Endstops
702 702
 //
703 703
 // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
704
-// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500.
704
+// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500.
705 705
 //
706 706
 //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
707 707
 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles

+ 1
- 1
Marlin/example_configurations/delta/generic/Configuration.h 查看文件

@@ -755,7 +755,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
755 755
 // Servo Endstops
756 756
 //
757 757
 // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
758
-// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500.
758
+// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500.
759 759
 //
760 760
 //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
761 761
 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles

+ 1
- 1
Marlin/example_configurations/delta/kossel_mini/Configuration.h 查看文件

@@ -759,7 +759,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
759 759
 // Servo Endstops
760 760
 //
761 761
 // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
762
-// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500.
762
+// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500.
763 763
 //
764 764
 //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
765 765
 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles

+ 1
- 1
Marlin/example_configurations/makibox/Configuration.h 查看文件

@@ -699,7 +699,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
699 699
 // Servo Endstops
700 700
 //
701 701
 // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
702
-// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500.
702
+// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500.
703 703
 //
704 704
 //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
705 705
 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles

+ 1
- 1
Marlin/example_configurations/tvrrug/Round2/Configuration.h 查看文件

@@ -705,7 +705,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
705 705
 // Servo Endstops
706 706
 //
707 707
 // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
708
-// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500.
708
+// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500.
709 709
 //
710 710
 //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
711 711
 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles

+ 16
- 11
Marlin/temperature.cpp 查看文件

@@ -83,15 +83,20 @@ unsigned char soft_pwm_bed;
83 83
 #ifdef FILAMENT_SENSOR
84 84
   int current_raw_filwidth = 0;  //Holds measured filament diameter - one extruder only
85 85
 #endif  
86
-#if defined (THERMAL_RUNAWAY_PROTECTION_PERIOD) && THERMAL_RUNAWAY_PROTECTION_PERIOD > 0
87
-void thermal_runaway_protection(int *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc);
88
-static int thermal_runaway_state_machine[4]; // = {0,0,0,0};
89
-static unsigned long thermal_runaway_timer[4]; // = {0,0,0,0};
90
-static bool thermal_runaway = false;
91
-#if TEMP_SENSOR_BED != 0
92
-  static int thermal_runaway_bed_state_machine;
93
-  static unsigned long thermal_runaway_bed_timer;
94
-#endif
86
+
87
+#define HAS_HEATER_THERMAL_PROTECTION (defined(THERMAL_RUNAWAY_PROTECTION_PERIOD) && THERMAL_RUNAWAY_PROTECTION_PERIOD > 0)
88
+#define HAS_BED_THERMAL_PROTECTION (defined(THERMAL_RUNAWAY_PROTECTION_BED_PERIOD) && THERMAL_RUNAWAY_PROTECTION_BED_PERIOD > 0 && TEMP_SENSOR_BED != 0)
89
+#if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION
90
+  static bool thermal_runaway = false;
91
+  void thermal_runaway_protection(int *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc);
92
+  #if HAS_HEATER_THERMAL_PROTECTION
93
+    static int thermal_runaway_state_machine[4]; // = {0,0,0,0};
94
+    static unsigned long thermal_runaway_timer[4]; // = {0,0,0,0};
95
+  #endif
96
+  #if HAS_BED_THERMAL_PROTECTION
97
+    static int thermal_runaway_bed_state_machine;
98
+    static unsigned long thermal_runaway_bed_timer;
99
+  #endif
95 100
 #endif
96 101
 
97 102
 //===========================================================================
@@ -650,7 +655,7 @@ void manage_heater() {
650 655
 
651 656
   #if TEMP_SENSOR_BED != 0
652 657
   
653
-    #if defined(THERMAL_RUNAWAY_PROTECTION_BED_PERIOD) && THERMAL_RUNAWAY_PROTECTION_BED_PERIOD > 0
658
+    #if HAS_BED_THERMAL_PROTECTION
654 659
       thermal_runaway_protection(&thermal_runaway_bed_state_machine, &thermal_runaway_bed_timer, current_temperature_bed, target_temperature_bed, 9, THERMAL_RUNAWAY_PROTECTION_BED_PERIOD, THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS);
655 660
     #endif
656 661
 
@@ -1008,7 +1013,7 @@ void setWatch() {
1008 1013
   #endif 
1009 1014
 }
1010 1015
 
1011
-#if defined(THERMAL_RUNAWAY_PROTECTION_PERIOD) && THERMAL_RUNAWAY_PROTECTION_PERIOD > 0
1016
+#if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION
1012 1017
 void thermal_runaway_protection(int *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc)
1013 1018
 {
1014 1019
 /*

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

@@ -136,7 +136,6 @@ static void lcd_status_screen();
136 136
     if (encoderLine < currentMenuViewOffset) currentMenuViewOffset = encoderLine; \
137 137
     uint8_t _lineNr = currentMenuViewOffset, _menuItemNr; \
138 138
     bool wasClicked = LCD_CLICKED, itemSelected; \
139
-    if (wasClicked) lcd_quick_feedback(); \
140 139
     for (uint8_t _drawLineNr = 0; _drawLineNr < LCD_HEIGHT; _drawLineNr++, _lineNr++) { \
141 140
       _menuItemNr = 0;
142 141
 
@@ -167,6 +166,7 @@ static void lcd_status_screen();
167 166
       if (lcdDrawUpdate) \
168 167
         lcd_implementation_drawmenu_ ## type(itemSelected, _drawLineNr, PSTR(label), ## args); \
169 168
       if (wasClicked && itemSelected) { \
169
+        lcd_quick_feedback(); \
170 170
         menu_action_ ## type(args); \
171 171
         return; \
172 172
       } \
@@ -1155,10 +1155,10 @@ static void lcd_quick_feedback() {
1155 1155
   #elif defined(BEEPER) && BEEPER > -1
1156 1156
     SET_OUTPUT(BEEPER);
1157 1157
     #ifndef LCD_FEEDBACK_FREQUENCY_HZ
1158
-      #define LCD_FEEDBACK_FREQUENCY_HZ 500
1158
+      #define LCD_FEEDBACK_FREQUENCY_HZ 5000
1159 1159
     #endif
1160 1160
     #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS
1161
-      #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 50
1161
+      #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2
1162 1162
     #endif
1163 1163
     const unsigned int delay = 1000000 / LCD_FEEDBACK_FREQUENCY_HZ / 2;
1164 1164
     int i = LCD_FEEDBACK_FREQUENCY_DURATION_MS * LCD_FEEDBACK_FREQUENCY_HZ / 1000;

正在加载...
取消
保存