Repository navigation
tests: bring the multiaxis tests from #4730 under 10 seconds each - #4807
Merged
Merged
Conversation
…each Issue LinuxCNC#4805 (BsAtHome): twp-table took over five minutes and twp-native over one, and with ptp-machine-frame, ptp-robot and kins-switch at 16 to 26 seconds they added about eight minutes to CI. None of them waits on anything but motion and polling: the sims moved at 90 deg/s on the rotaries and 120 mm/s on the slides, often under TCP, where the slides swing around a pivot to keep the tip still; and every step waited out a 10 ms task cycle, the 10 ms poll of wait_complete() and two 50 ms status polls. The sims now move fast. Most checks look only at where a move ends. twp-native reads paths from a sampler once a servo cycle: its G30.5 check now allows the a * dt^2 / 2 the turn can fall short between two samples from the joint's own acceleration, where it had the figure for 700 mm/s^2 written in. kins-switch samples status while its program strokes W, and W rests on a dwell at the end of the stroke. The tests wait on what wait_complete() waits for, polled every 2 ms, and twp-native, twp-table and the ptp tests run task on a 1 ms cycle. Faster polls showed three races the slow ones had hidden. A move counted as ended when motion was in position with an empty queue, which is also true before task has sent the move on: the tests now also wait for task's interpreter to be idle. Status is a copy task writes once a cycle, so two polls can read the same copy and see still joints that are moving: a move now counts as ended only on a copy task wrote two cycles after the command, and still joints only over copies with motion's heartbeat apart. And twp-native counted the sampler log's lines before a move while the log, block buffered, could still lack the end of the previous one: it now waits for the log to reach the machine at rest before a move as well as after, and reads only the lines added since. kins-switch keeps its 10 ms task cycle. At 1 ms its program's G12.1 after a G0 W0 sometimes switches while W is still about 25 um from the end of its move, and W stays there; that is for its own issue, not for this test. Two tests are split, so that each half starts LinuxCNC once and runs beside the other: twp-table-one-sided takes the one-sided A of twp-table's second run, and twp-native-ptp the point-to-point moves of twp-native, sharing its INI and HAL files and, through twp-native/native.py, its helpers. twp-table starts each case with one joint-space G69 G53.5 move rather than a G0 of the tip, since G53.1 chooses its pose from the rotaries alone; it checks the pose with no P against the P1 and P2 poses it already has from the same start rather than driving there again; and it keeps three planes of five, one in general position, one with J negative and one whose C sits near the +-180 wrap. twp-native's timed point-to-point feeds take half a second each rather than one and two. Here, each alone: twp-native 70 s => 7.1 s twp-native-ptp 7.2 s twp-table 338 s => 9.0 s twp-table-one-sided 4.1 s ptp-machine-frame 26 s => 5.5 s ptp-robot 22 s => 4.2 s kins-switch 16 s => 8.4 s All of them pass with six copies of each running beside four busy loops, and pinned to one CPU. About 3.6 s of each is LinuxCNC starting and stopping. Fixes LinuxCNC#4805
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4805.
The tests from #4730 waited on nothing but motion and polling. The sims moved at 90 deg/s on the rotaries and 120 mm/s on the slides, often under TCP, where the slides swing around a pivot to keep the tip still, and every step waited out a 10 ms task cycle, the 10 ms poll of
wait_complete()and two 50 ms status polls. twp-table did not stall: it finishes after about 5.6 minutes here.About 3.6 s of each is LinuxCNC starting and stopping. All of them pass with six copies of each running beside four busy loops, and pinned to one CPU.
wait_complete()waits for, polled every 2 ms, and task runs a 1 ms cycle, except in kins-switch (below).twp-native/native.py.G69 G53.5 G0move, checks "no P is the nearer pose" against the P1 and P2 poses it already has from the same start, and keeps three of its five planes: one in general position, one with J negative, and one whose C sits near the +-180 wrap.kins-switch keeps its 10 ms task cycle: at 1 ms its program's
G12.1after aG0 W0sometimes switches while W is still about 25 um from the end of its move, and W stays there. That looks like a real race in the switch's wait for motion, which I will look into separately.