documentation and heli450 update

This commit is contained in:
Ewoud Smeur
2016-03-30 18:47:03 +02:00
parent 801c7eb76d
commit 4754f42dd4
2 changed files with 19 additions and 12 deletions
+8 -8
View File
@@ -37,10 +37,10 @@
<servos driver="Pwm">
<servo name="THROTTLE" no="0" min="1000" neutral="1000" max="2000"/>
<servo name="FRONT" no="1" min="2100" neutral="1500" max="900"/>
<servo name="RIGHTBACK" no="2" min="900" neutral="1500" max="2100"/>
<servo name="LEFTBACK" no="3" min="2100" neutral="1500" max="900"/>
<servo name="TAIL" no="4" min="1100" neutral="1450" max="1800"/>
<servo name="BACK" no="1" min="1050" neutral="1500" max="1950"/>
<servo name="LEFTFRONT" no="2" min="1050" neutral="1500" max="1950"/>
<servo name="RIGHTFRONT" no="3" min="1950" neutral="1500" max="1050"/>
<servo name="TAIL" no="4" min="1850" neutral="1600" max="1350"/>
</servos>
<commands>
@@ -61,7 +61,7 @@
<section name="MIXING" prefix="SW_MIXING_">
<!-- front left (CW), front right (CCW), back right (CW), back left (CCW) -->
<define name="TYPE" value="H120"/>
<define name="TYPE" value="HR120"/>
<define name="TRIM_ROLL" value="0"/>
<define name="TRIM_PITCH" value="0"/>
<define name="TRIM_COLL" value="0"/>
@@ -71,9 +71,9 @@
<call fun="throttle_curve_run(autopilot_motors_on, values)"/>
<call fun="swashplate_mixing_run(values)"/>
<set servo="THROTTLE" value="throttle_curve.throttle"/>
<set servo="FRONT" value="swashplate_mixing.commands[SW_FRONT]"/>
<set servo="RIGHTBACK" value="swashplate_mixing.commands[SW_RIGHTBACK]"/>
<set servo="LEFTBACK" value="swashplate_mixing.commands[SW_LEFTBACK]"/>
<set servo="BACK" value="swashplate_mixing.commands[SW_BACK]"/>
<set servo="LEFTFRONT" value="swashplate_mixing.commands[SW_LEFTFRONT]"/>
<set servo="RIGHTFRONT" value="swashplate_mixing.commands[SW_RIGHTFRONT]"/>
<set servo="TAIL" value="@YAW + throttle_curve.throttle*2800/7000"/>
</command_laws>
@@ -21,12 +21,13 @@
*/
/** @file stabilization_attitude_quat_indi.c
* MAVLab Delft University of Technology
* @brief MAVLab Delft University of Technology
* This control algorithm is Incremental Nonlinear Dynamic Inversion (INDI)
*
* This is a simplified implementation of the (soon to be) publication in the
* This is a simplified implementation of the publication in the
* journal of Control Guidance and Dynamics: Adaptive Incremental Nonlinear
* Dynamic Inversion for Attitude Control of Micro Aerial Vehicles
* http://arc.aiaa.org/doi/pdf/10.2514/1.G001490
*/
#include "firmwares/rotorcraft/stabilization/stabilization_indi.h"
@@ -43,6 +44,8 @@
#error You have to define the first order time constant of the actuator dynamics!
#endif
// these parameters are used in the filtering of the angular acceleration
// define them in the airframe file if different values are required
#ifndef STABILIZATION_INDI_FILT_OMEGA
#define STABILIZATION_INDI_FILT_OMEGA 50.0
#endif
@@ -51,6 +54,7 @@
#define STABILIZATION_INDI_FILT_ZETA 0.55
#endif
// the yaw sometimes requires more filtering
#ifndef STABILIZATION_INDI_FILT_OMEGA_R
#define STABILIZATION_INDI_FILT_OMEGA_R STABILIZATION_INDI_FILT_OMEGA
#endif
@@ -231,8 +235,8 @@ static inline void stabilization_indi_calc_cmd(int32_t indi_commands[], struct I
indi.angular_accel_ref.r = indi.reference_acceleration.rate_r * ((float)radio_control.values[RADIO_YAW] / MAX_PPRZ * indi.max_rate - body_rates->r);
}
//Incremented in angular acceleration requires increment in control input
//G1 is the actuator effectiveness. In the yaw axis, we need something additional: G2.
//Increment in angular acceleration requires increment in control input
//G1 is the control effectiveness. In the yaw axis, we need something additional: G2.
//It takes care of the angular acceleration caused by the change in rotation rate of the propellers
//(they have significant inertia, see the paper mentioned in the header for more explanation)
indi.du.p = 1.0 / indi.g1.p * (indi.angular_accel_ref.p - indi.rate.dx.p);
@@ -259,6 +263,8 @@ static inline void stabilization_indi_calc_cmd(int32_t indi_commands[], struct I
stabilization_indi_second_order_filter(&indi.u, &indi.u_act_dyn);
//Don't increment if thrust is off
//TODO: this should be something more elegant, but without this the inputs will increment to the maximum before
//even getting in the air.
if (stabilization_cmd[COMMAND_THRUST] < 300) {
FLOAT_RATES_ZERO(indi.du);
FLOAT_RATES_ZERO(indi.u_act_dyn);
@@ -267,6 +273,7 @@ static inline void stabilization_indi_calc_cmd(int32_t indi_commands[], struct I
FLOAT_RATES_ZERO(indi.u.dx);
FLOAT_RATES_ZERO(indi.u.ddx);
} else {
// only run the estimation if the commands are not zero.
lms_estimation();
}