From 2635e2c3869bc8f904dcdee920943cb662e18a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Fri, 26 Aug 2022 15:32:42 +0200 Subject: [PATCH] airframes: replace blade with generic helicopter --- ROMFS/px4fmu_common/init.d/CMakeLists.txt | 1 + .../init.d/airframes/16001_helicopter | 40 +++---------------- ROMFS/px4fmu_common/init.d/rc.heli_defaults | 18 +++++++++ 3 files changed, 25 insertions(+), 34 deletions(-) create mode 100644 ROMFS/px4fmu_common/init.d/rc.heli_defaults diff --git a/ROMFS/px4fmu_common/init.d/CMakeLists.txt b/ROMFS/px4fmu_common/init.d/CMakeLists.txt index 248350cd4e..81f99fcb65 100644 --- a/ROMFS/px4fmu_common/init.d/CMakeLists.txt +++ b/ROMFS/px4fmu_common/init.d/CMakeLists.txt @@ -41,6 +41,7 @@ px4_add_romfs_files( rc.boat_defaults rc.fw_apps rc.fw_defaults + rc.heli_defaults rc.interface rc.logging rc.mc_apps diff --git a/ROMFS/px4fmu_common/init.d/airframes/16001_helicopter b/ROMFS/px4fmu_common/init.d/airframes/16001_helicopter index 4157f12926..36f1a68f14 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/16001_helicopter +++ b/ROMFS/px4fmu_common/init.d/airframes/16001_helicopter @@ -1,55 +1,27 @@ #!/bin/sh # -# @name Blade 130X +# @name Generic Helicopter (Tail ESC) # # @type Helicopter # @class Copter # -# @maintainer Bart Slinger -# -# @output Motor1 main motor -# @output Servo1 front swashplate servo -# @output Servo2 right swashplate servo -# @output Servo3 left swashplate servo -# @output Servo4 tail-rotor servo -# # @board px4_fmu-v2 exclude # @board bitcraze_crazyflie exclude # -. ${R}etc/init.d/rc.mc_defaults - -# Configure as helicopter -param set-default MAV_TYPE 4 +. ${R}etc/init.d/rc.heli_defaults - -param set-default ATT_BIAS_MAX 0 - -param set-default CBRK_IO_SAFETY 22027 - -param set-default MC_ROLL_P 5 +# Disable PID gains for initial setup. These should be enabled after setting the FF gain. +# P is expected to be lower than FF. param set-default MC_ROLLRATE_P 0 param set-default MC_ROLLRATE_I 0 param set-default MC_ROLLRATE_D 0 -param set-default MC_ROLLRATE_FF 0.15 +param set-default MC_ROLLRATE_FF 0.1 param set-default MC_PITCHRATE_P 0 param set-default MC_PITCHRATE_I 0 param set-default MC_PITCHRATE_D 0 -param set-default MC_PITCHRATE_FF 0.15 -param set-default MC_YAW_P 3 -param set-default MC_YAWRATE_P 0.1 -param set-default MC_YAWRATE_I 0 -param set-default MC_ROLLRATE_MAX 720 -param set-default MC_PITCHRATE_MAX 720 -param set-default MC_YAWRATE_MAX 400 -param set-default MC_ACRO_R_MAX 360 -param set-default MC_ACRO_P_MAX 360 - -param set-default MPC_THR_MIN 0.06 -param set-default MPC_MANTHR_MIN 0.06 - -param set-default PWM_MAIN_MIN 1075 +param set-default MC_PITCHRATE_FF 0.1 param set-default CA_AIRFRAME 10 diff --git a/ROMFS/px4fmu_common/init.d/rc.heli_defaults b/ROMFS/px4fmu_common/init.d/rc.heli_defaults new file mode 100644 index 0000000000..42fb728819 --- /dev/null +++ b/ROMFS/px4fmu_common/init.d/rc.heli_defaults @@ -0,0 +1,18 @@ +#!/bin/sh +# +# Helicopter default parameters. +# +# NOTE: Script variables are declared/initialized/unset in the rcS script. +# + +# Inherit from mc +. ${R}etc/init.d/rc.mc_defaults + +param set-default MAV_TYPE 4 + +param set-default COM_PREARM_MODE 2 +param set-default COM_SPOOLUP_TIME 10 + +param set-default MPC_MANTHR_MIN 0 + +