|
@@ -127,10 +127,7 @@
|
127
|
127
|
invert = false,
|
128
|
128
|
ec = true;
|
129
|
129
|
|
130
|
|
- float axisOffset = 0;
|
131
|
|
-
|
132
|
|
- int32_t axisOffsetTicks = 0,
|
133
|
|
- zeroOffset = 0,
|
|
130
|
+ int32_t zeroOffset = 0,
|
134
|
131
|
lastPosition = 0,
|
135
|
132
|
position;
|
136
|
133
|
|
|
@@ -168,7 +165,7 @@
|
168
|
165
|
}
|
169
|
166
|
|
170
|
167
|
FORCE_INLINE float get_position_mm() { return mm_from_count(get_position()); }
|
171
|
|
- FORCE_INLINE int32_t get_position() { return get_raw_count() - zeroOffset - axisOffsetTicks; }
|
|
168
|
+ FORCE_INLINE int32_t get_position() { return get_raw_count() - zeroOffset; }
|
172
|
169
|
|
173
|
170
|
int32_t get_axis_error_steps(const bool report);
|
174
|
171
|
float get_axis_error_mm(const bool report);
|
|
@@ -219,16 +216,6 @@
|
219
|
216
|
|
220
|
217
|
FORCE_INLINE int get_stepper_ticks() { return stepperTicks; }
|
221
|
218
|
FORCE_INLINE void set_stepper_ticks(const int ticks) { stepperTicks = ticks; }
|
222
|
|
-
|
223
|
|
- FORCE_INLINE float get_axis_offset() { return axisOffset; }
|
224
|
|
- FORCE_INLINE void set_axis_offset(const float newOffset) {
|
225
|
|
- axisOffset = newOffset;
|
226
|
|
- axisOffsetTicks = int32_t(axisOffset * get_encoder_ticks_mm());
|
227
|
|
- }
|
228
|
|
-
|
229
|
|
- FORCE_INLINE void set_current_position(const float newPositionMm) {
|
230
|
|
- set_axis_offset(get_position_mm() - newPositionMm + axisOffset);
|
231
|
|
- }
|
232
|
219
|
};
|
233
|
220
|
|
234
|
221
|
class I2CPositionEncodersMgr {
|