Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
stabilization_indi_simple module

Simple INDI stabilization controller for rotorcraft

No detailed description...

Example for airframe file

Add to your firmware section:

<module name="stabilization_indi_simple"/>

Module configuration options

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: ATTITUDE_REFERENCE prefix: STABILIZATION_ATTITUDE_
    • name REF_OMEGA_P value: 400
      Description: reference generator omega param on roll rate
    • name REF_ZETA_P value: 0.9
      Description: reference generator zeta param on roll rate
    • name REF_MAX_P value: 300.
      Description: reference generator max roll rate
    • name REF_MAX_PDOT value: RadOfDeg(7000.)
      Description: reference generator max roll acceleration
    • name REF_OMEGA_Q value: 400
      Description: reference generator omega param on pitch rate
    • name REF_ZETA_Q value: 0.9
      Description: reference generator zeta param on pitch rate
    • name REF_MAX_Q value: 300.
      Description: reference generator max pitch rate
    • name REF_MAX_QDOT value: RadOfDeg(7000.)
      Description: reference generator max pitch acceleration
    • name REF_OMEGA_R value: 250
      Description: reference generator omega param on yaw rate
    • name REF_ZETA_R value: 0.9
      Description: reference generator zeta param on yaw rate
    • name REF_MAX_R value: 180.
      Description: reference generator max yaw rate
    • name REF_MAX_RDOT value: RadOfDeg(1800.)
      Description: reference generator max yaw acceleration
  • section name: STABILIZATION_ATTITUDE_INDI prefix: STABILIZATION_INDI_
    • name G1_P value: 0.0639
      Description: control effectiveness G1 gain on roll rate
    • name G1_Q value: 0.0361
      Description: control effectiveness G1 gain on pitch rate
    • name G1_R value: 0.0022
      Description: control effectiveness G1 gain on yaw rate
    • name G2_R value: 0.1450
      Description: control effectiveness G2 gain on yaw rate
    • name REF_ERR_P value: 600.0
      Description: linear gains for INDI reference
    • name REF_ERR_Q value: 600.0
      Description: linear gains for INDI reference
    • name REF_ERR_R value: 600.0
      Description: linear gains for INDI reference
    • name REF_RATE_P value: 28.0
      Description: linear gains for INDI reference
    • name REF_RATE_Q value: 28.0
      Description: linear gains for INDI reference
    • name REF_RATE_R value: 28.0
      Description: linear gains for INDI reference
    • name MAX_R value: 120.0
      Description: max yaw rate
    • name FILT_CUTOFF value: 8.0
      Description: second order filter cutoff frequency Hz
    • name FILT_CUTOFF_RDOT value: 8.0
      Description: second order filter cutoff frequency rdot Hz
    • name ESTIMATION_FILT_CUTOFF value: 8.0
      Description: second order cutoff parameter
    • name ACT_FREQ_P value: 53.9
      Description: first order actuator dynamics on roll rate [rad/s]
    • name ACT_FREQ_Q value: 53.9
      Description: first order actuator dynamics on pitch rate [rad/s]
    • name ACT_FREQ_R value: 53.9
      Description: first order actuator dynamics on yaw rate [rad/s]
    • name USE_ADAPTIVE value: FALSE|TRUE
      Description: enable adaptive gains
    • name ADAPTIVE_MU value: 0.0001
      Description: adaptation parameter
    • name FULL_AUTHORITY value: FALSE
      Description: Enable full control authority
    • name FILT_CUTOFF_P value: 30.0
      Description: First order filter P cutoff value
    • name FILT_CUTOFF_Q value: 30.0
      Description: First order filter Q cutoff value
    • name FILT_CUTOFF_R value: 30.0
      Description: First order filter R cutoff value

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_simple.c
  • /stabilization/stabilization_attitude_quat_indi.c

Raw stabilization_indi_simple.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="stabilization_indi_simple" dir="stabilization" task="control">
<doc>
<description>
Simple INDI stabilization controller for rotorcraft
</description>
<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="ATTITUDE_REFERENCE" prefix="STABILIZATION_ATTITUDE_">
<define name="REF_OMEGA_P" value="400" description="reference generator omega param on roll rate" unit="deg/s"/>
<define name="REF_ZETA_P" value="0.9" description="reference generator zeta param on roll rate"/>
<define name="REF_MAX_P" value="300." description="reference generator max roll rate" unit="deg/s"/>
<define name="REF_MAX_PDOT" value="RadOfDeg(7000.)" description="reference generator max roll acceleration"/>
<define name="REF_OMEGA_Q" value="400" description="reference generator omega param on pitch rate" unit="deg/s"/>
<define name="REF_ZETA_Q" value="0.9" description="reference generator zeta param on pitch rate"/>
<define name="REF_MAX_Q" value="300." description="reference generator max pitch rate" unit="deg/s"/>
<define name="REF_MAX_QDOT" value="RadOfDeg(7000.)" description="reference generator max pitch acceleration"/>
<define name="REF_OMEGA_R" value="250" description="reference generator omega param on yaw rate" unit="deg/s"/>
<define name="REF_ZETA_R" value="0.9" description="reference generator zeta param on yaw rate"/>
<define name="REF_MAX_R" value="180." description="reference generator max yaw rate" unit="deg/s"/>
<define name="REF_MAX_RDOT" value="RadOfDeg(1800.)" description="reference generator max yaw acceleration"/>
</section>
<section name="STABILIZATION_ATTITUDE_INDI" prefix="STABILIZATION_INDI_">
<define name="G1_P" value="0.0639" description="control effectiveness G1 gain on roll rate"/>
<define name="G1_Q" value="0.0361" description="control effectiveness G1 gain on pitch rate"/>
<define name="G1_R" value="0.0022" description="control effectiveness G1 gain on yaw rate"/>
<define name="G2_R" value="0.1450" description="control effectiveness G2 gain on yaw rate"/>
<define name="REF_ERR_P" value="600.0" description="linear gains for INDI reference"/>
<define name="REF_ERR_Q" value="600.0" description="linear gains for INDI reference"/>
<define name="REF_ERR_R" value="600.0" description="linear gains for INDI reference"/>
<define name="REF_RATE_P" value="28.0" description="linear gains for INDI reference"/>
<define name="REF_RATE_Q" value="28.0" description="linear gains for INDI reference"/>
<define name="REF_RATE_R" value="28.0" description="linear gains for INDI reference"/>
<define name="MAX_R" value="120.0" description="max yaw rate" unit="deg/s"/>
<define name="FILT_CUTOFF" value="8.0" description="second order filter cutoff frequency Hz"/>
<define name="FILT_CUTOFF_RDOT" value="8.0" description="second order filter cutoff frequency rdot Hz"/>
<define name="ESTIMATION_FILT_CUTOFF" value="8.0" description="second order cutoff parameter"/>
<define name="ACT_FREQ_P" value="53.9" description="first order actuator dynamics on roll rate [rad/s]"/>
<define name="ACT_FREQ_Q" value="53.9" description="first order actuator dynamics on pitch rate [rad/s]"/>
<define name="ACT_FREQ_R" value="53.9" description="first order actuator dynamics on yaw rate [rad/s]"/>
<define name="USE_ADAPTIVE" value="FALSE|TRUE" description="enable adaptive gains"/>
<define name="ADAPTIVE_MU" value="0.0001" description="adaptation parameter"/>
<define name="FULL_AUTHORITY" value="FALSE" description="Enable full control authority"/>
<define name="FILT_CUTOFF_P" value="30.0" description="First order filter P cutoff value"/>
<define name="FILT_CUTOFF_Q" value="30.0" description="First order filter Q cutoff value"/>
<define name="FILT_CUTOFF_R" value="30.0" description="First order filter R cutoff value"/>
</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" persistent="true" module="stabilization/stabilization_indi_simple"/>
<dl_setting var="indi.gains.rate.p" min="0" step="0.1" max="100" shortname="kd_p" param="STABILIZATION_INDI_REF_RATE_P" persistent="true"/>
<dl_setting var="indi.g1.p" min="0.001" step="0.001" max="10" shortname="ctl_eff_p" param="STABILIZATION_INDI_G1_P" persistent="true"/>
<dl_setting var="indi.gains.att.q" min="0" step="1" max="2500" shortname="kp_q" param="STABILIZATION_INDI_REF_ERR_Q" persistent="true"/>
<dl_setting var="indi.gains.rate.q" min="0" step="0.1" max="100" shortname="kd_q" param="STABILIZATION_INDI_REF_RATE_P" persistent="true"/>
<dl_setting var="indi.g1.q" min="0.001" step="0.001" max="10" shortname="ctl_eff_q" param="STABILIZATION_INDI_G1_Q" persistent="true"/>
<dl_setting var="indi.gains.att.r" min="0" step="1" max="2500" shortname="kp_r" param="STABILIZATION_INDI_REF_ERR_R" persistent="true"/>
<dl_setting var="indi.gains.rate.r" min="0" step="0.1" max="100" shortname="kd_r" param="STABILIZATION_INDI_REF_RATE_P" persistent="true"/>
<dl_setting var="indi.g1.r" min="0.0001" step="0.0001" max="10" shortname="ctl_eff_r" param="STABILIZATION_INDI_G1_R" persistent="true"/>
<dl_setting var="indi.g2" min="0" step="0.01" max="10" shortname="g2" param="STABILIZATION_INDI_G2_R" persistent="true"/>
<dl_setting var="indi.adaptive" min="0" step="1" max="1" shortname="use_adaptive" values="FALSE|TRUE" param="STABILIZATION_INDI_USE_ADAPTIVE" type="uint8" persistent="true"/>
<dl_setting var="indi.max_rate" min="0" step="0.01" max="400.0" shortname="max_rate" param="STABILIZATION_INDI_MAX_RATE" unit="rad/s" alt_unit="deg/s"/>
<dl_setting var="indi.attitude_max_yaw_rate" min="0" step="0.01" max="400.0" shortname="max_yaw_rate_attitude" param="STABILIZATION_INDI_MAX_R" unit="rad/s" alt_unit="deg/s"/>
<dl_setting var="indi.cutoff_r" min="0.2" step="0.1" max="30.0" shortname="r_cutoff_hz" handler="reset_r_filter_cutoff" type="float" module="stabilization/stabilization_indi_simple"/>
</dl_settings>
</dl_settings>
</settings>
<dep>
<depends>stabilization_rotorcraft,@attitude_command</depends>
<provides>commands</provides>
</dep>
<header>
<file name="stabilization_indi_simple.h"/>
</header>
<init fun="stabilization_indi_init()"/>
<makefile target="ap|nps" firmware="rotorcraft">
<file name="stabilization_indi_simple.c" dir="$(SRC_FIRMWARE)/stabilization"/>
<file name="stabilization_attitude_quat_indi.c" dir="$(SRC_FIRMWARE)/stabilization"/>
<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_SIMPLE" value="true"/>
</makefile>
</module>