Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
stabilization_indi module

Full INDI stabilization controller for rotorcraft

No detailed description...

Example for airframe file

Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!

1 <module name="stabilization_indi">
2  <configure default="4" name="INDI_OUTPUTS" />
3  <configure default="4" name="INDI_NUM_ACT" />
4 </module>

Module configuration options

Configure Options

  • name: INDI_OUTPUTS value: None
  • name: INDI_NUM_ACT value: None

Airframe file section

  • section name: RC_SETPOINT prefix: STABILIZATION_ATTITUDE_
    • name SP_MAX_PHI value: 45.
      Description: max setpoint for roll angle
    • name SP_MAX_THETA value: 45.
      Description: max setpoint for pitch angle
    • name SP_MAX_R value: 90.
      Description: max setpoint for yaw rate
    • name DEADBAND_R value: 250
      Description: deadband on yaw rate input
  • section name: STABILIZATION_ATTITUDE_INDI prefix: STABILIZATION_INDI_
    • name G1_ROLL value: {20 , -20, -20 , 20 }
      Description: control effectiveness of every actuator on the roll axis
    • name G1_PITCH value: {14 , 14, -14 , -14 }
      Description: control effectiveness of every actuator on the pitch axis
    • name G1_YAW value: {-1, 1, -1, 1}
      Description: control effectiveness of every actuator on the yaw axis
    • name G1_THRUST value: {-.4, -.4, -.4, -.4}
      Description: control effectiveness of every actuator on the thrust axis
    • name G2 value: {-60.0, 60.0, -60.0, 60.0}
      Description: control effectiveness of every actuator derivative on the yaw axis (important for propellers with strong torque changes)
    • name REF_ERR_P value: 600.0
      Description: reference acceleration
    • name REF_ERR_Q value: 600.0
      Description: reference acceleration
    • name REF_ERR_R value: 600.0
      Description: reference acceleration
    • name REF_RATE_P value: 28.0
      Description: reference acceleration
    • name REF_RATE_Q value: 28.0
      Description: reference acceleration
    • name REF_RATE_R value: 28.0
      Description: reference acceleration
    • name MAX_R value: 120.0
      Description: max yaw rate
    • name FILT_CUTOFF value: 8.0
      Description: second order cutoff parameter
    • name ESTIMATION_FILT_CUTOFF value: 8.0
      Description: second order cutoff parameter
    • name ACT_DYN value: {0.1, 0.1, 0.1, 0.1}
      Description: actuator dynamics
    • name ACT_IS_SERVO value: {0,0,0,0}
      Description: 1 for every actuator that is a servo
    • name ACT_RATE_LIMIT value: {9600,9600,9600,9600}
      Description: rate limit in PPRZ units per timestep (depends on control frequency)
    • name ACT_PREF value: {0.0, 0.0, 0.0, 0.0}
      Description: preferred (low energy) actuator value. Important when the system is over-determined!
    • name USE_ADAPTIVE value: FALSE|TRUE
      Description: enable adaptive gains
    • name ADAPTIVE_MU value: 0.0001
      Description: adaptation parameter

Auto-loaded modules

The following modules are automatically loaded (just as if you had added them in the airframe file)

  • module__stabilizationrotorcraft

Module functions

Init Functions

These initialization functions are called once on startup.

Files

Header Files

The following headers are automatically included in modules.h

Source Files

  • /stabilization/stabilization_indi.c
  • /stabilization/stabilization_attitude_quat_indi.c
  • /stabilization/stabilization_attitude_quat_transformations.c
  • /stabilization/stabilization_attitude_rc_setpoint.c
  • /stabilization/wls/wls_alloc.c
  • math/qr_solve/qr_solve.c
  • math/qr_solve/r8lib_min.c

Raw stabilization_indi.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="stabilization_indi" dir="stabilization">
<doc>
<description>
Full INDI stabilization controller for rotorcraft
</description>
<configure name="INDI_OUTPUTS" default="4"/>
<configure name="INDI_NUM_ACT" default="4"/>
<section name="RC_SETPOINT" prefix="STABILIZATION_ATTITUDE_">
<define name="SP_MAX_PHI" value="45." description="max setpoint for roll angle" unit="deg"/>
<define name="SP_MAX_THETA" value="45." description="max setpoint for pitch angle" unit="deg"/>
<define name="SP_MAX_R" value="90." description="max setpoint for yaw rate" unit="deg/s"/>
<define name="DEADBAND_R" value="250" description="deadband on yaw rate input"/>
</section>
<section name="STABILIZATION_ATTITUDE_INDI" prefix="STABILIZATION_INDI_">
<define name="G1_ROLL" value="{20 , -20, -20 , 20 }" description="control effectiveness of every actuator on the roll axis"/>
<define name="G1_PITCH" value="{14 , 14, -14 , -14 }" description="control effectiveness of every actuator on the pitch axis"/>
<define name="G1_YAW" value="{-1, 1, -1, 1}" description="control effectiveness of every actuator on the yaw axis"/>
<define name="G1_THRUST" value="{-.4, -.4, -.4, -.4}" description="control effectiveness of every actuator on the thrust axis"/>
<define name="G2" value="{-60.0, 60.0, -60.0, 60.0}" description="control effectiveness of every actuator derivative on the yaw axis (important for propellers with strong torque changes)"/>
<define name="REF_ERR_P" value="600.0" description="reference acceleration"/>
<define name="REF_ERR_Q" value="600.0" description="reference acceleration"/>
<define name="REF_ERR_R" value="600.0" description="reference acceleration"/>
<define name="REF_RATE_P" value="28.0" description="reference acceleration"/>
<define name="REF_RATE_Q" value="28.0" description="reference acceleration"/>
<define name="REF_RATE_R" value="28.0" description="reference acceleration"/>
<define name="MAX_R" value="120.0" description="max yaw rate" unit="deg/s"/>
<define name="FILT_CUTOFF" value="8.0" description="second order cutoff parameter"/>
<define name="ESTIMATION_FILT_CUTOFF" value="8.0" description="second order cutoff parameter"/>
<define name="ACT_DYN" value="{0.1, 0.1, 0.1, 0.1}" description="actuator dynamics"/>
<define name="ACT_IS_SERVO" value="{0,0,0,0}" description="1 for every actuator that is a servo"/>
<define name="ACT_RATE_LIMIT" value="{9600,9600,9600,9600}" description="rate limit in PPRZ units per timestep (depends on control frequency)"/>
<define name="ACT_PREF" value="{0.0, 0.0, 0.0, 0.0}" description="preferred (low energy) actuator value. Important when the system is over-determined!"/>
<define name="USE_ADAPTIVE" value="FALSE|TRUE" description="enable adaptive gains"/>
<define name="ADAPTIVE_MU" value="0.0001" description="adaptation parameter"/>
</section>
</doc>
<settings>
<dl_settings>
<dl_settings NAME="indi">
<dl_setting var="reference_acceleration.err_p" min="0" step="1" max="2500" shortname="kp_p" param="STABILIZATION_INDI_REF_ERR_P"/>
<dl_setting var="reference_acceleration.rate_p" min="0" step="0.1" max="100" shortname="kd_p" param="STABILIZATION_INDI_REF_RATE_P"/>
<dl_setting var="reference_acceleration.err_q" min="0" step="1" max="2500" shortname="kp_q" param="STABILIZATION_INDI_REF_ERR_Q"/>
<dl_setting var="reference_acceleration.rate_q" min="0" step="0.1" max="100" shortname="kd_q" param="STABILIZATION_INDI_REF_RATE_P"/>
<dl_setting var="reference_acceleration.err_r" min="0" step="1" max="2500" shortname="kp_r" param="STABILIZATION_INDI_REF_ERR_R"/>
<dl_setting var="reference_acceleration.rate_r" min="0" step="0.1" max="100" shortname="kd_r" param="STABILIZATION_INDI_REF_RATE_P"/>
<dl_setting var="indi_use_adaptive" min="0" step="1" max="1" shortname="use_adaptive" values="FALSE|TRUE" param="STABILIZATION_INDI_USE_ADAPTIVE" type="uint8"/>
</dl_settings>
</dl_settings>
</settings>
<autoload name="stabilization" type="rotorcraft"/>
<header>
<file name="stabilization_indi.h"/>
</header>
<init fun="stabilization_indi_init()"/>
<makefile target="ap|nps" firmware="rotorcraft">
<file name="stabilization_indi.c" dir="$(SRC_FIRMWARE)/stabilization"/>
<file name="stabilization_attitude_quat_indi.c" dir="$(SRC_FIRMWARE)/stabilization"/>
<file name="stabilization_attitude_quat_transformations.c" dir="$(SRC_FIRMWARE)/stabilization"/>
<file name="stabilization_attitude_rc_setpoint.c" dir="$(SRC_FIRMWARE)/stabilization"/>
<file name="wls_alloc.c" dir="$(SRC_FIRMWARE)/stabilization/wls"/>
<file name="qr_solve.c" dir="math/qr_solve"/>
<file name="r8lib_min.c" dir="math/qr_solve"/>
<configure name="INDI_OUTPUTS" default="4"/>
<configure name="INDI_NUM_ACT" default="4"/>
<define name="INDI_OUTPUTS" value="$(INDI_OUTPUTS)"/>
<define name="INDI_NUM_ACT" value="$(INDI_NUM_ACT)"/>
<define name="CA_N_V" value="$(INDI_OUTPUTS)"/>
<define name="CA_N_U" value="$(INDI_NUM_ACT)"/>
<define name="STABILIZATION_ATTITUDE_TYPE_INT"/>
<define name="STABILIZATION_ATTITUDE_TYPE_H" value="stabilization/stabilization_attitude_quat_indi.h" type="string"/>
<define name="STABILIZATION_ATTITUDE_INDI_FULL" value="true"/>
</makefile>
</module>