DISCLAIMER: This could be dangerous and might crash your copter.
OK! I made some new changes to the autotuning algorithm and I have tested it again in the simulator. I think this is ready for some real world testing from some VERY BRAVE users, or some simulation testing. Unfortunately I do not own a quad and my octo is out of commission until Tuesday, or I would be testing this right now outside.
First, here is what is new:
1. The amount of change applied to the P gain scales down with each iteration. This allows for quicker acquisition and better resolution of your Pretty Good Gain
2. If the tuning logic moved the P gain in the wrong direction it will revert to the best P gain that had been found and use that as the new launching point which should save some iterations
How to use it:
1. Replace the files in your ArduCopter 2.2b2 code base with the files that I have included in the .zip.
2. Upload the code to your board and test in the simulator so that you can get a feel for how it works (follow the same steps below for setup starting at step 5)
3. Update the config file to disable the HIL setting or change your frame type, etc...
4. Re-upload the code for live flight IF YOU DARE
5. Connect the APM to the Mission Planner.
6. Go to the configuration tab and manually set the CH7_OPTION to 8 as seen below and click "Write Params"
7. Set your Integral (I) gains for pitch and roll to zero and click "Write Params"
8. Bring the copter to a hover and flip CH7 to the high position to activate the auto tuning mode
9. Roll to the right or left and quickly return the stick to the center position. (Repeat this step at least 5 times)
10. Deactivate auto tuning mode by flipping CH7 to the low position
11. Reactivate auto tuning mode by flipping CH7 to the high position
12. Pitch the copter forward or back and quickly return the stick to the center position. (Repeat this step at least 5 times)
13. Deactivate auto tuning mode by flipping CH7 to the low position
14. Go to the configuration tab of the Mission planner and click "Refresh Params" to see your new tuned P gains
15. Write those values down.
The idea of steps 9 and 12 is to introduce a wobble and let the copter try to even itself out. Don't go too aggressive with your pitch or roll... again its just to introduce a disturbance.
My videos are in 1080p so that you will be able to read whats on the screen.
Questions, comments, discussion is welcome and encouraged!