|
@@ -76,7 +76,7 @@
|
76
|
76
|
// G10 - retract filament according to settings of M207
|
77
|
77
|
// G11 - retract recover filament according to settings of M208
|
78
|
78
|
// G28 - Home all Axis
|
79
|
|
-// G29 - Detailed Z-Probe, probes the bed at 3 points. You must de at the home position for this to work correctly.
|
|
79
|
+// G29 - Detailed Z-Probe, probes the bed at 3 or more points. Will fail if you haven't homed yet.
|
80
|
80
|
// G30 - Single Z Probe, probes bed at current XY location.
|
81
|
81
|
// G90 - Use Absolute Coordinates
|
82
|
82
|
// G91 - Use Relative Coordinates
|
|
@@ -137,8 +137,8 @@
|
137
|
137
|
// M204 - Set default acceleration: S normal moves T filament only moves (M204 S3000 T7000) im mm/sec^2 also sets minimum segment time in ms (B20000) to prevent buffer underruns and M20 minimum feedrate
|
138
|
138
|
// M205 - advanced settings: minimum travel speed S=while printing T=travel only, B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk, E=maximum E jerk
|
139
|
139
|
// M206 - set additional homeing offset
|
140
|
|
-// M207 - set retract length S[positive mm] F[feedrate mm/sec] Z[additional zlift/hop]
|
141
|
|
-// M208 - set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/sec]
|
|
140
|
+// M207 - set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting
|
|
141
|
+// M208 - set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/min]
|
142
|
142
|
// M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction.
|
143
|
143
|
// M218 - set hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>
|
144
|
144
|
// M220 S<factor in percent>- set speed factor override percentage
|
|
@@ -231,10 +231,13 @@ int EtoPPressure=0;
|
231
|
231
|
#endif
|
232
|
232
|
|
233
|
233
|
#ifdef FWRETRACT
|
234
|
|
- bool autoretract_enabled=true;
|
|
234
|
+ bool autoretract_enabled=false;
|
235
|
235
|
bool retracted=false;
|
236
|
|
- float retract_length=3, retract_feedrate=17*60, retract_zlift=0.8;
|
237
|
|
- float retract_recover_length=0, retract_recover_feedrate=8*60;
|
|
236
|
+ float retract_length = RETRACT_LENGTH;
|
|
237
|
+ float retract_feedrate = RETRACT_FEEDRATE;
|
|
238
|
+ float retract_zlift = RETRACT_ZLIFT;
|
|
239
|
+ float retract_recover_length = RETRACT_RECOVER_LENGTH;
|
|
240
|
+ float retract_recover_feedrate = RETRACT_RECOVER_FEEDRATE;
|
238
|
241
|
#endif
|
239
|
242
|
|
240
|
243
|
#ifdef ULTIPANEL
|
|
@@ -978,6 +981,28 @@ static void retract_z_probe() {
|
978
|
981
|
#endif
|
979
|
982
|
}
|
980
|
983
|
|
|
984
|
+/// Probe bed height at position (x,y), returns the measured z value
|
|
985
|
+static float probe_pt(float x, float y, float z_before) {
|
|
986
|
+ // move to right place
|
|
987
|
+ do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before);
|
|
988
|
+ do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);
|
|
989
|
+
|
|
990
|
+ engage_z_probe(); // Engage Z Servo endstop if available
|
|
991
|
+ run_z_probe();
|
|
992
|
+ float measured_z = current_position[Z_AXIS];
|
|
993
|
+ retract_z_probe();
|
|
994
|
+
|
|
995
|
+ SERIAL_PROTOCOLPGM(MSG_BED);
|
|
996
|
+ SERIAL_PROTOCOLPGM(" x: ");
|
|
997
|
+ SERIAL_PROTOCOL(x);
|
|
998
|
+ SERIAL_PROTOCOLPGM(" y: ");
|
|
999
|
+ SERIAL_PROTOCOL(y);
|
|
1000
|
+ SERIAL_PROTOCOLPGM(" z: ");
|
|
1001
|
+ SERIAL_PROTOCOL(measured_z);
|
|
1002
|
+ SERIAL_PROTOCOLPGM("\n");
|
|
1003
|
+ return measured_z;
|
|
1004
|
+}
|
|
1005
|
+
|
981
|
1006
|
#endif // #ifdef ENABLE_AUTO_BED_LEVELING
|
982
|
1007
|
|
983
|
1008
|
static void homeaxis(int axis) {
|
|
@@ -1058,6 +1083,46 @@ static void homeaxis(int axis) {
|
1058
|
1083
|
}
|
1059
|
1084
|
}
|
1060
|
1085
|
#define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS)
|
|
1086
|
+void refresh_cmd_timeout(void)
|
|
1087
|
+{
|
|
1088
|
+ previous_millis_cmd = millis();
|
|
1089
|
+}
|
|
1090
|
+
|
|
1091
|
+#ifdef FWRETRACT
|
|
1092
|
+ void retract(bool retracting) {
|
|
1093
|
+ if(retracting && !retracted) {
|
|
1094
|
+ destination[X_AXIS]=current_position[X_AXIS];
|
|
1095
|
+ destination[Y_AXIS]=current_position[Y_AXIS];
|
|
1096
|
+ destination[Z_AXIS]=current_position[Z_AXIS];
|
|
1097
|
+ destination[E_AXIS]=current_position[E_AXIS];
|
|
1098
|
+ current_position[E_AXIS]+=retract_length/volumetric_multiplier[active_extruder];
|
|
1099
|
+ plan_set_e_position(current_position[E_AXIS]);
|
|
1100
|
+ float oldFeedrate = feedrate;
|
|
1101
|
+ feedrate=retract_feedrate;
|
|
1102
|
+ retracted=true;
|
|
1103
|
+ prepare_move();
|
|
1104
|
+ current_position[Z_AXIS]-=retract_zlift;
|
|
1105
|
+ plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
1106
|
+ prepare_move();
|
|
1107
|
+ feedrate = oldFeedrate;
|
|
1108
|
+ } else if(!retracting && retracted) {
|
|
1109
|
+ destination[X_AXIS]=current_position[X_AXIS];
|
|
1110
|
+ destination[Y_AXIS]=current_position[Y_AXIS];
|
|
1111
|
+ destination[Z_AXIS]=current_position[Z_AXIS];
|
|
1112
|
+ destination[E_AXIS]=current_position[E_AXIS];
|
|
1113
|
+ current_position[Z_AXIS]+=retract_zlift;
|
|
1114
|
+ plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
1115
|
+ //prepare_move();
|
|
1116
|
+ current_position[E_AXIS]-=(retract_length+retract_recover_length)/volumetric_multiplier[active_extruder];
|
|
1117
|
+ plan_set_e_position(current_position[E_AXIS]);
|
|
1118
|
+ float oldFeedrate = feedrate;
|
|
1119
|
+ feedrate=retract_recover_feedrate;
|
|
1120
|
+ retracted=false;
|
|
1121
|
+ prepare_move();
|
|
1122
|
+ feedrate = oldFeedrate;
|
|
1123
|
+ }
|
|
1124
|
+ } //retract
|
|
1125
|
+#endif //FWRETRACT
|
1061
|
1126
|
|
1062
|
1127
|
void process_commands()
|
1063
|
1128
|
{
|
|
@@ -1074,6 +1139,18 @@ void process_commands()
|
1074
|
1139
|
case 1: // G1
|
1075
|
1140
|
if(Stopped == false) {
|
1076
|
1141
|
get_coordinates(); // For X Y Z E F
|
|
1142
|
+ #ifdef FWRETRACT
|
|
1143
|
+ if(autoretract_enabled)
|
|
1144
|
+ if( !(code_seen(X_AXIS) || code_seen(Y_AXIS) || code_seen(Z_AXIS)) && code_seen(E_AXIS)) {
|
|
1145
|
+ float echange=destination[E_AXIS]-current_position[E_AXIS];
|
|
1146
|
+ if((echange<-MIN_RETRACT && !retracted) || (echange>MIN_RETRACT && retracted)) { //move appears to be an attempt to attract or recover
|
|
1147
|
+ current_position[E_AXIS] = destination[E_AXIS]; //hide the slicer-generated retract/recover from calculations
|
|
1148
|
+ plan_set_e_position(current_position[E_AXIS]); //AND from the planner
|
|
1149
|
+ retract(!retracted);
|
|
1150
|
+ return;
|
|
1151
|
+ }
|
|
1152
|
+ }
|
|
1153
|
+ #endif //FWRETRACT
|
1077
|
1154
|
prepare_move();
|
1078
|
1155
|
//ClearToSend();
|
1079
|
1156
|
return;
|
|
@@ -1108,31 +1185,10 @@ void process_commands()
|
1108
|
1185
|
break;
|
1109
|
1186
|
#ifdef FWRETRACT
|
1110
|
1187
|
case 10: // G10 retract
|
1111
|
|
- if(!retracted)
|
1112
|
|
- {
|
1113
|
|
- destination[X_AXIS]=current_position[X_AXIS];
|
1114
|
|
- destination[Y_AXIS]=current_position[Y_AXIS];
|
1115
|
|
- destination[Z_AXIS]=current_position[Z_AXIS];
|
1116
|
|
- current_position[Z_AXIS]+=-retract_zlift;
|
1117
|
|
- destination[E_AXIS]=current_position[E_AXIS]-retract_length;
|
1118
|
|
- feedrate=retract_feedrate;
|
1119
|
|
- retracted=true;
|
1120
|
|
- prepare_move();
|
1121
|
|
- }
|
1122
|
|
-
|
|
1188
|
+ retract(true);
|
1123
|
1189
|
break;
|
1124
|
1190
|
case 11: // G11 retract_recover
|
1125
|
|
- if(retracted)
|
1126
|
|
- {
|
1127
|
|
- destination[X_AXIS]=current_position[X_AXIS];
|
1128
|
|
- destination[Y_AXIS]=current_position[Y_AXIS];
|
1129
|
|
- destination[Z_AXIS]=current_position[Z_AXIS];
|
1130
|
|
- current_position[Z_AXIS]+=retract_zlift;
|
1131
|
|
- destination[E_AXIS]=current_position[E_AXIS]+retract_length+retract_recover_length;
|
1132
|
|
- feedrate=retract_recover_feedrate;
|
1133
|
|
- retracted=false;
|
1134
|
|
- prepare_move();
|
1135
|
|
- }
|
|
1191
|
+ retract(false);
|
1136
|
1192
|
break;
|
1137
|
1193
|
#endif //FWRETRACT
|
1138
|
1194
|
case 28: //G28 Home all Axis one at a time
|
|
@@ -1185,7 +1241,7 @@ void process_commands()
|
1185
|
1241
|
|
1186
|
1242
|
#else // NOT DELTA
|
1187
|
1243
|
|
1188
|
|
- home_all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2])));
|
|
1244
|
+ home_all_axis = !((code_seen(axis_codes[X_AXIS])) || (code_seen(axis_codes[Y_AXIS])) || (code_seen(axis_codes[Z_AXIS])));
|
1189
|
1245
|
|
1190
|
1246
|
#if Z_HOME_DIR > 0 // If homing away from BED do Z first
|
1191
|
1247
|
if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) {
|
|
@@ -1353,6 +1409,15 @@ void process_commands()
|
1353
|
1409
|
#error "You must have a Z_MIN endstop in order to enable Auto Bed Leveling feature!!! Z_MIN_PIN must point to a valid hardware pin."
|
1354
|
1410
|
#endif
|
1355
|
1411
|
|
|
1412
|
+ // Prevent user from running a G29 without first homing in X and Y
|
|
1413
|
+ if (! (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) )
|
|
1414
|
+ {
|
|
1415
|
+ LCD_MESSAGEPGM(MSG_POSITION_UNKNOWN);
|
|
1416
|
+ SERIAL_ECHO_START;
|
|
1417
|
+ SERIAL_ECHOLNPGM(MSG_POSITION_UNKNOWN);
|
|
1418
|
+ break; // abort G29, since we don't know where we are
|
|
1419
|
+ }
|
|
1420
|
+
|
1356
|
1421
|
st_synchronize();
|
1357
|
1422
|
// make sure the bed_level_rotation_matrix is identity or the planner will get it incorectly
|
1358
|
1423
|
//vector_3 corrected_position = plan_get_position_mm();
|
|
@@ -1407,31 +1472,20 @@ void process_commands()
|
1407
|
1472
|
|
1408
|
1473
|
for (int xCount=0; xCount < ACCURATE_BED_LEVELING_POINTS; xCount++)
|
1409
|
1474
|
{
|
|
1475
|
+ float z_before;
|
1410
|
1476
|
if (probePointCounter == 0)
|
1411
|
1477
|
{
|
1412
|
1478
|
// raise before probing
|
1413
|
|
- do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_BEFORE_PROBING);
|
|
1479
|
+ z_before = Z_RAISE_BEFORE_PROBING;
|
1414
|
1480
|
} else
|
1415
|
1481
|
{
|
1416
|
1482
|
// raise extruder
|
1417
|
|
- do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS);
|
|
1483
|
+ z_before = current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS;
|
1418
|
1484
|
}
|
1419
|
1485
|
|
|
1486
|
+ float measured_z = probe_pt(xProbe, yProbe, z_before);
|
1420
|
1487
|
|
1421
|
|
- do_blocking_move_to(xProbe - X_PROBE_OFFSET_FROM_EXTRUDER, yProbe - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);
|
1422
|
|
-
|
1423
|
|
- engage_z_probe(); // Engage Z Servo endstop if available
|
1424
|
|
- run_z_probe();
|
1425
|
|
- eqnBVector[probePointCounter] = current_position[Z_AXIS];
|
1426
|
|
- retract_z_probe();
|
1427
|
|
-
|
1428
|
|
- SERIAL_PROTOCOLPGM("Bed x: ");
|
1429
|
|
- SERIAL_PROTOCOL(xProbe);
|
1430
|
|
- SERIAL_PROTOCOLPGM(" y: ");
|
1431
|
|
- SERIAL_PROTOCOL(yProbe);
|
1432
|
|
- SERIAL_PROTOCOLPGM(" z: ");
|
1433
|
|
- SERIAL_PROTOCOL(current_position[Z_AXIS]);
|
1434
|
|
- SERIAL_PROTOCOLPGM("\n");
|
|
1488
|
+ eqnBVector[probePointCounter] = measured_z;
|
1435
|
1489
|
|
1436
|
1490
|
eqnAMatrix[probePointCounter + 0*ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS] = xProbe;
|
1437
|
1491
|
eqnAMatrix[probePointCounter + 1*ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS] = yProbe;
|
|
@@ -1461,56 +1515,13 @@ void process_commands()
|
1461
|
1515
|
|
1462
|
1516
|
|
1463
|
1517
|
// prob 1
|
1464
|
|
- do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_BEFORE_PROBING);
|
1465
|
|
- do_blocking_move_to(LEFT_PROBE_BED_POSITION - X_PROBE_OFFSET_FROM_EXTRUDER, BACK_PROBE_BED_POSITION - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);
|
1466
|
|
-
|
1467
|
|
- engage_z_probe(); // Engage Z Servo endstop if available
|
1468
|
|
- run_z_probe();
|
1469
|
|
- float z_at_xLeft_yBack = current_position[Z_AXIS];
|
1470
|
|
- retract_z_probe();
|
1471
|
|
-
|
1472
|
|
- SERIAL_PROTOCOLPGM("Bed x: ");
|
1473
|
|
- SERIAL_PROTOCOL(LEFT_PROBE_BED_POSITION);
|
1474
|
|
- SERIAL_PROTOCOLPGM(" y: ");
|
1475
|
|
- SERIAL_PROTOCOL(BACK_PROBE_BED_POSITION);
|
1476
|
|
- SERIAL_PROTOCOLPGM(" z: ");
|
1477
|
|
- SERIAL_PROTOCOL(current_position[Z_AXIS]);
|
1478
|
|
- SERIAL_PROTOCOLPGM("\n");
|
|
1518
|
+ float z_at_xLeft_yBack = probe_pt(LEFT_PROBE_BED_POSITION, BACK_PROBE_BED_POSITION, Z_RAISE_BEFORE_PROBING);
|
1479
|
1519
|
|
1480
|
1520
|
// prob 2
|
1481
|
|
- do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS);
|
1482
|
|
- do_blocking_move_to(LEFT_PROBE_BED_POSITION - X_PROBE_OFFSET_FROM_EXTRUDER, FRONT_PROBE_BED_POSITION - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);
|
1483
|
|
-
|
1484
|
|
- engage_z_probe(); // Engage Z Servo endstop if available
|
1485
|
|
- run_z_probe();
|
1486
|
|
- float z_at_xLeft_yFront = current_position[Z_AXIS];
|
1487
|
|
- retract_z_probe();
|
1488
|
|
-
|
1489
|
|
- SERIAL_PROTOCOLPGM("Bed x: ");
|
1490
|
|
- SERIAL_PROTOCOL(LEFT_PROBE_BED_POSITION);
|
1491
|
|
- SERIAL_PROTOCOLPGM(" y: ");
|
1492
|
|
- SERIAL_PROTOCOL(FRONT_PROBE_BED_POSITION);
|
1493
|
|
- SERIAL_PROTOCOLPGM(" z: ");
|
1494
|
|
- SERIAL_PROTOCOL(current_position[Z_AXIS]);
|
1495
|
|
- SERIAL_PROTOCOLPGM("\n");
|
|
1521
|
+ float z_at_xLeft_yFront = probe_pt(LEFT_PROBE_BED_POSITION, FRONT_PROBE_BED_POSITION, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS);
|
1496
|
1522
|
|
1497
|
1523
|
// prob 3
|
1498
|
|
- do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS);
|
1499
|
|
- // the current position will be updated by the blocking move so the head will not lower on this next call.
|
1500
|
|
- do_blocking_move_to(RIGHT_PROBE_BED_POSITION - X_PROBE_OFFSET_FROM_EXTRUDER, FRONT_PROBE_BED_POSITION - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);
|
1501
|
|
-
|
1502
|
|
- engage_z_probe(); // Engage Z Servo endstop if available
|
1503
|
|
- run_z_probe();
|
1504
|
|
- float z_at_xRight_yFront = current_position[Z_AXIS];
|
1505
|
|
- retract_z_probe(); // Retract Z Servo endstop if available
|
1506
|
|
-
|
1507
|
|
- SERIAL_PROTOCOLPGM("Bed x: ");
|
1508
|
|
- SERIAL_PROTOCOL(RIGHT_PROBE_BED_POSITION);
|
1509
|
|
- SERIAL_PROTOCOLPGM(" y: ");
|
1510
|
|
- SERIAL_PROTOCOL(FRONT_PROBE_BED_POSITION);
|
1511
|
|
- SERIAL_PROTOCOLPGM(" z: ");
|
1512
|
|
- SERIAL_PROTOCOL(current_position[Z_AXIS]);
|
1513
|
|
- SERIAL_PROTOCOLPGM("\n");
|
|
1524
|
+ float z_at_xRight_yFront = probe_pt(RIGHT_PROBE_BED_POSITION, FRONT_PROBE_BED_POSITION, current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS);
|
1514
|
1525
|
|
1515
|
1526
|
clean_up_after_endstop_move();
|
1516
|
1527
|
|
|
@@ -1545,7 +1556,8 @@ void process_commands()
|
1545
|
1556
|
feedrate = homing_feedrate[Z_AXIS];
|
1546
|
1557
|
|
1547
|
1558
|
run_z_probe();
|
1548
|
|
- SERIAL_PROTOCOLPGM("Bed Position X: ");
|
|
1559
|
+ SERIAL_PROTOCOLPGM(MSG_BED);
|
|
1560
|
+ SERIAL_PROTOCOLPGM(" X: ");
|
1549
|
1561
|
SERIAL_PROTOCOL(current_position[X_AXIS]);
|
1550
|
1562
|
SERIAL_PROTOCOLPGM(" Y: ");
|
1551
|
1563
|
SERIAL_PROTOCOL(current_position[Y_AXIS]);
|
|
@@ -2085,7 +2097,7 @@ void process_commands()
|
2085
|
2097
|
}
|
2086
|
2098
|
else
|
2087
|
2099
|
{
|
2088
|
|
- bool all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2]))|| (code_seen(axis_codes[3])));
|
|
2100
|
+ bool all_axis = !((code_seen(axis_codes[X_AXIS])) || (code_seen(axis_codes[Y_AXIS])) || (code_seen(axis_codes[Z_AXIS]))|| (code_seen(axis_codes[E_AXIS])));
|
2089
|
2101
|
if(all_axis)
|
2090
|
2102
|
{
|
2091
|
2103
|
st_synchronize();
|
|
@@ -2147,18 +2159,18 @@ void process_commands()
|
2147
|
2159
|
case 114: // M114
|
2148
|
2160
|
SERIAL_PROTOCOLPGM("X:");
|
2149
|
2161
|
SERIAL_PROTOCOL(current_position[X_AXIS]);
|
2150
|
|
- SERIAL_PROTOCOLPGM("Y:");
|
|
2162
|
+ SERIAL_PROTOCOLPGM(" Y:");
|
2151
|
2163
|
SERIAL_PROTOCOL(current_position[Y_AXIS]);
|
2152
|
|
- SERIAL_PROTOCOLPGM("Z:");
|
|
2164
|
+ SERIAL_PROTOCOLPGM(" Z:");
|
2153
|
2165
|
SERIAL_PROTOCOL(current_position[Z_AXIS]);
|
2154
|
|
- SERIAL_PROTOCOLPGM("E:");
|
|
2166
|
+ SERIAL_PROTOCOLPGM(" E:");
|
2155
|
2167
|
SERIAL_PROTOCOL(current_position[E_AXIS]);
|
2156
|
2168
|
|
2157
|
2169
|
SERIAL_PROTOCOLPGM(MSG_COUNT_X);
|
2158
|
2170
|
SERIAL_PROTOCOL(float(st_get_position(X_AXIS))/axis_steps_per_unit[X_AXIS]);
|
2159
|
|
- SERIAL_PROTOCOLPGM("Y:");
|
|
2171
|
+ SERIAL_PROTOCOLPGM(" Y:");
|
2160
|
2172
|
SERIAL_PROTOCOL(float(st_get_position(Y_AXIS))/axis_steps_per_unit[Y_AXIS]);
|
2161
|
|
- SERIAL_PROTOCOLPGM("Z:");
|
|
2173
|
+ SERIAL_PROTOCOLPGM(" Z:");
|
2162
|
2174
|
SERIAL_PROTOCOL(float(st_get_position(Z_AXIS))/axis_steps_per_unit[Z_AXIS]);
|
2163
|
2175
|
|
2164
|
2176
|
SERIAL_PROTOCOLLN("");
|
|
@@ -3041,42 +3053,6 @@ void get_coordinates()
|
3041
|
3053
|
next_feedrate = code_value();
|
3042
|
3054
|
if(next_feedrate > 0.0) feedrate = next_feedrate;
|
3043
|
3055
|
}
|
3044
|
|
- #ifdef FWRETRACT
|
3045
|
|
- if(autoretract_enabled)
|
3046
|
|
- if( !(seen[X_AXIS] || seen[Y_AXIS] || seen[Z_AXIS]) && seen[E_AXIS])
|
3047
|
|
- {
|
3048
|
|
- float echange=destination[E_AXIS]-current_position[E_AXIS];
|
3049
|
|
- if(echange<-MIN_RETRACT) //retract
|
3050
|
|
- {
|
3051
|
|
- if(!retracted)
|
3052
|
|
- {
|
3053
|
|
-
|
3054
|
|
- destination[Z_AXIS]+=retract_zlift; //not sure why chaninging current_position negatively does not work.
|
3055
|
|
- //if slicer retracted by echange=-1mm and you want to retract 3mm, corrrectede=-2mm additionally
|
3056
|
|
- float correctede=-echange-retract_length;
|
3057
|
|
- //to generate the additional steps, not the destination is changed, but inversely the current position
|
3058
|
|
- current_position[E_AXIS]+=-correctede;
|
3059
|
|
- feedrate=retract_feedrate;
|
3060
|
|
- retracted=true;
|
3061
|
|
- }
|
3062
|
|
-
|
3063
|
|
- }
|
3064
|
|
- else
|
3065
|
|
- if(echange>MIN_RETRACT) //retract_recover
|
3066
|
|
- {
|
3067
|
|
- if(retracted)
|
3068
|
|
- {
|
3069
|
|
- //current_position[Z_AXIS]+=-retract_zlift;
|
3070
|
|
- //if slicer retracted_recovered by echange=+1mm and you want to retract_recover 3mm, corrrectede=2mm additionally
|
3071
|
|
- float correctede=-echange+1*retract_length+retract_recover_length; //total unretract=retract_length+retract_recover_length[surplus]
|
3072
|
|
- current_position[E_AXIS]+=correctede; //to generate the additional steps, not the destination is changed, but inversely the current position
|
3073
|
|
- feedrate=retract_recover_feedrate;
|
3074
|
|
- retracted=false;
|
3075
|
|
- }
|
3076
|
|
- }
|
3077
|
|
-
|
3078
|
|
- }
|
3079
|
|
- #endif //FWRETRACT
|
3080
|
3056
|
}
|
3081
|
3057
|
|
3082
|
3058
|
void get_arc_coordinates()
|