From d688e5dee49a4a59fffaa6a11d4caeb5141b98a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Mon, 29 Nov 2021 16:20:17 +0100 Subject: [PATCH] sitl airframes: add control allocation config to some airframes (not enabled) To use them, manually set SYS_CTRL_ALLOC --- .../init.d-posix/airframes/1030_plane | 29 ++++++++++++ .../init.d-posix/airframes/1040_standard_vtol | 34 ++++++++++++++ .../init.d-posix/airframes/1042_tiltrotor | 46 +++++++++++++++++++ 3 files changed, 109 insertions(+) diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1030_plane b/ROMFS/px4fmu_common/init.d-posix/airframes/1030_plane index 6ce3449e69..6968455cd6 100644 --- a/ROMFS/px4fmu_common/init.d-posix/airframes/1030_plane +++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1030_plane @@ -43,5 +43,34 @@ param set-default NAV_DLL_ACT 2 param set-default RWTO_TKOFF 1 +#param set-default SYS_CTRL_ALLOC 1 +param set-default CA_AIRFRAME 5 + +param set-default CA_ROTOR_COUNT 1 +param set-default CA_ROTOR0_PX 0.3 + +param set-default CA_SV_CS_COUNT 6 +param set-default CA_SV_CS0_TRQ_Y 1.0000 +param set-default CA_SV_CS0_TYPE 2 +param set-default CA_SV_CS1_TYPE 7 +param set-default CA_SV_CS2_TRQ_P -1.0000 +param set-default CA_SV_CS2_TRQ_R 1.0000 +param set-default CA_SV_CS2_TYPE 9 +param set-default CA_SV_CS3_TRQ_P 1.0000 +param set-default CA_SV_CS3_TRQ_R 1.0000 +param set-default CA_SV_CS3_TYPE 10 +param set-default CA_SV_CS4_TRQ_P 1.0000 +param set-default CA_SV_CS5_TYPE 8 + +param set-default PWM_MAIN_FUNC3 201 +param set-default PWM_MAIN_FUNC4 202 +param set-default PWM_MAIN_FUNC5 101 +param set-default PWM_MAIN_FUNC6 203 +param set-default PWM_MAIN_FUNC7 204 +param set-default PWM_MAIN_FUNC8 205 +param set-default PWM_MAIN_FUNC9 206 +param set-default PWM_MAIN_REV 288 + + set MIXER_FILE etc/mixers-sitl/plane_sitl.main.mix set MIXER custom diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1040_standard_vtol b/ROMFS/px4fmu_common/init.d-posix/airframes/1040_standard_vtol index 6b22e67338..c0436573a4 100644 --- a/ROMFS/px4fmu_common/init.d-posix/airframes/1040_standard_vtol +++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1040_standard_vtol @@ -7,6 +7,40 @@ . ${R}etc/init.d/rc.vtol_defaults +#param set-default SYS_CTRL_ALLOC 1 +param set-default CA_AIRFRAME 1 + +param set-default CA_ROTOR_COUNT 4 +param set-default CA_ROTOR0_PX 0.1515 +param set-default CA_ROTOR0_PY 0.245 +param set-default CA_ROTOR0_KM 0.05 +param set-default CA_ROTOR1_PX -0.1515 +param set-default CA_ROTOR1_PY -0.1875 +param set-default CA_ROTOR1_KM 0.05 +param set-default CA_ROTOR2_PX 0.1515 +param set-default CA_ROTOR2_PY -0.245 +param set-default CA_ROTOR2_KM -0.05 +param set-default CA_ROTOR3_PX -0.1515 +param set-default CA_ROTOR3_PY 0.1875 +param set-default CA_ROTOR3_KM -0.05 + +param set-default CA_SV_CS_COUNT 3 +param set-default CA_SV_CS0_TRQ_R 1.0000 +param set-default CA_SV_CS0_TYPE 9 +param set-default CA_SV_CS1_TRQ_R 1.0000 +param set-default CA_SV_CS1_TYPE 10 +param set-default CA_SV_CS2_TRQ_P 1.0000 +param set-default PWM_MAIN_FUNC1 101 +param set-default PWM_MAIN_FUNC2 102 +param set-default PWM_MAIN_FUNC3 103 +param set-default PWM_MAIN_FUNC4 104 +param set-default PWM_MAIN_FUNC5 105 +param set-default PWM_MAIN_FUNC6 201 +param set-default PWM_MAIN_FUNC7 202 +param set-default PWM_MAIN_FUNC8 203 +param set-default PWM_MAIN_REV 32 + + param set-default FW_L1_PERIOD 12 param set-default FW_MAN_P_MAX 30 param set-default FW_PR_FF 0.2 diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1042_tiltrotor b/ROMFS/px4fmu_common/init.d-posix/airframes/1042_tiltrotor index 02d3346f93..973d42aba3 100644 --- a/ROMFS/px4fmu_common/init.d-posix/airframes/1042_tiltrotor +++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1042_tiltrotor @@ -7,6 +7,52 @@ . ${R}etc/init.d/rc.vtol_defaults +#param set-default SYS_CTRL_ALLOC 1 +param set-default CA_AIRFRAME 2 + +param set-default CA_ROTOR_COUNT 4 +param set-default CA_ROTOR0_PX 0.1515 +param set-default CA_ROTOR0_PY 0.245 +param set-default CA_ROTOR0_KM 0.05 +param set-default CA_ROTOR1_PX -0.1515 +param set-default CA_ROTOR1_PY -0.1875 +param set-default CA_ROTOR1_KM 0.05 +param set-default CA_ROTOR2_PX 0.1515 +param set-default CA_ROTOR2_PY -0.245 +param set-default CA_ROTOR2_KM -0.05 +param set-default CA_ROTOR3_PX -0.1515 +param set-default CA_ROTOR3_PY 0.1875 +param set-default CA_ROTOR3_KM -0.05 + +param set-default CA_ROTOR0_TILT 1 +param set-default CA_ROTOR1_TILT 2 +param set-default CA_ROTOR2_TILT 3 +param set-default CA_ROTOR3_TILT 4 +param set-default CA_SV_CS0_TRQ_R 1.0000 +param set-default CA_SV_CS0_TYPE 9 +param set-default CA_SV_CS1_TRQ_R 1.0000 +param set-default CA_SV_CS1_TYPE 10 +param set-default CA_SV_CS2_TRQ_P 1.0000 +param set-default CA_SV_CS_COUNT 3 +param set-default CA_SV_TL0_CT 0 +param set-default CA_SV_TL1_CT 0 +param set-default CA_SV_TL2_CT 0 +param set-default CA_SV_TL3_CT 0 +param set-default CA_SV_TL_COUNT 4 + +param set-default PWM_MAIN_FUNC1 101 +param set-default PWM_MAIN_FUNC2 102 +param set-default PWM_MAIN_FUNC3 103 +param set-default PWM_MAIN_FUNC4 104 +param set-default PWM_MAIN_FUNC5 204 +param set-default PWM_MAIN_FUNC6 205 +param set-default PWM_MAIN_FUNC7 206 +param set-default PWM_MAIN_FUNC8 207 +param set-default PWM_MAIN_FUNC9 201 +param set-default PWM_MAIN_FUNC10 202 +param set-default PWM_MAIN_FUNC11 203 +param set-default PWM_MAIN_REV 256 + param set-default FW_L1_PERIOD 12 param set-default FW_MAN_P_MAX 30 param set-default FW_PR_FF 0.2