I did some research and implemented a self learning PID algorithm. It is located in my cloned repo http://code.google.com/r/litho23-ardupilot/. I really like how it turned out. I hope you all are able to use it with success i'm lacking hardware right now to do further testing.
For those looking at the repo it is in the libraries/PID/ location.
I couldn't figure out how to add a parameter to the EEPROM memory so it is 95% implemented.
Tags: PID

Can you tell us more about this? Is it based on ArduPlane or ArduCopter?
Permalink Reply by Matt Landowski on April 1, 2012 at 7:52am My application was ArduPlane, but it can be used on any platform where a PID is needed.
It is based off this paper, http://www.ece.eng.wayne.edu/~flin/Conference/AI-PID.pdf.
I added a diagram to the original post that explains how the algorithm works. The paper doesn't explain it this way, but this is how it basically works.
I based it off the current PID.h/cpp library. The new self learning PID should be plug and play minus the EEPROM additional value I couldn't figure out how to implement.
Permalink Reply by Matt Landowski on April 1, 2012 at 7:54am Here is the self learning PID diagram.
Permalink Reply by Matt Landowski on April 1, 2012 at 8:18pm I figured out the param_table.h, c files and generated my new ones that should work with the self learning PID. Located at me cloned repo http://code.google.com/r/litho23-ardupilot/.
Permalink Reply by Jonathan M on April 2, 2012 at 10:53pm Do you have any recommendations on how to test this and what it is supposed to do? Looking at the paper it seems that the code should automatically optimize the control loops for the system, in this case a UAV. This is fantastic if so!
So, should we test this on the ground, fly it, etc (understanding the risk)? Will my quad automatically tune itself? Does the code affect all of the different flight modes directly or just a few modes?
The tuning process right now is hit or miss, and I doubt that many of us ever fully optimize our systems. A true self-learning control scheme would be a giant leap forward, especially considering all of the unique mechanical systems out there!
Permalink Reply by Matt Landowski on April 3, 2012 at 8:13pm I'm trying to figure out how to test it myself. I've ordered a APM 2.0 and that is going to take 4-6 weeks to get to me.
In the mean time i'm trying to figure out the software in the loop simulation (SITL) and test it that way. As to what platform it will work with. It should work with any.
A person could:
There are along of advanced control schemes out there with neural networks, but trying to find one that was simple, universal, and small to code was my goal.
As for how you can test it. I'm not 100% sure yet as I haven't been able to upload my build yet and I haven't uploaded a custom build before. I'll keep everyone posted though.
Permalink Reply by Jonathan M on April 3, 2012 at 9:27pm When you say "turn-on", is there a way to enable or disable the auto learning feature in the code? It would be interesting to do a flight test with normal well-tuned parameters and compare to a flight test with this adaptive control turned-on, see which one is better tuned.
I think that the SITL or HIL setup is the way to go at first to work out any bugs. Gotta get more of the devs and alpha testers on this thread! :)

I have a working ArduCopter SITL simulation running on Amazon's cloud.
Would it help to have access to it?
if yes, PM with public ssh key and you will have a server with SITL to play with
Permalink Reply by Anis Nielsen on April 3, 2012 at 10:00pm Neat! Something is telling me your apm 2 gonna ship much kicker than you think :D

This is super cool! I made a very caveman-like attempt at this a while back... this is much better.
Permalink Reply by Matt Landowski on April 11, 2012 at 6:31pm Thanks! I did a lot of researched and I thought this was the simplest and most elegant method. Making a self tuning PID can be done many different ways, but a lot of those are computationally intensive and to be honest confusing unless you have a PhD.
If you could give it a HIL test that would be awesome. I ran the autotest.py and it worked fine. As in didn't crash. I'm trying to come up with a more appropriate test script for it, but I've been busy lately. Maybe i'll finish it this weekend.

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.47 members
24 members
87 members
183 members
692 members
© 2013 Created by Chris Anderson.
Powered by
