|
@@ -61,6 +61,7 @@
|
61
|
61
|
* G30 - Single Z probe, probes bed at X Y location (defaults to current XY location)
|
62
|
62
|
* G31 - Dock sled (Z_PROBE_SLED only)
|
63
|
63
|
* G32 - Undock sled (Z_PROBE_SLED only)
|
|
64
|
+ * G33 - Delta '4-point' auto calibration iteration
|
64
|
65
|
* G38 - Probe target - similar to G28 except it uses the Z_MIN_PROBE for all three axes
|
65
|
66
|
* G90 - Use Absolute Coordinates
|
66
|
67
|
* G91 - Use Relative Coordinates
|
|
@@ -146,7 +147,7 @@
|
146
|
147
|
S<print> T<travel> minimum speeds
|
147
|
148
|
B<minimum segment time>
|
148
|
149
|
X<max X jerk>, Y<max Y jerk>, Z<max Z jerk>, E<max E jerk>
|
149
|
|
- * M206 - Set additional homing offset.
|
|
150
|
+ * M206 - Set additional homing offset. (Disabled by NO_WORKSPACE_OFFSETS or DELTA)
|
150
|
151
|
* M207 - Set Retract Length: S<length>, Feedrate: F<units/min>, and Z lift: Z<distance>. (Requires FWRETRACT)
|
151
|
152
|
* M208 - Set Recover (unretract) Additional (!) Length: S<length> and Feedrate: F<units/min>. (Requires FWRETRACT)
|
152
|
153
|
* M209 - Turn Automatic Retract Detection on/off: S<0|1> (For slicers that don't support G10/11). (Requires FWRETRACT)
|
|
@@ -179,7 +180,7 @@
|
179
|
180
|
* M410 - Quickstop. Abort all planned moves.
|
180
|
181
|
* M420 - Enable/Disable Leveling (with current values) S1=enable S0=disable (Requires MESH_BED_LEVELING or ABL)
|
181
|
182
|
* M421 - Set a single Z coordinate in the Mesh Leveling grid. X<units> Y<units> Z<units> (Requires MESH_BED_LEVELING or AUTO_BED_LEVELING_UBL)
|
182
|
|
- * M428 - Set the home_offset based on the current_position. Nearest edge applies.
|
|
183
|
+ * M428 - Set the home_offset based on the current_position. Nearest edge applies. (Disabled by NO_WORKSPACE_OFFSETS or DELTA)
|
183
|
184
|
* M500 - Store parameters in EEPROM. (Requires EEPROM_SETTINGS)
|
184
|
185
|
* M501 - Restore parameters from EEPROM. (Requires EEPROM_SETTINGS)
|
185
|
186
|
* M502 - Revert to the default "factory settings". ** Does not write them to EEPROM! **
|
|
@@ -408,18 +409,20 @@ bool axis_relative_modes[] = AXIS_RELATIVE_MODES,
|
408
|
409
|
float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_NOMINAL_FILAMENT_DIA),
|
409
|
410
|
volumetric_multiplier[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(1.0);
|
410
|
411
|
|
411
|
|
-#if DISABLED(NO_WORKSPACE_OFFSETS)
|
412
|
|
-
|
413
|
|
- // The distance that XYZ has been offset by G92. Reset by G28.
|
414
|
|
- float position_shift[XYZ] = { 0 };
|
415
|
|
-
|
416
|
|
- // This offset is added to the configured home position.
|
417
|
|
- // Set by M206, M428, or menu item. Saved to EEPROM.
|
418
|
|
- float home_offset[XYZ] = { 0 };
|
419
|
|
-
|
420
|
|
- // The above two are combined to save on computes
|
421
|
|
- float workspace_offset[XYZ] = { 0 };
|
422
|
|
-
|
|
412
|
+#if HAS_WORKSPACE_OFFSET
|
|
413
|
+ #if HAS_POSITION_SHIFT
|
|
414
|
+ // The distance that XYZ has been offset by G92. Reset by G28.
|
|
415
|
+ float position_shift[XYZ] = { 0 };
|
|
416
|
+ #endif
|
|
417
|
+ #if HAS_HOME_OFFSET
|
|
418
|
+ // This offset is added to the configured home position.
|
|
419
|
+ // Set by M206, M428, or menu item. Saved to EEPROM.
|
|
420
|
+ float home_offset[XYZ] = { 0 };
|
|
421
|
+ #endif
|
|
422
|
+ #if HAS_HOME_OFFSET && HAS_POSITION_SHIFT
|
|
423
|
+ // The above two are combined to save on computes
|
|
424
|
+ float workspace_offset[XYZ] = { 0 };
|
|
425
|
+ #endif
|
423
|
426
|
#endif
|
424
|
427
|
|
425
|
428
|
// Software Endstops are based on the configured limits.
|
|
@@ -1381,7 +1384,7 @@ bool get_target_extruder_from_command(int code) {
|
1381
|
1384
|
|
1382
|
1385
|
#endif // DUAL_X_CARRIAGE
|
1383
|
1386
|
|
1384
|
|
-#if DISABLED(NO_WORKSPACE_OFFSETS) || ENABLED(DUAL_X_CARRIAGE) || ENABLED(DELTA)
|
|
1387
|
+#if HAS_WORKSPACE_OFFSET || ENABLED(DUAL_X_CARRIAGE)
|
1385
|
1388
|
|
1386
|
1389
|
/**
|
1387
|
1390
|
* Software endstops can be used to monitor the open end of
|
|
@@ -1393,7 +1396,18 @@ bool get_target_extruder_from_command(int code) {
|
1393
|
1396
|
* at the same positions relative to the machine.
|
1394
|
1397
|
*/
|
1395
|
1398
|
void update_software_endstops(const AxisEnum axis) {
|
1396
|
|
- const float offs = workspace_offset[axis] = home_offset[axis] + position_shift[axis];
|
|
1399
|
+ const float offs = 0.0
|
|
1400
|
+ #if HAS_HOME_OFFSET
|
|
1401
|
+ + home_offset[axis]
|
|
1402
|
+ #endif
|
|
1403
|
+ #if HAS_POSITION_SHIFT
|
|
1404
|
+ + position_shift[axis]
|
|
1405
|
+ #endif
|
|
1406
|
+ ;
|
|
1407
|
+
|
|
1408
|
+ #if HAS_HOME_OFFSET && HAS_POSITION_SHIFT
|
|
1409
|
+ workspace_offset[axis] = offs;
|
|
1410
|
+ #endif
|
1397
|
1411
|
|
1398
|
1412
|
#if ENABLED(DUAL_X_CARRIAGE)
|
1399
|
1413
|
if (axis == X_AXIS) {
|
|
@@ -1426,8 +1440,10 @@ bool get_target_extruder_from_command(int code) {
|
1426
|
1440
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
1427
|
1441
|
if (DEBUGGING(LEVELING)) {
|
1428
|
1442
|
SERIAL_ECHOPAIR("For ", axis_codes[axis]);
|
1429
|
|
- #if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
1443
|
+ #if HAS_HOME_OFFSET
|
1430
|
1444
|
SERIAL_ECHOPAIR(" axis:\n home_offset = ", home_offset[axis]);
|
|
1445
|
+ #endif
|
|
1446
|
+ #if HAS_POSITION_SHIFT
|
1431
|
1447
|
SERIAL_ECHOPAIR("\n position_shift = ", position_shift[axis]);
|
1432
|
1448
|
#endif
|
1433
|
1449
|
SERIAL_ECHOPAIR("\n soft_endstop_min = ", soft_endstop_min[axis]);
|
|
@@ -1441,9 +1457,9 @@ bool get_target_extruder_from_command(int code) {
|
1441
|
1457
|
#endif
|
1442
|
1458
|
}
|
1443
|
1459
|
|
1444
|
|
-#endif // NO_WORKSPACE_OFFSETS
|
|
1460
|
+#endif // HAS_WORKSPACE_OFFSET || DUAL_X_CARRIAGE
|
1445
|
1461
|
|
1446
|
|
-#if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
1462
|
+#if HAS_M206_COMMAND
|
1447
|
1463
|
/**
|
1448
|
1464
|
* Change the home offset for an axis, update the current
|
1449
|
1465
|
* position and the software endstops to retain the same
|
|
@@ -1457,7 +1473,7 @@ bool get_target_extruder_from_command(int code) {
|
1457
|
1473
|
home_offset[axis] = v;
|
1458
|
1474
|
update_software_endstops(axis);
|
1459
|
1475
|
}
|
1460
|
|
-#endif // NO_WORKSPACE_OFFSETS
|
|
1476
|
+#endif // HAS_M206_COMMAND
|
1461
|
1477
|
|
1462
|
1478
|
/**
|
1463
|
1479
|
* Set an axis' current position to its home position (after homing).
|
|
@@ -1488,7 +1504,7 @@ static void set_axis_is_at_home(AxisEnum axis) {
|
1488
|
1504
|
|
1489
|
1505
|
axis_known_position[axis] = axis_homed[axis] = true;
|
1490
|
1506
|
|
1491
|
|
- #if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
1507
|
+ #if HAS_POSITION_SHIFT
|
1492
|
1508
|
position_shift[axis] = 0;
|
1493
|
1509
|
update_software_endstops(axis);
|
1494
|
1510
|
#endif
|
|
@@ -1564,7 +1580,7 @@ static void set_axis_is_at_home(AxisEnum axis) {
|
1564
|
1580
|
|
1565
|
1581
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
1566
|
1582
|
if (DEBUGGING(LEVELING)) {
|
1567
|
|
- #if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
1583
|
+ #if HAS_HOME_OFFSET
|
1568
|
1584
|
SERIAL_ECHOPAIR("> home_offset[", axis_codes[axis]);
|
1569
|
1585
|
SERIAL_ECHOLNPAIR("] = ", home_offset[axis]);
|
1570
|
1586
|
#endif
|
|
@@ -2299,7 +2315,7 @@ static void clean_up_after_endstop_or_probe_move() {
|
2299
|
2315
|
SERIAL_PROTOCOLPGM(" Y: ");
|
2300
|
2316
|
SERIAL_PROTOCOL_F(y, 3);
|
2301
|
2317
|
SERIAL_PROTOCOLPGM(" Z: ");
|
2302
|
|
- SERIAL_PROTOCOL_F(FIXFLOAT(measured_z), 3);
|
|
2318
|
+ SERIAL_PROTOCOL_F(measured_z, 3);
|
2303
|
2319
|
SERIAL_EOL;
|
2304
|
2320
|
}
|
2305
|
2321
|
|
|
@@ -4035,6 +4051,11 @@ inline void gcode_G28() {
|
4035
|
4051
|
* L Set the Left limit of the probing grid
|
4036
|
4052
|
* R Set the Right limit of the probing grid
|
4037
|
4053
|
*
|
|
4054
|
+ * Parameters with DEBUG_LEVELING_FEATURE only:
|
|
4055
|
+ *
|
|
4056
|
+ * C Make a totally fake grid with no actual probing.
|
|
4057
|
+ * For use in testing when no probing is possible.
|
|
4058
|
+ *
|
4038
|
4059
|
* Parameters with BILINEAR leveling only:
|
4039
|
4060
|
*
|
4040
|
4061
|
* Z Supply an additional Z probe offset
|
|
@@ -4077,6 +4098,12 @@ inline void gcode_G28() {
|
4077
|
4098
|
#endif
|
4078
|
4099
|
#endif
|
4079
|
4100
|
|
|
4101
|
+ #if ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY)
|
|
4102
|
+ const bool faux = code_seen('C') && code_value_bool();
|
|
4103
|
+ #else
|
|
4104
|
+ bool constexpr faux = false;
|
|
4105
|
+ #endif
|
|
4106
|
+
|
4080
|
4107
|
// Don't allow auto-leveling without homing first
|
4081
|
4108
|
if (axis_unhomed_error(true, true, true)) return;
|
4082
|
4109
|
|
|
@@ -4292,7 +4319,7 @@ inline void gcode_G28() {
|
4292
|
4319
|
SYNC_PLAN_POSITION_KINEMATIC();
|
4293
|
4320
|
}
|
4294
|
4321
|
|
4295
|
|
- setup_for_endstop_or_probe_move();
|
|
4322
|
+ if (!faux) setup_for_endstop_or_probe_move();
|
4296
|
4323
|
|
4297
|
4324
|
//xProbe = yProbe = measured_z = 0;
|
4298
|
4325
|
|
|
@@ -4550,7 +4577,7 @@ inline void gcode_G28() {
|
4550
|
4577
|
if (!position_is_reachable(pos, true)) continue;
|
4551
|
4578
|
#endif
|
4552
|
4579
|
|
4553
|
|
- measured_z = probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level);
|
|
4580
|
+ measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level);
|
4554
|
4581
|
|
4555
|
4582
|
if (isnan(measured_z)) {
|
4556
|
4583
|
planner.abl_enabled = abl_should_enable;
|
|
@@ -4585,7 +4612,7 @@ inline void gcode_G28() {
|
4585
|
4612
|
// Retain the last probe position
|
4586
|
4613
|
xProbe = LOGICAL_X_POSITION(points[i].x);
|
4587
|
4614
|
yProbe = LOGICAL_Y_POSITION(points[i].y);
|
4588
|
|
- measured_z = points[i].z = probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level);
|
|
4615
|
+ measured_z = points[i].z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level);
|
4589
|
4616
|
}
|
4590
|
4617
|
|
4591
|
4618
|
if (isnan(measured_z)) {
|
|
@@ -4624,7 +4651,7 @@ inline void gcode_G28() {
|
4624
|
4651
|
//
|
4625
|
4652
|
|
4626
|
4653
|
// Restore state after probing
|
4627
|
|
- clean_up_after_endstop_or_probe_move();
|
|
4654
|
+ if (!faux) clean_up_after_endstop_or_probe_move();
|
4628
|
4655
|
|
4629
|
4656
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
4630
|
4657
|
if (DEBUGGING(LEVELING)) DEBUG_POS("> probing complete", current_position);
|
|
@@ -4890,8 +4917,366 @@ inline void gcode_G28() {
|
4890
|
4917
|
|
4891
|
4918
|
#endif // Z_PROBE_SLED
|
4892
|
4919
|
|
|
4920
|
+ #if ENABLED(DELTA_AUTO_CALIBRATION)
|
|
4921
|
+ /**
|
|
4922
|
+ * G33: Delta '4-point' auto calibration iteration
|
|
4923
|
+ *
|
|
4924
|
+ * Usage: G33 <Cn> <Vn>
|
|
4925
|
+ *
|
|
4926
|
+ * C (default) = Calibrate endstops, height and delta radius
|
|
4927
|
+ *
|
|
4928
|
+ * -2, 1-4: n x n probe points, default 3 x 3
|
|
4929
|
+ *
|
|
4930
|
+ * 1: probe center
|
|
4931
|
+ * set height only - useful when z_offset is changed
|
|
4932
|
+ * 2: probe center and towers
|
|
4933
|
+ * solve one '4 point' calibration
|
|
4934
|
+ * -2: probe center and opposite the towers
|
|
4935
|
+ * solve one '4 point' calibration
|
|
4936
|
+ * 3: probe 3 center points, towers and opposite-towers
|
|
4937
|
+ * averages between 2 '4 point' calibrations
|
|
4938
|
+ * 4: probe 4 center points, towers, opposite-towers and itermediate points
|
|
4939
|
+ * averages between 4 '4 point' calibrations
|
|
4940
|
+ *
|
|
4941
|
+ * V Verbose level (0-3, default 1)
|
|
4942
|
+ *
|
|
4943
|
+ * 0: Dry-run mode: no calibration
|
|
4944
|
+ * 1: Settings
|
|
4945
|
+ * 2: Setting + probe results
|
|
4946
|
+ * 3: Expert mode: setting + iteration factors (see Configuration_adv.h)
|
|
4947
|
+ * This prematurely stops the iteration process when factors are found
|
|
4948
|
+ */
|
|
4949
|
+ inline void gcode_G33() {
|
|
4950
|
+
|
|
4951
|
+ stepper.synchronize();
|
|
4952
|
+
|
|
4953
|
+ #if PLANNER_LEVELING
|
|
4954
|
+ set_bed_leveling_enabled(false);
|
|
4955
|
+ #endif
|
|
4956
|
+
|
|
4957
|
+ const int8_t pp = code_seen('C') ? code_value_int() : DELTA_CALIBRATION_DEFAULT_POINTS,
|
|
4958
|
+ probe_points = (WITHIN(pp, 1, 4) || pp == -2) ? pp : DELTA_CALIBRATION_DEFAULT_POINTS;
|
|
4959
|
+
|
|
4960
|
+ int8_t verbose_level = code_seen('V') ? code_value_byte() : 1;
|
|
4961
|
+
|
|
4962
|
+ #if ENABLED(DELTA_CALIBRATE_EXPERT_MODE)
|
|
4963
|
+ #define _MAX_M33_V 3
|
|
4964
|
+ if (verbose_level == 3 && probe_points == 1) verbose_level--; // needs at least 4 points
|
|
4965
|
+ #else
|
|
4966
|
+ #define _MAX_M33_V 2
|
|
4967
|
+ if (verbose_level > 2)
|
|
4968
|
+ SERIAL_PROTOCOLLNPGM("Enable DELTA_CALIBRATE_EXPERT_MODE in Configuration_adv.h");
|
|
4969
|
+ #endif
|
|
4970
|
+
|
|
4971
|
+ if (!WITHIN(verbose_level, 0, _MAX_M33_V)) verbose_level = 1;
|
|
4972
|
+
|
|
4973
|
+ float zero_std_dev = verbose_level ? 999.0 : 0.0; // 0.0 in dry-run mode : forced end
|
|
4974
|
+
|
|
4975
|
+ gcode_G28();
|
|
4976
|
+
|
|
4977
|
+ float e_old[XYZ],
|
|
4978
|
+ dr_old = delta_radius,
|
|
4979
|
+ zh_old = home_offset[Z_AXIS];
|
|
4980
|
+ COPY(e_old,endstop_adj);
|
|
4981
|
+ #if ENABLED(DELTA_CALIBRATE_EXPERT_MODE)
|
|
4982
|
+ // expert variables
|
|
4983
|
+ float h_f_old = 1.00, r_f_old = 0.00,
|
|
4984
|
+ h_diff_min = 1.00, r_diff_max = 0.10;
|
|
4985
|
+ #endif
|
|
4986
|
+
|
|
4987
|
+ // print settings
|
|
4988
|
+
|
|
4989
|
+ SERIAL_PROTOCOLLNPGM("G33 Auto Calibrate");
|
|
4990
|
+ SERIAL_PROTOCOLPGM("Checking... AC");
|
|
4991
|
+ if (verbose_level == 0) SERIAL_PROTOCOLPGM(" (DRY-RUN)");
|
|
4992
|
+ #if ENABLED(DELTA_CALIBRATE_EXPERT_MODE)
|
|
4993
|
+ if (verbose_level == 3) SERIAL_PROTOCOLPGM(" (EXPERT)");
|
|
4994
|
+ #endif
|
|
4995
|
+ SERIAL_EOL;
|
|
4996
|
+ LCD_MESSAGEPGM("Checking... AC");
|
|
4997
|
+
|
|
4998
|
+ SERIAL_PROTOCOLPAIR("Height:", DELTA_HEIGHT + home_offset[Z_AXIS]);
|
|
4999
|
+ if (abs(probe_points) > 1) {
|
|
5000
|
+ SERIAL_PROTOCOLPGM(" Ex:");
|
|
5001
|
+ if (endstop_adj[A_AXIS] >= 0) SERIAL_CHAR('+');
|
|
5002
|
+ SERIAL_PROTOCOL_F(endstop_adj[A_AXIS], 2);
|
|
5003
|
+ SERIAL_PROTOCOLPGM(" Ey:");
|
|
5004
|
+ if (endstop_adj[B_AXIS] >= 0) SERIAL_CHAR('+');
|
|
5005
|
+ SERIAL_PROTOCOL_F(endstop_adj[B_AXIS], 2);
|
|
5006
|
+ SERIAL_PROTOCOLPGM(" Ez:");
|
|
5007
|
+ if (endstop_adj[C_AXIS] >= 0) SERIAL_CHAR('+');
|
|
5008
|
+ SERIAL_PROTOCOL_F(endstop_adj[C_AXIS], 2);
|
|
5009
|
+ SERIAL_PROTOCOLPAIR(" Radius:", delta_radius);
|
|
5010
|
+ }
|
|
5011
|
+ SERIAL_EOL;
|
|
5012
|
+
|
|
5013
|
+ #if ENABLED(Z_PROBE_SLED)
|
|
5014
|
+ DEPLOY_PROBE();
|
|
5015
|
+ #endif
|
|
5016
|
+
|
|
5017
|
+ float test_precision;
|
|
5018
|
+ int8_t iterations = 0;
|
|
5019
|
+
|
|
5020
|
+ do { // start iterations
|
|
5021
|
+
|
|
5022
|
+ setup_for_endstop_or_probe_move();
|
|
5023
|
+
|
|
5024
|
+ test_precision =
|
|
5025
|
+ #if ENABLED(DELTA_CALIBRATE_EXPERT_MODE)
|
|
5026
|
+ // Expert mode : forced end at std_dev < 0.1
|
|
5027
|
+ (verbose_level == 3 && zero_std_dev < 0.1) ? 0.0 :
|
|
5028
|
+ #endif
|
|
5029
|
+ zero_std_dev
|
|
5030
|
+ ;
|
|
5031
|
+
|
|
5032
|
+ float z_at_pt[13] = { 0 };
|
|
5033
|
+
|
|
5034
|
+ iterations++;
|
|
5035
|
+
|
|
5036
|
+ // probe the points
|
|
5037
|
+
|
|
5038
|
+ int16_t center_points = 0;
|
|
5039
|
+
|
|
5040
|
+ if (probe_points != 3) {
|
|
5041
|
+ z_at_pt[0] += probe_pt(0.0, 0.0 , true, 1);
|
|
5042
|
+ center_points = 1;
|
|
5043
|
+ }
|
|
5044
|
+
|
|
5045
|
+ int16_t step_axis = 4;
|
|
5046
|
+ if (probe_points >= 3) {
|
|
5047
|
+ for (int8_t axis = 9; axis > 0; axis -= step_axis) { // uint8_t starts endless loop
|
|
5048
|
+ z_at_pt[0] += probe_pt(
|
|
5049
|
+ 0.1 * cos(RADIANS(180 + 30 * axis)) * (DELTA_CALIBRATION_RADIUS),
|
|
5050
|
+ 0.1 * sin(RADIANS(180 + 30 * axis)) * (DELTA_CALIBRATION_RADIUS), true, 1);
|
|
5051
|
+ }
|
|
5052
|
+ center_points += 3;
|
|
5053
|
+ z_at_pt[0] /= center_points;
|
|
5054
|
+ }
|
|
5055
|
+
|
|
5056
|
+ float S1 = z_at_pt[0], S2 = sq(S1);
|
|
5057
|
+
|
|
5058
|
+ int16_t N = 1, start = (probe_points == -2) ? 3 : 1;
|
|
5059
|
+ step_axis = (abs(probe_points) == 2) ? 4 : (probe_points == 3) ? 2 : 1;
|
|
5060
|
+
|
|
5061
|
+ if (probe_points != 1) {
|
|
5062
|
+ for (uint8_t axis = start; axis < 13; axis += step_axis)
|
|
5063
|
+ z_at_pt[axis] += probe_pt(
|
|
5064
|
+ cos(RADIANS(180 + 30 * axis)) * (DELTA_CALIBRATION_RADIUS),
|
|
5065
|
+ sin(RADIANS(180 + 30 * axis)) * (DELTA_CALIBRATION_RADIUS), true, 1
|
|
5066
|
+ );
|
|
5067
|
+
|
|
5068
|
+ if (probe_points == 4) step_axis = 2;
|
|
5069
|
+ }
|
|
5070
|
+
|
|
5071
|
+ for (uint8_t axis = start; axis < 13; axis += step_axis) {
|
|
5072
|
+ if (probe_points == 4)
|
|
5073
|
+ z_at_pt[axis] = (z_at_pt[axis] + (z_at_pt[axis + 1] + z_at_pt[(axis + 10) % 12 + 1]) / 2.0) / 2.0;
|
|
5074
|
+
|
|
5075
|
+ S1 += z_at_pt[axis];
|
|
5076
|
+ S2 += sq(z_at_pt[axis]);
|
|
5077
|
+ N++;
|
|
5078
|
+ }
|
|
5079
|
+ zero_std_dev = round(sqrt(S2 / N) * 1000.0) / 1000.0 + 0.00001; // deviation from zero plane
|
|
5080
|
+
|
|
5081
|
+ // Solve matrices
|
|
5082
|
+
|
|
5083
|
+ if (zero_std_dev < test_precision) {
|
|
5084
|
+ COPY(e_old, endstop_adj);
|
|
5085
|
+ dr_old = delta_radius;
|
|
5086
|
+ zh_old = home_offset[Z_AXIS];
|
|
5087
|
+
|
|
5088
|
+ float e_delta[XYZ] = { 0.0 }, r_delta = 0.0;
|
|
5089
|
+
|
|
5090
|
+ #if ENABLED(DELTA_CALIBRATE_EXPERT_MODE)
|
|
5091
|
+ float h_f_new = 0.0, r_f_new = 0.0 , t_f_new = 0.0,
|
|
5092
|
+ h_diff = 0.00, r_diff = 0.00;
|
|
5093
|
+ #endif
|
|
5094
|
+
|
|
5095
|
+ #define ZP(N,I) ((N) * z_at_pt[I])
|
|
5096
|
+ #define Z1000(I) ZP(1.00, I)
|
|
5097
|
+ #define Z1050(I) ZP(H_FACTOR, I)
|
|
5098
|
+ #define Z0700(I) ZP((H_FACTOR) * 2.0 / 3.00, I)
|
|
5099
|
+ #define Z0350(I) ZP((H_FACTOR) / 3.00, I)
|
|
5100
|
+ #define Z0175(I) ZP((H_FACTOR) / 6.00, I)
|
|
5101
|
+ #define Z2250(I) ZP(R_FACTOR, I)
|
|
5102
|
+ #define Z0750(I) ZP((R_FACTOR) / 3.00, I)
|
|
5103
|
+ #define Z0375(I) ZP((R_FACTOR) / 6.00, I)
|
|
5104
|
+
|
|
5105
|
+ switch (probe_points) {
|
|
5106
|
+ case 1:
|
|
5107
|
+ LOOP_XYZ(i) e_delta[i] = Z1000(0);
|
|
5108
|
+ r_delta = 0.00;
|
|
5109
|
+ break;
|
|
5110
|
+
|
|
5111
|
+ case 2:
|
|
5112
|
+ e_delta[X_AXIS] = Z1050(0) + Z0700(1) - Z0350(5) - Z0350(9);
|
|
5113
|
+ e_delta[Y_AXIS] = Z1050(0) - Z0350(1) + Z0700(5) - Z0350(9);
|
|
5114
|
+ e_delta[Z_AXIS] = Z1050(0) - Z0350(1) - Z0350(5) + Z0700(9);
|
|
5115
|
+ r_delta = Z2250(0) - Z0750(1) - Z0750(5) - Z0750(9);
|
|
5116
|
+ break;
|
|
5117
|
+
|
|
5118
|
+ case -2:
|
|
5119
|
+ e_delta[X_AXIS] = Z1050(0) - Z0700(7) + Z0350(11) + Z0350(3);
|
|
5120
|
+ e_delta[Y_AXIS] = Z1050(0) + Z0350(7) - Z0700(11) + Z0350(3);
|
|
5121
|
+ e_delta[Z_AXIS] = Z1050(0) + Z0350(7) + Z0350(11) - Z0700(3);
|
|
5122
|
+ r_delta = Z2250(0) - Z0750(7) - Z0750(11) - Z0750(3);
|
|
5123
|
+ break;
|
|
5124
|
+
|
|
5125
|
+ default:
|
|
5126
|
+ e_delta[X_AXIS] = Z1050(0) + Z0350(1) - Z0175(5) - Z0175(9) - Z0350(7) + Z0175(11) + Z0175(3);
|
|
5127
|
+ e_delta[Y_AXIS] = Z1050(0) - Z0175(1) + Z0350(5) - Z0175(9) + Z0175(7) - Z0350(11) + Z0175(3);
|
|
5128
|
+ e_delta[Z_AXIS] = Z1050(0) - Z0175(1) - Z0175(5) + Z0350(9) + Z0175(7) + Z0175(11) - Z0350(3);
|
|
5129
|
+ r_delta = Z2250(0) - Z0375(1) - Z0375(5) - Z0375(9) - Z0375(7) - Z0375(11) - Z0375(3);
|
|
5130
|
+ break;
|
|
5131
|
+ }
|
|
5132
|
+
|
|
5133
|
+ #if ENABLED(DELTA_CALIBRATE_EXPERT_MODE)
|
|
5134
|
+ // Calculate h & r factors
|
|
5135
|
+ if (verbose_level == 3) {
|
|
5136
|
+ LOOP_XYZ(axis) h_f_new += e_delta[axis] / 3;
|
|
5137
|
+ r_f_new = r_delta;
|
|
5138
|
+ h_diff = (1.0 / H_FACTOR) * (h_f_old - h_f_new) / h_f_old;
|
|
5139
|
+ if (h_diff < h_diff_min && h_diff > 0.9) h_diff_min = h_diff;
|
|
5140
|
+ if (r_f_old != 0)
|
|
5141
|
+ r_diff = ( 0.0301 * sq(R_FACTOR) * R_FACTOR
|
|
5142
|
+ + 0.311 * sq(R_FACTOR)
|
|
5143
|
+ + 1.1493 * R_FACTOR
|
|
5144
|
+ + 1.7952
|
|
5145
|
+ ) * (r_f_old - r_f_new) / r_f_old;
|
|
5146
|
+ if (r_diff > r_diff_max && r_diff < 0.4444) r_diff_max = r_diff;
|
|
5147
|
+ SERIAL_EOL;
|
|
5148
|
+
|
|
5149
|
+ h_f_old = h_f_new;
|
|
5150
|
+ r_f_old = r_f_new;
|
|
5151
|
+ }
|
|
5152
|
+ #endif // DELTA_CALIBRATE_EXPERT_MODE
|
|
5153
|
+
|
|
5154
|
+ // Adjust delta_height and endstops by the max amount
|
|
5155
|
+ LOOP_XYZ(axis) endstop_adj[axis] += e_delta[axis];
|
|
5156
|
+ delta_radius += r_delta;
|
|
5157
|
+
|
|
5158
|
+ const float z_temp = MAX3(endstop_adj[0], endstop_adj[1], endstop_adj[2]);
|
|
5159
|
+ home_offset[Z_AXIS] -= z_temp;
|
|
5160
|
+ LOOP_XYZ(i) endstop_adj[i] -= z_temp;
|
|
5161
|
+
|
|
5162
|
+ recalc_delta_settings(delta_radius, delta_diagonal_rod);
|
|
5163
|
+ }
|
|
5164
|
+ else { // !iterate
|
|
5165
|
+ // step one back
|
|
5166
|
+ COPY(endstop_adj, e_old);
|
|
5167
|
+ delta_radius = dr_old;
|
|
5168
|
+ home_offset[Z_AXIS] = zh_old;
|
|
5169
|
+
|
|
5170
|
+ recalc_delta_settings(delta_radius, delta_diagonal_rod);
|
|
5171
|
+ }
|
|
5172
|
+
|
|
5173
|
+ // print report
|
|
5174
|
+
|
|
5175
|
+ #if ENABLED(DELTA_CALIBRATE_EXPERT_MODE)
|
|
5176
|
+ if (verbose_level == 3) {
|
|
5177
|
+ const float r_factor = 22.902 * sq(r_diff_max) * r_diff_max
|
|
5178
|
+ - 44.988 * sq(r_diff_max)
|
|
5179
|
+ + 31.697 * r_diff_max
|
|
5180
|
+ - 9.4439;
|
|
5181
|
+ SERIAL_PROTOCOLPAIR("h_factor:", 1.0 / h_diff_min);
|
|
5182
|
+ SERIAL_PROTOCOLPAIR(" r_factor:", r_factor);
|
|
5183
|
+ SERIAL_EOL;
|
|
5184
|
+ }
|
|
5185
|
+ #endif
|
|
5186
|
+ if (verbose_level == 2) {
|
|
5187
|
+ SERIAL_PROTOCOLPGM(". c:");
|
|
5188
|
+ if (z_at_pt[0] > 0) SERIAL_CHAR('+');
|
|
5189
|
+ SERIAL_PROTOCOL_F(z_at_pt[0], 2);
|
|
5190
|
+ if (probe_points > 1) {
|
|
5191
|
+ SERIAL_PROTOCOLPGM(" x:");
|
|
5192
|
+ if (z_at_pt[1] >= 0) SERIAL_CHAR('+');
|
|
5193
|
+ SERIAL_PROTOCOL_F(z_at_pt[1], 2);
|
|
5194
|
+ SERIAL_PROTOCOLPGM(" y:");
|
|
5195
|
+ if (z_at_pt[5] >= 0) SERIAL_CHAR('+');
|
|
5196
|
+ SERIAL_PROTOCOL_F(z_at_pt[5], 2);
|
|
5197
|
+ SERIAL_PROTOCOLPGM(" z:");
|
|
5198
|
+ if (z_at_pt[9] >= 0) SERIAL_CHAR('+');
|
|
5199
|
+ SERIAL_PROTOCOL_F(z_at_pt[9], 2);
|
|
5200
|
+ }
|
|
5201
|
+ if (probe_points > 0) SERIAL_EOL;
|
|
5202
|
+ if (probe_points > 2 || probe_points == -2) {
|
|
5203
|
+ if (probe_points > 2) SERIAL_PROTOCOLPGM(". ");
|
|
5204
|
+ SERIAL_PROTOCOLPGM(" yz:");
|
|
5205
|
+ if (z_at_pt[7] >= 0) SERIAL_CHAR('+');
|
|
5206
|
+ SERIAL_PROTOCOL_F(z_at_pt[7], 2);
|
|
5207
|
+ SERIAL_PROTOCOLPGM(" zx:");
|
|
5208
|
+ if (z_at_pt[11] >= 0) SERIAL_CHAR('+');
|
|
5209
|
+ SERIAL_PROTOCOL_F(z_at_pt[11], 2);
|
|
5210
|
+ SERIAL_PROTOCOLPGM(" xy:");
|
|
5211
|
+ if (z_at_pt[3] >= 0) SERIAL_CHAR('+');
|
|
5212
|
+ SERIAL_PROTOCOL_F(z_at_pt[3], 2);
|
|
5213
|
+ SERIAL_EOL;
|
|
5214
|
+ }
|
|
5215
|
+ }
|
|
5216
|
+ if (test_precision != 0.0) { // !forced end
|
|
5217
|
+ if (zero_std_dev >= test_precision) {
|
|
5218
|
+ SERIAL_PROTOCOLPGM("Calibration OK");
|
|
5219
|
+ SERIAL_PROTOCOLLNPGM(" rolling back 1");
|
|
5220
|
+ LCD_MESSAGEPGM("Calibration OK");
|
|
5221
|
+ SERIAL_EOL;
|
|
5222
|
+ }
|
|
5223
|
+ else { // !end iterations
|
|
5224
|
+ char mess[15] = "No convergence";
|
|
5225
|
+ if (iterations < 31)
|
|
5226
|
+ sprintf_P(mess, PSTR("Iteration : %02i"), (int)iterations);
|
|
5227
|
+ SERIAL_PROTOCOL(mess);
|
|
5228
|
+ SERIAL_PROTOCOLPGM(" std dev:");
|
|
5229
|
+ SERIAL_PROTOCOL_F(zero_std_dev, 3);
|
|
5230
|
+ SERIAL_EOL;
|
|
5231
|
+ lcd_setstatus(mess);
|
|
5232
|
+ }
|
|
5233
|
+ SERIAL_PROTOCOLPAIR("Height:", DELTA_HEIGHT + home_offset[Z_AXIS]);
|
|
5234
|
+ if (abs(probe_points) > 1) {
|
|
5235
|
+ SERIAL_PROTOCOLPGM(" Ex:");
|
|
5236
|
+ if (endstop_adj[A_AXIS] >= 0) SERIAL_CHAR('+');
|
|
5237
|
+ SERIAL_PROTOCOL_F(endstop_adj[A_AXIS], 2);
|
|
5238
|
+ SERIAL_PROTOCOLPGM(" Ey:");
|
|
5239
|
+ if (endstop_adj[B_AXIS] >= 0) SERIAL_CHAR('+');
|
|
5240
|
+ SERIAL_PROTOCOL_F(endstop_adj[B_AXIS], 2);
|
|
5241
|
+ SERIAL_PROTOCOLPGM(" Ez:");
|
|
5242
|
+ if (endstop_adj[C_AXIS] >= 0) SERIAL_CHAR('+');
|
|
5243
|
+ SERIAL_PROTOCOL_F(endstop_adj[C_AXIS], 2);
|
|
5244
|
+ SERIAL_PROTOCOLPAIR(" Radius:", delta_radius);
|
|
5245
|
+ }
|
|
5246
|
+ SERIAL_EOL;
|
|
5247
|
+ if (zero_std_dev >= test_precision)
|
|
5248
|
+ SERIAL_PROTOCOLLNPGM("Save with M500");
|
|
5249
|
+ }
|
|
5250
|
+ else { // forced end
|
|
5251
|
+ #if ENABLED(DELTA_CALIBRATE_EXPERT_MODE)
|
|
5252
|
+ if (verbose_level == 3)
|
|
5253
|
+ SERIAL_PROTOCOLLNPGM("Copy to Configuration_adv.h");
|
|
5254
|
+ else
|
|
5255
|
+ #endif
|
|
5256
|
+ {
|
|
5257
|
+ SERIAL_PROTOCOLPGM("End DRY-RUN std dev:");
|
|
5258
|
+ SERIAL_PROTOCOL_F(zero_std_dev, 3);
|
|
5259
|
+ SERIAL_EOL;
|
|
5260
|
+ }
|
|
5261
|
+ }
|
|
5262
|
+
|
|
5263
|
+ clean_up_after_endstop_or_probe_move();
|
|
5264
|
+ stepper.synchronize();
|
|
5265
|
+
|
|
5266
|
+ gcode_G28();
|
|
5267
|
+
|
|
5268
|
+ } while (zero_std_dev < test_precision && iterations < 31);
|
|
5269
|
+
|
|
5270
|
+ #if ENABLED(Z_PROBE_SLED)
|
|
5271
|
+ RETRACT_PROBE();
|
|
5272
|
+ #endif
|
|
5273
|
+ }
|
|
5274
|
+
|
|
5275
|
+ #endif // DELTA_AUTO_CALIBRATION
|
|
5276
|
+
|
4893
|
5277
|
#endif // HAS_BED_PROBE
|
4894
|
5278
|
|
|
5279
|
+
|
4895
|
5280
|
#if ENABLED(G38_PROBE_TARGET)
|
4896
|
5281
|
|
4897
|
5282
|
static bool G38_run_probe() {
|
|
@@ -4996,7 +5381,7 @@ inline void gcode_G92() {
|
4996
|
5381
|
current_position[i] = code_value_axis_units(i);
|
4997
|
5382
|
if (i != E_AXIS) didXYZ = true;
|
4998
|
5383
|
#else
|
4999
|
|
- #if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
5384
|
+ #if HAS_POSITION_SHIFT
|
5000
|
5385
|
float p = current_position[i];
|
5001
|
5386
|
#endif
|
5002
|
5387
|
float v = code_value_axis_units(i);
|
|
@@ -5005,7 +5390,7 @@ inline void gcode_G92() {
|
5005
|
5390
|
|
5006
|
5391
|
if (i != E_AXIS) {
|
5007
|
5392
|
didXYZ = true;
|
5008
|
|
- #if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
5393
|
+ #if HAS_POSITION_SHIFT
|
5009
|
5394
|
position_shift[i] += v - p; // Offset the coordinate space
|
5010
|
5395
|
update_software_endstops((AxisEnum)i);
|
5011
|
5396
|
#endif
|
|
@@ -5620,7 +6005,7 @@ inline void gcode_M42() {
|
5620
|
6005
|
|
5621
|
6006
|
if (axis_unhomed_error(true, true, true)) return;
|
5622
|
6007
|
|
5623
|
|
- int8_t verbose_level = code_seen('V') ? code_value_byte() : 1;
|
|
6008
|
+ const int8_t verbose_level = code_seen('V') ? code_value_byte() : 1;
|
5624
|
6009
|
if (!WITHIN(verbose_level, 0, 4)) {
|
5625
|
6010
|
SERIAL_PROTOCOLLNPGM("?Verbose Level not plausible (0-4).");
|
5626
|
6011
|
return;
|
|
@@ -7012,7 +7397,7 @@ inline void gcode_M205() {
|
7012
|
7397
|
if (code_seen('E')) planner.max_jerk[E_AXIS] = code_value_axis_units(E_AXIS);
|
7013
|
7398
|
}
|
7014
|
7399
|
|
7015
|
|
-#if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
7400
|
+#if HAS_M206_COMMAND
|
7016
|
7401
|
|
7017
|
7402
|
/**
|
7018
|
7403
|
* M206: Set Additional Homing Offset (X Y Z). SCARA aliases T=X, P=Y
|
|
@@ -7031,12 +7416,13 @@ inline void gcode_M205() {
|
7031
|
7416
|
report_current_position();
|
7032
|
7417
|
}
|
7033
|
7418
|
|
7034
|
|
-#endif // NO_WORKSPACE_OFFSETS
|
|
7419
|
+#endif // HAS_M206_COMMAND
|
7035
|
7420
|
|
7036
|
7421
|
#if ENABLED(DELTA)
|
7037
|
7422
|
/**
|
7038
|
7423
|
* M665: Set delta configurations
|
7039
|
7424
|
*
|
|
7425
|
+ * H = diagonal rod // AC-version
|
7040
|
7426
|
* L = diagonal rod
|
7041
|
7427
|
* R = delta radius
|
7042
|
7428
|
* S = segments per second
|
|
@@ -7045,6 +7431,12 @@ inline void gcode_M205() {
|
7045
|
7431
|
* C = Gamma (Tower 3) diagonal rod trim
|
7046
|
7432
|
*/
|
7047
|
7433
|
inline void gcode_M665() {
|
|
7434
|
+ if (code_seen('H')) {
|
|
7435
|
+ home_offset[Z_AXIS] = code_value_linear_units() - DELTA_HEIGHT;
|
|
7436
|
+ current_position[Z_AXIS] += code_value_linear_units() - DELTA_HEIGHT - home_offset[Z_AXIS];
|
|
7437
|
+ home_offset[Z_AXIS] = code_value_linear_units() - DELTA_HEIGHT;
|
|
7438
|
+ update_software_endstops(Z_AXIS);
|
|
7439
|
+ }
|
7048
|
7440
|
if (code_seen('L')) delta_diagonal_rod = code_value_linear_units();
|
7049
|
7441
|
if (code_seen('R')) delta_radius = code_value_linear_units();
|
7050
|
7442
|
if (code_seen('S')) delta_segments_per_second = code_value_float();
|
|
@@ -7903,7 +8295,7 @@ void quickstop_stepper() {
|
7903
|
8295
|
|
7904
|
8296
|
#endif
|
7905
|
8297
|
|
7906
|
|
-#if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
8298
|
+#if HAS_M206_COMMAND
|
7907
|
8299
|
|
7908
|
8300
|
/**
|
7909
|
8301
|
* M428: Set home_offset based on the distance between the
|
|
@@ -7945,7 +8337,7 @@ void quickstop_stepper() {
|
7945
|
8337
|
}
|
7946
|
8338
|
}
|
7947
|
8339
|
|
7948
|
|
-#endif // NO_WORKSPACE_OFFSETS
|
|
8340
|
+#endif // HAS_M206_COMMAND
|
7949
|
8341
|
|
7950
|
8342
|
/**
|
7951
|
8343
|
* M500: Store settings in EEPROM
|
|
@@ -8924,9 +9316,9 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
8924
|
9316
|
// The newly-selected extruder XY is actually at...
|
8925
|
9317
|
current_position[X_AXIS] += xydiff[X_AXIS];
|
8926
|
9318
|
current_position[Y_AXIS] += xydiff[Y_AXIS];
|
8927
|
|
- #if DISABLED(NO_WORKSPACE_OFFSETS) || ENABLED(DUAL_X_CARRIAGE)
|
|
9319
|
+ #if HAS_WORKSPACE_OFFSET || ENABLED(DUAL_X_CARRIAGE)
|
8928
|
9320
|
for (uint8_t i = X_AXIS; i <= Y_AXIS; i++) {
|
8929
|
|
- #if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
9321
|
+ #if HAS_POSITION_SHIFT
|
8930
|
9322
|
position_shift[i] += xydiff[i];
|
8931
|
9323
|
#endif
|
8932
|
9324
|
update_software_endstops((AxisEnum)i);
|
|
@@ -9192,6 +9584,15 @@ void process_next_command() {
|
9192
|
9584
|
break;
|
9193
|
9585
|
|
9194
|
9586
|
#endif // Z_PROBE_SLED
|
|
9587
|
+
|
|
9588
|
+ #if ENABLED(DELTA_AUTO_CALIBRATION)
|
|
9589
|
+
|
|
9590
|
+ case 33: // G33: Delta Auto Calibrate
|
|
9591
|
+ gcode_G33();
|
|
9592
|
+ break;
|
|
9593
|
+
|
|
9594
|
+ #endif // DELTA_AUTO_CALIBRATION
|
|
9595
|
+
|
9195
|
9596
|
#endif // HAS_BED_PROBE
|
9196
|
9597
|
|
9197
|
9598
|
#if ENABLED(G38_PROBE_TARGET)
|
|
@@ -9509,7 +9910,7 @@ void process_next_command() {
|
9509
|
9910
|
gcode_M205();
|
9510
|
9911
|
break;
|
9511
|
9912
|
|
9512
|
|
- #if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
9913
|
+ #if HAS_M206_COMMAND
|
9513
|
9914
|
case 206: // M206: Set home offsets
|
9514
|
9915
|
gcode_M206();
|
9515
|
9916
|
break;
|
|
@@ -9677,7 +10078,7 @@ void process_next_command() {
|
9677
|
10078
|
break;
|
9678
|
10079
|
#endif
|
9679
|
10080
|
|
9680
|
|
- #if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
10081
|
+ #if HAS_M206_COMMAND
|
9681
|
10082
|
case 428: // M428: Apply current_position to home_offset
|
9682
|
10083
|
gcode_M428();
|
9683
|
10084
|
break;
|
|
@@ -10198,8 +10599,8 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
10198
|
10599
|
* splitting the move where it crosses mesh borders.
|
10199
|
10600
|
*/
|
10200
|
10601
|
void mesh_line_to_destination(float fr_mm_s, uint8_t x_splits = 0xff, uint8_t y_splits = 0xff) {
|
10201
|
|
- int cx1 = mbl.cell_index_x(RAW_CURRENT_POSITION(X_AXIS)),
|
10202
|
|
- cy1 = mbl.cell_index_y(RAW_CURRENT_POSITION(Y_AXIS)),
|
|
10602
|
+ int cx1 = mbl.cell_index_x(RAW_CURRENT_POSITION(X)),
|
|
10603
|
+ cy1 = mbl.cell_index_y(RAW_CURRENT_POSITION(Y)),
|
10203
|
10604
|
cx2 = mbl.cell_index_x(RAW_X_POSITION(destination[X_AXIS])),
|
10204
|
10605
|
cy2 = mbl.cell_index_y(RAW_Y_POSITION(destination[Y_AXIS]));
|
10205
|
10606
|
NOMORE(cx1, GRID_MAX_POINTS_X - 2);
|
|
@@ -11043,6 +11444,9 @@ void disable_all_steppers() {
|
11043
|
11444
|
#if ENABLED(E3_IS_TMC2130)
|
11044
|
11445
|
automatic_current_control(stepperE3);
|
11045
|
11446
|
#endif
|
|
11447
|
+ #if ENABLED(E4_IS_TMC2130)
|
|
11448
|
+ automatic_current_control(stepperE4);
|
|
11449
|
+ #endif
|
11046
|
11450
|
}
|
11047
|
11451
|
}
|
11048
|
11452
|
|
|
@@ -11410,7 +11814,7 @@ void setup() {
|
11410
|
11814
|
// This also updates variables in the planner, elsewhere
|
11411
|
11815
|
(void)settings.load();
|
11412
|
11816
|
|
11413
|
|
- #if DISABLED(NO_WORKSPACE_OFFSETS)
|
|
11817
|
+ #if HAS_M206_COMMAND
|
11414
|
11818
|
// Initialize current position based on home_offset
|
11415
|
11819
|
COPY(current_position, home_offset);
|
11416
|
11820
|
#else
|