Skip to content

Commit

Permalink
Oneloop Controller updates (#3405)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmldeponti authored Nov 1, 2024
1 parent 1f08f63 commit 67edd8a
Show file tree
Hide file tree
Showing 21 changed files with 1,392 additions and 250 deletions.
21 changes: 19 additions & 2 deletions conf/airframes/AG/rot_wing_v3c_oneloop_optitrack_ext_pose_AG.xml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,24 @@
<set VALUE="($th_hold? -9600 : commands[COMMAND_MOTOR_LEFT] )" SERVO="BMOTOR_LEFT"/>
<set VALUE="commands[COMMAND_ROT_MECH]" SERVO="BROTATION_MECH"/>
</command_laws>
<section name="ROTWING" prefix="ROTWING_">
<define name="FW_MIN_AIRSPEED" value="17.0"/> <!-- Forward stall airspeed + margin (motors off) -->
<define name="FW_QUAD_MIN_AIRSPEED" value="15.0"/> <!-- Forward stall airspeed + margin with quad motors on -->
<define name="FW_CRUISE_AIRSPEED" value="19.0"/> <!-- Default cruise airspeed -->
<define name="FW_MAX_AIRSPEED" value="22.0"/> <!-- Maximum forward airspeed -->
<define name="FW_MAX_DECELERATION" value="0.75"/> <!-- Maximum horizontal deceleration in fixed wing mode -->
<define name="QUAD_NOPUSH_AIRSPEED" value="5.0"/> <!-- Maximum quadrotor without pusher motor airspeed -->
<define name="QUAD_MAX_AIRSPEED" value="12.0"/> <!-- Maximum quadrotor airspeed (with pusher motor)-->
<define name="QUAD_MAX_DECELERATION" value="0.75"/> <!-- Maximum horizontal deceleration in quad mode -->
<define name="SKEW_UP_AIRSPEED" value="10.0"/> <!-- Airspeed where the skewing starts when going up in airspeed -->
<define name="SKEW_DOWN_AIRSPEED" value="8.0"/> <!-- Airspeed where the skewing starts when going down in airspeed -->

<define name="SKEW_REF_MODEL" value="TRUE"/> <!-- Enable second order reference model for the skewing command -->
<define name="SKEW_REF_MODEL_P_GAIN" value="0.001"/> <!-- Skewing reference model proportional gain -->
<define name="SKEW_REF_MODEL_D_GAIN" value="0.003"/> <!-- Skewing reference model differential gain -->
<define name="SKEW_REF_MODEL_MAX_SPEED" value="20"/> <!-- Maximum rotational skewing speed bound for the reference model -->
<define name="FW_SKEW_ANGLE" value="85"/>
</section>
<section NAME="MISC">
<!-- Voltage and current measurements -->
<define name="VoltageOfAdc(adc)" value="((3.3f/65536.0f) * 11.98389 * adc)"/>
Expand Down Expand Up @@ -280,8 +297,8 @@
<!-- | MF | MR | MB | ML | MP | ELE | RUD | AIL | FLA | PHI | THETA | -->
<define name = "ACT_DYN" value = "{ 22.0f, 22.0f, 22.0f, 22.0f, 30.0f, 50.00f, 50.00f, 50.00f, 50.00f, 0.00f, 0.00f }" />
<define name = "ACT_IS_SERVO" value = "{ 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0 }" />
<define name = "ACT_MAX" value = "{ 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, M_PI_4, M_PI_4}"/>
<define name = "ACT_MIN" value = "{ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -9600.0f, -9600.0f, -9600.0f, -M_PI_4, -M_PI_4}"/>
<define name = "ACT_MAX" value = "{ 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, M_PI_4, M_PI_6}"/>
<define name = "ACT_MIN" value = "{ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -9600.0f, -9600.0f, -9600.0f, -M_PI_4, -M_PI_6}"/>
<define name = "ACT_MAX_NORM" value = "{ 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}"/>
<define name = "ACT_MIN_NORM" value = "{ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f}"/>
<define name = "WU" value = "{ 0.75f, 0.75f, 0.75f, 0.75f, 1.00f, 6.0f, 6.0f, 6.0f, 6.0f, 1.20f, 1.20f}"/>
Expand Down
21 changes: 19 additions & 2 deletions conf/airframes/tudelft/rotwing_v3c_oneloop.xml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,24 @@
<set VALUE="($th_hold? -9600 : commands[COMMAND_MOTOR_BACK] )" SERVO="BMOTOR_BACK"/>
<set VALUE="($th_hold? -9600 : commands[COMMAND_MOTOR_LEFT] )" SERVO="BMOTOR_LEFT"/>
</command_laws>
<section name="ROTWING" prefix="ROTWING_">
<define name="FW_MIN_AIRSPEED" value="17.0"/> <!-- Forward stall airspeed + margin (motors off) -->
<define name="FW_QUAD_MIN_AIRSPEED" value="15.0"/> <!-- Forward stall airspeed + margin with quad motors on -->
<define name="FW_CRUISE_AIRSPEED" value="19.0"/> <!-- Default cruise airspeed -->
<define name="FW_MAX_AIRSPEED" value="22.0"/> <!-- Maximum forward airspeed -->
<define name="FW_MAX_DECELERATION" value="0.75"/> <!-- Maximum horizontal deceleration in fixed wing mode -->
<define name="QUAD_NOPUSH_AIRSPEED" value="5.0"/> <!-- Maximum quadrotor without pusher motor airspeed -->
<define name="QUAD_MAX_AIRSPEED" value="12.0"/> <!-- Maximum quadrotor airspeed (with pusher motor)-->
<define name="QUAD_MAX_DECELERATION" value="0.75"/> <!-- Maximum horizontal deceleration in quad mode -->
<define name="SKEW_UP_AIRSPEED" value="10.0"/> <!-- Airspeed where the skewing starts when going up in airspeed -->
<define name="SKEW_DOWN_AIRSPEED" value="8.0"/> <!-- Airspeed where the skewing starts when going down in airspeed -->

<define name="SKEW_REF_MODEL" value="TRUE"/> <!-- Enable second order reference model for the skewing command -->
<define name="SKEW_REF_MODEL_P_GAIN" value="0.001"/> <!-- Skewing reference model proportional gain -->
<define name="SKEW_REF_MODEL_D_GAIN" value="0.003"/> <!-- Skewing reference model differential gain -->
<define name="SKEW_REF_MODEL_MAX_SPEED" value="20"/> <!-- Maximum rotational skewing speed bound for the reference model -->
<define name="FW_SKEW_ANGLE" value="85"/>
</section>
<section NAME="MISC">
<!-- Voltage and current measurements -->
<define name="VoltageOfAdc(adc)" value="((3.3f/65536.0f) * 11.98389 * adc)"/>
Expand Down Expand Up @@ -286,8 +303,8 @@
<!-- | MF | MR | MB | ML | MP | ELE | RUD | AIL | FLA | PHI | THETA | -->
<define name = "ACT_DYN" value = "{ 22.0f, 22.0f, 22.0f, 22.0f, 30.0f, 50.00f, 50.00f, 50.00f, 50.00f, 0.00f, 0.00f }" />
<define name = "ACT_IS_SERVO" value = "{ 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0 }" />
<define name = "ACT_MAX" value = "{ 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, M_PI_4, M_PI_4}"/>
<define name = "ACT_MIN" value = "{ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -9600.0f, -9600.0f, -9600.0f, -M_PI_4, -M_PI_4}"/>
<define name = "ACT_MAX" value = "{ 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, M_PI_4, M_PI_6}"/>
<define name = "ACT_MIN" value = "{ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -9600.0f, -9600.0f, -9600.0f, -M_PI_4, -M_PI_6}"/>
<define name = "ACT_MAX_NORM" value = "{ 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}"/>
<define name = "ACT_MIN_NORM" value = "{ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f}"/>
<define name = "WU" value = "{ 0.75f, 0.75f, 0.75f, 0.75f, 1.00f, 6.0f, 6.0f, 6.0f, 6.0f, 1.20f, 1.20f}"/>
Expand Down
24 changes: 21 additions & 3 deletions conf/airframes/tudelft/rotwing_v3c_oneloop_optitrack.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
<!-- Log in high speed (Remove for outdoor flights) -->
<!-- <define name="IMU_LOG_HIGHSPEED" value="TRUE"/> -->
<define name="I2C2_CLOCK_SPEED" value="100000"/>

<define name="INS_EXT_VISION_ROTATION" value="TRUE"/><!--AP only-->
</target>

Expand Down Expand Up @@ -223,7 +222,24 @@
<set VALUE="($th_hold? -9600 : commands[COMMAND_MOTOR_BACK] )" SERVO="BMOTOR_BACK"/>
<set VALUE="($th_hold? -9600 : commands[COMMAND_MOTOR_LEFT] )" SERVO="BMOTOR_LEFT"/>
</command_laws>
<section name="ROTWING" prefix="ROTWING_">
<define name="FW_MIN_AIRSPEED" value="17.0"/> <!-- Forward stall airspeed + margin (motors off) -->
<define name="FW_QUAD_MIN_AIRSPEED" value="15.0"/> <!-- Forward stall airspeed + margin with quad motors on -->
<define name="FW_CRUISE_AIRSPEED" value="19.0"/> <!-- Default cruise airspeed -->
<define name="FW_MAX_AIRSPEED" value="22.0"/> <!-- Maximum forward airspeed -->
<define name="FW_MAX_DECELERATION" value="0.75"/> <!-- Maximum horizontal deceleration in fixed wing mode -->
<define name="QUAD_NOPUSH_AIRSPEED" value="5.0"/> <!-- Maximum quadrotor without pusher motor airspeed -->
<define name="QUAD_MAX_AIRSPEED" value="12.0"/> <!-- Maximum quadrotor airspeed (with pusher motor)-->
<define name="QUAD_MAX_DECELERATION" value="0.75"/> <!-- Maximum horizontal deceleration in quad mode -->
<define name="SKEW_UP_AIRSPEED" value="10.0"/> <!-- Airspeed where the skewing starts when going up in airspeed -->
<define name="SKEW_DOWN_AIRSPEED" value="8.0"/> <!-- Airspeed where the skewing starts when going down in airspeed -->

<define name="SKEW_REF_MODEL" value="TRUE"/> <!-- Enable second order reference model for the skewing command -->
<define name="SKEW_REF_MODEL_P_GAIN" value="0.001"/> <!-- Skewing reference model proportional gain -->
<define name="SKEW_REF_MODEL_D_GAIN" value="0.003"/> <!-- Skewing reference model differential gain -->
<define name="SKEW_REF_MODEL_MAX_SPEED" value="20"/> <!-- Maximum rotational skewing speed bound for the reference model -->
<define name="FW_SKEW_ANGLE" value="85"/>
</section>
<section NAME="MISC">
<!-- Voltage and current measurements -->
<define name="VoltageOfAdc(adc)" value="((3.3f/65536.0f) * 11.98389 * adc)"/>
Expand Down Expand Up @@ -275,6 +291,8 @@
</section>

<section PREFIX="ONELOOP_ANDI_" NAME="ONELOOP_ANDI">
<define name = "POLES_POS_OMEGA_N" value = "2.2"/>
<define name = "POLES_ALT_OMEGA_N" value = "2.2"/>
<define name = "HEADING_MANUAL" value = "TRUE"/>
<define name = "YAW_STICK_IN_AUTO" value = "TRUE"/>
<define name = "MAX_R" value = "120.0" unit="deg/s"/>
Expand All @@ -291,8 +309,8 @@
<!-- | MF | MR | MB | ML | MP | ELE | RUD | AIL | FLA | PHI | THETA | -->
<define name = "ACT_DYN" value = "{ 22.0f, 22.0f, 22.0f, 22.0f, 30.0f, 50.00f, 50.00f, 50.00f, 50.00f, 0.00f, 0.00f }" />
<define name = "ACT_IS_SERVO" value = "{ 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0 }" />
<define name = "ACT_MAX" value = "{ 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, M_PI_4, M_PI_4}"/>
<define name = "ACT_MIN" value = "{ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -9600.0f, -9600.0f, -9600.0f, -M_PI_4, -M_PI_4}"/>
<define name = "ACT_MAX" value = "{ 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, M_PI_4, M_PI_6}"/>
<define name = "ACT_MIN" value = "{ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -9600.0f, -9600.0f, -9600.0f, -M_PI_4, -M_PI_6}"/>
<define name = "ACT_MAX_NORM" value = "{ 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}"/>
<define name = "ACT_MIN_NORM" value = "{ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f}"/>
<define name = "WU" value = "{ 0.75f, 0.75f, 0.75f, 0.75f, 1.00f, 6.0f, 6.0f, 6.0f, 6.0f, 1.20f, 1.20f}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<!-- Log in high speed (Remove for outdoor flights) -->
<!-- <define name="IMU_LOG_HIGHSPEED" value="TRUE"/> -->
<define name="I2C2_CLOCK_SPEED" value="100000"/>
<define name="INS_EXT_VISION_ROTATION" value="TRUE"/><!--AP only-->
</target>

<target name="nps" board="pc">
Expand Down Expand Up @@ -252,7 +253,6 @@
<define name="STABILIZATION_ATTITUDE_SP_MAX_R" value="90." unit="deg/s"/>
<define name="STABILIZATION_ATTITUDE_DEADBAND_R" value="200" />
<define name="FWD_SIDESLIP_GAIN" value="0.25"/> <!-- cyfoam 0.32-->
<define name="INS_EXT_VISION_ROTATION" value="TRUE"/>
</section>
<section name="GROUND_DETECT">
<define name="THRESHOLD_GROUND_DETECT" value="40"/>
Expand Down
4 changes: 2 additions & 2 deletions conf/airframes/tudelft/rotwing_v3c_oneloop_simulation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@
<!-- | MF | MR | MB | ML | MP | ELE | RUD | AIL | FLA | PHI | THETA | -->
<define name = "ACT_DYN" value = "{ 22.0f, 22.0f, 22.0f, 22.0f, 30.0f, 50.00f, 50.00f, 50.00f, 50.00f, 0.00f, 0.00f }" />
<define name = "ACT_IS_SERVO" value = "{ 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0 }" />
<define name = "ACT_MAX" value = "{ 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, M_PI_4, M_PI_4}"/>
<define name = "ACT_MIN" value = "{ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -9600.0f, -9600.0f, -9600.0f, -M_PI_4, -M_PI_4}"/>
<define name = "ACT_MAX" value = "{ 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, 9600.0f, M_PI_4, M_PI_6}"/>
<define name = "ACT_MIN" value = "{ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -9600.0f, -9600.0f, -9600.0f, -M_PI_4, -M_PI_6}"/>
<define name = "ACT_MAX_NORM" value = "{ 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}"/>
<define name = "ACT_MIN_NORM" value = "{ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f}"/>
<define name = "WU" value = "{ 0.75f, 0.75f, 0.75f, 0.75f, 1.00f, 6.0f, 6.0f, 6.0f, 6.0f, 1.20f, 1.20f}"/>
Expand Down
Loading

0 comments on commit 67edd8a

Please sign in to comment.