|
@@ -248,7 +248,7 @@ float volumetric_multiplier[EXTRUDERS] = {1.0
|
248
|
248
|
#endif
|
249
|
249
|
};
|
250
|
250
|
float current_position[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0 };
|
251
|
|
-float add_homing[3] = { 0, 0, 0 };
|
|
251
|
+float home_offset[3] = { 0, 0, 0 };
|
252
|
252
|
#ifdef DELTA
|
253
|
253
|
float endstop_adj[3] = { 0, 0, 0 };
|
254
|
254
|
#endif
|
|
@@ -984,7 +984,7 @@ static int dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
|
984
|
984
|
|
985
|
985
|
static float x_home_pos(int extruder) {
|
986
|
986
|
if (extruder == 0)
|
987
|
|
- return base_home_pos(X_AXIS) + add_homing[X_AXIS];
|
|
987
|
+ return base_home_pos(X_AXIS) + home_offset[X_AXIS];
|
988
|
988
|
else
|
989
|
989
|
// In dual carriage mode the extruder offset provides an override of the
|
990
|
990
|
// second X-carriage offset when homed - otherwise X2_HOME_POS is used.
|
|
@@ -1016,9 +1016,9 @@ static void axis_is_at_home(int axis) {
|
1016
|
1016
|
return;
|
1017
|
1017
|
}
|
1018
|
1018
|
else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) {
|
1019
|
|
- current_position[X_AXIS] = base_home_pos(X_AXIS) + add_homing[X_AXIS];
|
1020
|
|
- min_pos[X_AXIS] = base_min_pos(X_AXIS) + add_homing[X_AXIS];
|
1021
|
|
- max_pos[X_AXIS] = min(base_max_pos(X_AXIS) + add_homing[X_AXIS],
|
|
1019
|
+ current_position[X_AXIS] = base_home_pos(X_AXIS) + home_offset[X_AXIS];
|
|
1020
|
+ min_pos[X_AXIS] = base_min_pos(X_AXIS) + home_offset[X_AXIS];
|
|
1021
|
+ max_pos[X_AXIS] = min(base_max_pos(X_AXIS) + home_offset[X_AXIS],
|
1022
|
1022
|
max(extruder_offset[X_AXIS][1], X2_MAX_POS) - duplicate_extruder_x_offset);
|
1023
|
1023
|
return;
|
1024
|
1024
|
}
|
|
@@ -1046,11 +1046,11 @@ static void axis_is_at_home(int axis) {
|
1046
|
1046
|
|
1047
|
1047
|
for (i=0; i<2; i++)
|
1048
|
1048
|
{
|
1049
|
|
- delta[i] -= add_homing[i];
|
|
1049
|
+ delta[i] -= home_offset[i];
|
1050
|
1050
|
}
|
1051
|
1051
|
|
1052
|
|
- // SERIAL_ECHOPGM("addhome X="); SERIAL_ECHO(add_homing[X_AXIS]);
|
1053
|
|
- // SERIAL_ECHOPGM(" addhome Y="); SERIAL_ECHO(add_homing[Y_AXIS]);
|
|
1052
|
+ // SERIAL_ECHOPGM("addhome X="); SERIAL_ECHO(home_offset[X_AXIS]);
|
|
1053
|
+ // SERIAL_ECHOPGM(" addhome Y="); SERIAL_ECHO(home_offset[Y_AXIS]);
|
1054
|
1054
|
// SERIAL_ECHOPGM(" addhome Theta="); SERIAL_ECHO(delta[X_AXIS]);
|
1055
|
1055
|
// SERIAL_ECHOPGM(" addhome Psi+Theta="); SERIAL_ECHOLN(delta[Y_AXIS]);
|
1056
|
1056
|
|
|
@@ -1068,14 +1068,14 @@ static void axis_is_at_home(int axis) {
|
1068
|
1068
|
}
|
1069
|
1069
|
else
|
1070
|
1070
|
{
|
1071
|
|
- current_position[axis] = base_home_pos(axis) + add_homing[axis];
|
1072
|
|
- min_pos[axis] = base_min_pos(axis) + add_homing[axis];
|
1073
|
|
- max_pos[axis] = base_max_pos(axis) + add_homing[axis];
|
|
1071
|
+ current_position[axis] = base_home_pos(axis) + home_offset[axis];
|
|
1072
|
+ min_pos[axis] = base_min_pos(axis) + home_offset[axis];
|
|
1073
|
+ max_pos[axis] = base_max_pos(axis) + home_offset[axis];
|
1074
|
1074
|
}
|
1075
|
1075
|
#else
|
1076
|
|
- current_position[axis] = base_home_pos(axis) + add_homing[axis];
|
1077
|
|
- min_pos[axis] = base_min_pos(axis) + add_homing[axis];
|
1078
|
|
- max_pos[axis] = base_max_pos(axis) + add_homing[axis];
|
|
1076
|
+ current_position[axis] = base_home_pos(axis) + home_offset[axis];
|
|
1077
|
+ min_pos[axis] = base_min_pos(axis) + home_offset[axis];
|
|
1078
|
+ max_pos[axis] = base_max_pos(axis) + home_offset[axis];
|
1079
|
1079
|
#endif
|
1080
|
1080
|
}
|
1081
|
1081
|
|
|
@@ -1858,7 +1858,7 @@ inline void gcode_G28() {
|
1858
|
1858
|
if (code_value_long() != 0) {
|
1859
|
1859
|
current_position[X_AXIS] = code_value()
|
1860
|
1860
|
#ifndef SCARA
|
1861
|
|
- + add_homing[X_AXIS]
|
|
1861
|
+ + home_offset[X_AXIS]
|
1862
|
1862
|
#endif
|
1863
|
1863
|
;
|
1864
|
1864
|
}
|
|
@@ -1867,7 +1867,7 @@ inline void gcode_G28() {
|
1867
|
1867
|
if (code_seen(axis_codes[Y_AXIS]) && code_value_long() != 0) {
|
1868
|
1868
|
current_position[Y_AXIS] = code_value()
|
1869
|
1869
|
#ifndef SCARA
|
1870
|
|
- + add_homing[Y_AXIS]
|
|
1870
|
+ + home_offset[Y_AXIS]
|
1871
|
1871
|
#endif
|
1872
|
1872
|
;
|
1873
|
1873
|
}
|
|
@@ -1941,7 +1941,7 @@ inline void gcode_G28() {
|
1941
|
1941
|
|
1942
|
1942
|
|
1943
|
1943
|
if (code_seen(axis_codes[Z_AXIS]) && code_value_long() != 0)
|
1944
|
|
- current_position[Z_AXIS] = code_value() + add_homing[Z_AXIS];
|
|
1944
|
+ current_position[Z_AXIS] = code_value() + home_offset[Z_AXIS];
|
1945
|
1945
|
|
1946
|
1946
|
#ifdef ENABLE_AUTO_BED_LEVELING
|
1947
|
1947
|
if (home_all_axis || code_seen(axis_codes[Z_AXIS]))
|
|
@@ -2512,22 +2512,13 @@ inline void gcode_G92() {
|
2512
|
2512
|
if (!code_seen(axis_codes[E_AXIS]))
|
2513
|
2513
|
st_synchronize();
|
2514
|
2514
|
|
2515
|
|
- for (int i=0;i<NUM_AXIS;i++) {
|
|
2515
|
+ for (int i = 0; i < NUM_AXIS; i++) {
|
2516
|
2516
|
if (code_seen(axis_codes[i])) {
|
2517
|
|
- if (i == E_AXIS) {
|
2518
|
|
- current_position[i] = code_value();
|
|
2517
|
+ current_position[i] = code_value();
|
|
2518
|
+ if (i == E_AXIS)
|
2519
|
2519
|
plan_set_e_position(current_position[E_AXIS]);
|
2520
|
|
- }
|
2521
|
|
- else {
|
2522
|
|
- current_position[i] = code_value() +
|
2523
|
|
- #ifdef SCARA
|
2524
|
|
- ((i != X_AXIS && i != Y_AXIS) ? add_homing[i] : 0)
|
2525
|
|
- #else
|
2526
|
|
- add_homing[i]
|
2527
|
|
- #endif
|
2528
|
|
- ;
|
|
2520
|
+ else
|
2529
|
2521
|
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
2530
|
|
- }
|
2531
|
2522
|
}
|
2532
|
2523
|
}
|
2533
|
2524
|
}
|
|
@@ -3464,9 +3455,9 @@ inline void gcode_M114() {
|
3464
|
3455
|
SERIAL_PROTOCOLLN("");
|
3465
|
3456
|
|
3466
|
3457
|
SERIAL_PROTOCOLPGM("SCARA Cal - Theta:");
|
3467
|
|
- SERIAL_PROTOCOL(delta[X_AXIS]+add_homing[X_AXIS]);
|
|
3458
|
+ SERIAL_PROTOCOL(delta[X_AXIS]+home_offset[X_AXIS]);
|
3468
|
3459
|
SERIAL_PROTOCOLPGM(" Psi+Theta (90):");
|
3469
|
|
- SERIAL_PROTOCOL(delta[Y_AXIS]-delta[X_AXIS]-90+add_homing[Y_AXIS]);
|
|
3460
|
+ SERIAL_PROTOCOL(delta[Y_AXIS]-delta[X_AXIS]-90+home_offset[Y_AXIS]);
|
3470
|
3461
|
SERIAL_PROTOCOLLN("");
|
3471
|
3462
|
|
3472
|
3463
|
SERIAL_PROTOCOLPGM("SCARA step Cal - Theta:");
|
|
@@ -3684,12 +3675,12 @@ inline void gcode_M205() {
|
3684
|
3675
|
inline void gcode_M206() {
|
3685
|
3676
|
for (int8_t i=X_AXIS; i <= Z_AXIS; i++) {
|
3686
|
3677
|
if (code_seen(axis_codes[i])) {
|
3687
|
|
- add_homing[i] = code_value();
|
|
3678
|
+ home_offset[i] = code_value();
|
3688
|
3679
|
}
|
3689
|
3680
|
}
|
3690
|
3681
|
#ifdef SCARA
|
3691
|
|
- if (code_seen('T')) add_homing[X_AXIS] = code_value(); // Theta
|
3692
|
|
- if (code_seen('P')) add_homing[Y_AXIS] = code_value(); // Psi
|
|
3682
|
+ if (code_seen('T')) home_offset[X_AXIS] = code_value(); // Theta
|
|
3683
|
+ if (code_seen('P')) home_offset[Y_AXIS] = code_value(); // Psi
|
3693
|
3684
|
#endif
|
3694
|
3685
|
}
|
3695
|
3686
|
|
|
@@ -5287,7 +5278,7 @@ void clamp_to_software_endstops(float target[3])
|
5287
|
5278
|
float negative_z_offset = 0;
|
5288
|
5279
|
#ifdef ENABLE_AUTO_BED_LEVELING
|
5289
|
5280
|
if (Z_PROBE_OFFSET_FROM_EXTRUDER < 0) negative_z_offset = negative_z_offset + Z_PROBE_OFFSET_FROM_EXTRUDER;
|
5290
|
|
- if (add_homing[Z_AXIS] < 0) negative_z_offset = negative_z_offset + add_homing[Z_AXIS];
|
|
5281
|
+ if (home_offset[Z_AXIS] < 0) negative_z_offset = negative_z_offset + home_offset[Z_AXIS];
|
5291
|
5282
|
#endif
|
5292
|
5283
|
|
5293
|
5284
|
if (target[Z_AXIS] < min_pos[Z_AXIS]+negative_z_offset) target[Z_AXIS] = min_pos[Z_AXIS]+negative_z_offset;
|