|
@@ -37,7 +37,7 @@
|
37
|
37
|
*/
|
38
|
38
|
|
39
|
39
|
// Change EEPROM version if the structure changes
|
40
|
|
-#define EEPROM_VERSION "V77"
|
|
40
|
+#define EEPROM_VERSION "V78"
|
41
|
41
|
#define EEPROM_OFFSET 100
|
42
|
42
|
|
43
|
43
|
// Check the integrity of data offsets.
|
|
@@ -135,7 +135,7 @@
|
135
|
135
|
|
136
|
136
|
typedef struct { uint16_t X, Y, Z, X2, Y2, Z2, Z3, Z4, E0, E1, E2, E3, E4, E5, E6, E7; } tmc_stepper_current_t;
|
137
|
137
|
typedef struct { uint32_t X, Y, Z, X2, Y2, Z2, Z3, Z4, E0, E1, E2, E3, E4, E5, E6, E7; } tmc_hybrid_threshold_t;
|
138
|
|
-typedef struct { int16_t X, Y, Z, X2; } tmc_sgt_t;
|
|
138
|
+typedef struct { int16_t X, Y, Z, X2, Y2, Z2, Z3, Z4; } tmc_sgt_t;
|
139
|
139
|
typedef struct { bool X, Y, Z, X2, Y2, Z2, Z3, Z4, E0, E1, E2, E3, E4, E5, E6, E7; } tmc_stealth_enabled_t;
|
140
|
140
|
|
141
|
141
|
// Limit an index to an array size
|
|
@@ -328,7 +328,7 @@ typedef struct SettingsDataStruct {
|
328
|
328
|
//
|
329
|
329
|
tmc_stepper_current_t tmc_stepper_current; // M906 X Y Z X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5
|
330
|
330
|
tmc_hybrid_threshold_t tmc_hybrid_threshold; // M913 X Y Z X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5
|
331
|
|
- tmc_sgt_t tmc_sgt; // M914 X Y Z X2
|
|
331
|
+ tmc_sgt_t tmc_sgt; // M914 X Y Z X2 Y2 Z2 Z3 Z4
|
332
|
332
|
tmc_stealth_enabled_t tmc_stealth_enabled; // M569 X Y Z X2 Y2 Z2 Z3 Z4 E0 E1 E2 E3 E4 E5
|
333
|
333
|
|
334
|
334
|
//
|
|
@@ -1112,10 +1112,14 @@ void MarlinSettings::postprocess() {
|
1112
|
1112
|
{
|
1113
|
1113
|
tmc_sgt_t tmc_sgt{0};
|
1114
|
1114
|
#if USE_SENSORLESS
|
1115
|
|
- TERN_(X_SENSORLESS, tmc_sgt.X = stepperX.homing_threshold());
|
|
1115
|
+ TERN_(X_SENSORLESS, tmc_sgt.X = stepperX.homing_threshold());
|
1116
|
1116
|
TERN_(X2_SENSORLESS, tmc_sgt.X2 = stepperX2.homing_threshold());
|
1117
|
|
- TERN_(Y_SENSORLESS, tmc_sgt.Y = stepperY.homing_threshold());
|
1118
|
|
- TERN_(Z_SENSORLESS, tmc_sgt.Z = stepperZ.homing_threshold());
|
|
1117
|
+ TERN_(Y_SENSORLESS, tmc_sgt.Y = stepperY.homing_threshold());
|
|
1118
|
+ TERN_(Y2_SENSORLESS, tmc_sgt.Y2 = stepperY2.homing_threshold());
|
|
1119
|
+ TERN_(Z_SENSORLESS, tmc_sgt.Z = stepperZ.homing_threshold());
|
|
1120
|
+ TERN_(Z2_SENSORLESS, tmc_sgt.Z2 = stepperZ2.homing_threshold());
|
|
1121
|
+ TERN_(Z3_SENSORLESS, tmc_sgt.Z3 = stepperZ3.homing_threshold());
|
|
1122
|
+ TERN_(Z4_SENSORLESS, tmc_sgt.Z4 = stepperZ4.homing_threshold());
|
1119
|
1123
|
#endif
|
1120
|
1124
|
EEPROM_WRITE(tmc_sgt);
|
1121
|
1125
|
}
|
|
@@ -1929,9 +1933,6 @@ void MarlinSettings::postprocess() {
|
1929
|
1933
|
|
1930
|
1934
|
//
|
1931
|
1935
|
// TMC StallGuard threshold.
|
1932
|
|
- // X and X2 use the same value
|
1933
|
|
- // Y and Y2 use the same value
|
1934
|
|
- // Z, Z2, Z3 and Z4 use the same value
|
1935
|
1936
|
//
|
1936
|
1937
|
{
|
1937
|
1938
|
tmc_sgt_t tmc_sgt;
|
|
@@ -1939,37 +1940,14 @@ void MarlinSettings::postprocess() {
|
1939
|
1940
|
EEPROM_READ(tmc_sgt);
|
1940
|
1941
|
#if USE_SENSORLESS
|
1941
|
1942
|
if (!validating) {
|
1942
|
|
- #ifdef X_STALL_SENSITIVITY
|
1943
|
|
- #if AXIS_HAS_STALLGUARD(X)
|
1944
|
|
- stepperX.homing_threshold(tmc_sgt.X);
|
1945
|
|
- #endif
|
1946
|
|
- #if AXIS_HAS_STALLGUARD(X2) && !X2_SENSORLESS
|
1947
|
|
- stepperX2.homing_threshold(tmc_sgt.X);
|
1948
|
|
- #endif
|
1949
|
|
- #endif
|
|
1943
|
+ TERN_(X_SENSORLESS, stepperX.homing_threshold(tmc_sgt.X));
|
1950
|
1944
|
TERN_(X2_SENSORLESS, stepperX2.homing_threshold(tmc_sgt.X2));
|
1951
|
|
- #ifdef Y_STALL_SENSITIVITY
|
1952
|
|
- #if AXIS_HAS_STALLGUARD(Y)
|
1953
|
|
- stepperY.homing_threshold(tmc_sgt.Y);
|
1954
|
|
- #endif
|
1955
|
|
- #if AXIS_HAS_STALLGUARD(Y2)
|
1956
|
|
- stepperY2.homing_threshold(tmc_sgt.Y);
|
1957
|
|
- #endif
|
1958
|
|
- #endif
|
1959
|
|
- #ifdef Z_STALL_SENSITIVITY
|
1960
|
|
- #if AXIS_HAS_STALLGUARD(Z)
|
1961
|
|
- stepperZ.homing_threshold(tmc_sgt.Z);
|
1962
|
|
- #endif
|
1963
|
|
- #if AXIS_HAS_STALLGUARD(Z2)
|
1964
|
|
- stepperZ2.homing_threshold(tmc_sgt.Z);
|
1965
|
|
- #endif
|
1966
|
|
- #if AXIS_HAS_STALLGUARD(Z3)
|
1967
|
|
- stepperZ3.homing_threshold(tmc_sgt.Z);
|
1968
|
|
- #endif
|
1969
|
|
- #if AXIS_HAS_STALLGUARD(Z4)
|
1970
|
|
- stepperZ4.homing_threshold(tmc_sgt.Z);
|
1971
|
|
- #endif
|
1972
|
|
- #endif
|
|
1945
|
+ TERN_(Y_SENSORLESS, stepperY.homing_threshold(tmc_sgt.Y));
|
|
1946
|
+ TERN_(Y2_SENSORLESS, stepperY2.homing_threshold(tmc_sgt.Y2));
|
|
1947
|
+ TERN_(Z_SENSORLESS, stepperZ.homing_threshold(tmc_sgt.Z));
|
|
1948
|
+ TERN_(Z2_SENSORLESS, stepperZ2.homing_threshold(tmc_sgt.Z2));
|
|
1949
|
+ TERN_(Z3_SENSORLESS, stepperZ3.homing_threshold(tmc_sgt.Z3));
|
|
1950
|
+ TERN_(Z4_SENSORLESS, stepperZ4.homing_threshold(tmc_sgt.Z4));
|
1973
|
1951
|
}
|
1974
|
1952
|
#endif
|
1975
|
1953
|
}
|