-
Notifications
You must be signed in to change notification settings - Fork 623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wpimath] ExponentialProfile doesn't enter the correct limit cycle for nonzero velocity goals #7760
Comments
This is intended behavior. If you provide a constant goal with a nonzero velocity, the system will enter a limit cycle in phase space to hit the goal repeatedly. If you want the profile to reach steady-state, you should pass a zero velocity. |
Why is the behavior entirely different with a velocity of 2.99999 and 3.00000 in that case? It seems like the resulting profile should be nearly identical in those cases. |
After the initial movement, the profile also fails to reach the goal again afterwards (and doesn’t follow a normal cycle). If it cycles to hit the goal repeatedly, I would have expected both of those to be true. |
Could you be more specific about the behavior you saw instead of a limit cycle? |
A position vs velocity plot would be much more informative than a time domain plot. |
(The first example is stable after it reaches the goal) |
It shouldn't be stable tho, because it's not physically possible to stay at a given position-velocity pair in steady-state when that velocity is nonzero; the nonzero velocity necessarily makes the position diverge. |
Under certain conditions, an exponential profile with a constant goal can produce oscillations that prevent it from finishing the profile. The graph below shows the position setpoint for one such profile.
This behavior appears to be extremely sensitive to the initial inputs. The example below produces the issue consistently, but changing the goal velocity to
2.99999
or3.00001
fixes the issue. It's not clear whether this might be related to using a nonzero goal velocity given how sensitive it is to the exact values.This log includes the positions and velocities of the setpoints for the example above: exponentialprofilebug.wpilog.zip
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: