-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
mc_rate_control: use vehicle_angular_acceleration topic #14048
Conversation
ff83fcf
to
1d7b01b
Compare
699d1ea
to
6357bd1
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.
Sounds good to me.
Another benefit is that angular acceleration may be used for system ID (ex: #13585 ) , so it is better if the same data is used in the controller.
Requires careful flight test.
@@ -147,12 +145,18 @@ MulticopterRateControl::Run() | |||
vehicle_angular_velocity_s angular_velocity; | |||
|
|||
if (_vehicle_angular_velocity_sub.update(&angular_velocity)) { | |||
|
|||
// grab corresponding vehicle_angular_acceleration immediately after vehicle_angular_velocity copy |
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.
We may document on both sides - _mc_rate_control and vehicle_angular_velocity - that velocity is published before accel, and that they should be read in the same order. This is not obvious and may be lost in a future refactoring.
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 ordering doesn't actually matter because the execution of vehicle_angular_velocity
(where both angular velocity and angular acceleration are published) followed by mc_rate_control
is serialized. Although there's nothing actually enforcing this implementation.
I'll still add a comment publisher side.
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.
Right, 👍
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.
Makes sense from my pespective to handle this on the sensor side and I don't see the problem IF the filtering inside vehicle_angular_acceleration
is equivalent which it should be.
Just came to my mind: What happens in the case where the gyro sensor is switched in air and the derivative should not have a jump?
Before we merge this we have to directly compare if it really doesn't change filtering because if there's a difference this could easily flip multicopters on takeoff and/or significantly impair performance.
Also @bkueng should be added as reviewer since he contributed the D-term filtering which was a big improvement.
|
||
// grab corresponding vehicle_angular_acceleration immediately after vehicle_angular_velocity copy | ||
vehicle_angular_acceleration_s v_angular_acceleration{}; | ||
_vehicle_angular_acceleration_sub.copy(&v_angular_acceleration); |
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.
Minor implementation detail but what about using a SubscriptionData
and directly fetching the vector using:
const Vector3f angular_accl{_vhicle_angular_acceleration_sub.get().xyz};
?
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.
It's pretty minor, but there's no need to store the data because every iteration grabs a new one.
That's a good point. At the moment the filters aren't explicitly reset on sensor change, but may reset a few iterations later if the sample rate of the new primary is different (eg pixhawk 4 Invensense -> Bosch). In most real world use the sensor failover is likely to be abrupt due to resetting the bias. This will be addressed once we have an estimator instance per IMU. |
I'm ok with the change, but please do:
|
Tested on NXP FMUK66 v3Flight Card 1
Flight Card 2
Flight Card 3
|
Tested on CUAV nano V5Flight Card 1 Modes Tested: Procedure: Notes: Logs: https://review.px4.io/plot_app?log=56fcea9c-9ef1-43dd-9356-33a19e8620d4 Flight Card 2 Modes Tested Procedure Armed form QGC. Logs: https://review.px4.io/plot_app?log=67168d92-dc09-44fb-b76c-eff8551accaa Flight Card 3 Modes Tested Procedure Good flight in general. Note: Logs: https://review.px4.io/plot_app?log=b6b3d5e0-e3c7-4b17-8558-7e9b257634cf Flight Card 4 - Modes Tested Logs: https://review.px4.io/plot_app?log=8b4b4dfb-3f95-4ead-99a0-22a2d13a982d Tested on PixRacer V4Flight Card 1 Modes Tested: Procedure: Notes: Logs: https://review.px4.io/plot_app?log=11f4eff7-7305-401c-8def-241c373316a9 Flight Card 2 Modes Tested Procedure Armed form QGC. Logs: https://review.px4.io/plot_app?log=668d6d5a-f34e-4e73-a489-7652b6c57936 Flight Card 3 Modes Tested Procedure Note: Logs: https://review.px4.io/plot_app?log=a5416a58-52eb-42e8-9d8a-7fce74716653 Flight Card 4
Logs: https://review.px4.io/plot_app?log=e7f0e0ba-fcec-4ef0-960f-a5520e3ffb96 |
Tested on pixhawk4 v5 f-450 Modes Tested Procedure Notes Log Flight Card 2 Modes Tested Procedure Notes Log Flight Card 3 Modes Tested Procedure Notes Log Flight Card 4 Modes Tested |
Merge conflict resolved. @PX4/testflights could you do another multicopter flight with SDLOG_PROFILE "High rate" enabled. The new data we're talking about using here isn't logged by default. A single thorough multicopter flight on any vehicle with a comparison to master should suffice. |
Tested on PixRacer V4Flight Card 1 Modes Tested: Procedure: Notes: Logs: https://review.px4.io/plot_app?log=6c33763b-dd5f-4652-849b-d6591b9c74a0 Flight Card 2 Modes Tested Procedure Armed form QGC. Logs: https://review.px4.io/plot_app?log=50319699-7e95-4ae7-9b35-80f6bbded185 Flight Card 3 Modes Tested Procedure Note: Logs: https://review.px4.io/plot_app?log=d69037d1-b9ce-41e6-9755-6128d316c38a Log |
Tested on NXP FMUK66 v3Flight Card 1
Flight Card 2
Flight Card 3
Comparison Master
|
Are we good to go here? |
Looks good to me.
Le jeu. 12 mars 2020 à 15:04, Daniel Agar <[email protected]> a
écrit :
… Are we good to go here?
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#14048 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKQZB3FERDGFWYBLFC7M6TRHDTYRANCNFSM4KMXMIXA>
.
|
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 still consider it useful given the current filter producing the angular acceleration state is configured the same way as the derivative term filter before. Note that there was a sample rate detection (kind of related: #14303).
Thanks everyone. I'll get the documentation updated for the release. |
I'm missing the parameter transition support. It would make this considerably more user-friendly. |
Good idea. #14389 |
We're computing
vehicle_angular_acceleration
upstream of the controllers in the sensor pipeline now. Should we use it the multicopter rate controller?