PX4 / flight_review

web application for flight log analysis & review
https://logs.px4.io/
BSD 3-Clause "New" or "Revised" License
195 stars 191 forks source link

feat: added FFT plots for accelerometer, gyro and rate setpoints #194

Open francelico opened 4 years ago

francelico commented 4 years ago

Added new FFT plots for the accelerometer and gyro raw data in order to better visualise the effect of notch and lowpass filters.

bokeh_plot

bokeh_plot(1)

Also added a FFT for the rate setpoints data. Not convinced of its utility yet, the reasoning was to provide additional insights of the outputs of the rate controller.

bokeh_plot(2)

In the future I would like to also have a Dterm FFT plot but that will require a PR to have it logged in the main stack.

dagar commented 4 years ago

In the future I would like to also have a Dterm FFT plot but that will require a PR to have it logged in the main stack.

In current PX4 we have vehicle_angular_acceleration computed and filtered upstream of the controller.

dagar commented 4 years ago

bokeh_plot(1)

Overlaying the gyro filter parameters on the accelerometer FFT is a bit distracting.

dagar commented 4 years ago

Would it be interesting to plot the FFT for some of these topics before and after filtering?

bkueng commented 4 years ago
francelico commented 4 years ago

bokeh_plot(1)

Overlaying the gyro filter parameters on the accelerometer FFT is a bit distracting.

Good point, will fix this.

francelico commented 4 years ago

Would it be interesting to plot the FFT for some of these topics before and after filtering?

Agreed to have both raw and filtered data, would be really helpful for filters tuning. However we are in a weird situation where the filtering is not happening in the same place in stable and master at the moment.

From my understanding: Differences between v1.10.1 (stable) and master:

In this PR the log is showing the sensors_combined data, which means it would show the filtered data in stable and the unfiltered data in master. Should we wait for v.1.11 stable release to unify things?

Concerning the Dterm:

so making FFT of vehicle_angular_acceleration output would show the filtered data on master, and the unfiltered data on stable. v1.11 stable should also unify things there.

francelico commented 4 years ago
* I'd rather use the FIFO topics to show unfiltered FFT's. That gives much higher frequencies and is already there: https://github.com/PX4/flight_review/blob/724102d869e95c4538afcc169333ef41886c7b0e/plot_app/configured_plots.py#L629
  .

* I think a separate FFT for the D-term is useful

It would be great to use FIFO for raw data @bkueng , as I understand we would have much higher sampling rate? The FFT would then provide much more info (see https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem ). The FIFO plots don't appear when I run the stable release on fmuv5 (CUAV nano). I tried looking into past PRs to see the state of things but couldn't find clear info. What is the state of FIFO in stable/master/v1.11 upcoming release for the fmuv5 boards? Do you need to enable it manually on stable?

bkueng commented 4 years ago

You'll have to use master for the fifo topics, and add them to the log - it's a bit more involved as logging rate becomes exceedingly high, and I'll have to do some changes to the logger to make it generally usable. As we have an upcoming release, we can make sure everything works against master, the previous release is just too different.