#!nsh
#
# @name E-flite Convergence
# @type VTOL Tiltrotor
# @maintainer Andreas Antener <andreas@uaventure.com>
# @output MAIN1 Motor right
# @output MAIN2 Motor back
# @output MAIN3 Motor left
# @output MAIN4 empty
# @output MAIN5 Tilt servo right
# @output MAIN6 Tilt servo left
# @output MAIN7 Elevon right
# @output MAIN8 Elevon left
#

sh /etc/init.d/rc.vtol_defaults

if [ $AUTOCNF == yes ]
then
    param set VT_MOT_COUNT 3
    param set VT_FW_MOT_OFFID 3
    param set VT_IDLE_PWM_MC 1080
    param set VT_TYPE 1

    param set VT_TILT_MC 0.0
    param set VT_TILT_TRANS 0.35
    param set VT_TILT_FW 1.0
    param set VT_F_TRANS_DUR 2.0
    param set VT_TRANS_MIN_TM 3.0
    param set VT_F_TR_OL_TM 7.0
    param set VT_TRANS_P2_DUR 2.2
    param set VT_B_TRANS_DUR 1.0
    param set VT_FW_PERM_STAB 1

    param set FW_L1_PERIOD 16
    param set FW_MAN_R_MAX 50.0
    param set FW_PSP_OFF 4.0
    param set FW_P_LIM_MAX 30
    param set FW_P_LIM_MIN -30
    param set FW_RR_FF 0.35
    param set FW_RR_P 0.14

    param set MC_YAWRATE_P 0.3
    param set MPC_LAND_SPEED 1.2
    param set MPC_TKO_SPEED 2.5
    param set MPC_Z_VEL_MAX_UP 3.0

    param set CBRK_AIRSPD_CHK 162128
    param set FW_ARSP_MODE 2

    param set SENS_BOARD_ROT 8
fi

set MIXER vtol_convergence
set PWM_OUT 1234
set PWM_RATE 400

set MAV_TYPE 21
