Flight tests with ArduPilot in EasyGlider Pro

I posted an earlier blog with pictures on how I placed the avionics in an EasyGlider Pro for autonomous flight. I found out that was the easy part! Now I’m performing flight tests to hone in on the code mods for stable flight ( as Jordi states, the latest code is optimized for the EasyStar). My method has been:
Fly and observe performance in autonomous mode – record observations – make code modifications on laptop – remove GPS and upload code – replace GPS – fly again. Laborious but also fun since physical computing yields immediate effects that you get to see.
I’ve attached a table I made in Excel to organize my iterations and keep me on track. Maybe this will help others in the same situation. One mistake I made was getting in a hurry to go fly. I could have found out about the reversed servo throws and IR sensor placement by just walking the plane around on the ground and changing its attitude by hand. This would have avoided the “death spirals” I experienced on that first day of flying!

Views: 702

Comment by Bryan Cuervo on May 14, 2009 at 3:35pm
I never used the 2.0.1 code. I went from the 2.0 to 2.1 and now I just switched and flew with the 2.1.1. No, I never checked the sensors with the sensor test. They were checked by unplugging the GPS and rolling the plane by hand. With the GPS unplugged, the sensors worked fine with stabilizing the roll and pitch. Just wouldn't work on the roll (ailerons) with GPS plugged in and code running.
I flew with 2.1.1 today and did the same roll test by hand and GPS plugged in and now I get the proper IR sensor response. Go figure. During flight, no major changes were needed to stabilize in roll.
Either code changes were made in 2.1.1 that I'm not aware of or there is another variable I'm not accounting for. I wonder if a cloudy vs. sunny day could make a difference since there would be a change in the temperature gradient?

3D Robotics
Comment by Chris Anderson on May 14, 2009 at 3:37pm
No changes that I know of. Cloud cover can make a difference. The more clouds, the worse the performance.
Comment by Bryan Cuervo on May 16, 2009 at 8:28am
First flights with 2.1.1 code

Comment by Bryan Cuervo on May 16, 2009 at 2:49pm
Latest flight path. Winds out of the south ~12knots. You can see how the wind pushed her off course towards the first waypoint but not sure why she overcorrected so much. When she deviated north (off the picture)(another mystery), I switched back to manual mode and just happened to fly over WP3.

Comment by Matt on May 16, 2009 at 7:13pm
Chris or Bryan,
I may get an easy glider so I can follow your parameter adjustments. Could you please tell me what these values are measured in? Are they percentages? Maybe in the code comments Jordi could write the parameter ranges for each setting.
I'm not a programmer so it looks pretty foreign to me, so well commented code would be welcomed.
Is there any documentation on this stuff?

3D Robotics
Comment by Chris Anderson on May 16, 2009 at 8:04pm

We're finishing up 2.2, which will shield users from the code entirely (it will use the setup utility for everything). Since that will be the first "user-friendly" version, we'll release proper documentation then, including some guidelines on tuning and ways to import aircrafts-specific setup files.
Comment by Matt on May 17, 2009 at 12:07am
Chris, that's great news. Sounds like a big leap in ease of use. When can we expect to see 2.2 released?
Comment by Bryan Cuervo on May 17, 2009 at 12:41pm
Latest flight log. The third flight path is shown above.

Comment by Matt on May 19, 2009 at 4:55pm

Could you provide some guidance as I'm unsure if I'm changing the right parameters for my first flight tests.
I posted this in another thread but it went unanswered:

I took the predator to the field today for the initial test which wasn't too successful.
Here are my observations, maybe someone can provide some guidance for me.

Firstly, after each code upload, I had the blue light immediately, so I gather that the EPROM is not totally erased and that I don't need to jumper the pins for every restart.

I then changed the code to reflect the cable at the front like so:
#define REVERSE_X_SENSOR 0 //1 = cable behind, 0 = cable front

Pitch and Roll orientation
I pitched the aircraft up and down and noted that the elevator was compensating the wrong way so I changed the following line of code as follows:
#define REVERSE_PITCH 1 //To reverse servo pitch
I rolled the plane and saw the corrections were of the correct orientation so I left the code as follows:
#define REVERSE_ROLL 0 //To reverse servo roll
I note that when I I pitched or rolled the plane the pitch and roll servos took a long long time to move to the correct position. I expected them to move in real time.

Roll trim
The plane has a whole heap of right trim programmed in on my radio for it to fly strait and level.
When I flick my switch from Manual mode to RTL, the ailerons try and center themselves by jumping back to servo center. I tried adjusting the following line of code which had NO effect.
char roll_trim= -4; //You know like the transmitter trims
Is this the code to edit the neutral roll trim of the aircraft?
If so, what are the +-ranges I can try. It had no effect even though I tried -40 to +40
Whilst ground testing this, I expected to be able to flick the switch to RTL and see no deviation if I had found the correct values.

The elevator needs the same attention and editing of the following line of code had no effect, so as with the roll trim, I left it at default:
char pitch_trim= 10; //You know like the transmitter trims

I launched anyway and flew about 150 meters away and at about 50 meters height, When I flicked the switch to RTL, the plane immediately rolled left and the nose pitched suddenly down. I let it fly a while and the nose came up a bit, but it was still in a descent and the plane continued to want to orbit left.

SO my questions are:
1) How do I fix the neutral trim position?; and
2) What lines of code should I be looking at next, considering the plane didn't even nearly do what I had expected?


Comment by Bryan Cuervo on May 20, 2009 at 5:45am
I’ll answer these questions the best I can but with this disclaimer: I don’t really understand how the code works so a lot of what I’ve learned is through trail and error.

GPS - You are correct. You don’t need to jumper the pins for every restart. I’ve not used the jumpers in my last few trips to the same flying field. When I first turn on my Rx at the field, it takes around a minute for the GPS to get a lock (blue light on). After that first lock, it only takes a few seconds for the blue light to come back on.

IR, pitch and roll orientation – Sounds like you have that figured out. The simplest test is to walk away from “home” and switch to RTL. The elevator should deflect up and the ailerons/rudder should guide you back home. Tilting the plane on roll and pitch will tell you if the IR sensor is oriented correctly. This response will not be as quick as the autopilot inputs but you should see a correction right when you change the attitude. For some reason, the 2.1 code seems to produce a better roll IR response than the 2.0 code??

Roll trim – I would get all of my mechanical linkages correct and not depend so much on the Tx trims. This would be easier than trying to correct in the code. I don’t know what effect “char roll_trim” has.

Elevator trim – This has always been a sticking point. I’m using the configuration utility and as you can see in my tests, had to raise the trim from 0 to 11 to keep the plane from diving while under RTL or WP. I’ve also just discovered that a cloudy, wet day will require different trim settings than a sunny, dry day.

Launch – Mechanically fix the aileron trim so centered servos and Tx trims give you neutral ailerons. Raise the elevator trim in the config utility. And/or raise the value in alt_pitch_min (on the first tab with the other defines) closer to zero.

It’s just the nature of the beast. An infant, low cost autopilot like this is going to take a lot of messing with to work in a different airplane. I’m just having fun with it, trying to learn a little and waiting for the next software, hardware upgrades.
Let me know if any of these suggestions help.


You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2020   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service