Developer

ArduCopter Loiter Tuner / SIM

3689457389?profile=original

This is a simulation I'm working on to improve the Loiter control laws and discover optimal gains. I have identical code from Arducopter running in Flash as OO Javascript so I can ensure the behavior is the same as the real thing. I tested the MTEK GPS to find the actual latency and accuracy and then modeled it in code. This allows me to test PIDs and other coding ideas to see how the copter will behave in real life. The copter itself is a simple physics equation and should be fairly accurate. To better tune the SIM, I can compare AC Flash Logs from real flights side-by-side with the SIM flights which also output the same text based logs.

I've already found many areas for improvement in the Loiter code which i've just checked in to the GIT repository. 

 

Hopefully this tool will serve as a great PID introduction as well. I know I've learned a lot by comparing plots with small changes in the gains. 

 

Jason

 

 

E-mail me when people leave their comments –

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

Join diydrones

Comments

  • jason, it seems i have to restart the sim to make changes to any values.  i would love to be able to simulate gusts by changing the windspeed during the loiter.  any chance of updating these variables "on the fly"?

     

    james 

  • hello Jason
    absent for two days, I notice that you move very quickly
    congratulations thanks to you we will be able to better adjust ourquad and save accessories
    Daniel

  • Awesome job!

  • That is realy awesome. On version 1 have literally sit hours changing the values and just seeing what does the graph do to get use to what the variables mean and how to manipulate them to get the response I want.

  • Developer

    It's also really, really fun to use. did you check out the Flip in Acro mode video? That's the SIM running an automated flip using the CH7 toggle. 

    http://diydrones.com/video/sim?xg_source=activity

    Jason

  • I agree 100%, the sim is not just sweet, it is mind blowing, and because of this alot of people save alot of money on blades and parts because of this.

  • Developer

    I'm asking because I'm developing a very sweet SIM and it's quite an effort. It will have all of the AC params and some hardware details like Kv and weight. I'll probably post more in a week.

    Jason

  • I recon what made this product sooo successful is that there is not just the hardware but there is software supporting the product as well and as a software developer I know that no piece of software will ever become grate if there is no criticism and external inputs.

  • I would donate! It would be neat to have an web based sim where you enter all your copter measurements, motor speed, weight... Then get an starting spot for PID's specific to the parameters you enter :)

  • Developer

    Here's a question. If you could have a SIM that had all of these factors and could simulate virtually all of AC flight (but 2d Only) what would it be worth? Would you donate towards its development?

    Jason

This reply was deleted.