mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-05 15:30:08 +08:00
Single Tuning File for all IMU Fixedwings
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
<!DOCTYPE airframe SYSTEM "airframe.dtd">
|
<!DOCTYPE airframe SYSTEM "airframe.dtd">
|
||||||
|
|
||||||
<!-- Reely Condor
|
<!--
|
||||||
|
Use settings/tuning_ins.xml
|
||||||
|
Use telemetry/default_fixedwing_imu.xml
|
||||||
|
|
||||||
|
Reely Condor
|
||||||
TWOG v1.0 Board (http://paparazzi.enac.fr/wiki/TWOG)
|
TWOG v1.0 Board (http://paparazzi.enac.fr/wiki/TWOG)
|
||||||
Sparkfun Razor IMU with Premerlani Code
|
Sparkfun Razor IMU with Premerlani Code
|
||||||
wi.232 Radiomodems
|
wi.232 Radiomodems
|
||||||
@@ -95,9 +99,9 @@
|
|||||||
|
|
||||||
<!-- settings for the Analog IMU -->
|
<!-- settings for the Analog IMU -->
|
||||||
|
|
||||||
<section name="IMU" prefix="IMU_">
|
<section name="INS" prefix="INS_">
|
||||||
<define name="ROLL_NEUTRAL_DEFAULT" value="0" unit="deg"/>
|
<define name="ROLL_NEUTRAL_DEFAULT" value="RadOfDeg(0)" unit="deg"/>
|
||||||
<define name="PITCH_NEUTRAL_DEFAULT" value="0" unit="deg"/>
|
<define name="PITCH_NEUTRAL_DEFAULT" value="RadOfDeg(0)" unit="deg"/>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- 3S LiPo with 1050mAh, connected to an 20A ESC -->
|
<!-- 3S LiPo with 1050mAh, connected to an 20A ESC -->
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
# attitude estimation for fixedwings via dcm algorithm
|
# attitude estimation for fixedwings via dcm algorithm
|
||||||
|
|
||||||
|
|
||||||
|
$(TARGET).CFLAGS += -DAHRS_TYPE_H=\"subsystems/ahrs/ahrs_float_dcm.h\"
|
||||||
|
|
||||||
ifeq ($(ARCH), lpc21)
|
ifeq ($(ARCH), lpc21)
|
||||||
|
|
||||||
ap.CFLAGS += -DUSE_ANALOG_IMU
|
ap.CFLAGS += -DUSE_ANALOG_IMU
|
||||||
|
|
||||||
ap.srcs += $(SRC_SUBSYSTEMS)/ahrs.c
|
ap.srcs += $(SRC_SUBSYSTEMS)/ahrs.c
|
||||||
@@ -21,7 +24,7 @@ sim.CFLAGS += -DUSE_INFRARED
|
|||||||
sim.srcs += subsystems/sensors/infrared.c
|
sim.srcs += subsystems/sensors/infrared.c
|
||||||
|
|
||||||
sim.srcs += $(SRC_ARCH)/sim_ir.c
|
sim.srcs += $(SRC_ARCH)/sim_ir.c
|
||||||
sim.srcs += $(SRC_ARCH)/sim_analogimu.c
|
sim.srcs += $(SRC_ARCH)/sim_imu.c
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -80,6 +80,16 @@
|
|||||||
settings="settings/basic.xml"
|
settings="settings/basic.xml"
|
||||||
gui_color="#6293ba"
|
gui_color="#6293ba"
|
||||||
/>
|
/>
|
||||||
|
<aircraft
|
||||||
|
name="Tiny_IMU"
|
||||||
|
ac_id="7"
|
||||||
|
airframe="airframes/example_twog_analogimu.xml"
|
||||||
|
radio="radios/cockpitSX.xml"
|
||||||
|
telemetry="telemetry/default_fixedwing_imu.xml"
|
||||||
|
flight_plan="flight_plans/versatile.xml"
|
||||||
|
settings="settings/tuning_ins.xml"
|
||||||
|
gui_color="blue"
|
||||||
|
/>
|
||||||
|
|
||||||
<aircraft
|
<aircraft
|
||||||
name="Twinjet"
|
name="Twinjet"
|
||||||
|
|||||||
@@ -1,100 +0,0 @@
|
|||||||
<!DOCTYPE settings SYSTEM "settings.dtd">
|
|
||||||
|
|
||||||
<!-- A conf to use to tune a new A/C -->
|
|
||||||
|
|
||||||
<settings>
|
|
||||||
<dl_settings>
|
|
||||||
<dl_settings NAME="flight params">
|
|
||||||
<dl_setting MAX="1000" MIN="0" STEP="10" VAR="flight_altitude" shortname="altitude"/>
|
|
||||||
<dl_setting MAX="10" MIN="-10" STEP="0.5" VAR="wind_east"/>
|
|
||||||
<dl_setting MAX="10" MIN="-10" STEP="0.5" VAR="wind_north"/>
|
|
||||||
</dl_settings>
|
|
||||||
|
|
||||||
<dl_settings NAME="mode">
|
|
||||||
<dl_setting MAX="2" MIN="0" STEP="1" VAR="pprz_mode" module="autopilot"/>
|
|
||||||
<dl_setting MAX="1" MIN="0" STEP="1" VAR="alt_kalman_enabled" shortname="alt_kalman" module="estimator"/>
|
|
||||||
<dl_setting MAX="0" MIN="0" STEP="1" VAR="estimator_flight_time" shortname="flight time"/>
|
|
||||||
<dl_setting MAX="1000" MIN="0" STEP="1" VAR="stage_time"/>
|
|
||||||
<dl_setting MAX="1" MIN="0" STEP="1" VAR="launch"/>
|
|
||||||
<dl_setting MAX="1" MIN="0" STEP="1" VAR="kill_throttle"/>
|
|
||||||
<dl_setting MAX="2" MIN="0" STEP="1" VAR="telemetry_mode_Ap_DefaultChannel" shortname="tele_AP" module="downlink"/>
|
|
||||||
<dl_setting MAX="1" MIN="0" STEP="1" VAR="telemetry_mode_Fbw_DefaultChannel" shortname="tele_FBW" module="downlink"/>
|
|
||||||
<dl_setting MAX="2" MIN="0" STEP="1" VAR="gps_reset" module="gps_ubx" handler="Reset" shortname="GPS reset"/>
|
|
||||||
|
|
||||||
<dl_setting MAX="200" MIN="-200" STEP="10" VAR="nav_radius" module="subsystems/nav" handler="SetNavRadius">
|
|
||||||
<strip_button icon="circle-right.png" name="Circle right" value="1"/>
|
|
||||||
<strip_button icon="circle-left.png" name="Circle left" value="-1"/>
|
|
||||||
<key_press key="greater" value="1"/>
|
|
||||||
<key_press key="less" value="-1"/>
|
|
||||||
</dl_setting>
|
|
||||||
</dl_settings>
|
|
||||||
|
|
||||||
<dl_settings NAME="control">
|
|
||||||
|
|
||||||
<dl_settings NAME="IMU">
|
|
||||||
<dl_setting MAX="45" MIN="-45" STEP="0.1" VAR="imu_roll_neutral" shortname="roll neutral" module="subsystems/ahrs/ahrs_float_dcm" param="IMU_NEUTRAL_DEFAULT" unit="rad" alt_unit="deg" alt_unit_coef="57.3"/>
|
|
||||||
<dl_setting MAX="45" MIN="-45" STEP="0.1" VAR="imu_pitch_neutral" shortname="pitch neutral" module="subsystems/ahrs/ahrs_float_dcm" param="IMU_NEUTRAL_DEFAULT" unit="rad" alt_unit="deg" alt_unit_coef="57.3"/>
|
|
||||||
</dl_settings>
|
|
||||||
|
|
||||||
|
|
||||||
<dl_settings NAME="attitude">
|
|
||||||
<dl_setting MAX="25000" MIN="000" STEP="250" VAR="h_ctl_roll_pgain" shortname="roll_pgain" module="stabilization/stabilization_attitude"/>
|
|
||||||
<dl_setting MAX="1" MIN="0" STEP="0.05" VAR="h_ctl_roll_max_setpoint" shortname="max_roll" param="H_CTL_ROLL_MAX_SETPOINT"/>
|
|
||||||
<dl_setting MAX="000" MIN="-25000" STEP="250" VAR="h_ctl_pitch_pgain" shortname="pitch_pgain" param="H_CTL_PITCH_PGAIN"/>
|
|
||||||
<dl_setting MAX="0" MIN="-50000" STEP="10" VAR="h_ctl_pitch_dgain" shortname="pitch_dgain" param="H_CTL_PITCH_DGAIN"/>
|
|
||||||
<dl_setting MAX="5000" MIN="0" STEP="100" VAR="h_ctl_elevator_of_roll" shortname="elevator_of_roll" param="H_CTL_ELEVATOR_OF_ROLL"/>
|
|
||||||
<dl_setting MAX="5000" MIN="0" STEP="100" VAR="h_ctl_aileron_of_throttle" shortname="aileron_of_throttle"/>
|
|
||||||
|
|
||||||
|
|
||||||
<dl_setting MAX="0" MIN="-15000" STEP="250" VAR="h_ctl_roll_attitude_gain" shortname="roll attitude pgain" param="H_CTL_ROLL_ATTITUDE_GAIN"/>
|
|
||||||
<dl_setting MAX="0" MIN="-15000" STEP="250" VAR="h_ctl_roll_rate_gain" shortname="roll rate gain" param="H_CTL_ROLL_RATE_GAIN"/>
|
|
||||||
|
|
||||||
</dl_settings>
|
|
||||||
|
|
||||||
<dl_settings name="alt">
|
|
||||||
<dl_setting MAX="0" MIN="-0.2" STEP="0.01" VAR="v_ctl_altitude_pgain" shortname="alt_pgain" param="V_CTL_ALTITUDE_PGAIN"/>
|
|
||||||
</dl_settings>
|
|
||||||
|
|
||||||
<dl_settings name="auto_throttle">
|
|
||||||
<dl_setting MAX="1" MIN="0.0" STEP="0.05" VAR="v_ctl_auto_throttle_cruise_throttle" shortname="cruise throttle" module="guidance/guidance_v" handler="SetCruiseThrottle" param="V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE">
|
|
||||||
<strip_button name="Loiter" value="0.1"/>
|
|
||||||
<strip_button name="Cruise" value="0"/>
|
|
||||||
<strip_button name="Dash" value="1"/>
|
|
||||||
</dl_setting>
|
|
||||||
|
|
||||||
|
|
||||||
<dl_setting MAX="0.00" MIN="-0.05" STEP="0.005" VAR="v_ctl_auto_throttle_pgain" shortname="throttle_pgain" param="V_CTL_AUTO_THROTTLE_PGAIN"/>
|
|
||||||
<dl_setting MAX="1" MIN="0.0" STEP="0.05" VAR="v_ctl_auto_throttle_igain" shortname="throttle_igain" param="V_CTL_AUTO_THROTTLE_IGAIN"/>
|
|
||||||
<dl_setting MAX="2" MIN="0.0" STEP="0.1" VAR="v_ctl_auto_throttle_dgain" shortname="throttle_dgain"/>
|
|
||||||
<!-- commented by poine - does anybody use that ?at all ? -->
|
|
||||||
<!-- <dl_setting MAX="0" MIN="-4000" STEP="100" VAR="v_ctl_auto_throttle_dash_trim" shortname="dash trim"/> -->
|
|
||||||
<!-- <dl_setting MIN="0" MAX="3000" STEP="100" VAR="v_ctl_auto_throttle_loiter_trim" shortname="loiter trim" param="V_CTL_AUTO_THROTTLE_LOITER_TRIM"/> -->
|
|
||||||
<dl_setting MAX="1" MIN="0" STEP="0.01" VAR="v_ctl_auto_throttle_climb_throttle_increment" shortname="throttle_incr" param="V_CTL_AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT"/>
|
|
||||||
<dl_setting MAX="1" MIN="0" STEP="0.01" VAR="v_ctl_auto_throttle_pitch_of_vz_pgain" shortname="pitch_of_vz" param="V_CTL_AUTO_THROTTLE_PITCH_OF_VZ_PGAIN"/>
|
|
||||||
<dl_setting MAX="10" MIN="-10" STEP="0.1" VAR="v_ctl_auto_throttle_pitch_of_vz_dgain" shortname="pitch_of_vz (d)"/>
|
|
||||||
</dl_settings>
|
|
||||||
|
|
||||||
<dl_settings name="auto_pitch">
|
|
||||||
<dl_setting MAX="-0.01" MIN="-0.1" STEP="0.01" VAR="v_ctl_auto_pitch_pgain" shortname="pgain" param="V_CTL_AUTO_PITCH_PGAIN"/>
|
|
||||||
<dl_setting MAX="1" MIN="0" STEP="0.01" VAR="v_ctl_auto_pitch_igain" shortname="igain" param="V_CTL_AUTO_PITCH_IGAIN"/>
|
|
||||||
</dl_settings>
|
|
||||||
|
|
||||||
<dl_settings name="nav">
|
|
||||||
<dl_setting MAX="-0.1" MIN="-3" STEP="0.05" VAR="h_ctl_course_pgain" shortname="course pgain" param="H_CTL_COURSE_PGAIN"/>
|
|
||||||
<dl_setting MAX="2" MIN="0" STEP="0.1" VAR="h_ctl_course_dgain" shortname="course dgain" param="H_CTL_COURSE_DGAIN"/>
|
|
||||||
<dl_setting MAX="2" MIN="0.1" STEP="0.05" VAR="h_ctl_course_pre_bank_correction" shortname="pre bank cor" param="H_CTL_COURSE_PRE_BANK_CORRECTION"/>
|
|
||||||
<dl_setting MAX="1" MIN="0.0" STEP="0.05" VAR="nav_glide_pitch_trim" shortname="glide pitch trim" param="NAV_GLIDE_PITCH_TRIM"/>
|
|
||||||
<dl_setting MAX="1" MIN="0.02" STEP="0.01" VAR="h_ctl_roll_slew" shortname="roll slew"/>
|
|
||||||
<dl_setting MAX="500" MIN="-500" STEP="5" VAR="nav_radius"/>
|
|
||||||
<dl_setting MAX="359" MIN="0" STEP="5" VAR="nav_course"/>
|
|
||||||
<dl_setting MAX="2" MIN="1" STEP="1" VAR="nav_mode"/>
|
|
||||||
<dl_setting MAX="5" MIN="-5" STEP="0.5" VAR="nav_climb"/>
|
|
||||||
<dl_setting MAX="15" MIN="-15" STEP="1" VAR="fp_pitch"/>
|
|
||||||
<dl_setting MAX="50" MIN="-50" STEP="5" VAR="nav_shift" module="subsystems/nav" handler="IncreaseShift" shortname="inc. shift"/>
|
|
||||||
<dl_setting MAX="50" MIN="5" STEP="0.5" VAR="nav_ground_speed_setpoint" shortname="ground speed"/>
|
|
||||||
<dl_setting MAX="0." MIN="-0.2" STEP="0.01" VAR="nav_ground_speed_pgain" shortname="ground speed pgain"/>
|
|
||||||
<dl_setting MAX="500" MIN="50" STEP="5" VAR="nav_survey_shift"/>
|
|
||||||
</dl_settings>
|
|
||||||
</dl_settings>
|
|
||||||
</dl_settings>
|
|
||||||
</settings>
|
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
<dl_settings NAME="control">
|
<dl_settings NAME="control">
|
||||||
|
|
||||||
<dl_settings NAME="ins">
|
<dl_settings NAME="ins">
|
||||||
<dl_setting MAX="0.3" MIN="-0.3" STEP="0.01" VAR="ins_roll_neutral" shortname="roll_neutral" param="INS_ROLL_NEUTRAL_DEFAULT" unit="rad"/>
|
<dl_setting MAX="0.3" MIN="-0.3" STEP="0.01" VAR="ins_roll_neutral" shortname="roll_neutral" module="subsystems/ahrs" param="INS_ROLL_NEUTRAL_DEFAULT" unit="rad"/>
|
||||||
<dl_setting MAX="0.5" MIN="-0.3" STEP="0.01" VAR="ins_pitch_neutral" shortname="pitch_neutral" param="INS_PITCH_NEUTRAL_DEFAULT" unit="rad"/>
|
<dl_setting MAX="0.5" MIN="-0.3" STEP="0.01" VAR="ins_pitch_neutral" shortname="pitch_neutral" param="INS_PITCH_NEUTRAL_DEFAULT" unit="rad"/>
|
||||||
</dl_settings>
|
</dl_settings>
|
||||||
|
|
||||||
@@ -66,8 +66,9 @@
|
|||||||
<dl_setting MAX="0.00" MIN="-0.05" STEP="0.005" VAR="v_ctl_auto_throttle_pgain" shortname="throttle_pgain" param="V_CTL_AUTO_THROTTLE_PGAIN"/>
|
<dl_setting MAX="0.00" MIN="-0.05" STEP="0.005" VAR="v_ctl_auto_throttle_pgain" shortname="throttle_pgain" param="V_CTL_AUTO_THROTTLE_PGAIN"/>
|
||||||
<dl_setting MAX="1" MIN="0.0" STEP="0.05" VAR="v_ctl_auto_throttle_igain" shortname="throttle_igain" param="V_CTL_AUTO_THROTTLE_IGAIN"/>
|
<dl_setting MAX="1" MIN="0.0" STEP="0.05" VAR="v_ctl_auto_throttle_igain" shortname="throttle_igain" param="V_CTL_AUTO_THROTTLE_IGAIN"/>
|
||||||
<dl_setting MAX="2" MIN="0.0" STEP="0.1" VAR="v_ctl_auto_throttle_dgain" shortname="throttle_dgain"/>
|
<dl_setting MAX="2" MIN="0.0" STEP="0.1" VAR="v_ctl_auto_throttle_dgain" shortname="throttle_dgain"/>
|
||||||
<dl_setting MAX="0" MIN="-4000" STEP="100" VAR="v_ctl_auto_throttle_dash_trim" shortname="dash trim"/>
|
<!-- commented by poine - does anybody use that ?at all ? -->
|
||||||
<dl_setting MIN="0" MAX="3000" STEP="100" VAR="v_ctl_auto_throttle_loiter_trim" shortname="loiter trim" param="V_CTL_AUTO_THROTTLE_LOITER_TRIM"/>
|
<!-- <dl_setting MAX="0" MIN="-4000" STEP="100" VAR="v_ctl_auto_throttle_dash_trim" shortname="dash trim"/> -->
|
||||||
|
<!-- <dl_setting MIN="0" MAX="3000" STEP="100" VAR="v_ctl_auto_throttle_loiter_trim" shortname="loiter trim" param="V_CTL_AUTO_THROTTLE_LOITER_TRIM"/> -->
|
||||||
<dl_setting MAX="1" MIN="0" STEP="0.01" VAR="v_ctl_auto_throttle_climb_throttle_increment" shortname="throttle_incr" param="V_CTL_AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT"/>
|
<dl_setting MAX="1" MIN="0" STEP="0.01" VAR="v_ctl_auto_throttle_climb_throttle_increment" shortname="throttle_incr" param="V_CTL_AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT"/>
|
||||||
<dl_setting MAX="1" MIN="0" STEP="0.01" VAR="v_ctl_auto_throttle_pitch_of_vz_pgain" shortname="pitch_of_vz" param="V_CTL_AUTO_THROTTLE_PITCH_OF_VZ_PGAIN"/>
|
<dl_setting MAX="1" MIN="0" STEP="0.01" VAR="v_ctl_auto_throttle_pitch_of_vz_pgain" shortname="pitch_of_vz" param="V_CTL_AUTO_THROTTLE_PITCH_OF_VZ_PGAIN"/>
|
||||||
<dl_setting MAX="10" MIN="-10" STEP="0.1" VAR="v_ctl_auto_throttle_pitch_of_vz_dgain" shortname="pitch_of_vz (d)"/>
|
<dl_setting MAX="10" MIN="-10" STEP="0.1" VAR="v_ctl_auto_throttle_pitch_of_vz_dgain" shortname="pitch_of_vz (d)"/>
|
||||||
|
|||||||
@@ -11,5 +11,5 @@
|
|||||||
|
|
||||||
#include <caml/mlvalues.h>
|
#include <caml/mlvalues.h>
|
||||||
|
|
||||||
float imu_roll_neutral = RadOfDeg(IMU_ROLL_NEUTRAL_DEFAULT);
|
float ins_roll_neutral = INS_ROLL_NEUTRAL_DEFAULT;
|
||||||
float imu_pitch_neutral = RadOfDeg(IMU_PITCH_NEUTRAL_DEFAULT);
|
float ins_pitch_neutral = INS_PITCH_NEUTRAL_DEFAULT;
|
||||||
@@ -33,6 +33,12 @@
|
|||||||
#define AHRS_UNINIT 0
|
#define AHRS_UNINIT 0
|
||||||
#define AHRS_RUNNING 1
|
#define AHRS_RUNNING 1
|
||||||
|
|
||||||
|
/* underlying includes (needed for parameters) */
|
||||||
|
#ifdef AHRS_TYPE_H
|
||||||
|
#include AHRS_TYPE_H
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
struct Ahrs {
|
struct Ahrs {
|
||||||
|
|
||||||
struct Int32Quat ltp_to_imu_quat;
|
struct Int32Quat ltp_to_imu_quat;
|
||||||
|
|||||||
@@ -40,8 +40,8 @@
|
|||||||
struct AhrsFloatDCM ahrs_impl;
|
struct AhrsFloatDCM ahrs_impl;
|
||||||
|
|
||||||
// remotely settable
|
// remotely settable
|
||||||
float imu_roll_neutral = RadOfDeg(IMU_ROLL_NEUTRAL_DEFAULT);
|
float ins_roll_neutral = INS_ROLL_NEUTRAL_DEFAULT;
|
||||||
float imu_pitch_neutral = RadOfDeg(IMU_PITCH_NEUTRAL_DEFAULT);
|
float ins_pitch_neutral = INS_PITCH_NEUTRAL_DEFAULT;
|
||||||
|
|
||||||
// Axis definition: X axis pointing forward, Y axis pointing to the right and Z axis pointing down.
|
// Axis definition: X axis pointing forward, Y axis pointing to the right and Z axis pointing down.
|
||||||
// Positive pitch : nose up
|
// Positive pitch : nose up
|
||||||
@@ -82,8 +82,8 @@ void ahrs_update_fw_estimator( void )
|
|||||||
//compute_body_orientation_and_rates();
|
//compute_body_orientation_and_rates();
|
||||||
|
|
||||||
// export results to estimator
|
// export results to estimator
|
||||||
estimator_phi = ahrs_float.ltp_to_imu_euler.phi - imu_roll_neutral;
|
estimator_phi = ahrs_float.ltp_to_imu_euler.phi - ins_roll_neutral;
|
||||||
estimator_theta = ahrs_float.ltp_to_imu_euler.theta - imu_pitch_neutral;
|
estimator_theta = ahrs_float.ltp_to_imu_euler.theta - ins_pitch_neutral;
|
||||||
estimator_psi = ahrs_float.ltp_to_imu_euler.psi;
|
estimator_psi = ahrs_float.ltp_to_imu_euler.psi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ struct AhrsFloatDCM {
|
|||||||
};
|
};
|
||||||
extern struct AhrsFloatDCM ahrs_impl;
|
extern struct AhrsFloatDCM ahrs_impl;
|
||||||
|
|
||||||
extern float imu_roll_neutral;
|
extern float ins_roll_neutral;
|
||||||
extern float imu_pitch_neutral;
|
extern float ins_pitch_neutral;
|
||||||
|
|
||||||
void ahrs_update_fw_estimator(void);
|
void ahrs_update_fw_estimator(void);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user