Evolving aircraft control values using a genetic algorithm

I've been doing some experiments to evolve PID control values in X-plane using a genetic algorithm, with some success. I posted a description about the experiment on my blog. I didn't want to reproduce the entire post here, but thought I would link it and post a video of the experiment:

Blog post:




E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones


  • Thanks! Will do
  • Good point re: PID. Its sort of like the duct tape of the controls world - not very elegant, but can often be used by non-experts to decent effect, and can sometime lead to more problems.

    If you are interested in non-GA algorithms for control development, check Google Scholar for the following terms:

    Fictitious Reference Iterative Tuning (FRIT)
    Virtual Reference Feedback Tuning (VRFT)
    Iterative feedback tuning (IFT)

    - Roy
  • Roy

    "How do you know that you have generated sufficiently diverse "children" such that they have explored a large enough region of the solution space?"

    That is a very good question. I am not an expert in GAs, but enjoy experimenting with them, so don't take this as expert opinion. The answer can be that you don't know. There may be very good solutions that a GA will not find. But that is the tradeoff - computing resources vs. globally optimised results.

    Yes, it may very well be more efficient to use other optimization techniques, I make no claim on efficiency.

    More importantly, I think it could be better to not use PID control at all, since it is a method used when you don't have knowledge of the underlying process. Simulation might provide sufficient knowledge of the underlying system.

    Thanks for the ideas, I hope that I can explore them at some point!

    - Ben
  • Benjamin,

    Thanks for the interesting post.

    I am not that familiar with genetic algorithms. How do you know that you have generated sufficiently diverse "children" such that they have explored a large enough region of the solution space? Wouldn't it be more efficient to just use least squares or other optimization algorithm to generate the PID values directly from simulation data?

    - Roy
  • Nice work!
  • Very cool.
  • Bravo.


  • That is the Y dollar question. To apply this practically, the target aeroplane must be described accurately enough in X-plane so the simulation gives a usable result that can be tested in the real world. I would only test the high fitness results in a real aeroplane.


    It could be that this method of determining PID values is not practical. In that case I can still develop the higher-order autopilot functions with a simulator, and substitute PID values derived by some other means into the control system. Hopefully...



  • Interesting work... but is there a way to apply this practically without a low fitness condition causing a crash?
This reply was deleted.