Skip to content

Commit f74c89e

Browse files
committed
Determine probe trigger position using offsets
Intead of using the position of the toolhead, determine the probe trigger point using the probe offsets and randomization range.
1 parent b55e5d9 commit f74c89e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/core/objects/probe.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ static void probe_update(core_object_t *object, uint64_t ticks,
9191
if (!probe->axis_valid[i])
9292
continue;
9393

94-
probe->position[i] =
95-
((double *)&status.position)[i] + probe->offsets[i];
96-
probe->triggered &= ((double *)&status.position)[i] <= probe->range;
94+
probe->position[i] = *(((double *)&status.position) + i) + probe->offsets[i];
95+
probe->triggered &= (probe->position[i] >= (probe->offsets[i] - probe->range)) &&
96+
(probe->position[i] <= (probe->offsets[i] + probe->range));
9797
}
9898

9999
probe->pin_word = !!probe->triggered;

0 commit comments

Comments
 (0)