paparazzi-devel
[Top][All Lists]
Advanced

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

Re: [Paparazzi-devel] Airspeed


From: Jesus Martin Sanchez
Subject: Re: [Paparazzi-devel] Airspeed
Date: Thu, 23 Feb 2012 18:37:44 +0100

Hi:
  I´ve verified my conecctions and all it´s ok, my problem it´s that I have any error message, the only problem it´s that the GCS doesn´t load anything. The only thing that I´ve changed respect the correct airframe file (without the airspeed) are the airspeed code. Thats it´s what I´m using that dont work...
  Thanks a lot
  Jesús

<!DOCTYPE airframe SYSTEM "airframe.dtd">

<!-- Mugin UAV, 
     XTend
     LEA 5H GPS (set to POSLLH)
-->

<!--RESPI VERSION V3 modificada con los para metros del EasyStar_ets que tiene AirSpeed y Baro. Verson Nueva para V3. param cambia define-->

<airframe name="Mugin UAV">

  <firmware name="fixedwing">

    <target name="ap" board="twog_1.0">
      <define name="AGR_CLIMB"/>
      <define name="LOITER_TRIM"/>
      <define name="ALT_KALMAN"/>
      <define name="USE_I2C0"/><!--RESPI ADD-->
      <define name="UNLOCKED_HOME_MODE" value="TRUE"/> <!--Esto se anade para deshabilitar el salir de HOME_MODE desde la GCS-->
      <define name="USE_AIRSPEED"/><!--RESPI ADD AIRSPEED-->
      <define name="SENSOR_SYNC_SEND"/><!--RESPI ADD AIRSPEED-->
      <!--<define name="USE_BARO_ETS"/>RESPI ADD BARO-->
      <define name="GPS_USE_LATLONG"/><!--RESPI ADD Para ver si se arregla lod el HOME MODE porculero-->
      <define name="USE_USB_HIGH_PCLK" />

    </target>

    <target name="sim" board="pc">
      <define name="LOITER_TRIM"/>
      <define name="ALT_KALMAN"/>
      <define name="AGR_CLIMB"/>
    </target>

    <subsystem name="radio_control" type="ppm"/>
    <subsystem name="telemetry"     type="transparent">
      <define name="MODEM_BAUD"          value="B57600"/><!--RESPI :PROBAMOS CON ESTO AHORA Y VA OK TAMBIEN-->
     </subsystem>
    <subsystem name="control"/>
    <subsystem name="gps" type="ublox"/>
    <!--<subsystem name="navigation"/>   RESPI Esto del TwinStar-->
    <subsystem name="navigation"    type="extra"/>  <!--Esto es del EasyStar. Se usa para rutinas de navegacion avanzadas-->
   <subsystem name="i2c"> <!--RESPI ADD-->
    </subsystem>
   <subsystem name="spi_slave_hs"><!--JESUS ADD-->
    </subsystem>

  </firmware>

  <!--<firmware name="setup"> RESPI SUB
    <target name="tunnel"           board="twog_1.0" />
    <target name="setup_actuators"  board="twog_1.0" />
  </firmware>-->
 
  <!--CHIMU ADD-->
  <modules>
  <load name="ins_chimu_spi.xml" >

  </load>
  <!--AIRSPEED ADD-->
    <load name="airspeed_ets.xml">
       <define name="AIRSPEED_ETS_SCALE"   value="1.8"/>
       <define name="AIRSPEED_ETS_OFFSET"  value="4"/>
       <define name="AIRSPEED_ETS_I2C_DEV" value="i2c0"/>
    </load>
    

  </modules><!-- END RESPI ADD-->

<!-- commands section -->
  <servos>
    <servo name="AIL_LEFT"           no="0" min="1800" neutral="1500" max="1200"/>
    <servo name="RUDDERVATOR_LEFT"   no="1" min="1950" neutral="1500" max="1050"/>
    <servo name="MOTOR"              no="2" min="2100" neutral="1650" max="1200"/>
    <servo name="RUDDERVATOR_RIGHT"  no="3" min="1050" neutral="1500" max="1950"/>
    <servo name="AIL_RIGHT"          no="4" min="1800" neutral="1500" max="1200"/>
    <servo name="RUEDA_MORRO"        no="5" min="1200" neutral="1500" max="1800"/>
    <servo name="FRENOS"             no="6" min="1000" neutral="1500" max="2000"/>
    <servo name="PARACAIDAS"         no="7" min="1000" neutral="1500" max="2000"/>
    
  </servos>

  <commands>
    <axis name="THROTTLE"   failsafe_value="0"/>
    <axis name="ROLL"       failsafe_value="0"/>
    <axis name="PITCH"      failsafe_value="0"/>
    <axis name="YAW"        failsafe_value="0"/> 
    <axis name="FRENOS"     failsafe_value="0"/>
    <axis name="PARACAIDAS" failsafe_value="0"/>
  </commands>

  <rc_commands>
    <set command="THROTTLE"   value="@THROTTLE"/>
    <set command="ROLL"       value="@ROLL"/>
    <set command="PITCH"      value="@PITCH"/>
    <set command="YAW"        value="@YAW"/> 
    <set command="PARACAIDAS" value="@PARACAIDAS"/>
    <set command="FRENOS"     value="@FRENOS"/>
  </rc_commands>

  <auto_rc_commands>
    <set command="PARACAIDAS" value="@PARACAIDAS"/>
    <set command="FRENOS" value="@FRENOS"/>
  </auto_rc_commands>

  <section name="MIXER">
    <define name="RUDERVATOR_YAW_RATE" value="0.8"/><!--DEJADO COMO TENIA RAFA-->
    <define name="RUDERVATOR_ELEVATOR_RATE" value="0.7"/><!--COMO LO TENÍA RAFA-->
    <define name="RUEDA_MORRO_YAW_RATE" value="0.7"/><!--ESTO ESTA BIEN???-->
    <define name="AILERON_DIFF" value="0.7"/>
  </section>

  <command_laws>
    <let var="aileron"                 value="@ROLL"/>
    <let var="elevator"                value="@PITCH * RUDERVATOR_ELEVATOR_RATE"/>
    <let var="yaw"                     value="@YAW * RUDERVATOR_YAW_RATE * RUEDA_MORRO_YAW_RATE "/> <!--ESTO ESTA BIEN??? TBC-->
    <set servo="MOTOR"                 value="@THROTTLE"/>
    <set servo="RUDDERVATOR_LEFT"      value="$elevator - $yaw"/>
    <set servo="RUDDERVATOR_RIGHT"     value="$elevator + $yaw"/>
    <set servo="AIL_RIGHT"             value="($aileron > 0 ? AILERON_DIFF : 1) address@hidden"/>
    <set servo="AIL_LEFT"              value="($aileron > 0 ? 1 : AILERON_DIFF) address@hidden"/>  <!--hay que añadir el resto de canales (frenos... etc)? TBC-->
    <set servo="RUEDA_MORRO"           value="@YAW"/>
    <set servo="PARACAIDAS"            value="@PARACAIDAS"/>
    <set servo="FRENOS"                value="@FRENOS"/>
  </command_laws>

<section name="INS" prefix="INS_"><!--jesus ADD PARA LA IMU-->
     <define name="ROLL_NEUTRAL_DEFAULT" value="0" unit="deg"/>
     <define name="PITCH_NEUTRAL_DEFAULT" value="0" unit="deg"/>
  </section>

  <section name="AUTO1" prefix="AUTO1_"><!--RESPI Esta seccion del EasyStar-->
    <define name="MAX_ROLL" value="RadOfDeg(40)"/><!--Angulo de la SUPERFICIE de Alerones NO ES ROLL-->
    <define name="MAX_PITCH" value="RadOfDeg(40)"/><!--Angulo de la SUPERFICIE de Profundidad NO ES PITCH-->
  </section>



   <section name="BAT">
    <define name="MILLIAMP_AT_FULL_THROTTLE" value="1200" unit="mA"/><!--RESPI Cambiado en V4-->
    <define name="ADC_CHANNEL_CURRENT" value="ADC_3" /><!--Anadido en V4-->
    <define name="MilliAmpereOfAdc(adc)" value="(124*(adc-519))"/><!--Anadido en V4. Habra que escalarlo correctamente Con 112 estaba por debajo.-->
    <define name="VoltageOfAdc(adc)" value ="(0.0268*adc)"/><!--Para su el valor de bateria indicado sea correcto. Definido en twog_1.0.h-->
    <define name="CATASTROPHIC_BAT_LEVEL" value="5.8" unit="V"/><!--Valores adaptados a la diferencia de escalado. Poner sus valores cuando se ponga bien-->
    <define name="CRITIC_BAT_LEVEL" value="2" unit="V"/>
    <define name="LOW_BAT_LEVEL" value="5.5" unit="V"/>
    <define name="MAX_BAT_LEVEL" value="8.3" unit="V"/>
    <define name="ADC_CHANNEL_VOLTIOS_BATERIA_MOTOR" value="ADC_4" />
    <define name="VoltageOfAdc_auxiliar(adc)" value ="(0.0268*adc)"/><!--Lo pongo para la bateria de motor. Definido en twog_1.0.h-->
  </section>

  <section name="MISC"><!--RESPI Esto del TwinStar-->
    <define name="MINIMUM_AIRSPEED" value="12." unit="m/s"/>
    <define name="NOMINAL_AIRSPEED" value="15." unit="m/s"/>
    <define name="MAXIMUM_AIRSPEED" value="25." unit="m/s"/>
    <define name="CARROT" value="5." unit="s"/>
    <define name="KILL_MODE_DISTANCE" value="(1.5*MAX_DIST_FROM_HOME)"/>
    <define name="CONTROL_RATE" value="60" unit="Hz"/><!--RESPI MOD 60HZ Puede ser 20 Hz-->
    <define name="ALT_KALMAN_ENABLED" value="FALSE"/><!--RESPI FALSE-->

    <define name="TRIGGER_DELAY" value="1."/>
    <define name="DEFAULT_CIRCLE_RADIUS" value="150."/>
    
  </section>


  <section name="VERTICAL CONTROL" prefix="V_CTL_"><!--RESPI Esta Seccion es completa del EasyStar-->
    <define name="POWER_CTL_BAT_NOMINAL" value="8.4" unit="volt"/><!--Era 11.1 Se lo pongo a 8.4 para la micro-->
    <!-- outer loop -->
    <define name="ALTITUDE_PGAIN" value="-0.15" unit="(m/s)/m"/><!--RESPI CALERO UPDATE Estaba en -0.075 -->
    <define name="ALTITUDE_MAX_CLIMB" value="3." unit="m/s"/>
    <!-- auto throttle inner loop -->
    <define name="AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" value="0.35" unit="%"/>
    <define name="AUTO_THROTTLE_MIN_CRUISE_THROTTLE" value="0.2" unit="%"/><!--Era 0.4.Cambiado 29-03-2011-->
    <define name="AUTO_THROTTLE_MAX_CRUISE_THROTTLE" value="0.9" unit="%"/><!--Era 0.8.Cambiado 29-03-2011-->
    <define name="AUTO_THROTTLE_LOITER_TRIM" value="1500" unit="pprz_t"/>
    <define name="AUTO_THROTTLE_DASH_TRIM" value="-1000" unit="pprz_t"/>
    <define name="AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT" value="0.1" unit="%/(m/s)"/>
    <define name="AUTO_THROTTLE_PGAIN" value="-0.02" unit="%/(m/s)"/>
    <define name="AUTO_THROTTLE_IGAIN" value="0.1"/>
    <define name="AUTO_THROTTLE_PITCH_OF_VZ_PGAIN" value="0.2" unit="rad/(m/s)"/><!--RESPI CALERO UPDATE Estaba en 0.05-->

    <define name="AUTO_PITCH_PGAIN" value="-0.05"/> <!--RESPI Era -0.125 Vuelo viernes -0.09-->
    <define name="AUTO_PITCH_IGAIN" value="0.015"/> <!--RESPI Era -0.025 Vuelo Viernes 0.024-->
    <define name="AUTO_PITCH_MAX_PITCH" value="RadOfDeg(25)"/>
    <define name="AUTO_PITCH_MIN_PITCH" value="RadOfDeg(-25)"/>
    <define name="THROTTLE_SLEW" value="1.0"/>

    <!-- auto airspeed and altitude inner loop --><!--RESPI ADD-->
    
     <define name="AUTO_AIRSPEED_SETPOINT" value="8.0" unit="m/s"/> <!--Era 14.5-->
     <define name="AUTO_AIRSPEED_PGAIN" value="0.060"/>
     <define name="AUTO_AIRSPEED_IGAIN" value="0.050"/>

     <define name="AUTO_GROUNDSPEED_SETPOINT" value="5.0" unit="m/s"/><!--Era 6-->
     <define name="AUTO_GROUNDSPEED_PGAIN" value="0.75"/>
     <define name="AUTO_GROUNDSPEED_IGAIN" value="0.25"/>

  </section>

<!--  <section name="HORIZONTAL CONTROL" prefix="H_CTL_">
    <define name="COURSE_PGAIN" value="-1.0"/>
    <define name="ROLL_MAX_SETPOINT" value="0.60" unit="radians"/>
    <define name="PITCH_MAX_SETPOINT" value="0.5" unit="radians"/>
    <define name="PITCH_MIN_SETPOINT" value="-0.5" unit="radians"/>

    <define name="ROLL_PGAIN" value="6000."/>
    <define name="AILERON_OF_THROTTLE" value="0.0"/>
    <define name="PITCH_PGAIN" value="-9000."/>
    <define name="PITCH_DGAIN" value="-1700."/>

    <define name="ELEVATOR_OF_ROLL" value="1500"/>
  </section>  RESPI Esto es del Twin-->

  <section name="HORIZONTAL CONTROL" prefix="H_CTL_"><!--RESPI Esta seccion entera del EasyStar-->
    <define name="COURSE_PGAIN" value="-0.7"/>
    <define name="ROLL_MAX_SETPOINT" value="0.6" unit="radians"/><!--Pongo los limites en radianes RadOfDeg(35)-->
    <define name="PITCH_MAX_SETPOINT" value="0.4" unit="radians"/><!--Pongo los limites en radianes RadOfDeg(25)-->
    <define name="PITCH_MIN_SETPOINT" value="-0.4" unit="radians"/><!--Pongo los limites en radianes RadOfDeg(25)-->

    <define name="ROLL_PGAIN" value="1560."/><!--RESPI Esto lo conservo del Twin--><!--Era 6000 Cambiado a 1560 Vuelo 17-03-->
    <define name="PITCH_PGAIN" value="-8000."/><!--Era -12000 Cambiado a -8000 Vuelo 17-03-->
    <define name="PITCH_DGAIN" value="1.5"/>
    <define name="ELEVATOR_OF_ROLL" value="2500"/>
    <define name="ROLL_ATTITUDE_GAIN" value="-10000"/><!--Estaba en -14000 Vuelo 17-03-->
    <define name="ROLL_RATE_GAIN" value="-200"/>
  </section>


  <section name="NAV">
    <define name="NAV_PITCH" value="0."/>
    <define name="NAV_GLIDE_PITCH_TRIM" value="0"/>
  </section>

  <section name="AGGRESSIVE" prefix="AGR_">
    <define name="BLEND_START" value="50"/><!-- Altitude Error to Initiate Aggressive Climb CANNOT BE ZERO!!-->
    <define name="BLEND_END" value="15"/><!-- Altitude Error to Blend Aggressive to Regular Climb Modes  CANNOT BE ZERO!!-->
    <define name="CLIMB_THROTTLE" value="0.6" unit="%"/><!-- Gaz for Aggressive Climb RESPI esto es del EasyStar 0.9-->
    <define name="CLIMB_PITCH" value="RadOfDeg(20)"/><!-- Pitch for Aggressive Climb RESPI Esto es del EasyStar 0.35-->
    <define name="DESCENT_THROTTLE" value="0.1"/><!-- Gaz for Aggressive Decent RESPI Esto del EasyStar 0.05-->
    <define name="DESCENT_PITCH" value="RadOfDeg(-20)"/><!-- Pitch for Aggressive Decent RESPI Esto es del EasyStar -0.35-->
    <define name="CLIMB_NAV_RATIO" value="0.8"/><!-- Percent Navigation for Altitude Error Equal to Start Altitude -->
    <define name="DESCENT_NAV_RATIO" value="1.0"/>
  </section>

  <section name="FAILSAFE" prefix="FAILSAFE_">
    <define name="DELAY_WITHOUT_GPS" value="5" unit="s"/>
    <define name="DEFAULT_THROTTLE" value="0.1" unit="%"/>
    <define name="DEFAULT_ROLL" value="0.17" unit="rad"/>
    <define name="DEFAULT_PITCH" value="0.08" unit="rad"/>
    <define name="HOME_RADIUS" value="80" unit="m"/>
  </section>

  <section name="DATALINK" prefix="DATALINK_">
    <define name="DEVICE_TYPE" value="PPRZ"/>
    <define name="DEVICE_ADDRESS" value="...."/>
  </section>


 <makefile>

 ap.CFLAGS += -DADC -DUSE_ADC_3 -DUSE_ADC_4

  </makefile>


</airframe>

--
Jesús Martín




reply via email to

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