MPU9255 with adafruit gps

hi, i wanna create an autopilot, i dont found any example of how to do it, i had tested a quadriant program that appears to works but when i saw that sucks 60% of the memory i discard it, my plane only consist on a rudder and has to glide in a circular pattern of 250m, i dont know what to use, in theory the plane should leave the rudder center when is tilted more than 45 degrees in both direction up or down , and should not allow the plane to roll more than 45 either becouse it can roll over, consider that i think that the algoritm is symplified a lot, and considering its low speed should not be so hard, i just cant use a kalman filter and a pid?

Please sort things out. What physical stuff do You have? What do You want to do? What means, sensors and controll devices are available?

I don't care what You want to do, fly and land upside down. That's Your property. But All helpers are newbies regarding Your proj. Slow down and read the questions. I'm a former pilot so I do have some aviation knowledge.

i am building a glider , that has to fly in a circular pattern of 250m by marked gps wapypoints, and the only control surface is the rudder, no elevetors or alierons are allowed.
The glider is dropped at an altitude of 500m aprox, so starting position can be upside down or rolled, i want that the rudder take action only when the plane has less than 45 degree of pitch and roll.
I had tryed the madwick algorithm and didnt work, it deliveres wrong values at least with mpu92550 it's look its the best algorithm out there but the lack of information it's make it dificult to adapt to another imu.
My hardware is:
arduino mega
mpu92550
adafruit ultimate gps v3

i had found a code that work relative good, but its cracking my head becouse the pitch angle reboot to 0 with a litte roll in ay direction

sketch_mar20a.ino (9.55 KB)

I had tryed the madwick algorithm and didnt work, it deliveres wrong values at least with mpu92550

The Kris Winer/Sparkfun code does not work at all for the MPU-9250. Corrected here.

jremington:
The Kris Winer/Sparkfun code does not work at all for the MPU-9250. Corrected here.

thanks!!! it really worked and with low cpu and memmory consumption!, how ever thats 50% of the work but the algorithm for navigate between gps point i assume is far easy

Most GPS libraries have a function that computes the bearing angle between two GPS points.

Use an electronic compass (magnetometer) or the MPU-9250 to measure the heading angle of your gizmo, and steer so that heading=bearing.

jremington:
The Kris Winer/Sparkfun code does not work at all for the MPU-9250. Corrected here.

i spoked to early, is not working, is mixing pitch and roll i know a litte movement in all axes is expected, but i roll and i see both of them beyond 90 degrees the previos code worked better

this is far harder than i expected :cry:

For informed help, please read and follow the instructions in the "How to use this forum" post.

Yes, to "create an autopilot" is very difficult, even if you know what you are doing.

There seem to be plenty of examples of 'arduino autopilot' found by a Google search.