PhoenixPilot/PhoenixPilot — pull request #215 by kubark42 (2013-01-24 19:26:03+00:00)
Title: Kenz/vibration testing

This module allows you the frequency and magnitude of vibration while you operate your vehicle.

This commit is for feedback before moving to the final commit. The program works as promised, but there are some brutish hacks in the GCS scope gadget. Please be brutish on everything, including the CMSIS3 library binary blob.

In order to try it out, you need to

1. Optionally update your makefile (if you don't have a RM or FlyingF3)
2. Enable ModuleSettings-->State-->VibrationTesting
3. In the UAVO browser, set VibrationTestSettings-->SampleRate to the desired sample rate.
4. Reboot

Now it should be working. Of course, this isn't much use if you can't visualize the output, and right now that's done through a scope.

1. Go to the Preferences/Options and create a new Scope.
2. Call it ```Vibration```.
3. Set the X-Axis-->Plot Type: to ```Histogram Plot```
4. In the Y-axis, add three data fields to track. It doesn't matter which ones you choose, it's hardcoded into the GCS scope to use Histogram. Make sure the three have different colors. (For those who are a bit experienced with scopes, you'll already have realized that you can just clone the Accels scope, change it to a Histogram plot, and be done with this step.)
5. Set the Data Size to 100 seconds.
6. In Tools--> Edit Gadgets mode, set up a Scope-->Vibration widget.

You should now have visualization working, and be able to see the results in the scope. Play around by shaking the FC board.

It works much better if you change the FFT_PARAM in vibrationtest.c to 2, but this exceeds the available memory on the FlyingF3. (Which is surprising, since the FlyingF3 should have more memory free than the CC3D, but currently has about 1K less) On the F4 platforms, the available memory is in the 15K, so you can actually go as high as FFT_PARAM 3, but then this crashes GCS (because it can't handle the data load?).

P.S. I realize it's not a histogram. I had originally intended it to be one, in order to save on memory, but this didn't work out as intended in the scope. I would still like to be able to set up a histogram binning so that the output values can be narrowed down to just the interesting part of the signal.