[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Paparazzi-devel] LISAm2.0 with DX6I

From: Junnan Shen
Subject: [Paparazzi-devel] LISAm2.0 with DX6I
Date: Tue, 13 Aug 2013 21:25:54 +0800

Hi everybody!

 Thank you very much!
     Now I use a lisa/m2.0 +aspirin v2.0.
     cause I am in china now,so I just desigh a QUADSHOT(mybe like the espresso ) by myself.
     and use DX6I as the transmitter.DSM2 as the recervers.
     but it doesn`t work。
     If there is any possibly ,can I be your aency of the quadshot in china.
    I have a small UAV company which can provide Aerial service and APM uav manufacture.
here is the  airframe xml:
<!-- this is a quadshot vehicle equiped with Lisa/M and generic china pwm motor controllers -->
<!-- Copyright (C) 2012, Pranay Sinha, Transition Robotics, Inc. -->

<airframe name="qs4_lisam2">

  <servos min="0" neutral="0" max="0xff">
    <servo name="A1"            no="0" min="1000" neutral="1000" max="2000"/>
    <servo name="A2"            no="1" min="1000" neutral="1000" max="2000"/>
    <servo name="B1"            no="2" min="1000" neutral="1000" max="2000"/>
    <servo name="B2"            no="3" min="1000" neutral="1000" max="2000"/>
    <servo name="AILEVON_LEFT"  no="4" min="1000" neutral="1500" max="2000"/>
    <servo name="AILEVON_RIGHT" no="5" min="1000" neutral="1500" max="2000"/>
    <servo name="CAMERA_MOUNT"  no="6" min="1700" neutral="1500" max="1000"/>

    <axis name="ROLL"     failsafe_value="0"/>
    <axis name="PITCH"    failsafe_value="0"/>
    <axis name="YAW"      failsafe_value="0"/>
    <axis name="THRUST"   failsafe_value="0"/>
    <axis name="RC_MODE"  failsafe_value="0"/>
    <axis name="RC_ROLL"  failsafe_value="0"/>
    <axis name="RC_PITCH" failsafe_value="0"/>
    <axis name="RC_THRUST" failsafe_value="0"/>
    <axis name="CAMERA"   failsafe_value="0"/>

  <section name="AUTOPILOT">
    <define name="MODE_AUTO1"  value="AP_MODE_TOYTRONICS_FORWARD"/>
    <define name="MODE_AUTO2"  value="AP_MODE_TOYTRONICS_AEROBATIC"/>
    <define name="AUTOPILOT_KILL_WITHOUT_AHRS"  value="TRUE"/>
    <define name="AUTOPILOT_LOBATT_BLINK"  value="TRUE"/>
    <!--This is to enable a wing waggle at specified low battery voltage.-->
    <define name="LOBATT_WING_WAGGLE" value="TRUE"/>
    <define name="TOYTRONICS" value="TRUE"/>
    <define name="KILL_AS_FAILSAFE" value="TRUE"/>

    <!-- needed to set up mode laws -->
    <set command="RC_MODE"  value="@MODE < -1500 ? MODE_MANUAL : (@MODE > 1500 ? MODE_AUTO2 : MODE_AUTO1) "/>
    <set command="RC_ROLL"  value="@ROLL"/>
    <set command="RC_PITCH" value="@PITCH"/>
    <set command="RC_THRUST" value="@THROTTLE"/>

    <!--************* different mixing strategies - probably don't edit this ****************-->
    <!-- aileron feedback -->
    <let var="aileron_feedback_left"  value="address@hidden * (9600 + @RC_THRUST)/9600"/>
    <let var="aileron_feedback_right" value="address@hidden * (9600 + @RC_THRUST)/9600"/>

    <!-- elevator feedback -->
    <let var="elevator_feedback_left"  value="address@hidden * (9600 + @RC_THRUST)/9600"/>
    <let var="elevator_feedback_right" value="address@hidden * (9600 + @RC_THRUST)/9600"/>

    <!--************* which mode uses which mixing strategy - edit this for configuration ****************-->
    <!-- mode hover -->
    <let var="hover_left"  value="3*$aileron_feedback_left"/>
    <let var="hover_right" value="3*$aileron_feedback_right"/>

    <!-- mode hover_forward -->
    <let var="hover_forward_left"  value="@RC_THRUST > 1800 ? (3*$aileron_feedback_left  + 2*$elevator_feedback_left) : (@RC_PITCH > 1600 ? (3*$aileron_feedback_left  + 2*$elevator_feedback_left) : (@RC_PITCH < -1800 ? (3*$aileron_feedback_left  + 2*$elevator_feedback_left) : 0))"/>
    <let var="hover_forward_right" value="@RC_THRUST > 1800 ? (3*$aileron_feedback_right  + 2*$elevator_feedback_right) : (@RC_PITCH > 1600 ? (3*$aileron_feedback_right  + 2*$elevator_feedback_right) : (@RC_PITCH < -1800 ? (3*$aileron_feedback_right  + 2*$elevator_feedback_right) : 0))"/>

    <!-- mode forward -->
    <let var="forward_left"  value="3*$aileron_feedback_left  + 2*$elevator_feedback_left"/>
    <let var="forward_right" value="3*$aileron_feedback_right + 2*$elevator_feedback_right"/>

    <!-- mode aerobatic -->
    <let var="aerobatic_left"  value="3*$aileron_feedback_left  + 2*$elevator_feedback_left"/>
    <let var="aerobatic_right" value="3*$aileron_feedback_right + 2*$elevator_feedback_right"/>

    <!--************ Map laws to correct modes - probably don't edit this ****************-->
    <set servo="AILEVON_LEFT"   value="@RC_MODE == AP_MODE_TOYTRONICS_HOVER ? $hover_left  : (@RC_MODE == AP_MODE_TOYTRONICS_HOVER_FORWARD ? $hover_forward_left  : (@RC_MODE == AP_MODE_TOYTRONICS_FORWARD ? $forward_left : $aerobatic_left))" />
    <set servo="AILEVON_RIGHT"   value="@RC_MODE == AP_MODE_TOYTRONICS_HOVER ? $hover_right  : (@RC_MODE == AP_MODE_TOYTRONICS_HOVER_FORWARD ? $hover_forward_right  : (@RC_MODE == AP_MODE_TOYTRONICS_FORWARD ? $forward_right : $aerobatic_right))" />
    <set servo="CAMERA_MOUNT"   value="@CAMERA"/>
  <!-- for the sim -->
  <section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
    <define name="NB" value="4"/>
    <define name="ADDR" value="{ 0x52, 0x54, 0x56, 0x58 }"/>

  <section name="ROTORCRAFT" prefix="ROTORCRAFT_">
    <define name="COMMANDS_YAW_ALWAYS_ENABLED" value="TRUE"/>
  <section name="SUPERVISION" prefix="SUPERVISION_">
    <define name="MIN_MOTOR" value="1000"/>
    <define name="MAX_MOTOR" value="2000"/>
    <define name="TRIM_A" value="0"/>
    <define name="TRIM_E" value="0"/>
    <define name="TRIM_R" value="0"/>
    <define name="NB_MOTOR" value="4"/>
    <define name="SCALE" value="256"/>
    <define name="PITCH_COEF"  value="{ -256, -256,  256,  256 }"/>
    <define name="ROLL_COEF"   value="{  256, -256, -128,  128 }"/>
    <define name="YAW_COEF"    value="{  256, -256,  256, -256 }"/>
    <define name="THRUST_COEF" value="{  256,  256,  256,  256 }"/>

  <include href="">

  <section name="IMU" prefix="IMU_">
    <define name="BODY_TO_IMU_PHI"   value="RadOfDeg( 000. )"/>
    <define name="BODY_TO_IMU_THETA" value="RadOfDeg(   0. )"/>
    <define name="BODY_TO_IMU_PSI"   value="RadOfDeg(   0. )"/>


 <section name="BAT">
   <define name="MILLIAMP_AT_FULL_THROTTLE" value="10000"/>
   <define name="CATASTROPHIC_BAT_LEVEL" value="9.3" unit="V"/>
   <define name="MIN_BAT_LEVEL" value="10.4" units="V"/>


    <define name="SP_MAX_P" value="10000"/>
    <define name="SP_MAX_Q" value="10000"/>
    <define name="SP_MAX_R" value="10000"/>

    <define name="GAIN_P" value="-400"/>
    <define name="GAIN_Q" value="-400"/>
    <define name="GAIN_R" value="-350"/>


    <!-- setpoints -->
    <define name="SP_MAX_PHI"     value="RadOfDeg(45.)"/>
    <define name="SP_MAX_THETA"   value="RadOfDeg(45.)"/>
    <define name="SP_MAX_PSI"     value="RadOfDeg(45.)"/>
    <define name="SP_MAX_R"       value="RadOfDeg(90.)"/>
    <define name="SP_MAX_P"       value="RadOfDeg(90.)"/>
    <define name="DEADBAND_R"     value="250"/>
    <define name="DEADBAND_A"     value="250"/>

    <!-- reference -->
    <define name="REF_OMEGA_R"  value="RadOfDeg(600)"/>
    <define name="REF_ZETA_R"   value="0.90"/>
    <define name="REF_MAX_R"    value="RadOfDeg(400.)"/>
    <define name="REF_MAX_RDOT" value="RadOfDeg(8000.)"/>

    <define name="REF_OMEGA_Q"  value="RadOfDeg(800)"/>
    <define name="REF_ZETA_Q"   value="0.90"/>
    <define name="REF_MAX_Q"    value="RadOfDeg(500.)"/>
    <define name="REF_MAX_QDOT" value="RadOfDeg(8000.)"/>

    <define name="REF_OMEGA_P"  value="RadOfDeg(600)"/>
    <define name="REF_ZETA_P"   value="0.85"/>
    <define name="REF_MAX_P"    value="RadOfDeg(220.)"/>
    <define name="REF_MAX_PDOT" value="RadOfDeg(1800.)"/>

    <!-- feedback -->
    <define name="PSI_PGAIN"  value="-750"/>
    <define name="PSI_DGAIN"  value="-370"/>
    <define name="PSI_IGAIN"  value="-100"/>

    <define name="THETA_PGAIN"  value="-800"/>
    <define name="THETA_DGAIN"  value="-240"/>
    <define name="THETA_IGAIN"  value="-100"/>

    <define name="PHI_PGAIN"  value="-4000"/>
    <define name="PHI_DGAIN"  value="-600"/>
    <define name="PHI_IGAIN"  value="-10"/>

    <!-- feedforward -->
    <define name="PHI_DDGAIN"   value=" 300"/>
    <define name="THETA_DDGAIN" value=" 300"/>
    <define name="PSI_DDGAIN"   value=" 300"/>


  <section name="INS" prefix="INS_">
    <define name="BARO_SENS" value="3.3" integer="16"/>

 <section name="GUIDANCE_V" prefix="GUIDANCE_V_">
   <define name="MIN_ERR_Z"   value="POS_BFP_OF_REAL(-10.)"/>
   <define name="MAX_ERR_Z"   value="POS_BFP_OF_REAL( 10.)"/>
   <define name="MIN_ERR_ZD"  value="SPEED_BFP_OF_REAL(-10.)"/>
   <define name="MAX_ERR_ZD"  value="SPEED_BFP_OF_REAL( 10.)"/>
   <define name="MAX_SUM_ERR" value="2000000"/>
   <define name="HOVER_KP"    value="-150"/>
   <define name="HOVER_KD"    value="-80"/>
   <define name="HOVER_KI"    value="-20"/>
   <!-- 1.5m/s for full stick : BOOZ_SPEED_I_OF_F(1.5) / (MAX_PPRZ/2) -->
   <define name="RC_CLIMB_COEF" value ="163"/>
   <!-- BOOZ_SPEED_I_OF_F(1.5) * 20% -->
   <define name="RC_CLIMB_DEAD_BAND" value ="160000"/>
   <define name="INV_M" value ="0.21"/>

  <section name="AHRS" prefix="AHRS_">
    <define name="PROPAGATE_FREQUENCY" value="512"/>
    <define name="MAG_UPDATE_YAW_ONLY" value="1"/>
    <!-- magnetic field for Santa cruz from -->
    <define name="H_X" value=" 0.47577"/>
    <define name="H_Y" value=" 0.11811"/>
    <define name="H_Z" value=" 0.87161"/>

 <section name="GUIDANCE_H" prefix="GUIDANCE_H_">
   <define name="PGAIN" value="-100"/>
   <define name="DGAIN" value="-100"/>
   <define name="IGAIN" value="-0"/>

 <section name="SIMULATOR" prefix="NPS_">
   <define name="ACTUATOR_NAMES"  value="{&quot;front_motor&quot;, &quot;back_motor&quot;, &quot;right_motor&quot;, &quot;left_motor&quot;}"/>
   <define name="INITIAL_CONDITITONS" value="&quot;reset00&quot;"/>
   <define name="SENSORS_PARAMS" value="&quot;nps_sensors_params_booz2_a1.h&quot;"/>

 <include href=""> <include href="">  <include href="">

 <modules main_freq="512">
   <load name="battery_buzzer.xml"/>
   <load name="led_driver.xml"/>

  <firmware name="rotorcraft">
    <target name="ap" board="lisa_m_2.0">
<!--      <define name="BOOZ_START_DELAY" value="1"/> -->
      <subsystem name="radio_control" type="spektrum"/>
      <subsystem name="actuators"     type="pwm_supervision"/>
      <subsystem name="telemetry"     type="transparent"/>
      <define name="SERVO_HZ" value="400"/>
      <define name="RADIO_EXPO" value="RADIO_GEAR"/>
      <define name="SERVO_HZ_SECONDARY" value="40"/>
      <define name="RADIO_MODE" value="RADIO_FLAP"/>
      <!--define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/-->
      <define name="RADIO_CONTROL_SPEKTRUM_SIGNS" value="\{1,1,-1,1,-1,-1,-1,1,1,1,1,1\}"/>
      <define name = "RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT" value = "UART5"/>
      <define name = "OVERRIDE_UART5_IRQ_HANDLER"/>
    <target name="sim" board="pc">
      <subsystem name="fdm"           type="nps"/>
      <subsystem name="radio_control" type="ppm"/>
      <subsystem name="actuators"     type="mkk"/>

    <subsystem name="imu"           type="aspirin_v2.0"/>
    <configure name="PERIODIC_FREQUENCY" value="512"/>
    <subsystem name="gps"           type="ublox"/>
    <!--subsystem name="ahrs"          type="float_dcm"/-->
    <subsystem name="ahrs"          type="int_cmpl_quat"/>
    <subsystem name="stabilization" type="quaternion"/>
    <subsystem name="toytronics"    type="default"/>
    <subsystem name="camera_mount"  type="default"/>

  <firmware name="lisa_m_test_progs">
    <target name="test_led"            board="lisa_m_2.0"/>
    <target name="test_uart_lisam"            board="lisa_m_2.0"/>
    <target name="test_servos"            board="lisa_m_2.0"/>
    <target name="test_telemetry"        board="lisa_m_2.0"/>
    <target name="test_imu_aspirin"            board="lisa_m_2.0"/>
    <target name="test_rc_spektrum"        board="lisa_m_2.0"/>
    <target name="test_baro"            board="lisa_m_2.0"/>
    <!--<target name="test_imu"            board="lisa_m_2.0"/>
    <target name="test_rc_ppm"            board="lisa_m_2.0"/>
    <target name="test_adc"            board="lisa_m_2.0"/>
    <target name="test_hmc5843"            board="lisa_m_2.0"/>
    <target name="test_itg3200"            board="lisa_m_2.0"/>
    <target name="test_adxl345"            board="lisa_m_2.0"/>
    <target name="test_esc_mkk_simple"        board="lisa_m_2.0"/>
    <target name="test_esc_asctecv1_simple"    board="lisa_m_2.0"/>
    <target name="test_actuators_mkk"        board="lisa_m_2.0"/>
    <target name="test_actuators_asctecv1"    board="lisa_m_2.0"/-->
and the radio xml
<?xml version="1.0"?>
<!-- $Id$
-- (c) 2003 Pascal Brisset, Antoine Drouin
-- This file is part of paparazzi.
-- paparazzi is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2, or (at your option)
-- any later version.
-- paparazzi is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- GNU General Public License for more details.
-- You should have received a copy of the GNU General Public License
-- along with paparazzi; see the file COPYING.  If not, write to
-- the Free Software Foundation, 59 Temple Place - Suite 330,
-- Boston, MA 02111-1307, USA.

-- Attributes of root (Radio) tag :
-- name: name of RC
-- min: min width of a pulse to be considered as a data pulse
-- max: max width of a pulse to be considered as a data pulse
-- sync: min width of a pulse to be considered as a synchro pulse
-- min, max and sync are expressed in micro-seconds

-- Attributes of channel tag :
-- ctl: name of the command on the transmitter - only for displaying
-- function: logical command
-- average: (boolean) channel filtered through several frames (for discrete commands)
-- min: minimum pulse length (micro-seconds)
-- max: maximum pulse length (micro-seconds)
-- neutral: neutral pulse length (micro-seconds)
Note: a command may be reversed by exchanging min and max values

<!DOCTYPE radio SYSTEM "radio.dtd">
<radio name="DX6i" data_min="700" data_max="2300" sync_min="4000" sync_max="20000" pulse_type="NEGATIVE">
  <channel ctl="0" function="THROTTLE" min="1100" neutral="1500" max="1900" average="0"/>     <!-- right stick left/right -->
  <channel ctl="1" function="ROLL" min="1900" neutral="1500" max="1100" average="0"/>    <!-- left stick up/down -->
  <channel ctl="2" function="PITCH" min="1100" neutral="1100" max="1900" average="0"/>    <!-- right stick up/down -->
  <channel ctl="3" function="YAW" min="1100" neutral="1500" max="1900" average="0"/>    <!-- left stick left/right-->
  <channel ctl="4" function="EXPO" min="1900" neutral="1500" max="1100" average="0"/>     <!-- right switch -->
  <channel ctl="5" function="MODE" min="1900" neutral="1500" max="1100" average="0"/>     <!-- left switch -->

reply via email to

[Prev in Thread] Current Thread [Next in Thread]