Difference between revisions of "Module/FlightBenchmark"

From PaparazziUAV
Jump to navigation Jump to search
(removed info about updating gen_flight_plan, as this was merged into master)
m (FlightBenchmark moved to Module/FlightBenchmark: moved to Module)
(No difference)

Revision as of 07:29, 3 November 2011

Description

This module allows a quantitative assessment of the flight. It calculates the sum of squared error of the two-dimensional course (x / y), the altitude and true airspeed. The sum of squared error of the course and altitude were separated, because they are regulated separately, and so they dependent on various parameters. The module was written to optimize the control parameters and has already been used successfully.

The measurement is not started until about the variable benchm_go is set to 1.

The sum of squared error can by reseted by changing the boolean variable benchm_reset to zero (will turn back to 1 automatically after it has done the reset). This can also be used in a flight plan, which allows a flight plan with auto-reset. So it is possible to fly an oval or a eight figure with a sum of squared error that will be reseted at the very same point of the figure.

Example plot: sum of squared error of altitude

Module Infos

ModuleXML

  • flight_benchmark.xml

Code- and headerfile

  • sw/airborne/modules/benchmark

Settings file

  • benchmark.xml

Airframe Adjustments

The code is aviable in the master git branch.

  • (1) Insert the software module in the airframe:
       <modules>
               <load name="flight_benchmark.xml">
                       <define name="BENCHMARK_AIRSPEED"/>    
                       <define name="BENCHMARK_ALTITUDE"/>    
                       <define name="BENCHMARK_POSITION"/>  
                       <define name="BENCHMARK_TOLERANCE_AIRSPEED" value="0."/> 
                       <define name="BENCHMARK_TOLERANCE_ALTITUDE" value="0."/> 
                       <define name="BENCHMARK_TOLERANCE_POSITION" value="0."/> 
               </load> 
       </modules>
    • Legend:
      • Define BENCHMARK_AIRSPEED to enable airspeed benchmarking (only with airspeed module)
      • Define BENCHMARK_ALTITUDE to enable altitude benchmarking.
      • Define BENCHMARK_POSITION to enable position (x/y) benchmarking. (shortest error to the path)
      • BENCHMARK_TOLERANCE_... define the tolerated value where the sum of squared error won't change. Set to zero to have no tolerance.
  • (2) Add the settings XML to the settings list: benchmark.xml
  • (3) Now you can turn on the calculations by setting the benchm_go to 1 (in GCS under benchamrk)

Example configurations in flightplan for auto-reset

A example flightplan can be downloaded here but beware: This file contains extras you probably won't need.

  • (1) Add this #include to your flightplan in the header:
<flight_plan alt="............your configurations.............">
       <header>
               #include "modules/benchmark/flight_benchmark.h"
       </header>
       ...
       <blocks>
       ...
       ...
       </blocks>
       ...
</flight_plan>


  • (2) Add this block to the blocks section:
       <block group="base_pattern" name="Oval Bench" strip_button="Oval Bench(wp 1-2)" strip_icon="oval.png">
               <oval p1="Ov1" p2="Ov2" radius="nav_radius" until="nav_oval_count > 0"/>
               <set value="1" var="benchm_reset"/>
               <deroute block="Oval Bench"/>
       </block>


  • (3) Make sure that you've named your points right.


  • (4) Now you can use this block in the flightplan:
       <block key="F7" name="Eight Bench" strip_button="Figure 8 (wp 1-2)" strip_icon="eight.png" group="base_pattern">
               <eight center="8C" radius="nav_radius" turn_around="8T" until="nav_oval_count > 0"/>
               <set value="1" var="benchm_reset"/>
               <deroute block="Eight Bench"/>
       </block>