![](/media/cache/profiles/8158fa3e4de806e614f7ff02e7b22fde.jpg.50x50_q85.png)
New version of quadcopter software written to OO principles
Dependencies: mbed MODSERIAL filter mbed-rtos ConfigFile PID PPM FreeIMU_external_magnetometer TinyGPS
Global/Global.h@3:4823d6750629, 2015-04-24 (annotated)
- Committer:
- joe4465
- Date:
- Fri Apr 24 16:50:20 2015 +0000
- Revision:
- 3:4823d6750629
- Parent:
- 2:969dfa4f2436
Altitude mode working.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
joe4465 | 0:c6a85bb2a827 | 1 | #include "mbed.h" |
joe4465 | 0:c6a85bb2a827 | 2 | |
joe4465 | 0:c6a85bb2a827 | 3 | #ifndef GLOBAL_H |
joe4465 | 0:c6a85bb2a827 | 4 | #define GLOBAL_H |
joe4465 | 0:c6a85bb2a827 | 5 | |
joe4465 | 3:4823d6750629 | 6 | #define DEBUG(...) printf(__VA_ARGS__) |
joe4465 | 3:4823d6750629 | 7 | //#define DEBUG(a) (void)0 |
joe4465 | 3:4823d6750629 | 8 | |
joe4465 | 0:c6a85bb2a827 | 9 | |
joe4465 | 2:969dfa4f2436 | 10 | #define MOTORS_ENABLED |
joe4465 | 2:969dfa4f2436 | 11 | |
joe4465 | 2:969dfa4f2436 | 12 | #define MOD(a) ((a > 180.0) ? (a - 360.0) : ((a < -180.0) ? (a + 360.0) : a)) |
joe4465 | 3:4823d6750629 | 13 | #define PI 3.14159265 |
joe4465 | 2:969dfa4f2436 | 14 | |
joe4465 | 0:c6a85bb2a827 | 15 | #define IMU_YAW_ANGLE_MAX 180 |
joe4465 | 0:c6a85bb2a827 | 16 | #define IMU_YAW_ANGLE_MIN -180 |
joe4465 | 0:c6a85bb2a827 | 17 | #define IMU_ROLL_ANGLE_MAX 90 |
joe4465 | 0:c6a85bb2a827 | 18 | #define IMU_ROLL_ANGLE_MIN -90 |
joe4465 | 0:c6a85bb2a827 | 19 | #define IMU_PITCH_ANGLE_MAX 90 |
joe4465 | 0:c6a85bb2a827 | 20 | #define IMU_PITCH_ANGLE_MIN -90 |
joe4465 | 0:c6a85bb2a827 | 21 | #define IMU_YAW_RATE_MAX 360 |
joe4465 | 0:c6a85bb2a827 | 22 | #define IMU_YAW_RATE_MIN -360 |
joe4465 | 0:c6a85bb2a827 | 23 | #define IMU_ROLL_RATE_MAX 360 |
joe4465 | 0:c6a85bb2a827 | 24 | #define IMU_ROLL_RATE_MIN -360 |
joe4465 | 0:c6a85bb2a827 | 25 | #define IMU_PITCH_RATE_MAX 360 |
joe4465 | 0:c6a85bb2a827 | 26 | #define IMU_PITCH_RATE_MIN -360 |
joe4465 | 0:c6a85bb2a827 | 27 | |
joe4465 | 0:c6a85bb2a827 | 28 | #define RC_CHANNELS 8 |
joe4465 | 0:c6a85bb2a827 | 29 | #define RC_THROTTLE_CHANNEL 3 |
joe4465 | 0:c6a85bb2a827 | 30 | #define RC_IN_MAX 1900 |
joe4465 | 0:c6a85bb2a827 | 31 | #define RC_IN_MIN 1000 |
joe4465 | 0:c6a85bb2a827 | 32 | #define RC_OUT_MAX 1 |
joe4465 | 0:c6a85bb2a827 | 33 | #define RC_OUT_MIN 0 |
joe4465 | 0:c6a85bb2a827 | 34 | #define RC_YAW_RATE_MAX 180 |
joe4465 | 0:c6a85bb2a827 | 35 | #define RC_YAW_RATE_MIN -180 |
joe4465 | 0:c6a85bb2a827 | 36 | #define RC_ROLL_RATE_MAX 90 |
joe4465 | 0:c6a85bb2a827 | 37 | #define RC_ROLL_RATE_MIN -90 |
joe4465 | 0:c6a85bb2a827 | 38 | #define RC_PITCH_RATE_MAX 90 |
joe4465 | 0:c6a85bb2a827 | 39 | #define RC_PITCH_RATE_MIN -90 |
joe4465 | 2:969dfa4f2436 | 40 | #define RC_ROLL_ANGLE_MAX 45 |
joe4465 | 2:969dfa4f2436 | 41 | #define RC_ROLL_ANGLE_MIN -45 |
joe4465 | 2:969dfa4f2436 | 42 | #define RC_PITCH_ANGLE_MAX 45 |
joe4465 | 2:969dfa4f2436 | 43 | #define RC_PITCH_ANGLE_MIN -45 |
joe4465 | 0:c6a85bb2a827 | 44 | #define RC_THRUST_MAX 1 |
joe4465 | 0:c6a85bb2a827 | 45 | #define RC_THRUST_MIN 0 |
joe4465 | 2:969dfa4f2436 | 46 | #define RC_DEAD_ZONE 0.1 |
joe4465 | 3:4823d6750629 | 47 | #define RC_HOVER 0.6 |
joe4465 | 0:c6a85bb2a827 | 48 | |
joe4465 | 0:c6a85bb2a827 | 49 | #define MOTORS_OFF 0 |
joe4465 | 2:969dfa4f2436 | 50 | #define MOTORS_ARMED 1060 |
joe4465 | 0:c6a85bb2a827 | 51 | #define MOTORS_MIN 1060 |
joe4465 | 0:c6a85bb2a827 | 52 | #define MOTORS_MAX 1860 |
joe4465 | 0:c6a85bb2a827 | 53 | |
joe4465 | 0:c6a85bb2a827 | 54 | #define RATE_PID_CONTROLLER_OUTPUT_MAX 100 |
joe4465 | 0:c6a85bb2a827 | 55 | #define RATE_PID_CONTROLLER_OUTPUT_MIN -100 |
joe4465 | 0:c6a85bb2a827 | 56 | |
joe4465 | 2:969dfa4f2436 | 57 | #define ALTITUDE_MIN 0 |
joe4465 | 2:969dfa4f2436 | 58 | #define ALTITUDE_MAX 1000 |
joe4465 | 3:4823d6750629 | 59 | #define MAX_CLIMB_RATE 2.5 |
joe4465 | 3:4823d6750629 | 60 | #define MIN_CLIMB_RATE -2.5 |
joe4465 | 2:969dfa4f2436 | 61 | |
joe4465 | 0:c6a85bb2a827 | 62 | #define FLIGHT_CONTROLLER_FREQUENCY 500 |
joe4465 | 0:c6a85bb2a827 | 63 | |
joe4465 | 0:c6a85bb2a827 | 64 | #endif |