From PaparazziUAV
Revision as of 09:18, 16 December 2016 by Ewoud (talk | contribs) (Control Implementations)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Control subsystem

The control subsystem provides the attitude stabilization and guidance controller for fixedwings.

The control loops can be divided in two independent groups:

  • stabilization
  • guidance

stabilization is the part that is given a pitch and a roll angle (desired) and calculates a respective elevator or aileron deflection to reach the desired angle

this part is always used when engaging Auto1 or Auto2

in Auto1 the desired angles are generated by the RC transmitter

in Auto2 the desired angles are generated by the respective guidance loops

files can be found in sw/airborne/firmwares/fixedwing/stabilization/xxx.c

guidance is the part on top of stabilization that calculates the desired pitch and roll angle, taking into account the desired altitude / climb reqirement from the flight plan or the airspeed for example

only used when in Auto2

files can be found in sw/airborne/firmwares/fixedwing/guidance/xxx.c

Just specify the appropriate subsystem in your firmware section.

Currently you can choose between:

type stabilization guidance description
- attitude v
adaptive adaptive v
new adaptive v_n
energy attitude energy
energyadaptie adaptive energy


Just specify the control subsystem without any specific type in your firmware section.

File: conf/airframes/myplane.xml
  <firmware name="fixedwing">
    <subsystem name="control"/>


File: conf/airframes/myplane.xml
  <firmware name="fixedwing">
    <subsystem name="control" type="adaptive"/>


"New" vertical control for fixed wing vehicles with merged auto pitch and auto throttle. Standard horizontal/stabilization control loops.

File: conf/airframes/myplane.xml
  <firmware name="fixedwing">
    <subsystem name="control" type="new"/>


Total Energy (speed + height) vertical control with the default horizontal loop.


  • thrust = path + acceleration[g] (total energy)
  • pitch = path - acceleration[g] (energy balance)

See also EnergyControl and the generated docs: [1]

File: conf/airframes/myplane.xml
  <firmware name="fixedwing">
    <subsystem name="control" type="energy"/>


Use the total energy vertical control loop with the adaptive horizontal loop.

File: conf/airframes/myplane.xml
  <firmware name="fixedwing">
    <subsystem name="control" type="energyadaptive"/>

Control Implementations

Every control type needs its own set of defines in your airframe file. For details check the links in the table above!

However, they mostly use a similar VERTICAL_CONTROL and HORIZONTAL_CONTROL xml configuration section:

For the Default type it could look like this:

File: conf/airframes/myplane.xml
  <section name="VERTICAL CONTROL" prefix="V_CTL_">
    <define name="POWER_CTL_BAT_NOMINAL" value="11.1" unit="volt"/>
    <!-- outer loop proportional gain -->
    <define name="ALTITUDE_PGAIN" value="0.03"/>
    <!-- outer loop saturation -->
    <define name="ALTITUDE_MAX_CLIMB" value="2."/>

    <!-- auto throttle inner loop -->
    <define name="AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" value="0.32"/>
    <define name="AUTO_THROTTLE_MIN_CRUISE_THROTTLE" value="0.25"/>
    <define name="AUTO_THROTTLE_MAX_CRUISE_THROTTLE" value="0.65"/>
    <define name="AUTO_THROTTLE_LOITER_TRIM" value="1500"/>
    <define name="AUTO_THROTTLE_DASH_TRIM" value="-4000"/>
    <define name="AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT" value="0.15" unit="%/(m/s)"/>
    <define name="AUTO_THROTTLE_PGAIN" value="0.01"/>
    <define name="AUTO_THROTTLE_IGAIN" value="0.1"/>
    <define name="AUTO_THROTTLE_PITCH_OF_VZ_PGAIN" value="0.05"/>

    <define name="THROTTLE_SLEW_LIMITER" value="2" unit="s"/>

  <section name="HORIZONTAL CONTROL" prefix="H_CTL_">
    <define name="COURSE_PGAIN" value="1.0"/>
    <define name="COURSE_DGAIN" value="0.3"/>

    <define name="ROLL_MAX_SETPOINT"  value="35"  unit="deg"/>
    <define name="PITCH_MAX_SETPOINT" value="30"  unit="deg"/>
    <define name="PITCH_MIN_SETPOINT" value="-30" unit="deg"/>

    <define name="PITCH_PGAIN" value="12000."/>
    <define name="PITCH_DGAIN" value="1.5"/>

    <define name="ELEVATOR_OF_ROLL" value="1250"/>

    <define name="ROLL_SLEW" value="0.1"/>

    <define name="ROLL_ATTITUDE_GAIN" value="7500"/>
    <define name="ROLL_RATE_GAIN" value="1500"/>