|
@@ -125,6 +125,9 @@ void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*=
|
125
|
125
|
millis_t ms = millis();
|
126
|
126
|
#endif
|
127
|
127
|
|
|
128
|
+ // Did Z change since the last call?
|
|
129
|
+ const float zmoved = current_position[Z_AXIS] - info.current_position[Z_AXIS];
|
|
130
|
+
|
128
|
131
|
if (force
|
129
|
132
|
#if DISABLED(SAVE_EACH_CMD_MODE) // Always save state when enabled
|
130
|
133
|
#if PIN_EXISTS(POWER_LOSS) // Save if power loss pin is triggered
|
|
@@ -133,8 +136,8 @@ void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*=
|
133
|
136
|
#if SAVE_INFO_INTERVAL_MS > 0 // Save if interval is elapsed
|
134
|
137
|
|| ELAPSED(ms, next_save_ms)
|
135
|
138
|
#endif
|
136
|
|
- // Save every time Z is higher than the last call
|
137
|
|
- || current_position[Z_AXIS] > info.current_position[Z_AXIS]
|
|
139
|
+ || zmoved > 0 // Z moved up (including Z-hop)
|
|
140
|
+ || zmoved < -5 // Z moved down a lot (for some reason)
|
138
|
141
|
#endif
|
139
|
142
|
) {
|
140
|
143
|
|