Repository navigation
motion: the S-curve single axis planner stops at the end of a move - #4844
Merged
Merged
Conversation
On the S-curve planner, a move of the single axis planner, which runs jogs, free mode joint moves, homing included, and external offsets, that reached its target went back and forth over it for about two seconds and stopped up to 0.8 um off. Once within its dead band of the target, simple_scurve_tp_update() set the speed to zero but still took one more step with the speed and acceleration of the cycle before; that step put it some microns back outside, the trapezoid ramp it falls back on there brought it in again, and so on, each round a little smaller. Motion reported the jog done while this went on. An incremental jog of X by 5 at 100 mm/s, 800 mm/s^2 and a jerk of 10000 arrives after 252 servo cycles, then hunted until cycle 2047, up to 7.7 um off the target, and came to rest 0.8 um off it; now it stops on the cycle it arrives, 3 nm off. At the target the planner now stops without that step. tests/jog-speed-change adds an incremental jog of joint 0 in free mode and of X in teleop mode, on both planners, and checks that each ends where it was sent and that no servo cycle runs the other way. On master the S-curve run has joint 0 run backwards in 130 servo cycles and X in 445; here none. The joint's velocity is checked in free mode only, since in teleop it comes from the cubic interpolator rather than the planner.
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.
On the S-curve planner (
PLANNER_TYPE = 1with a jerk limit), a move of the single axis planner hunted around its target for about two seconds after arriving, and came to rest up to 0.8 um off it. That planner runs world and joint jogs, free mode joint moves (homing included) and external offsets. Motion reported the jog done while this went on.Example: an incremental jog of X by 5 at 100 mm/s, 800 mm/s^2 and jerk 10000 arrives after 252 servo cycles. On master it then went back and forth until cycle 2047, up to 7.7 um off the target, and stopped 0.8 um off. With this change it stops on the cycle it arrives, 3 nm off.
The cause: once within its dead band of the target,
simple_scurve_tp_update()set the speed to zero but still took one more step with the previous cycle's speed and acceleration. That step put it a few microns back outside the band, the trapezoid ramp it falls back on brought it in again, and so on, each round a little smaller. Now it stops at the target without that step.I found it because tests/twp-jog-frame on the multiaxis branch (#4374) waits for the position to stop changing after each jog, and its S-curve run spent about 30 of its 44 seconds waiting out the hunting.
tests/jog-speed-change now also makes an incremental jog of joint 0 in free mode and of X in teleop mode, on both planners. It checks that each ends where it was sent and that no servo cycle runs the other way. On master the S-curve run has joint 0 running backwards in 130 servo cycles and X in 445; here none. The joint's velocity is checked in free mode only, because in teleop it comes from the cubic interpolator rather than the planner. The test passes with six copies beside four busy loops and pinned to one CPU.