Difference between revisions of "Working with INDI"

From PaparazziUAV
Jump to: navigation, search
(Actuator Dynamics)
Line 1: Line 1:
 +
== Example Airframe Section ==
 +
 +
To use INDI for your drone, you have to specify:
 +
    <module name="stabilization" type="indi"/>
 +
or
 +
    <module name="stabilization" type="rate_indi"/>
 +
if you want to fly manual rate control.
 +
 +
Below you can see an example of how INDI can be configured in the airframe file:
 +
{{Box Code|conf/airframes/myplane.xml|
 +
<source lang="xml">
 +
  <section name="STABILIZATION_ATTITUDE_INDI" prefix="STABILIZATION_INDI_">
 +
    <!-- control effectiveness -->
 +
    <define name="G1_P" value="0.0639"/>
 +
    <define name="G1_Q" value="0.0361"/>
 +
    <define name="G1_R" value="0.0022"/>
 +
    <define name="G2_R" value="0.1450"/>
 +
 +
    <!-- reference acceleration for attitude control -->
 +
    <define name="REF_ERR_P" value="600.0"/>
 +
    <define name="REF_ERR_Q" value="600.0"/>
 +
    <define name="REF_ERR_R" value="600.0"/>
 +
    <define name="REF_RATE_P" value="28.0"/>
 +
    <define name="REF_RATE_Q" value="28.0"/>
 +
    <define name="REF_RATE_R" value="28.0"/>
 +
 +
    <!--Maxium yaw rate, to avoid instability-->
 +
    <define name="MAX_R" value="120.0" unit="deg/s"/>
 +
 +
    <!-- second order filter parameters -->
 +
    <define name="FILT_OMEGA" value="50.0"/>
 +
    <define name="FILT_ZETA" value="0.55"/>
 +
    <define name="FILT_OMEGA_R" value="50.0"/>
 +
    <define name="FILT_ZETA_R" value="0.55"/>
 +
 +
    <!-- first order actuator dynamics -->
 +
    <define name="ACT_DYN_P" value="0.1"/>
 +
    <define name="ACT_DYN_Q" value="0.1"/>
 +
    <define name="ACT_DYN_R" value="0.1"/>
 +
 +
    <!-- Adaptive Learning Rate -->
 +
    <define name="USE_ADAPTIVE" value="FALSE"/>
 +
    <define name="ADAPTIVE_MU" value="0.0001"/>
 +
  </section>
 +
</source>
 +
}}
 +
 +
 
== Actuator Dynamics ==
 
== Actuator Dynamics ==
  

Revision as of 00:38, 8 June 2016

Example Airframe Section

To use INDI for your drone, you have to specify:

   <module name="stabilization" type="indi"/>

or

   <module name="stabilization" type="rate_indi"/>

if you want to fly manual rate control.

Below you can see an example of how INDI can be configured in the airframe file:

File: conf/airframes/myplane.xml
  <section name="STABILIZATION_ATTITUDE_INDI" prefix="STABILIZATION_INDI_">
    <!-- control effectiveness -->
    <define name="G1_P" value="0.0639"/>
    <define name="G1_Q" value="0.0361"/>
    <define name="G1_R" value="0.0022"/>
    <define name="G2_R" value="0.1450"/>

    <!-- reference acceleration for attitude control -->
    <define name="REF_ERR_P" value="600.0"/>
    <define name="REF_ERR_Q" value="600.0"/>
    <define name="REF_ERR_R" value="600.0"/>
    <define name="REF_RATE_P" value="28.0"/>
    <define name="REF_RATE_Q" value="28.0"/>
    <define name="REF_RATE_R" value="28.0"/>

    <!--Maxium yaw rate, to avoid instability-->
    <define name="MAX_R" value="120.0" unit="deg/s"/>

    <!-- second order filter parameters -->
    <define name="FILT_OMEGA" value="50.0"/>
    <define name="FILT_ZETA" value="0.55"/>
    <define name="FILT_OMEGA_R" value="50.0"/>
    <define name="FILT_ZETA_R" value="0.55"/>

    <!-- first order actuator dynamics -->
    <define name="ACT_DYN_P" value="0.1"/>
    <define name="ACT_DYN_Q" value="0.1"/>
    <define name="ACT_DYN_R" value="0.1"/>

    <!-- Adaptive Learning Rate -->
    <define name="USE_ADAPTIVE" value="FALSE"/>
    <define name="ADAPTIVE_MU" value="0.0001"/>
  </section>


Actuator Dynamics

Actuators don't react instantly. Motors need time to spin up, and servos can only move so many degrees per second. This means that if the input is suddenly changed, the angular acceleration is not immediately expected to change. If there is actuator feedback available, we know exactly how much the actuator has moved and at what moment how much angular acceleration we should expect. If actuator feedback is not available, an estimate of the actuator position has to be made.

For electric motors, a first order system can be an accurate model. This can be written as: act(i+1) = act(i) + alpha*(input - act(i)), where alpha is the value that can be specified in the airframe file. There are a few vehicles for which this value has been determined, such as the ARDrone, Bebop and AscTec Hummingbird. It can be obtained with a step response of the motors, using for instance a logic analyzer and a light sensor to record the spinup profile.

Control Effectiveness

The control effectiveness is what relates inputs to the actuators to angular accelerations. These values are not meant to be tuned. They can be obtained from flight logs, or by using the adaptive algorithm.