From 7072931eb2ef431b3833f6d1c9122b8cfc400617 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Mon, 24 Jun 2019 12:57:27 +0100 Subject: [PATCH 1/3] Airframes: add Holybro S500 Kit which was tested at dev summit --- .../init.d/airframes/4015_holybro_s500 | 26 +++++++++++++++++++ .../init.d/airframes/CMakeLists.txt | 1 + 2 files changed, 27 insertions(+) create mode 100644 ROMFS/px4fmu_common/init.d/airframes/4015_holybro_s500 diff --git a/ROMFS/px4fmu_common/init.d/airframes/4015_holybro_s500 b/ROMFS/px4fmu_common/init.d/airframes/4015_holybro_s500 new file mode 100644 index 000000000000..fd2c87d63151 --- /dev/null +++ b/ROMFS/px4fmu_common/init.d/airframes/4015_holybro_s500 @@ -0,0 +1,26 @@ +#!/bin/sh +# +# @name Holybro S500 +# +# @type Quadrotor x +# @class Copter +# +# @maintainer Lorenz Meier +# + +sh /etc/init.d/rc.mc_defaults + +set MIXER quad_x +set PWM_OUT 1234 + +if [ $AUTOCNF = yes ] +then + param set IMU_GYRO_CUTOFF 80 + param set MC_DTERM_CUTOFF 40 + param set MC_ROLLRATE_P 0.14 + param set MC_PITCHRATE_P 0.14 + param set MC_ROLLRATE_I 0.3 + param set MC_PITCHRATE_I 0.3 + param set MC_ROLLRATE_D 0.004 + param set MC_PITCHRATE_D 0.004 +fi diff --git a/ROMFS/px4fmu_common/init.d/airframes/CMakeLists.txt b/ROMFS/px4fmu_common/init.d/airframes/CMakeLists.txt index 49c0fff59d30..9d12291bddab 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/CMakeLists.txt +++ b/ROMFS/px4fmu_common/init.d/airframes/CMakeLists.txt @@ -69,6 +69,7 @@ px4_add_romfs_files( 4012_quad_x_can 4013_bebop 4014_s500 + 4015_holybro_s500 4020_hk_micro_pcb 4030_3dr_solo 4031_3dr_quad From 91f98a1d14ced9e28043f3b05b6e17d963148f22 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Mon, 24 Jun 2019 12:58:10 +0100 Subject: [PATCH 2/3] Airframes: rename normal S500 to generic and remove PX4 defaults --- ROMFS/px4fmu_common/init.d/airframes/4014_s500 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d/airframes/4014_s500 b/ROMFS/px4fmu_common/init.d/airframes/4014_s500 index 40e9f59945df..48c018c0b31b 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/4014_s500 +++ b/ROMFS/px4fmu_common/init.d/airframes/4014_s500 @@ -1,6 +1,6 @@ #!/bin/sh # -# @name S500 +# @name S500 Generic # # @type Quadrotor x # @class Copter @@ -15,12 +15,10 @@ set PWM_OUT 1234 if [ $AUTOCNF = yes ] then - param set MC_ROLL_P 6.5 param set MC_ROLLRATE_P 0.18 - param set MC_ROLLRATE_I 0.15 - param set MC_ROLLRATE_D 0.003 - param set MC_PITCH_P 6.5 param set MC_PITCHRATE_P 0.18 + param set MC_ROLLRATE_I 0.15 param set MC_PITCHRATE_I 0.15 + param set MC_ROLLRATE_D 0.003 param set MC_PITCHRATE_D 0.003 fi From 04c78386a48e8133d18665f1a6c9276b726baa96 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Mon, 24 Jun 2019 13:43:31 +0100 Subject: [PATCH 3/3] mc_att_control: Increase default rate integral gain @bkueang and me realized that on every frame we tune the integral gain for the roll and pitch rate controller is much too low. Usually it needs to be increased to 0.3 or even 0.4 to have better "locked in" flight performance and 0.2 seems like a good compromise for a safe default. --- src/modules/mc_att_control/mc_att_control_params.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/mc_att_control/mc_att_control_params.c b/src/modules/mc_att_control/mc_att_control_params.c index bfba1ea68e38..d6049f0d8e8e 100644 --- a/src/modules/mc_att_control/mc_att_control_params.c +++ b/src/modules/mc_att_control/mc_att_control_params.c @@ -76,7 +76,7 @@ PARAM_DEFINE_FLOAT(MC_ROLLRATE_P, 0.15f); * @increment 0.01 * @group Multicopter Attitude Control */ -PARAM_DEFINE_FLOAT(MC_ROLLRATE_I, 0.05f); +PARAM_DEFINE_FLOAT(MC_ROLLRATE_I, 0.2f); /** * Roll rate integrator limit @@ -151,7 +151,7 @@ PARAM_DEFINE_FLOAT(MC_PITCHRATE_P, 0.15f); * @increment 0.01 * @group Multicopter Attitude Control */ -PARAM_DEFINE_FLOAT(MC_PITCHRATE_I, 0.05f); +PARAM_DEFINE_FLOAT(MC_PITCHRATE_I, 0.2f); /** * Pitch rate integrator limit