forked from Archive/PX4-Autopilot
Merge pull request #2422 from tumbili/VTOL_new_tailsitter
Vtol new tailsitter
This commit is contained in:
commit
03d45b8dbf
|
@ -1,7 +1,7 @@
|
|||
#
|
||||
# Generic configuration file for caipirinha VTOL version
|
||||
#
|
||||
# Roman Bapst <bapstr@ethz.ch>
|
||||
# Roman Bapst <bapstr@gmail.com>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.vtol_defaults
|
||||
|
@ -13,3 +13,4 @@ set PWM_MAX 2000
|
|||
set PWM_RATE 400
|
||||
param set VT_MOT_COUNT 2
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 0
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# Generic configuration file for BirdsEyeView Aerobotics FireFly6
|
||||
#
|
||||
# Roman Bapst <romanbapst@yahoo.de>
|
||||
# Roman Bapst <bapstroman@gmail.com>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.vtol_defaults
|
||||
|
@ -41,3 +41,4 @@ set MAV_TYPE 21
|
|||
|
||||
param set VT_MOT_COUNT 6
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 1
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
#
|
||||
# Generic configuration file for a tailsitter with motors in X configuration.
|
||||
#
|
||||
# Roman Bapst <bapstroman@gmail.com>
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.vtol_defaults
|
||||
|
||||
set MIXER quad_x_vtol
|
||||
|
||||
set PWM_OUT 1234
|
||||
set PWM_MAX 2000
|
||||
set PWM_RATE 400
|
||||
set MAV_TYPE 20
|
||||
param set VT_MOT_COUNT 4
|
||||
param set VT_IDLE_PWM_MC 1080
|
||||
param set VT_TYPE 0
|
|
@ -268,6 +268,14 @@ then
|
|||
sh /etc/init.d/13002_firefly6
|
||||
fi
|
||||
|
||||
#
|
||||
# Tailsitter with 4 motors in x config
|
||||
#
|
||||
if param compare SYS_AUTOSTART 13003
|
||||
then
|
||||
sh /etc/init.d/13003_quad_tailsitter
|
||||
fi
|
||||
|
||||
#
|
||||
# TriCopter Y Yaw+
|
||||
#
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
Mixer for Tailsitter with x motor configuration and elevons
|
||||
===========================================================
|
||||
|
||||
This file defines a single mixer for tailsitter with motors in X configuration. All controls
|
||||
are mixed 100%.
|
||||
|
||||
R: 4x 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
|
|
@ -193,12 +193,14 @@ private:
|
|||
float trim_roll;
|
||||
float trim_pitch;
|
||||
float trim_yaw;
|
||||
float rollsp_offset_deg; /**< Roll Setpoint Offset in deg */
|
||||
float pitchsp_offset_deg; /**< Pitch Setpoint Offset in deg */
|
||||
float rollsp_offset_rad; /**< Roll Setpoint Offset in rad */
|
||||
float pitchsp_offset_rad; /**< Pitch Setpoint Offset in rad */
|
||||
float man_roll_max; /**< Max Roll in rad */
|
||||
float man_pitch_max; /**< Max Pitch in rad */
|
||||
float rollsp_offset_deg; /**< Roll Setpoint Offset in deg */
|
||||
float pitchsp_offset_deg; /**< Pitch Setpoint Offset in deg */
|
||||
float rollsp_offset_rad; /**< Roll Setpoint Offset in rad */
|
||||
float pitchsp_offset_rad; /**< Pitch Setpoint Offset in rad */
|
||||
float man_roll_max; /**< Max Roll in rad */
|
||||
float man_pitch_max; /**< Max Pitch in rad */
|
||||
|
||||
int vtol_type; /**< VTOL type: 0 = tailsitter, 1 = tiltrotor */
|
||||
|
||||
} _parameters; /**< local copies of interesting parameters */
|
||||
|
||||
|
@ -241,6 +243,8 @@ private:
|
|||
param_t man_roll_max;
|
||||
param_t man_pitch_max;
|
||||
|
||||
param_t vtol_type;
|
||||
|
||||
} _parameter_handles; /**< handles for interesting parameters */
|
||||
|
||||
|
||||
|
@ -404,6 +408,8 @@ FixedwingAttitudeControl::FixedwingAttitudeControl() :
|
|||
_parameter_handles.man_roll_max = param_find("FW_MAN_R_MAX");
|
||||
_parameter_handles.man_pitch_max = param_find("FW_MAN_P_MAX");
|
||||
|
||||
_parameter_handles.vtol_type = param_find("VT_TYPE");
|
||||
|
||||
/* fetch initial parameter values */
|
||||
parameters_update();
|
||||
}
|
||||
|
@ -481,6 +487,8 @@ FixedwingAttitudeControl::parameters_update()
|
|||
_parameters.man_roll_max = math::radians(_parameters.man_roll_max);
|
||||
_parameters.man_pitch_max = math::radians(_parameters.man_pitch_max);
|
||||
|
||||
param_get(_parameter_handles.vtol_type, &_parameters.vtol_type);
|
||||
|
||||
/* pitch control parameters */
|
||||
_pitch_ctrl.set_time_constant(_parameters.tconst);
|
||||
_pitch_ctrl.set_k_p(_parameters.p_p);
|
||||
|
@ -703,10 +711,8 @@ FixedwingAttitudeControl::task_main()
|
|||
/* load local copies */
|
||||
orb_copy(ORB_ID(vehicle_attitude), _att_sub, &_att);
|
||||
|
||||
if (_vehicle_status.is_vtol) {
|
||||
/* vehicle type is VTOL, need to modify attitude!
|
||||
* The following modification to the attitude is vehicle specific and in this case applies
|
||||
* to tail-sitter models !!!
|
||||
if (_vehicle_status.is_vtol && _parameters.vtol_type == 0) {
|
||||
/* vehicle is a tailsitter, we need to modify the estimated attitude for fw mode
|
||||
*
|
||||
* Since the VTOL airframe is initialized as a multicopter we need to
|
||||
* modify the estimated attitude for the fixed wing operation.
|
||||
|
|
Loading…
Reference in New Issue