File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -171,13 +171,14 @@ int32_t Backlash::get_applied_steps(const AxisEnum axis) {
171
171
172
172
const int32_t residual_error_axis = residual_error[axis];
173
173
174
- // At startup it is assumed the last move was forward.
175
- // So the applied steps will always be negative.
174
+ // At startup, when no steps are applied, it is assumed the last move was backwards.
175
+ // So the applied steps will always be zero (when moving backwards) or a positive
176
+ // number (when moving forwards).
176
177
177
- if (forward) return -residual_error_axis;
178
+ if (! forward) return -residual_error_axis;
178
179
179
180
const float f_corr = float (correction) / all_on;
180
- const int32_t full_error_axis = - f_corr * distance_mm[axis] * planner.settings .axis_steps_per_mm [axis];
181
+ const int32_t full_error_axis = f_corr * distance_mm[axis] * planner.settings .axis_steps_per_mm [axis];
181
182
return full_error_axis - residual_error_axis;
182
183
}
183
184
You can’t perform that action at this time.
0 commit comments