Conversation
|
CI is complaining... Haven't had a chance to look at the code yet, GitHub is being weird on my end... |
|
Thanks for this. #3839 is a real gap: an arc is only checked at its endpoint. The joint side overlaps #4374, though. There, canon already takes every line and arc through the kinematics in force, whatever the module, and caps each segment at what its joints can follow; checking the joint position limits inside segments is the next step on the same sampling. #4374 also reworks the files the joint part touches: Could you trim this PR to the Cartesian arc bounds: the full extent of partial, multi-turn, helical and tilted arcs, checked against the axis limits? That part is independent of the kinematics, fixes #3839 on trivkins machines, and would fit either way. |
|
Thanks, that makes sense. I'll trim this PR to the Cartesian arc bounds, including partial, multi-turn, helical and tilted arcs, with the corresponding tests. |
b36668d to
6e6a145
Compare
| if (b->amplitude == 0) | ||
| return; | ||
|
|
||
| if (b->radial_rate == 0) { |
There was a problem hiding this comment.
What does circle->spiral come out as for an R-word arc, where the interpreter computes the centre so both radii are equal? Is it exactly 0, or a few ulps? If it is 1e-15, which branch does this test send that circle down, and what does R/(2k) mean in the spiral branch with k at that size?
Try G0 X-36.2949 Y44.4302 then G2 X-96.1034 Y10.8100 R-109.857 against dense pmCirclePoint() sampling.
There was a problem hiding this comment.
Yep, you're right. I tried your example and got spiral = -1.42e-14, so it takes the spiral branch. The Y bounds come back as [10.81, 44.43], while sampling gives about [-173.21, 46.50]. That's a pretty big miss.
The code doesn't actually calculate R/(2k) - that's only in the comment - but the sign checks near the tan poles break down with k this small. The current tests don't catch it. Thanks for the example, this needs fixing.
There was a problem hiding this comment.
I'll fix it when I'm back at my PC. I'll switch to atan2 for finding the inflection points, so tiny k doesn't break the sign checks near the tan poles. I'll add your example to the tests too, and check both signs of a one-ulp radius difference.
Fixes #3839.
Circular moves were checked at their endpoint before entering the motion queue. A G2/G3 move could therefore pass validation while exceeding axis soft limits between its endpoints, including full circles whose endpoints coincide.
Changes
This PR is limited to Cartesian arc bounds. The proposed joint bounds interface and CoreXY/SCARA implementations have been removed from this PR to avoid overlapping with #4374.
Testing
--enable-werror(make -O -j4 default pycheck V=1).tests/arc-soft-limitstests/posemath/arc-boundstests/abort/g64tests/hard-limitsThe tests cover rejection before motion in MDI and AUTO, queued starting positions, valid paths and tangencies, and arc geometry in different planes. Geometry tests also cover large coordinates, large turn counts, and invalid inputs. RTAI was built only; kernel modules were not loaded.
Scope
These checks cover commanded arc geometry before trajectory planning. They do not validate interior joint positions for arbitrary kinematics or subsequent trajectory changes from blending, interpolation, external offsets, or changes to limits after queueing.