Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
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!

<module name="stabilization_indi">
b'<define name="TILT_TWIST_CTRL" value="FALSE|TRUE" />\n\n '
b'<configure name="INDI_OUTPUTS" default="4" />\n '
b'<configure name="INDI_NUM_ACT" default="4" />\n\n '
</module>

Module configuration options

Configure Options

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

Define Options

  • name: TILT_TWIST_CTRL value: FALSE|TRUE
    Description: assume twist is slower than tilt and solve separately

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 ALLOCATION_PSEUDO_INVERSE value: FALSE|TRUE
      Description: Master setting: leave false for WLS allocation, and use TRUE if not overactuated and no WLS
    • 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: INDI gains linear controller
    • name REF_ERR_Q value: 600.0
      Description: INDI gains linear controller
    • name REF_ERR_R value: 600.0
      Description: INDI gains linear controller
    • name REF_RATE_P value: 28.0
      Description: INDI gains linear controller
    • name REF_RATE_Q value: 28.0
      Description: INDI gains linear controller
    • name REF_RATE_R value: 28.0
      Description: INDI gains linear controller
    • name MAX_R value: 120.0
      Description: max yaw rate
    • name FILT_CUTOFF value: 8.0
      Description: second order cutoff frequency for angular accelerations in Hz
    • name FILTER_RATES_SECOND_ORDER value: FALSE|TRUE
      Description: use second order rate filters instead of first order
    • name STABILIZATION_INDI_FILT_CUTOFF_P value: 20.0
      Description: First order cutoff freq for angular rate in Hz
    • name STABILIZATION_INDI_FILT_CUTOFF_Q value: 20.0
      Description: First order cutoff freq for angular rate in Hz
    • name STABILIZATION_INDI_FILT_CUTOFF_R value: 20.0
      Description: First order cutoff freq for angular rate in Hz
    • name ESTIMATION_FILT_CUTOFF value: 8.0
      Description: second order cutoff parameter
    • name ACT_FREQ value: {53.9, 53.9, 53.9, 53.9}
      Description: actuator dynamics [rad/s]
    • name ACT_IS_SERVO value: {0,0,0,0}
      Description: 1 for every actuator that is a servo
    • name ACT_IS_THRUSTER_X value: {0,0,0,0}
      Description: 1 for every actuator that is a thruster in the body-x direction
    • 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
    • name WLS_PRIORITIES value: {1000, 1000, 1, 100, 100}
      Description: WLS control objective priorities: roll, pitch, thrust, yaw, thrust_x
    • name WLS_WU value: {1, 1, 1, 1}
      Description: WLS actuator cost (size of INDI_NUM_ACT)
    • name RPM_FEEDBACK value: FALSE
      Description: enable RPM feedback
    • name ACT_FEEDBACK_ID value: ABI_BROADCAST
      Description: listening for RPM feedback on this ABI id

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

Raw stabilization_indi.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="stabilization_indi" dir="stabilization" task="control">
<doc>
<description>
Full INDI stabilization controller for rotorcraft
</description>
<configure name="INDI_OUTPUTS" default="4"/>
<configure name="INDI_NUM_ACT" default="4"/>
<define name="TILT_TWIST_CTRL" value="FALSE|TRUE" description="assume twist is slower than tilt and solve separately"/>
<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="ALLOCATION_PSEUDO_INVERSE" value="FALSE|TRUE" description="Master setting: leave false for WLS allocation, and use TRUE if not overactuated and no WLS"/>
<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="INDI gains linear controller"/>
<define name="REF_ERR_Q" value="600.0" description="INDI gains linear controller"/>
<define name="REF_ERR_R" value="600.0" description="INDI gains linear controller"/>
<define name="REF_RATE_P" value="28.0" description="INDI gains linear controller"/>
<define name="REF_RATE_Q" value="28.0" description="INDI gains linear controller"/>
<define name="REF_RATE_R" value="28.0" description="INDI gains linear controller"/>
<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 frequency for angular accelerations in Hz"/>
<define name="FILTER_RATES_SECOND_ORDER" value="FALSE|TRUE" description="use second order rate filters instead of first order"/>
<define name="STABILIZATION_INDI_FILT_CUTOFF_P" value="20.0" description="First order cutoff freq for angular rate in Hz"/>
<define name="STABILIZATION_INDI_FILT_CUTOFF_Q" value="20.0" description="First order cutoff freq for angular rate in Hz"/>
<define name="STABILIZATION_INDI_FILT_CUTOFF_R" value="20.0" description="First order cutoff freq for angular rate in Hz"/>
<define name="ESTIMATION_FILT_CUTOFF" value="8.0" description="second order cutoff parameter"/>
<define name="ACT_FREQ" value="{53.9, 53.9, 53.9, 53.9}" description="actuator dynamics [rad/s]"/>
<define name="ACT_IS_SERVO" value="{0,0,0,0}" description="1 for every actuator that is a servo"/>
<define name="ACT_IS_THRUSTER_X" value="{0,0,0,0}" description="1 for every actuator that is a thruster in the body-x direction"/>
<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"/>
<define name="WLS_PRIORITIES" value="{1000, 1000, 1, 100, 100}" description="WLS control objective priorities: roll, pitch, thrust, yaw, thrust_x"/>
<define name="WLS_WU" value="{1, 1, 1, 1}" description="WLS actuator cost (size of INDI_NUM_ACT)"/>
<define name="RPM_FEEDBACK" value="FALSE" description="enable RPM feedback"/>
<define name="ACT_FEEDBACK_ID" value="ABI_BROADCAST" description="listening for RPM feedback on this ABI id"/>
</section>
</doc>
<settings>
<dl_settings>
<dl_settings NAME="indi">
<dl_setting var="indi_gains.att.p" min="0" step="1" max="2500" shortname="kp_p" param="STABILIZATION_INDI_REF_ERR_P"/>
<dl_setting var="indi_gains.rate.p" min="0.1" step="0.1" max="100" shortname="kd_p" param="STABILIZATION_INDI_REF_RATE_P"/>
<dl_setting var="indi_gains.att.q" min="0" step="1" max="2500" shortname="kp_q" param="STABILIZATION_INDI_REF_ERR_Q"/>
<dl_setting var="indi_gains.rate.q" min="0.1" step="0.1" max="100" shortname="kd_q" param="STABILIZATION_INDI_REF_RATE_P"/>
<dl_setting var="indi_gains.att.r" min="0" step="1" max="2500" shortname="kp_r" param="STABILIZATION_INDI_REF_ERR_R"/>
<dl_setting var="indi_gains.rate.r" min="0.1" 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_setting var="stablization_indi_yaw_dist_limit" min="0" step=".01" max="10.0" shortname="lim_yaw_spec_moment" param="STABILIZATION_INDI_YAW_DISTURBANCE_LIMIT"/>
</dl_settings>
</dl_settings>
</settings>
<dep>
<depends>stabilization_rotorcraft,@attitude_command,wls</depends>
<provides>commands</provides>
</dep>
<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"/>
<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="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>