main.h
Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (c) 2011, Ascending Technologies GmbH
00004 All rights reserved.
00005 
00006 Redistribution and use in source and binary forms, with or without
00007 modification, are permitted provided that the following conditions are met:
00008 
00009  * Redistributions of source code must retain the above copyright notice,
00010    this list of conditions and the following disclaimer.
00011  * Redistributions in binary form must reproduce the above copyright
00012    notice, this list of conditions and the following disclaimer in the
00013    documentation and/or other materials provided with the distribution.
00014 
00015 THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
00016 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00017 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00018 DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY
00019 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00020 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00021 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00022 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00023 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00024 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00025 DAMAGE.
00026 
00027  */
00028 
00029 #ifndef MAIN_H_
00030 #define MAIN_H_
00031 
00032 extern void mainloop(void);
00033 extern void timer0ISR(void);
00034 extern void timer1ISR(void);
00035 
00036 
00037 volatile unsigned int GPS_timeout;
00038 volatile char SYSTEM_initialized;
00039 
00040 #define BATTERY_WARNING_VOLTAGE 10600   //10.6V
00041 #define BAT_DIV 6//(BATTERY_WARNING_VOLTAGE-10000)/100
00042 
00043 //#define GPS_BEEP      //warning if GPS has no lock
00044 #define ERROR_BEEP  //sensor calibration errors signaled by buzzer
00045 #define INIT_BEEP       //double beep during system initialization
00046 
00047 #define ControllerCyclesPerSecond       1000
00048 
00049 #define OFF 0
00050 #define ON  1
00051 
00052 #define NORMAL 0
00053 
00054 
00055 //packet descriptors
00056 #define PD_IMURAWDATA       0x01
00057 #define PD_LLSTATUS             0x02
00058 #define PD_IMUCALCDATA      0x03
00059 #define PD_HLSTATUS             0x04
00060 
00061 #define PD_CTRLOUT                      0x11
00062 #define PD_FLIGHTPARAMS     0x12
00063 #define PD_CTRLCOMMANDS         0x13
00064 #define PD_CTRLINTERNAL         0x14
00065 #define PD_RCDATA               0x15
00066 #define PD_CTRLSTATUS           0x16
00067 
00068 #define PD_WAYPOINT             0x20
00069 #define PD_CURRENTWAY           0x21
00070 #define PD_NMEADATA             0x22
00071 #define PD_GPSDATA                      0x23
00072 
00073 #define PD_CAMERACOMMANDS       0x30
00074 #define PD_RO_ALL_DATA          0x90
00075 
00076 
00077 //system status defines for buzzer handling
00078 #define FM_COMPASS_FAILURE                      0x10
00079 #define FM_CALIBRATION_ERROR            0x100
00080 #define FM_CALIBRATION_ERROR_GYROS      0x200
00081 #define FM_CALIBRATION_ERROR_ACC        0x400
00082 #define FM_ADC_STARTUP_ERROR        0x800
00083 #define FM_MAG_FIELD_STRENGTH_ERROR 0x4000
00084 #define FM_MAG_INCLINATION_ERROR        0x8000
00085 
00086 
00087 
00088 struct IMU_CALCDATA {
00089 //angles derived by integration of gyro_outputs, drift compensated by data fusion; -90000..+90000 pitch(nick) and roll, 0..360000 yaw; 1000 = 1 degree
00090     int angle_nick;
00091     int angle_roll;
00092     int angle_yaw;
00093 
00094 //angular velocities, 16 bit values, bias free, 1 LSB = 0.0154 �/s (=> 64.8 = 1 �/s)
00095     int angvel_nick;
00096     int angvel_roll;
00097     int angvel_yaw;
00098 
00099 //acc-sensor outputs, calibrated: -10000..+10000 = -1g..+1g, body frame coordinate system
00100     short acc_x_calib;
00101     short acc_y_calib;
00102     short acc_z_calib;
00103 
00104 //horizontal / vertical accelerations: -10000..+10000 = -1g..+1g
00105     short acc_x;
00106     short acc_y;
00107     short acc_z;
00108 
00109 //reference angles derived by accelerations only: -90000..+90000; 1000 = 1 degree
00110     int acc_angle_nick;
00111     int acc_angle_roll;
00112 
00113 //total acceleration measured (10000 = 1g)
00114     int acc_absolute_value;
00115 
00116 //magnetic field sensors output, offset free and scaled; units not determined, as only the direction of the field vector is taken into account
00117     int Hx;
00118     int Hy;
00119     int Hz;
00120 
00121 //compass reading: angle reference for angle_yaw: 0..360000; 1000 = 1 degree
00122     int mag_heading;
00123 
00124 //pseudo speed measurements: integrated accelerations, pulled towards zero; units unknown; used for short-term position stabilization
00125     int speed_x;
00126     int speed_y;
00127     int speed_z;
00128 
00129 //height in mm (after data fusion)
00130     int height;
00131 
00132 //diff. height in mm/s (after data fusion)
00133     int dheight;
00134 
00135 //diff. height measured by the pressure sensor [mm/s]
00136     int dheight_reference;
00137 
00138 //height measured by the pressure sensor [mm]
00139     int height_reference;
00140 };
00141 extern struct IMU_CALCDATA IMU_CalcData, IMU_CalcData_tmp;
00142 
00143 
00144 
00145 #endif /*MAIN_H_*/
00146 


asctec_hl_firmware
Author(s): Markus Achtelik, Michael Achtelik, Stephan Weiss, Laurent Kneip
autogenerated on Tue Jan 7 2014 11:05:19