aboutsummaryrefslogtreecommitdiff
path: root/ROMFS
diff options
context:
space:
mode:
authorLorenz Meier <lm@qgroundcontrol.org>2014-12-15 23:33:42 +0100
committerLorenz Meier <lm@qgroundcontrol.org>2014-12-15 23:33:42 +0100
commita2bcbabd161d629148ae3b9fcb181fddc5a8d1d1 (patch)
tree3fa5eebf711f77f58c43f8ef8157cfa6347289d8 /ROMFS
parentaa40c69853be0dc7e79bc3084472b77f9667c1f1 (diff)
parent89e2e08de0e9f76114b095782167722597f298fa (diff)
downloadpx4-firmware-a2bcbabd161d629148ae3b9fcb181fddc5a8d1d1.tar.gz
px4-firmware-a2bcbabd161d629148ae3b9fcb181fddc5a8d1d1.tar.bz2
px4-firmware-a2bcbabd161d629148ae3b9fcb181fddc5a8d1d1.zip
Merge pull request #1481 from PX4/vtol_merge
VTOL architecture working with caipirinha
Diffstat (limited to 'ROMFS')
-rw-r--r--ROMFS/px4fmu_common/init.d/13001_caipirinha_vtol16
-rw-r--r--ROMFS/px4fmu_common/init.d/rc.autostart11
-rw-r--r--ROMFS/px4fmu_common/init.d/rc.vtol_apps15
-rw-r--r--ROMFS/px4fmu_common/init.d/rc.vtol_defaults39
-rw-r--r--ROMFS/px4fmu_common/init.d/rcS39
-rw-r--r--ROMFS/px4fmu_common/mixers/FMU_caipirinha_vtol.mix16
6 files changed, 136 insertions, 0 deletions
diff --git a/ROMFS/px4fmu_common/init.d/13001_caipirinha_vtol b/ROMFS/px4fmu_common/init.d/13001_caipirinha_vtol
new file mode 100644
index 000000000..bff971c0f
--- /dev/null
+++ b/ROMFS/px4fmu_common/init.d/13001_caipirinha_vtol
@@ -0,0 +1,16 @@
+#!nsh
+#
+# Generic configuration file for caipirinha VTOL version
+#
+# Roman Bapst <bapstr@ethz.ch>
+#
+
+sh /etc/init.d/rc.vtol_defaults
+
+set MIXER FMU_caipirinha_vtol
+
+set PWM_OUTPUTS 12
+set PWM_MAX 2000
+set PWM_RATE 400
+param set VTOL_MOT_COUNT 2
+param set IDLE_PWM_MC 1080
diff --git a/ROMFS/px4fmu_common/init.d/rc.autostart b/ROMFS/px4fmu_common/init.d/rc.autostart
index 496a52c5f..8388da1dd 100644
--- a/ROMFS/px4fmu_common/init.d/rc.autostart
+++ b/ROMFS/px4fmu_common/init.d/rc.autostart
@@ -15,6 +15,7 @@
# 10000 .. 10999 Wide arm / H frame
# 11000 .. 11999 Hexa Cox
# 12000 .. 12999 Octo Cox
+# 13000 .. 13999 VTOL
#
# Simulation
@@ -237,3 +238,13 @@ if param compare SYS_AUTOSTART 12001
then
sh /etc/init.d/12001_octo_cox
fi
+
+# 13000 is historically reserved for the quadshot
+
+#
+# VTOL caipririnha
+#
+ if param compare SYS_AUTOSTART 13001
+ then
+ sh /etc/init.d/13001_caipirinha_vtol
+ fi
diff --git a/ROMFS/px4fmu_common/init.d/rc.vtol_apps b/ROMFS/px4fmu_common/init.d/rc.vtol_apps
new file mode 100644
index 000000000..23ade6d78
--- /dev/null
+++ b/ROMFS/px4fmu_common/init.d/rc.vtol_apps
@@ -0,0 +1,15 @@
+#!nsh
+#
+# Standard apps for vtol:
+# att & pos estimator, att & pos control.
+#
+
+attitude_estimator_ekf start
+#ekf_att_pos_estimator start
+position_estimator_inav start
+
+vtol_att_control start
+mc_att_control start
+mc_pos_control start
+fw_att_control start
+fw_pos_control_l1 start
diff --git a/ROMFS/px4fmu_common/init.d/rc.vtol_defaults b/ROMFS/px4fmu_common/init.d/rc.vtol_defaults
new file mode 100644
index 000000000..10ee5db9b
--- /dev/null
+++ b/ROMFS/px4fmu_common/init.d/rc.vtol_defaults
@@ -0,0 +1,39 @@
+#!nsh
+
+set VEHICLE_TYPE vtol
+
+if [ $DO_AUTOCONFIG == yes ]
+then
+ #
+ #Default controller parameters for MC
+ #
+ param set MC_ROLL_P 6.0
+ param set MC_ROLLRATE_P 0.1
+ param set MC_ROLLRATE_I 0.0
+ param set MC_ROLLRATE_D 0.003
+ param set MC_PITCH_P 6.0
+ param set MC_PITCHRATE_P 0.2
+ param set MC_PITCHRATE_I 0.0
+ param set MC_PITCHRATE_D 0.003
+ param set MC_YAW_P 4
+ param set MC_YAWRATE_P 0.2
+ param set MC_YAWRATE_I 0.0
+ param set MC_YAWRATE_D 0.0
+ param set MC_YAW_FF 0.3
+
+ #
+ # Default parameters for FW
+ #
+ param set FW_PR_FF 0.3
+ param set FW_PR_I 0.000
+ param set FW_PR_IMAX 0.2
+ param set FW_PR_P 0.02
+ param set FW_RR_FF 0.3
+ param set FW_RR_I 0.00
+ param set FW_RR_IMAX 0.2
+ param set FW_RR_P 0.02
+fi
+
+set PWM_DISARMED 900
+set PWM_MIN 1000
+set PWM_MAX 2000
diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS
index b027107c8..5748fe2b5 100644
--- a/ROMFS/px4fmu_common/init.d/rcS
+++ b/ROMFS/px4fmu_common/init.d/rcS
@@ -552,6 +552,45 @@ then
fi
#
+ # VTOL setup
+ #
+ if [ $VEHICLE_TYPE == vtol ]
+ then
+ echo "[init] Vehicle type: VTOL"
+
+ if [ $MIXER == none ]
+ then
+ echo "Default mixer for vtol not defined"
+ fi
+
+ if [ $MAV_TYPE == none ]
+ then
+ # Use mixer to detect vehicle type
+ if [ $MIXER == FMU_caipirinha_vtol ]
+ then
+ set MAV_TYPE 19
+ fi
+ fi
+
+ # Still no MAV_TYPE found
+ if [ $MAV_TYPE == none ]
+ then
+ echo "Unknown MAV_TYPE"
+ else
+ param set MAV_TYPE $MAV_TYPE
+ fi
+
+ # Load mixer and configure outputs
+ sh /etc/init.d/rc.interface
+
+ # Start standard vtol apps
+ if [ $LOAD_DEFAULT_APPS == yes ]
+ then
+ sh /etc/init.d/rc.vtol_apps
+ fi
+ fi
+
+ #
# Start the navigator
#
navigator start
diff --git a/ROMFS/px4fmu_common/mixers/FMU_caipirinha_vtol.mix b/ROMFS/px4fmu_common/mixers/FMU_caipirinha_vtol.mix
new file mode 100644
index 000000000..5ae0f5588
--- /dev/null
+++ b/ROMFS/px4fmu_common/mixers/FMU_caipirinha_vtol.mix
@@ -0,0 +1,16 @@
+#!nsh
+# Caipirinha vtol mixer for PX4FMU
+#
+#===========================
+R: 2- 10000 10000 10000 0
+
+#mixer for the elevons
+M: 2
+O: 10000 10000 0 -10000 10000
+S: 1 0 10000 10000 0 -10000 10000
+S: 1 1 10000 10000 0 -10000 10000
+
+M: 2
+O: 10000 10000 0 -10000 10000
+S: 1 0 10000 10000 0 -10000 10000
+S: 1 1 -10000 -10000 0 -10000 10000