![](/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
Diff: Global/Global.h
- Revision:
- 2:969dfa4f2436
- Parent:
- 0:c6a85bb2a827
- Child:
- 3:4823d6750629
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Global/Global.h Wed Apr 01 11:19:21 2015 +0000 @@ -0,0 +1,64 @@ +#include "mbed.h" + +#ifndef GLOBAL_H +#define GLOBAL_H + +#if 1 + #define DEBUG(...) printf(__VA_ARGS__) +#else + #define DEBUG(a) (void)0 +#endif + +#define MOTORS_ENABLED + +#define MOD(a) ((a > 180.0) ? (a - 360.0) : ((a < -180.0) ? (a + 360.0) : a)) + +#define IMU_YAW_ANGLE_MAX 180 +#define IMU_YAW_ANGLE_MIN -180 +#define IMU_ROLL_ANGLE_MAX 90 +#define IMU_ROLL_ANGLE_MIN -90 +#define IMU_PITCH_ANGLE_MAX 90 +#define IMU_PITCH_ANGLE_MIN -90 +#define IMU_YAW_RATE_MAX 360 +#define IMU_YAW_RATE_MIN -360 +#define IMU_ROLL_RATE_MAX 360 +#define IMU_ROLL_RATE_MIN -360 +#define IMU_PITCH_RATE_MAX 360 +#define IMU_PITCH_RATE_MIN -360 + +#define RC_CHANNELS 8 +#define RC_THROTTLE_CHANNEL 3 +#define RC_IN_MAX 1900 +#define RC_IN_MIN 1000 +#define RC_OUT_MAX 1 +#define RC_OUT_MIN 0 +#define RC_YAW_RATE_MAX 180 +#define RC_YAW_RATE_MIN -180 +#define RC_ROLL_RATE_MAX 90 +#define RC_ROLL_RATE_MIN -90 +#define RC_PITCH_RATE_MAX 90 +#define RC_PITCH_RATE_MIN -90 +#define RC_ROLL_ANGLE_MAX 45 +#define RC_ROLL_ANGLE_MIN -45 +#define RC_PITCH_ANGLE_MAX 45 +#define RC_PITCH_ANGLE_MIN -45 +#define RC_THRUST_MAX 1 +#define RC_THRUST_MIN 0 +#define RC_DEAD_ZONE 0.1 + +#define MOTORS_OFF 0 +#define MOTORS_ARMED 1060 +#define MOTORS_MIN 1060 +#define MOTORS_MAX 1860 + +#define RATE_PID_CONTROLLER_OUTPUT_MAX 100 +#define RATE_PID_CONTROLLER_OUTPUT_MIN -100 + +#define ALTITUDE_MIN 0 +#define ALTITUDE_MAX 1000 +#define MAX_CLIMB_RATE 25 +#define MIN_CLIMB_RATE -25 + +#define FLIGHT_CONTROLLER_FREQUENCY 500 + +#endif \ No newline at end of file