-
Notifications
You must be signed in to change notification settings - Fork 13.4k
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
MPC: ORBIT: reduce jerk when transitioning into orbit #23634
Conversation
I tried with higher speeds and after changing the orbit radius the drone struggles a bit to settle back on the circle. This is probably because the jerk-limited trajectory makes the orbit controller oscillate. |
Good catch, i'll try do find a fix on monday |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I settled on this Orbit setpoint generation after many tests with position setpoints, smoothing, ... and this is the best implementation I found so far. The only catch which I never got to solving is accelerating into orbiting at the beginning. I think it only requires some kind of 1 dimensional acceleration phase for the velocity. Feeding everything through the trajectory generator in cartesian coordinates with position setpoints brings back all the issues I already went through during initial testing.
Note that @junwoo091400 went through a similar process making the follow me mode and also ended up smoothing on the tangential dimension.
Couldnt we use a linear ramp on the existing implementation? |
Sure, that might work well. Could for example ramp in the rotation velocity using
|
dfae130
to
f4f3938
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The orbit is made of 2 components:
- reference trajectory used as feedforward
- controller to bring the drone back on the circle
IMO, the slew-rate you want to add should be applied on the reference trajectory an not on everything. Also, instead of using an arbitrary time of 30dt to ramp up the velocity, why not limiting it using the acceleration parameter?
f4f3938
to
7625a8a
Compare
7625a8a
to
0c31657
Compare
Solved Problem
When transitioning from flying towards the orbit to orbiting, the vehicle can jerk quite alot around the axis pointing towards the orbit center (usually roll)
The Problem is the transition into the circling is implemented as a step response.
Solution
With this PR i also add a ramp of 30 samples to the initial start of the orbit maneuvre, by this the initial jerk is greatly reduced, and the transition is smoother
ADD PICTURE
Changelog Entry
For release notes:
Alternatives
Test coverage
Tested also with higher velocities and changing radiuses, the problems described by Mathieu are not present in this fix