From a65151d1c05dfae8ea2b7361340a04f3bb02d1d2 Mon Sep 17 00:00:00 2001 From: Simon Wilks Date: Wed, 17 Dec 2014 14:50:11 +0100 Subject: [PATCH 1/4] Airframe config and autostart for the TBS Discovery Long Range --- .../px4fmu_common/init.d/10018_tbs_endurance | 31 +++++++++++++++++++ ROMFS/px4fmu_common/init.d/rc.autostart | 5 +++ 2 files changed, 36 insertions(+) create mode 100644 ROMFS/px4fmu_common/init.d/10018_tbs_endurance diff --git a/ROMFS/px4fmu_common/init.d/10018_tbs_endurance b/ROMFS/px4fmu_common/init.d/10018_tbs_endurance new file mode 100644 index 0000000000..6619d14a76 --- /dev/null +++ b/ROMFS/px4fmu_common/init.d/10018_tbs_endurance @@ -0,0 +1,31 @@ +#!nsh +# +# Team Blacksheep Discovery Long Range Quadcopter +# +# Setup: 15 x 6.5" Props, 6S 4000mAh TBS LiPo, TBS 30A ESCs, TBS 400kV Motors +# +# Simon Wilks +# + +sh /etc/init.d/rc.mc_defaults + +if [ $DO_AUTOCONFIG == yes ] +then + param set MC_ROLL_P 7.0 + param set MC_ROLLRATE_P 0.07 + param set MC_ROLLRATE_I 0.02 + param set MC_ROLLRATE_D 0.003 + param set MC_PITCH_P 7.0 + param set MC_PITCHRATE_P 0.1 + param set MC_PITCHRATE_I 0.05 + param set MC_PITCHRATE_D 0.003 + param set MC_YAW_P 2.8 + param set MC_YAWRATE_P 0.4 + param set MC_YAWRATE_I 0.1 + param set MC_YAWRATE_D 0.0 +fi + +set MIXER FMU_quad_w + +set PWM_OUTPUTS 1234 +set PWM_MIN 1100 diff --git a/ROMFS/px4fmu_common/init.d/rc.autostart b/ROMFS/px4fmu_common/init.d/rc.autostart index 8388da1dd7..20f2be0d9e 100644 --- a/ROMFS/px4fmu_common/init.d/rc.autostart +++ b/ROMFS/px4fmu_common/init.d/rc.autostart @@ -221,6 +221,11 @@ then sh /etc/init.d/10017_steadidrone_qu4d fi +if param compare SYS_AUTOSTART 10018 18 +then + sh /etc/init.d/10018_tbs_endurance +fi + # # Hexa Coaxial # From d39e29e6ae1f1c785d4554f70c09e42ba9791de6 Mon Sep 17 00:00:00 2001 From: Simon Wilks Date: Wed, 17 Dec 2014 16:07:57 +0100 Subject: [PATCH 2/4] Up the min PWM slightly. --- ROMFS/px4fmu_common/init.d/10018_tbs_endurance | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ROMFS/px4fmu_common/init.d/10018_tbs_endurance b/ROMFS/px4fmu_common/init.d/10018_tbs_endurance index 6619d14a76..2d5e272bdd 100644 --- a/ROMFS/px4fmu_common/init.d/10018_tbs_endurance +++ b/ROMFS/px4fmu_common/init.d/10018_tbs_endurance @@ -28,4 +28,4 @@ fi set MIXER FMU_quad_w set PWM_OUTPUTS 1234 -set PWM_MIN 1100 +set PWM_MIN 1200 From 262b9fc7545805c7b93a15cbb80a2f67db5ecdf0 Mon Sep 17 00:00:00 2001 From: Thomas Gubler Date: Wed, 17 Dec 2014 21:13:13 +0100 Subject: [PATCH 3/4] fw pos ctl: make loop performance counter more meaningful --- src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp b/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp index e7c95cc864..948b29bcbe 100644 --- a/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp +++ b/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp @@ -1399,8 +1399,6 @@ FixedwingPositionControl::task_main() continue; } - perf_begin(_loop_perf); - /* check vehicle control mode for changes to publication state */ vehicle_control_mode_poll(); @@ -1419,6 +1417,7 @@ FixedwingPositionControl::task_main() /* only run controller if position changed */ if (fds[1].revents & POLLIN) { + perf_begin(_loop_perf); /* XXX Hack to get mavlink output going */ if (_mavlink_fd < 0) { @@ -1473,10 +1472,9 @@ FixedwingPositionControl::task_main() } } - + perf_end(_loop_perf); } - perf_end(_loop_perf); } _task_running = false; From 8fdd694f12cccfe90ed1dbec9bc7892269b3fefa Mon Sep 17 00:00:00 2001 From: Thomas Gubler Date: Wed, 17 Dec 2014 21:13:50 +0100 Subject: [PATCH 4/4] fw pos ctl: compile with -Os --- src/modules/fw_pos_control_l1/module.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/fw_pos_control_l1/module.mk b/src/modules/fw_pos_control_l1/module.mk index 15b575b50f..440bab2c5a 100644 --- a/src/modules/fw_pos_control_l1/module.mk +++ b/src/modules/fw_pos_control_l1/module.mk @@ -45,3 +45,5 @@ SRCS = fw_pos_control_l1_main.cpp \ mtecs/mTecs_params.c MODULE_STACKSIZE = 1200 + +MAXOPTIMIZATION = -Os