twog crashes in the first 10 seconds #3

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

twog crashes in the first 10 seconds #3

Chris Efstathiou
After much more testing i found that the problem also appears if i make
any airframe change so it is really a hit and miss situation.
Maybe the compiler is problematic or an update i did causes the problem
because as i said the problem exists even if i use the older 5.8.1 version.
Maybe i should reinstall the gcc arm none eabi or the new gcc arm embedded.
In any case here is the airframe file also:

<!DOCTYPE airframe SYSTEM "../airframe.dtd">


<airframe name="C177_flaperons_twog.xml">

<firmware name="fixedwing">

<target name="ap"             board="twog_1.0"/>
<target name="sim"             board="pc"/>


<!--#######################################################################################-->
<!--##############################   GLOBAL DEFINITIONS
#################################-->
<!--#######################################################################################-->

     <!--  "configure" pass the definition in the makefile -->
     <configure name="SYS_TIME_LED" value="1"/>
     <configure name="GPS_LED" value="2"/>
     <!--  "define" pass the definition in the C preprocessor -->
     <define name="USE_LED_1"/>
     <define name="USE_LED_2"/>
     <define name="USE_LED_3"/>
         <define name="AGR_CLIMB"/>
     <define name="WIND_INFO"/>
     <define name="WIND_INFO_RET"/>
     <define name="STRONG_WIND"/>
     <define name="USE_I2C"/>
     <define name="USE_I2C0"/>
<!--    <define name="SENSOR_SYNC_SEND"/>  -->
     <define name="USE_AHRS_GPS_ACCELERATIONS"/>

<!--#######################################################################################-->
<!--##############################     SUBSYSTEMS
#################################-->
<!--#######################################################################################-->
<!-- "define" goes to the C preprocessor, "configure" configures the
makefile -->

     <subsystem name="telemetry" type="transparent">
     <configure name="MODEM_BAUD" value="B115200"/>
<!--    <configure name="MODEM_PORT" value="UART2"/> -->
<!--    <configure name="MODEM_LED"  value="5"/>  -->
         </subsystem>
         <module name="gps" type="ublox">
     <configure name="GPS_BAUD"          value="B38400"/>
<!--    <configure name="GPS_PORT" value="UART3"/>  -->
<!--    <configure name="GPS_LED"           value="none"/> -->
         </module>

     <subsystem name="control" />
     <subsystem name="radio_control" type="ppm"/>
     <subsystem name="navigation" />
         <subsystem name="imu"    type="ppzuav" />
     <!-- MAGNETOMETER IS NOT WORKING IN DCM BE CAREFULL -->
         <subsystem name="ahrs" type="float_dcm">
         <define name="USE_MAGNETOMETER" value="0"/>
         <define name="USE_MAGNETOMETER_ONGROUND" value="0"/>
         </subsystem>
     <subsystem name="ins" type="alt_float"/>
     <subsystem name="spi" type="master"/>
</firmware>


<!--#######################################################################################-->
<!--################################      MODULES
#################################-->
<!--#######################################################################################-->
  <modules>
     <load name="nav_line.xml"/>
     <load name="my_cam_yaw_pitch_nose_180.xml"/>
</modules>


<!--#######################################################################################-->
<!--#############################   SERVOS AND CONTROLS
#################################-->
<!--#######################################################################################-->
<!-- commands section -->
<servos>
     <servo name="AILERON_LEFT"    no="0" min="1000" neutral="1500"
max="2000"/>
     <servo name="AILERON_RIGHT"    no="5" min="1000" neutral="1500"
max="2000"/>
     <servo name="ELEVATOR"        no="1" min="2000" neutral="1500"
max="1000"/>
     <servo name="MOTOR"        no="2" min="1100" neutral="1100"  
max="2000"/>
     <servo name="RUDDER"        no="3" min="1000" neutral="1500"
max="2000"/>
     <servo name="CAMERA_ZOOM"    no="4" min="943" neutral="1520"
max="2056"/>
     <servo name="CAMERA_PAN"    no="6" min="2056" neutral="1520"
max="943"/>
     <servo name="CAMERA_TILT"    no="7" min="996" neutral="1221"
max="2004"/>
</servos>

<commands>
     <axis name="ROLL"        failsafe_value="0"/>
     <axis name="PITCH"        failsafe_value="0"/>
     <axis name="THROTTLE"        failsafe_value="0"/>
     <axis name="YAW"        failsafe_value="0"/>
     <axis name="FLAPS"        failsafe_value="0"/>
     <axis name="CAM_TILT"        failsafe_value="0"/>
     <axis name="CAM_PAN"        failsafe_value="0"/>
     <axis name="CAM_ZOOM"        failsafe_value="0"/>
</commands>

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

<section name="MIXER">
         <define name="AILERON_DIFF" value="0.66"/>
     <define name="COMBI_SWITCH" value="0.3"/>
</section>

<command_laws>
         <let var="roll" value="@ROLL"/>
         <let var="flaps" value="@FLAPS"/>
         <set servo="AILERON_LEFT" value="$roll + $flaps"/>
         <set servo="AILERON_RIGHT" value="$roll - $flaps"/>
<!--
         <set servo="AILERON_LEFT" value="(($roll > 0 ? 1 :
AILERON_DIFF) * $roll) + $flaps"/>
         <set servo="AILERON_RIGHT" value="(($roll > 0 ? AILERON_DIFF :
1) * $roll) - $flaps"/>
-->
     <set servo="ELEVATOR"        value="@PITCH"/>
     <set servo="MOTOR"        value="@THROTTLE"/>
     <set servo="RUDDER"        value="@YAW - (@ROLL*COMBI_SWITCH)"/>
     <set servo="CAMERA_TILT"    value="@CAM_TILT"/>
     <set servo="CAMERA_PAN"        value="@CAM_PAN"/>
     <set servo="CAMERA_ZOOM"    value="@CAM_ZOOM"/>
</command_laws>

<!-- EMPTY "auto_rc_commands" block means NO RC RUDDER CONTROL IN AUTO2
AND AUTO1 -->
  <auto_rc_commands>
<!--    <set command="YAW" value="@YAW"/>  -->
  </auto_rc_commands>


<ap_only_commands>
<!--    <copy command="ANT_PAN"/>  -->
</ap_only_commands>


<!--#######################################################################################-->
<!--#################################    I M U SETUP
#################################-->
<!--#######################################################################################-->

<!-- Normalized Local magnetic field obtained from
http://www.ngdc.noaa.gov/geomag-web/#igrfwmm -->
<!-- Magnetic field intensity / total field strength -->
<!-- Calculated for PIRAEUS HELLAS 31 MAY 2013 declination = 3.59
degrees, 5.9 deg/year-->
<section name="AHRS" prefix="AHRS_" >
     <define name="H_X" value="(26536.9/45821.6)" />
     <define name="H_Y" value="(1850.1/45821.6)" />
     <define name="H_Z" value="(37309.3/45821.6) " />
     <define name="MAG_DECLINATION" value="(RadOfDeg(4))" />
</section>


<section name="IMU" prefix="IMU_">

     <define name="BODY_TO_IMU_PHI" value="0" unit="deg"/>
     <define name="BODY_TO_IMU_THETA" value="0" unit="deg"/>
     <define name="BODY_TO_IMU_PSI" value="0" unit="deg"/>

     <define name="GYRO_P_SIGN" value="1"/>
     <define name="GYRO_Q_SIGN" value="1"/>
     <define name="GYRO_R_SIGN" value="1"/>

     <define name="GYRO_P_Q" value="0."/>
     <define name="GYRO_P_R" value="0"/>
     <define name="GYRO_Q_P" value="0."/>
     <define name="GYRO_Q_R" value="0."/>
     <define name="GYRO_R_P" value="0."/>
     <define name="GYRO_R_Q" value="0."/>

     <!-- SENS = 14.375 LSB/(deg/sec) * 57.6 deg/rad = 828 LSB/rad/sec /
12bit FRAC: 4096 / 828 -->
     <define name="GYRO_P_SENS" value="4.947" integer="16"/>
     <define name="GYRO_Q_SENS" value="4.947" integer="16"/>
     <define name="GYRO_R_SENS" value="4.947" integer="16"/>

     <define name="ACCEL_X_SIGN" value="1"/>
     <define name="ACCEL_Y_SIGN" value="1"/>
     <define name="ACCEL_Z_SIGN" value="1"/>

     <define name="ACCEL_X_NEUTRAL" value="0"/>
     <define name="ACCEL_Y_NEUTRAL" value="0"/>
     <define name="ACCEL_Z_NEUTRAL" value="0"/>

     <!-- SENS = 256 LSB/g @ 2.5V [X&Y: 265 LSB/g @ 3.3V] / 9.81 ms2/g =
26.095 LSB/ms2 / 10bit FRAC: 1024 / 26.095 for z and 1024 / 27.01 for
X&Y -->
     <define name="ACCEL_X_SENS" value="37.9" integer="16"/>
     <define name="ACCEL_Y_SENS" value="37.9" integer="16"/>
     <define name="ACCEL_Z_SENS" value="39.24" integer="16"/>

<!-- PPZUAVIMU does not have a magnetometer. -->
     <define name="MAG_X_SIGN" value="1"/>
     <define name="MAG_Y_SIGN" value="1"/>
     <define name="MAG_Z_SIGN" value="1"/>

     <!-- Found with calibrate.py script -->
     <define name="MAG_X_NEUTRAL" value="73"/>
     <define name="MAG_Y_NEUTRAL" value="118"/>
     <define name="MAG_Z_NEUTRAL" value="169"/>

     <define name="MAG_X_SENS" value="4.25741044617" integer="16"/>
     <define name="MAG_Y_SENS" value="4.26451705702" integer="16"/>
     <define name="MAG_Z_SENS" value="4.87790997442" integer="16"/>

</section>

<!--#######################################################################################-->
<!--##################   AIRCRAFT ATTITUDE TRIMMING AND AUTO1 LIMITS  
#####################-->
<!--#######################################################################################-->
<section name="INS" prefix="INS_">
     <define name="ROLL_NEUTRAL_DEFAULT" value="RadOfDeg(-4.0)"
unit="radians"/>
     <define name="PITCH_NEUTRAL_DEFAULT" value="RadOfDeg(0)"
unit="radians"/>
</section>

<section name="AUTO1" prefix="AUTO1_">
     <define name="MAX_ROLL" value="40" unit="deg"/>
     <define name="MAX_PITCH" value="30" unit="deg"/>
</section>


<!--#######################################################################################-->
<!--#########################   AIRCRAFT  VERTICAL CONTROL SETUP  
########################-->
<!--#######################################################################################-->
<section name="VERTICAL CONTROL" prefix="V_CTL_">
                     <!-- OUTER LOOP PARAMETERS  -->
<!-- The below definition affect the throttle percentage shown on the
GCS. -->
     <define name="POWER_CTL_BAT_NOMINAL" value="12.0" unit="volt"/>
     <!-- outer loop ALTITUDE proportional gain -->
     <define name="ALTITUDE_PGAIN" value="0.07" unit="(m/s)/m"/>
     <!-- outer loop ALTITUDE LIMIT (saturation) -->
     <define name="ALTITUDE_MAX_CLIMB" value="3" unit="m/s"/>
     <!-- outer loop AIRSPEED proportional gain -->
     <define name="AIRSPEED_PGAIN"    value="0.2"/>

                    <!-- INNER LOOP PARAMETERS -->
         <!-- The below definitions are used almost always -->
     <define name="AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" value="0.50"
unit="%"/>
     <define name="AUTO_THROTTLE_MIN_CRUISE_THROTTLE" value="0.40"
unit="%"/>
     <define name="AUTO_THROTTLE_MAX_CRUISE_THROTTLE" value="0.60"
unit="%"/>
     <define name="THROTTLE_SLEW_LIMITER"             value="0.6" unit="s"/>
     <define name="AUTO_PITCH_MAX_PITCH" value="RadOfDeg(20)"/>
     <define name="AUTO_PITCH_MIN_PITCH" value="RadOfDeg(-20)"/>

     <!-- Climb loop (throttle) -->
     <define name="AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT" value="0.1"  
unit="%/(m/s)"/>
     <define name="AUTO_THROTTLE_NOMINAL_CRUISE_PITCH" value="0.0"
unit="rad"/>

     <define name="AUTO_THROTTLE_PGAIN" value="0.008"unit="%/(m/s)"/>
     <define name="AUTO_THROTTLE_IGAIN" value="0.0"/>
     <define name="AUTO_THROTTLE_DGAIN" value="0.001"/>

     <!-- Climb loop (pitch) -->
         <!-- magnitude of elevator movement on altitude change -->
     <define name="AUTO_THROTTLE_PITCH_OF_VZ_PGAIN" value="0.05"
unit="rad/(m/s)"/> <!-- 0.05 -->
         <define name="AUTO_PITCH_PGAIN" value="0.04"/> <!--0.052-->
         <define name="AUTO_PITCH_DGAIN" value="0.0"/>
         <define name="AUTO_PITCH_IGAIN" value="0.01"/> <!--0.065-->

     <!-- Loiter and Dash trimming -->
     <define name="AUTO_THROTTLE_LOITER_TRIM"        value="0"
unit="pprz_t"/>
     <define name="AUTO_THROTTLE_DASH_TRIM"            value="0"
unit="pprz_t"/>
     <define name="PITCH_LOITER_TRIM"            value="0" unit="pprz_t"/>
     <define name="PITCH_DASH_TRIM"                value="0" unit="pprz_t"/>

</section>



<!--#######################################################################################-->
<!--########################   AIRCRAFT HORIZONTAL CONTROL SETUP  
########################-->
<!--#######################################################################################-->
<section name="HORIZONTAL CONTROL" prefix="H_CTL_">
     <define name="COURSE_PGAIN"                value="0.7"/>
         <define name="COURSE_PRE_BANK_CORRECTION" value="1."/>

     <define name="PITCH_MAX_SETPOINT"            value="20" unit="deg"/>
     <define name="PITCH_MIN_SETPOINT"            value="-20" unit="deg"/>
     <define name="PITCH_PGAIN"                value="8000."/>

     <define name="ROLL_MAX_SETPOINT"            value="30" unit="deg"/>
     <define name="ROLL_SLEW"                value="0.1"/>
     <define name="ROLL_ATTITUDE_GAIN" value="9000"/>
     <define name="ROLL_RATE_GAIN" value="500."/>

     <define name="ELEVATOR_OF_ROLL" value="1350"/>
     <define name="AILERON_OF_THROTTLE" value="0.0"/>

     <define name="PITCH_DGAIN"                value="6."/>
     <define name="PITCH_IGAIN"                value="100."/>

</section>


<!--#######################################################################################-->
<!--############################    AIRBORNE BATTERY SETUP
#############################-->
<!--#######################################################################################-->
<section name="BAT">
     <define name="MILLIAMP_AT_FULL_THROTTLE" value="22000"/>
     <define name="BAT_CAPACITY" value="10000."/>
     <define name="CATASTROPHIC_BAT_LEVEL"            value="8" unit="V"/>
     <define name="CRITIC_BAT_LEVEL"                value="9.3" unit="V"/>
     <define name="LOW_BAT_LEVEL"                value="10.5" unit="V"/>
     <define name="MAX_BAT_LEVEL"                value="12.0" unit="V"/>
</section>

<!--#######################################################################################-->
<!--#############################    MISCELLANEOUS SETUP
###############################-->
<!--#######################################################################################-->

<section name="MISC">
     <define name="CLIMB_AIRSPEED"                value="16." unit="m/s"/>
     <define name="GLIDE_AIRSPEED"                value="14." unit="m/s"/>
     <define name="RACE_AIRSPEED"                value="26." unit="m/s"/>
     <define name="STALL_AIRSPEED"                value="12." unit="m/s"/>
     <define name="AIRSPEED_SETPOINT_SLEW"            value="1"
unit="s"/> <!--default=1-->
     <define name="NOMINAL_AIRSPEED"                value="22" unit="m/s"/>
         <define name="MINIMUM_AIRSPEED" value="16." unit="m/s"/>
         <define name="MAXIMUM_AIRSPEED" value="26." unit="m/s"/>
     <define name="CARROT"                    value="3." unit="s"/>
     <define name="GLIDE_RATIO"                value="5."/>
     <define name="KILL_MODE_DISTANCE" value="(1.5*MAX_DIST_FROM_HOME)"/>
     <define name="CONTROL_FREQUENCY"            value="60" unit="Hz"/>
     <define name="XBEE_INIT" value="\"ATPL2\rATRN1\rATTT80\r\""/>
     <define name="NO_XBEE_API_INIT" value="TRUE"/>
     <define name="TRIGGER_DELAY"                value="1."/>
     <define name="DEFAULT_CIRCLE_RADIUS" value="120."/>
     <define name="MIN_CIRCLE_RADIUS"            value="80."/>
     <define name="UNLOCKED_HOME_MODE" value="TRUE"/>
     <define name="RC_LOST_MODE" value="PPRZ_MODE_AUTO2"/>
</section>

<section name="AGGRESSIVE"        prefix="AGR_">
     <define name="BLEND_START" value="40"/><!-- Altitude Error to
Initiate Aggressive Climb CANNOT BE ZERO!!-->
     <define name="BLEND_END" value="10"/><!-- Altitude Error to Blend
Aggressive to Regular Climb Modes NOT ZERO!!-->
     <define name="CLIMB_THROTTLE" value="1.0"/><!-- Gaz for Aggressive
Climb -->
     <define name="CLIMB_PITCH" value="RadOfDeg(20)"/><!-- Pitch for
Aggressive Climb -->
     <define name="DESCENT_THROTTLE" value="0.1"/><!-- Gaz for
Aggressive Decent -->
     <define name="DESCENT_PITCH" value="RadOfDeg(-20)"/><!-- Pitch for
Aggressive Decent -->
     <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="NAV">
     <define name="NAV_PITCH"        value="0."/>
     <define name="NAV_GLIDE_PITCH_TRIM" value="0"/>
     <define name="NAV_GROUND_SPEED_PGAIN" value="0.015"/>
     <define name="NAV_FOLLOW_PGAIN" value="-0.05"/>
   </section>

   <section name="GLS_APPROACH" prefix="APP_">
     <define name="ANGLE" value="5"/>
     <define name="INTERCEPT_AF_TOD" value="10"/>
     <define name="TARGET_SPEED" value="13"/>
   </section>

<section name="FAILSAFE" prefix="FAILSAFE_">
     <define name="DELAY_WITHOUT_GPS"            value="1" unit="s"/>
         <define name="DEFAULT_THROTTLE" value="0.6" unit="%"/>
         <define name="DEFAULT_ROLL"                value="10" unit="deg"/>
         <define name="DEFAULT_PITCH"                value="1" unit="deg"/>
     <define name="HOME_RADIUS"                value="100" unit="m"/>
     <define name="KILL_MODE_DISTANCE" value="(MAX_DIST_FROM_HOME*1.5)"/>
</section>

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

   <section name="DIGITAL_CAMERA" prefix="DC_">
     <define name="AUTOSHOOT_QUARTERSEC_PERIOD" value="8"
unit="quarter_second"/>
     <define name="AUTOSHOOT_METER_GRID" value="100" unit="meter"/>
   </section>

   <section name="GCS">
     <define name="ALT_SHIFT_PLUS_PLUS" value="100"/>
     <define name="ALT_SHIFT_PLUS" value="10"/>
     <define name="ALT_SHIFT_MINUS" value="-10"/>
     <define name="SPEECH_NAME" value="Cessna"/>
   </section>

   <section name="SIMU">
     <define name="WEIGHT" value ="1.8"/>
     <define name="YAW_RESPONSE_FACTOR" value =".9"/> <!--default 1.-->
     <define name="PITCH_RESPONSE_FACTOR" value ="1."/> <!--default 1.-->
     <define name="ROLL_RESPONSE_FACTOR" value ="15."/> <!--default 15-->
   </section>

  <makefile>
sim.srcs += my_code.c
ap.srcs +=  my_code.c
#ap_flags += -DUSE_SPI -DSPI_MASTER
#ap.srcs += mcu_periph/spi.c $(SRC_ARCH)/mcu_periph/spi_arch.c
#LDFLAGS += -lnosys
  </makefile>
</airframe>

_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel