Commit 88ea9f9
committed
Better toolhead posistion detection and even triggering
The algorithm for detecting of the toolhead is at its origin point
was flawed in that assume that the axis positions will reach precisely
0.0. However, this may not always be the case. The ending axis
position could be a fraction of a millimeter away from 0.0, in which
case the toolhead will never reach the origin point.
Instead of assuming that the axes will reach 0.0, compute the axes
positions up to a certain precision and use that value to determine
the toolhead position.
In addition, ensure that the TOOLHEAD_ORIGIN event is triggered only
once per reaching the origin point.1 parent 6c1462c commit 88ea9f9
1 file changed
Lines changed: 21 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| |||
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
| 51 | + | |
47 | 52 | | |
48 | 53 | | |
49 | 54 | | |
| |||
170 | 175 | | |
171 | 176 | | |
172 | 177 | | |
173 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
174 | 185 | | |
175 | 186 | | |
176 | 187 | | |
177 | 188 | | |
178 | 189 | | |
179 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
180 | 196 | | |
181 | 197 | | |
182 | 198 | | |
183 | 199 | | |
| 200 | + | |
184 | 201 | | |
| 202 | + | |
185 | 203 | | |
186 | 204 | | |
187 | 205 | | |
| |||
262 | 280 | | |
263 | 281 | | |
264 | 282 | | |
| 283 | + | |
265 | 284 | | |
266 | 285 | | |
0 commit comments