Archive for the ‘Paparazzi’ Category

DIY Drones T3 contest – Round 2

Thursday, October 22nd, 2009

This month’s DIY T3 contest was definitively more challenging. I was only able to have one attempt due to the weather and a few other projects that kept me busy. I got first place on this round as well!

This time the challenge was that on each waypoint the altitude would change. I was able to hit the target altitude within 5m at each waypoint, it was a clean run. This attempt was without using the airspeed and altimeter sensors (not implemented at the time).

Screenshot-2

Screenshot

Flight testing of new Paparazzi altitude and airspeed control loops

Sunday, October 4th, 2009

Today it was the perfect day to test the new airspeed and altitude control loops. The wind was very gusty and with an average wind speed of 10 m/s, normally I would avoided flying my EasyStar in a day like that but what a better way to test the sensors and control loops! I had a few flights the day before in more mild conditions and had a chance to tune the altimeter and airspeed gains (see previous post for implementation details). The GPS only vertical control loops do a very good job when the wind is not too gusty, usually in days like today I would have to modify my airframe configuration to force the throttle to higher values than usual. With the airspeed sensor this is no longer needed, it will keep the airspeed in changing wind or attitude (e.g. climbing).

The following plots is from today’s flight. I was flying an oval against and with the wind, wind speed was about 10 m/s. Altitude hold was done with the barometric altitude sensor.

Screenshot1

For comparison the GPS altittude is also shown. Aggressive climb mode is still not enabled. The EagleTree altimeter is read at 20Hz and the existing Kalman filter is used to calculate the rate of climb. What I found interesting was that the pitch and altitude gains had to be increased considerably when the barometric altitude was used instead of the GPS. I am not sure why, it might have something to do with the update rate or the slightly modified Kalman filter parameters. After some tuning, I am fairly satisfied with the altitude hold (+/- 2m from setpoint for most of the flight), especially considering the effects of the high wind speeds.

09_10_04__17_50_27_alt2

The airspeed hold was the main reason I started this project and the benefits are obvious in this example. The throttle adjusts to keep the airspeed close to the setpoint. This time the airspeed deviation from the setpoint was higher than the last flight, the gains were the same so I believe the winds gusts might be to blame. I will try to see if I can improve the gains in the next flight.

09_10_04__17_50_27_as1

The new airspeed and altitude control loops will come in handy in the next DIY Drones T3 contest! Since endurance and not speed is the next objective, optimized throttle control will be essential.

I have a total of about 10 flights with the modified code and the EagleTree sensors with no major problems. I will be submitting my changes to SVN in the next few days. I still need to look into the following (hopefully in the next few weeks):

  • Test EagleTree sensors in 3rd party mode
  • Revert to GPS measurements if any of the sensors fail

Update on airspeed integration in the Paparazzi code

Friday, October 2nd, 2009

I was able to do a test flight with the airspeed sensor and the modified airspeed and altitude control loops. Some further tuning is required, but I am fairly happy with the results I got so far. First a brief description of the modifications made.

Besides the drivers for the EagleTree airspeed sensor, I had to modify the vertical control loops to make use of the airspeed. Since the actual airspeed is now known, I decided to try separating the altitude and airspeed loops as shown in the diagram below. Basically the throttle and pitch are now controlled independently and are not coupled in the control loops (of course one affects the other but the control loops are independent). The airspeed is controlled by two cascaded PI loops, the first is used to regulate the ground speed and the second the airspeed. This is needed to ensure that if the ground speed drops below a certain value the airspeed will be increased to compensate (in order to maintain a valid GPS heading).

Airspeed

I did some basic testing on the simulator (using airspeed = ground speed) and it worked well enough to fly test and tune. The following two plots are from an actual test flight after spending some time setting the loop gains (the real-time tuning through the GCS is a time saver!). The plane was flying circles at a constant altitude (except in the end). The wind was about 5 m/s, judging from the ground speed variations. In the middle there is an example of what happens when the ground speed falls below the setpoint. Finally the altitude setpoint was changed to verify that the airspeed will be maintained while climbing.

PlotAS

The altitude gains were the easiest to tune. Altitude is maintained fairly decently, at the end the altitude setpoint was changed (aggressive climb mode was disabled). This is still using the GPS altitude, barometric altitude has been implemented but not tested yet (Kalman parameters may need some tuning)

09_10_01__18_19_21_alt

Considering this is the first flight test I am fairly happy with the results. I would like to see if I can get the airspeed to hold closer to the setpoint, the reading is inherently noisy so either some additional filtering or further tuning of the gains might help. As soon as everything is tested I will submit to SVN. Remaining items that need testing:

  • Aggressive climb mode
  • Altitude control using barometric sensor
  • Test airspeed and barometric sensors in 3rd party mode (in the default mode the sensors will output raw values where in the 3rd party mode they will output converted values)

Paparazzi source files for the EagleTree altitude and airspeed sensors

Monday, September 7th, 2009

I was able to do a quick test with both sensors connected. The barometric altitude together with the GPS altitude is shown in the plot below.

altdemo1There are some discrepancies at the lower altitudes that I will need to work on a bit more. The coefficients for converting raw values from the sensors to the actual altitude and airspeed are calculated experimentally so some tuning may be required.

The source code was also released. This is code I am using to test the sensors and does nothing more than sending the altitude and airspeed data to the GCS. The next step will be to modify the airborne code to make use of the airspeed (for example maintain constant airspeed by adjusting the throttle).

Connecting the EagleTree airspeed module to Paparazzi

Sunday, September 6th, 2009

I had a successful flight with the EagleTree airspeed module connected to my TWOG. I did not have to do any hardware modifications, the sensor has an I2C interface that I connected directly to the TWOG I2C port. I was able to figure out the slave address and decode the raw output of the sensor. The results are quite good, the module is low cost and comes with a very good pitot tube (Prandtl style, pitot-static tube) that includes static and dynamic ports. For now I am simply sending the airspeed through the telemetry, the next step would be to modify the autopilot code to regulate the throttle in order to keep the airspeed constant (and a minimum ground speed). I am also working on interfacing with the EagleTree altimeter sensor.

air-micro-v3-pencil

Following is the data from my last flight, there was no wind and I tried to keep the pitch close to zero for most of the flight in order to be able to compare ground and air speed.

airspeeddemo1I will release the source code as soon as I have both airspeed and altimeter tested.

DIY Drones T3 competition (August)

Friday, September 4th, 2009

My Paparazzi / EasyStar entry won first place in the first round of the DIY drones T3 competition. Very fun competition and the timing was great, right after I finished tuning my EasyStar with Paparazzi. I did damage two LiPo packs running at full throttle but the airframe and autopilot performed great! The best part for me was getting to learn the Paparazzi flight plan editor, extremely powerful and flexible. Total time to complete the course was 49.5 seconds, a lot of very good entries with most autopilots represented. This was a great initiative of Chris Anderson and Gary Mortimer from DIY drones, the plan is to have a contest once a month. In fact the September competition is already ongoing. A video and a few screenshots follow.

T3_Vassilis_Entry3

IMG_0858

EasyStar with Paparazzi autopilot, first AUTO2 flight

Tuesday, August 4th, 2009

Success! I was at last able to fly my EasyStar with the Paparazzi open source autopilot. A few days ago I made the first flight in MANUAL and AUTO1 mode to get everything tested and tuned. Today I tried for the first time AUTO2 mode and worked beautifully! Some tuning is obviously required, especially for the roll response but it worked after only a few test flights. I will make a separate post detailing my setup, wiring (very important) and configuration files.

Following is a picture of my EasyStar, I had to move components around to minimize interference from the various receivers/transmitter. I currently have the following equipment:

  • EasyStar airframe with added ailerons
  • Paparazzi TWOG autopilot (from PPZ UAV)
  • GPS receiver
  • IR, horizontal and vertical
  • PPM encoder (worked great and with excellent support from Chris)
  • Xbee Pro 2.4GHz modem
  • KX191 camera
  • 900MHz, 500mW video transmitter
  • Pan/tilt video pod
  • Spektrum AR9000 receiver with a remote receiver (total of three receivers)

EasyStar2

img_0851

img_0855

The following two screenshots are from the Paparazzi ground station, two flight plans were tested an oval and a figure eight. Both worked very well considering that I have not spent too much time on tuning. Altitude was alse held within about 5 meters of the target.

screenshot-gcs-oval

screenshot-gcs-eight

Finally a video from the flight follows.

I am very impressed with the Paparazzi autopilot so far, it is open source, it has the best ground station software and a large and helpful community, what else can I ask for.