Skip to content
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

Adding vertical (Z) velocity to inav estimator #1397

Merged
merged 2 commits into from
Jan 23, 2015
Merged

Conversation

dyeldandi
Copy link
Contributor

This is needed for high-accuracy GNSS sensors (like Ashtech MB100 we are using). It allows copter to maintain better altitude stability.

Basically copying horizontal code.

Here is the log http://dash.oznet.ch/view/wxpvxAKYstGZjXvkKTSkye

@LorenzMeier
Copy link
Member

@DrTon Please join the review. Note that Thomas did suggest a pull request a while back to replace the boiler plate parameter handling code with the block params, e.g. like here:
https://github.com/PX4/Firmware/blob/master/src/modules/navigator/navigator_main.cpp#L140
Our recent discussion sounded like you appreciate now the value of wrapping the params as C++ objects to avoid boilerplate code 8). (PR is here for reference: #755)

However: There is no value in doing a rewrite just to merge this, so this is more of a general architectural remark - we should get this reviewed and in and then iterate on architecture.

@dyeldandi Your log shows that your copter might benefit from a small MC_PITCHRATE_I and MC_ROLLRATE_I value and would show even better position hold / control accuracy with it.

@dyeldandi
Copy link
Contributor Author

@LorenzMeier
Ah, yes, thank you! We will definitely try that.

* @max 10.0
* @group Position Estimator INAV
*/
PARAM_DEFINE_FLOAT(INAV_W_Z_GPS_V, 1.0f);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the initial tuning value here? Please provide the value you use in your system, but also a safe value that down weights GPS to a small contribution. We want to avoid getting altitude oscillation issues from bad GPS receivers and so start with a low default.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using value 1.0 now even without RTK differentials, and I'd guess it would be quite safe to start from 0.5. My understanding is, since most GNSS receivers provide vertical measurements twice as inaccurate as their horizontal measurements, it ought to be 2 times less than INAV_W_XY_GPS_V.

@anatolfilin
Copy link

@LorenzMeier

Your log shows that your copter might benefit from a small MC_PITCHRATE_I
and MC_ROLLRATE_I value and would show even better position hold / control accuracy with it.
Lorenz, wondering how did you come to this conclusion? Is it by looking at saw on ATT.ROLLRATE? We constantly analyzing log files and trying to learn as many lessons as possible ...

@LorenzMeier
Copy link
Member

Yes, the roll and pitch rates and commanded rates do not match and have a constant offset. If you have a constant offset, you need an integral gain to bring that offset to zero.
I will also add the commanded and actual local position, as this will similarly show how your controller performs. Generally you don't need to tune the outer loop controller for position much, but the rate and attitude responses have to be right for a good total response.

@anatolfilin
Copy link

Thanks a lot! Will try to tune inner loops better.

@LorenzMeier
Copy link
Member

Could you provide a more detailed analysis / logs if this actually improves flight performance? We would need plots of the GPS velocity and flights with and without. I'm concerned that in noisy GPS reception situations this patch can deteriorate flight performance as GPS altitude is much more affected than position once the signal quality / sky view deteriorates.

@DrTon
Copy link
Contributor

DrTon commented Jan 18, 2015

By default the weight for Z velocity can be 0. It needed only for RTK receivers, where altitude accuracy is ~10cm, in this case using velocity may be very useful.

@anatolfilin
Copy link

We've done lots of flying with and without this patch. We tested with regular Ublox and with Ashtech GPS board. We also played with various combinations of INAV_W_Z_GPS_P/INAV_W_Z_GPS_V/INAV_W_Z_GPS_BARO. The majority of tests were performed before merging Anton's L1 into trunk on MPC_TRACK branch. We haven't noticed any deterioration of quality. However there wasn't definite result on improving quality either. We just didn't have enough time before we stopped flying due to winter. I have plenty of log files with this patch showing very good vertical precision, but can't isolate effect of this particular patch vs overall quality of algorithm / hardware.

@LorenzMeier
Copy link
Member

Ok. Happy to merge with default weight set to zero then.

@dyeldandi
Copy link
Contributor Author

Ok. Happy to merge with default weight set to zero then.

Default is changed to zero.

@LorenzMeier
Copy link
Member

Thanks!

LorenzMeier added a commit that referenced this pull request Jan 23, 2015
Adding vertical (Z) velocity to inav estimator
@LorenzMeier LorenzMeier merged commit ba54dee into PX4:master Jan 23, 2015
@anatolfilin
Copy link

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants