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

Expose gyro data via all interfaces and validate #20

Closed
LorenzMeier opened this issue Aug 12, 2014 · 11 comments
Closed

Expose gyro data via all interfaces and validate #20

LorenzMeier opened this issue Aug 12, 2014 · 11 comments

Comments

@LorenzMeier
Copy link
Member

We should expose all gyro data and cross-check that rates and readout speed make sense. We should also include a flag to indicate wether the gyro data is available (in case we want to remove the sensor later if we conclude its not useful).

@priseborough
Copy link

The combination of gyro angular rate and non-motion compensated optical flow rates (optical flow in rad/second) are very useful for fusion of this data in an external observer.

This enables an external observer to:

a) estimate focal length scale factor error
b) correct the optical flow sensor gyro rates for bias errors before they are use for motion compensation
c) perform more precise motion compensation than would be possible using the observers own gyro data which is not time synchronized with the sensor and more precisely than would be possible with performing motion compensation within the px4flow sensor as its gyro rates are not bias corrected.

@priseborough
Copy link

This gyro data should be averaged using the same sample set that is used for the px4flow measurements. What I mean by this is that if there are invalid flow measurements that are not being averaged, the gyro data corresponding to those flow measurements should also not be included in the gyro average.

@priseborough
Copy link

I hacked the px4flow master code

priseborough/px4flow@8d4e185

to output the averaged gyro rates and flew it this weekend.

https://groups.google.com/d/msg/drones-discuss/SqgXeojbiZU/WcFo2KNWCYsJ

The improvement in performance was significant

@LorenzMeier
Copy link
Member Author

@dominiho The change set has been dangling for a while now, and I think we should try to wrap this up, since it doesn't seem to be major effort. @priseborough is there a chance to consolidate your patch with the current master here so we can get your changes across? We also need to sync with respect to #21.

@priseborough
Copy link

I think it would be best to work through the patch interactively with with someone on your team. Happy to schedule in a Skype meeting when it suits.

@LorenzMeier
Copy link
Member Author

@dominiho The scale factor here does not match the data sheet:
https://github.com/PX4/Flow/blob/master/src/gyro.c#L56

Thanks @priseborough for reporting and @tridge for working the code location out.

@LorenzMeier
Copy link
Member Author

This here doesn't quite make sense according to the data sheet - there is only 250/500/2000 selectable range.

{ 37548, 18774, 12516, 9387, 7510, 3755, 1877, 939 };

The three scaling factors should be:

  • 70000 for 2000 dps
  • 17500 for 500 dps
  • 8750 for 250 dps

@LorenzMeier
Copy link
Member Author

The temperature status is in register 0x26, so trivial to add there.

@priseborough
Copy link

i don't think the table in https://github.com/PX4/Flow/blob/master/src/gyro.c#L56 is affecting the integrated outputs. It looks like the scale factor applied is being calculated here:

https://github.com/PX4/Flow/blob/master/src/gyro.c#L141

@LorenzMeier
Copy link
Member Author

Yes, and that line pulls from the table ;-)

@LorenzMeier
Copy link
Member Author

M_PI_F (or a constant with 7-8 digits after the decimal point) should be used here instead:
https://github.com/PX4/Flow/blob/master/src/gyro.c#L143

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

No branches or pull requests

2 participants