2011-03-19 07:20:11 -03:00
|
|
|
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
2010-12-19 12:40:33 -04:00
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
|
|
|
|
//
|
|
|
|
// DO NOT EDIT this file to adjust your configuration. Create your own
|
|
|
|
// APM_Config.h and use APM_Config.h.example as a reference.
|
|
|
|
//
|
|
|
|
// WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
|
|
|
|
///
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Default and automatic configuration details.
|
|
|
|
//
|
|
|
|
// Notes for maintainers:
|
|
|
|
//
|
|
|
|
// - Try to keep this file organised in the same order as APM_Config.h.example
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "defines.h"
|
|
|
|
|
|
|
|
///
|
|
|
|
/// DO NOT EDIT THIS INCLUDE - if you want to make a local change, make that
|
|
|
|
/// change in your local copy of APM_Config.h.
|
2011-02-19 22:03:01 -04:00
|
|
|
///
|
2011-02-24 01:56:59 -04:00
|
|
|
#include "APM_Config.h" // <== THIS INCLUDE, DO NOT EDIT IT. EVER.
|
2010-12-19 12:40:33 -04:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// HARDWARE CONFIGURATION AND CONNECTIONS
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// FRAME_CONFIG
|
2011-02-19 22:03:01 -04:00
|
|
|
//
|
2010-12-19 12:40:33 -04:00
|
|
|
#ifndef FRAME_CONFIG
|
2011-05-18 20:38:24 -03:00
|
|
|
# define FRAME_CONFIG QUAD_FRAME
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
2011-05-18 20:38:24 -03:00
|
|
|
#ifndef FRAME_ORIENTATION
|
|
|
|
# define FRAME_ORIENTATION PLUS_FRAME
|
|
|
|
#endif
|
|
|
|
|
2010-12-19 12:40:33 -04:00
|
|
|
|
2011-02-20 19:09:28 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Sonar
|
|
|
|
//
|
2011-06-16 14:03:26 -03:00
|
|
|
|
2011-07-10 21:47:08 -03:00
|
|
|
#ifndef SONAR_PORT
|
|
|
|
# define SONAR_PORT AP_RANGEFINDER_PITOT_TUBE
|
2011-02-20 19:09:28 -04:00
|
|
|
#endif
|
|
|
|
|
2011-06-16 14:03:26 -03:00
|
|
|
#ifndef SONAR_TYPE
|
|
|
|
# define SONAR_TYPE MAX_SONAR_XL
|
|
|
|
#endif
|
|
|
|
|
2011-08-05 13:21:21 -03:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Acrobatics
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef CH7_OPTION
|
|
|
|
# define CH7_OPTION DO_SET_HOVER
|
|
|
|
#endif
|
|
|
|
|
2011-05-25 02:48:33 -03:00
|
|
|
|
2011-02-24 01:56:59 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// AIRSPEED_SENSOR
|
|
|
|
// AIRSPEED_RATIO
|
|
|
|
//
|
|
|
|
#ifndef AIRSPEED_SENSOR
|
|
|
|
# define AIRSPEED_SENSOR DISABLED
|
|
|
|
#endif
|
|
|
|
#ifndef AIRSPEED_RATIO
|
|
|
|
# define AIRSPEED_RATIO 1.9936 // Note - this varies from the value in ArduPilot due to the difference in ADC resolution
|
|
|
|
#endif
|
|
|
|
|
2011-05-25 02:48:33 -03:00
|
|
|
|
2011-02-24 01:56:59 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// HIL_PROTOCOL OPTIONAL
|
|
|
|
// HIL_MODE OPTIONAL
|
|
|
|
// HIL_PORT OPTIONAL
|
|
|
|
|
2011-05-09 09:20:22 -03:00
|
|
|
#ifndef HIL_MODE
|
|
|
|
#define HIL_MODE HIL_MODE_DISABLED
|
|
|
|
#endif
|
2011-02-24 01:56:59 -04:00
|
|
|
|
2011-05-09 12:46:56 -03:00
|
|
|
#ifndef HIL_PROTOCOL
|
2011-05-09 09:20:22 -03:00
|
|
|
#define HIL_PROTOCOL HIL_PROTOCOL_MAVLINK
|
2011-05-09 12:46:56 -03:00
|
|
|
#endif
|
2011-02-24 01:56:59 -04:00
|
|
|
|
2011-05-09 12:46:56 -03:00
|
|
|
#ifndef HIL_PORT
|
2011-05-09 09:20:22 -03:00
|
|
|
#define HIL_PORT 0
|
2011-05-09 12:46:56 -03:00
|
|
|
#endif
|
|
|
|
|
2011-05-09 09:20:22 -03:00
|
|
|
#if HIL_MODE != HIL_MODE_DISABLED // we are in HIL mode
|
2011-05-09 12:46:56 -03:00
|
|
|
|
2011-05-09 09:20:22 -03:00
|
|
|
# undef GPS_PROTOCOL
|
|
|
|
# define GPS_PROTOCOL GPS_PROTOCOL_NONE
|
2011-02-24 01:56:59 -04:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// If we are in XPlane, diasble the mag
|
|
|
|
#if HIL_MODE != HIL_MODE_DISABLED // we are in HIL mode
|
|
|
|
|
|
|
|
// check xplane settings
|
|
|
|
#if HIL_PROTOCOL == HIL_PROTOCOL_XPLANE
|
|
|
|
|
|
|
|
// MAGNETOMETER not supported by XPLANE
|
|
|
|
# undef MAGNETOMETER
|
|
|
|
# define MAGNETOMETER DISABLED
|
|
|
|
|
|
|
|
# if HIL_MODE != HIL_MODE_ATTITUDE
|
|
|
|
# error HIL_PROTOCOL_XPLANE requires HIL_MODE_ATTITUDE
|
|
|
|
# endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2011-05-25 02:48:33 -03:00
|
|
|
|
2011-02-24 01:56:59 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// GPS_PROTOCOL
|
|
|
|
//
|
|
|
|
// Note that this test must follow the HIL_PROTOCOL block as the HIL
|
|
|
|
// setup may override the GPS configuration.
|
|
|
|
//
|
|
|
|
#ifndef GPS_PROTOCOL
|
2011-05-18 20:38:24 -03:00
|
|
|
# define GPS_PROTOCOL GPS_PROTOCOL_AUTO
|
2011-02-24 01:56:59 -04:00
|
|
|
#endif
|
2010-12-19 12:40:33 -04:00
|
|
|
|
2011-05-25 02:48:33 -03:00
|
|
|
|
2010-12-19 12:40:33 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// GCS_PROTOCOL
|
|
|
|
// GCS_PORT
|
|
|
|
//
|
|
|
|
#ifndef GCS_PROTOCOL
|
2011-03-26 03:35:52 -03:00
|
|
|
# define GCS_PROTOCOL GCS_PROTOCOL_MAVLINK
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
|
|
|
|
2011-05-08 23:38:36 -03:00
|
|
|
//Chris: Commenting out assignment of GCS to port 3 because it kills MAVLink on Port 0
|
2011-05-09 09:20:22 -03:00
|
|
|
#ifndef GCS_PORT
|
|
|
|
# define GCS_PORT 3
|
|
|
|
#endif
|
2011-05-08 14:48:54 -03:00
|
|
|
|
2011-05-09 12:46:56 -03:00
|
|
|
#ifndef MAV_SYSTEM_ID
|
|
|
|
# define MAV_SYSTEM_ID 1
|
|
|
|
#endif
|
|
|
|
|
2011-05-25 02:48:33 -03:00
|
|
|
|
2010-12-19 12:40:33 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Serial port speeds.
|
|
|
|
//
|
|
|
|
#ifndef SERIAL0_BAUD
|
2011-02-24 01:56:59 -04:00
|
|
|
# define SERIAL0_BAUD 115200
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
|
|
|
#ifndef SERIAL3_BAUD
|
2011-02-24 01:56:59 -04:00
|
|
|
# define SERIAL3_BAUD 57600
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Battery monitoring
|
|
|
|
//
|
|
|
|
#ifndef BATTERY_EVENT
|
|
|
|
# define BATTERY_EVENT DISABLED
|
|
|
|
#endif
|
|
|
|
#ifndef LOW_VOLTAGE
|
2011-01-16 23:44:12 -04:00
|
|
|
# define LOW_VOLTAGE 9.6
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
|
|
|
#ifndef VOLT_DIV_RATIO
|
2011-05-09 12:46:56 -03:00
|
|
|
# define VOLT_DIV_RATIO 3.56
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
2011-02-24 01:56:59 -04:00
|
|
|
|
2011-05-09 12:46:56 -03:00
|
|
|
#ifndef CURR_AMP_PER_VOLT
|
|
|
|
# define CURR_AMP_PER_VOLT 27.32
|
2011-01-16 23:44:12 -04:00
|
|
|
#endif
|
2011-05-09 12:46:56 -03:00
|
|
|
#ifndef CURR_AMPS_OFFSET
|
|
|
|
# define CURR_AMPS_OFFSET 0.0
|
2011-01-16 23:44:12 -04:00
|
|
|
#endif
|
2011-05-09 12:46:56 -03:00
|
|
|
#ifndef HIGH_DISCHARGE
|
|
|
|
# define HIGH_DISCHARGE 1760
|
2011-02-19 22:03:01 -04:00
|
|
|
#endif
|
2010-12-19 12:40:33 -04:00
|
|
|
|
2011-05-25 02:48:33 -03:00
|
|
|
|
2010-12-19 12:40:33 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// INPUT_VOLTAGE
|
|
|
|
//
|
|
|
|
#ifndef INPUT_VOLTAGE
|
|
|
|
# define INPUT_VOLTAGE 5.0
|
|
|
|
#endif
|
|
|
|
|
2011-05-25 02:48:33 -03:00
|
|
|
|
2010-12-19 12:40:33 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// MAGNETOMETER
|
2011-02-24 01:56:59 -04:00
|
|
|
#ifndef MAGNETOMETER
|
|
|
|
# define MAGNETOMETER DISABLED
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
2011-02-24 01:56:59 -04:00
|
|
|
#ifndef MAG_ORIENTATION
|
|
|
|
# define MAG_ORIENTATION AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2011-07-21 20:14:53 -03:00
|
|
|
// OPTICAL_FLOW
|
|
|
|
#if defined( __AVR_ATmega2560__ ) // determines if optical flow code is included
|
2011-07-30 17:42:54 -03:00
|
|
|
//#define OPTFLOW_ENABLED
|
2011-07-21 20:14:53 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef OPTFLOW // sets global enabled/disabled flag for optflow (as seen in CLI)
|
|
|
|
# define OPTFLOW DISABLED
|
|
|
|
#endif
|
|
|
|
#ifndef OPTFLOW_ORIENTATION
|
|
|
|
# define OPTFLOW_ORIENTATION AP_OPTICALFLOW_ADNS3080_PINS_FORWARD
|
|
|
|
#endif
|
|
|
|
#ifndef OPTFLOW_FOV
|
2011-08-07 10:15:19 -03:00
|
|
|
# define OPTFLOW_FOV AP_OPTICALFLOW_ADNS3080_08_FOV
|
2011-07-21 20:14:53 -03:00
|
|
|
#endif
|
|
|
|
|
2010-12-19 12:40:33 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// RADIO CONFIGURATION
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// FLIGHT_MODE
|
|
|
|
//
|
|
|
|
|
|
|
|
#if !defined(FLIGHT_MODE_1)
|
|
|
|
# define FLIGHT_MODE_1 STABILIZE
|
|
|
|
#endif
|
|
|
|
#if !defined(FLIGHT_MODE_2)
|
|
|
|
# define FLIGHT_MODE_2 STABILIZE
|
|
|
|
#endif
|
|
|
|
#if !defined(FLIGHT_MODE_3)
|
|
|
|
# define FLIGHT_MODE_3 STABILIZE
|
|
|
|
#endif
|
|
|
|
#if !defined(FLIGHT_MODE_4)
|
|
|
|
# define FLIGHT_MODE_4 STABILIZE
|
|
|
|
#endif
|
|
|
|
#if !defined(FLIGHT_MODE_5)
|
|
|
|
# define FLIGHT_MODE_5 STABILIZE
|
|
|
|
#endif
|
|
|
|
#if !defined(FLIGHT_MODE_6)
|
|
|
|
# define FLIGHT_MODE_6 STABILIZE
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// THROTTLE_FAILSAFE
|
|
|
|
// THROTTLE_FS_VALUE
|
|
|
|
// THROTTLE_FAILSAFE_ACTION
|
|
|
|
//
|
|
|
|
#ifndef THROTTLE_FAILSAFE
|
2011-05-21 03:50:46 -03:00
|
|
|
# define THROTTLE_FAILSAFE DISABLED
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
|
|
|
#ifndef THROTTE_FS_VALUE
|
2011-05-21 03:50:46 -03:00
|
|
|
# define THROTTLE_FS_VALUE 975
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
|
|
|
#ifndef THROTTLE_FAILSAFE_ACTION
|
2011-05-21 03:50:46 -03:00
|
|
|
# define THROTTLE_FAILSAFE_ACTION 2
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2011-06-19 02:31:33 -03:00
|
|
|
#ifndef MINIMUM_THROTTLE
|
|
|
|
# define MINIMUM_THROTTLE 130
|
|
|
|
#endif
|
|
|
|
|
2010-12-19 12:40:33 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// STARTUP BEHAVIOUR
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// GROUND_START_DELAY
|
|
|
|
//
|
|
|
|
#ifndef GROUND_START_DELAY
|
2011-06-01 02:50:17 -03:00
|
|
|
# define GROUND_START_DELAY 3
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// FLIGHT AND NAVIGATION CONTROL
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2011-04-17 02:17:42 -03:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Y6 Support
|
|
|
|
|
2011-07-10 21:47:08 -03:00
|
|
|
#ifndef TOP_BOTTOM_RATIO
|
|
|
|
# define TOP_BOTTOM_RATIO 0.92
|
2011-04-17 02:17:42 -03:00
|
|
|
#endif
|
|
|
|
|
2010-12-19 12:40:33 -04:00
|
|
|
|
|
|
|
|
2011-09-04 21:15:36 -03:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Attitude Control
|
|
|
|
//
|
|
|
|
|
|
|
|
// SIMPLE Mode
|
|
|
|
#ifndef SIMPLE_YAW
|
|
|
|
# define SIMPLE_YAW YAW_HOLD
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SIMPLE_RP
|
|
|
|
# define SIMPLE_RP ROLL_PITCH_SIMPLE
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SIMPLE_THR
|
|
|
|
# define SIMPLE_THR THROTTLE_MANUAL
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Alt Hold Mode
|
|
|
|
#ifndef ALT_HOLD_YAW
|
|
|
|
# define ALT_HOLD_YAW YAW_HOLD
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef ALT_HOLD_RP
|
|
|
|
# define ALT_HOLD_RP ROLL_PITCH_STABLE
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef ALT_HOLD_THR
|
|
|
|
# define ALT_HOLD_THR THROTTLE_HOLD
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// AUTO Mode
|
|
|
|
#ifndef AUTO_YAW
|
|
|
|
# define AUTO_YAW YAW_AUTO
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef AUTO_RP
|
|
|
|
# define AUTO_RP ROLL_PITCH_AUTO
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef AUTO_THR
|
|
|
|
# define AUTO_THR THROTTLE_AUTO
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// CIRCLE Mode
|
|
|
|
#ifndef CIRCLE_YAW
|
|
|
|
# define CIRCLE_YAW YAW_HOLD
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef CIRCLE_RP
|
|
|
|
# define CIRCLE_RP ROLL_PITCH_AUTO
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef CIRCLE_THR
|
|
|
|
# define CIRCLE_THR THROTTLE_HOLD
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// LOITER Mode
|
|
|
|
#ifndef LOITER_YAW
|
|
|
|
# define LOITER_YAW YAW_HOLD
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef LOITER_RP
|
|
|
|
# define LOITER_RP ROLL_PITCH_AUTO
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef LOITER_THR
|
|
|
|
# define LOITER_THR THROTTLE_HOLD
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// RTL Mode
|
|
|
|
#ifndef RTL_YAW
|
|
|
|
# define RTL_YAW YAW_AUTO
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef RTL_RP
|
|
|
|
# define RTL_RP ROLL_PITCH_AUTO
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef RTL_THR
|
|
|
|
# define RTL_THR THROTTLE_AUTO
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-07-10 21:47:08 -03:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2011-07-31 17:09:27 -03:00
|
|
|
// Attitude Control
|
2011-07-10 21:47:08 -03:00
|
|
|
//
|
|
|
|
#ifndef STABILIZE_ROLL_P
|
2011-09-04 21:15:36 -03:00
|
|
|
# define STABILIZE_ROLL_P 3.6
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
2011-07-10 21:47:08 -03:00
|
|
|
#ifndef STABILIZE_ROLL_I
|
2011-09-04 21:15:36 -03:00
|
|
|
# define STABILIZE_ROLL_I 0.02
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
2011-07-10 21:47:08 -03:00
|
|
|
#ifndef STABILIZE_ROLL_IMAX
|
2011-09-04 21:15:36 -03:00
|
|
|
# define STABILIZE_ROLL_IMAX 1.5 // degrees
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
|
|
|
|
2011-07-31 17:09:27 -03:00
|
|
|
#ifndef STABILIZE_PITCH_P
|
2011-09-04 21:15:36 -03:00
|
|
|
# define STABILIZE_PITCH_P 3.6
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
2011-07-31 17:09:27 -03:00
|
|
|
#ifndef STABILIZE_PITCH_I
|
2011-09-04 21:15:36 -03:00
|
|
|
# define STABILIZE_PITCH_I 0.02
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
2011-07-31 17:09:27 -03:00
|
|
|
#ifndef STABILIZE_PITCH_IMAX
|
2011-09-04 21:15:36 -03:00
|
|
|
# define STABILIZE_PITCH_IMAX 1.5 // degrees
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2011-07-31 17:09:27 -03:00
|
|
|
// Rate Control
|
2010-12-19 12:40:33 -04:00
|
|
|
//
|
2011-07-31 17:09:27 -03:00
|
|
|
#ifndef RATE_ROLL_P
|
2011-09-04 21:15:36 -03:00
|
|
|
# define RATE_ROLL_P .13
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
2011-07-31 17:09:27 -03:00
|
|
|
#ifndef RATE_ROLL_I
|
|
|
|
# define RATE_ROLL_I 0.0
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
2011-07-31 17:09:27 -03:00
|
|
|
#ifndef RATE_ROLL_IMAX
|
|
|
|
# define RATE_ROLL_IMAX 15 // degrees
|
2011-07-10 21:47:08 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef RATE_PITCH_P
|
2011-09-04 21:15:36 -03:00
|
|
|
# define RATE_PITCH_P 0.13
|
2011-07-10 21:47:08 -03:00
|
|
|
#endif
|
|
|
|
#ifndef RATE_PITCH_I
|
|
|
|
# define RATE_PITCH_I 0.0
|
|
|
|
#endif
|
|
|
|
#ifndef RATE_PITCH_IMAX
|
2011-07-31 17:09:27 -03:00
|
|
|
# define RATE_PITCH_IMAX 15 // degrees
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// YAW Control
|
|
|
|
//
|
2011-07-10 21:47:08 -03:00
|
|
|
#ifndef STABILIZE_YAW_P
|
2011-09-04 21:15:36 -03:00
|
|
|
# define STABILIZE_YAW_P 7 // increase for more aggressive Yaw Hold, decrease if it's bouncy
|
2011-07-10 21:47:08 -03:00
|
|
|
#endif
|
|
|
|
#ifndef STABILIZE_YAW_I
|
|
|
|
# define STABILIZE_YAW_I 0.01 // set to .0001 to try and get over user's steady state error caused by poor balance
|
|
|
|
#endif
|
|
|
|
#ifndef STABILIZE_YAW_IMAX
|
2011-09-04 21:15:36 -03:00
|
|
|
# define STABILIZE_YAW_IMAX 8 // degrees * 100
|
2011-07-10 21:47:08 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef RATE_YAW_P
|
2011-09-04 21:15:36 -03:00
|
|
|
# define RATE_YAW_P .13 // used to control response in turning
|
2011-07-10 21:47:08 -03:00
|
|
|
#endif
|
|
|
|
#ifndef RATE_YAW_I
|
|
|
|
# define RATE_YAW_I 0.0
|
|
|
|
#endif
|
|
|
|
#ifndef RATE_YAW_IMAX
|
|
|
|
# define RATE_YAW_IMAX 50
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
2011-06-30 21:19:10 -03:00
|
|
|
|
|
|
|
|
2010-12-19 12:40:33 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Autopilot control limits
|
|
|
|
//
|
|
|
|
// how much to we pitch towards the target
|
|
|
|
#ifndef PITCH_MAX
|
2011-07-10 21:47:08 -03:00
|
|
|
# define PITCH_MAX 22 // degrees
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Navigation control gains
|
|
|
|
//
|
2011-09-04 21:15:36 -03:00
|
|
|
#ifndef LOITER_P
|
|
|
|
# define LOITER_P .4 //
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
2011-09-04 21:15:36 -03:00
|
|
|
#ifndef LOITER_I
|
|
|
|
# define LOITER_I 0.01 //
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
2011-09-04 21:15:36 -03:00
|
|
|
#ifndef LOITER_IMAX
|
2011-09-05 15:48:06 -03:00
|
|
|
# define LOITER_IMAX 12 // degrees°
|
2011-04-25 02:12:59 -03:00
|
|
|
#endif
|
|
|
|
|
2011-09-04 21:15:36 -03:00
|
|
|
#ifndef NAV_P
|
2011-09-05 15:48:06 -03:00
|
|
|
# define NAV_P 2.0 // for 4.5 ms error = 13.5 pitch
|
2011-09-04 21:15:36 -03:00
|
|
|
#endif
|
|
|
|
#ifndef NAV_I
|
2011-09-05 15:48:06 -03:00
|
|
|
# define NAV_I 0.1 // this
|
2011-09-04 21:15:36 -03:00
|
|
|
#endif
|
|
|
|
#ifndef NAV_IMAX
|
2011-09-05 15:48:06 -03:00
|
|
|
# define NAV_IMAX 16 // degrees
|
2011-09-04 21:15:36 -03:00
|
|
|
#endif
|
2011-06-28 03:31:18 -03:00
|
|
|
|
2011-09-04 21:15:36 -03:00
|
|
|
/*
|
|
|
|
#ifndef NAV_LOITER_P
|
|
|
|
# define NAV_LOITER_P .4 //1.4 //
|
2011-06-28 03:31:18 -03:00
|
|
|
#endif
|
2011-09-04 21:15:36 -03:00
|
|
|
#ifndef NAV_LOITER_I
|
|
|
|
# define NAV_LOITER_I 0.05 //
|
2011-06-28 03:31:18 -03:00
|
|
|
#endif
|
2011-09-04 21:15:36 -03:00
|
|
|
#ifndef NAV_LOITER_D
|
|
|
|
# define NAV_LOITER_D 2 //
|
2011-06-28 03:31:18 -03:00
|
|
|
#endif
|
2011-09-04 21:15:36 -03:00
|
|
|
#ifndef NAV_LOITER_IMAX
|
|
|
|
# define NAV_LOITER_IMAX 8 // degrees°
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
2011-09-04 21:15:36 -03:00
|
|
|
*/
|
2010-12-19 12:40:33 -04:00
|
|
|
|
2011-05-25 02:48:33 -03:00
|
|
|
|
2011-07-10 21:47:08 -03:00
|
|
|
#ifndef WAYPOINT_SPEED_MAX
|
2011-09-05 15:48:06 -03:00
|
|
|
# define WAYPOINT_SPEED_MAX 450 // for 6m/s error = 13mph
|
2011-06-28 03:31:18 -03:00
|
|
|
#endif
|
|
|
|
|
2011-09-04 21:15:36 -03:00
|
|
|
|
2010-12-19 12:40:33 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Throttle control gains
|
|
|
|
//
|
2011-07-10 21:47:08 -03:00
|
|
|
#ifndef THROTTLE_P
|
2011-09-07 13:43:06 -03:00
|
|
|
# define THROTTLE_P 0.35 //
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
2011-07-10 21:47:08 -03:00
|
|
|
#ifndef THROTTLE_I
|
2011-09-07 13:43:06 -03:00
|
|
|
# define THROTTLE_I 0.10 // with 4m error, 12.5s windup
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
2011-09-04 21:15:36 -03:00
|
|
|
//#ifndef THROTTLE_D
|
|
|
|
//# define THROTTLE_D 0.6 // upped with filter
|
|
|
|
//#endif
|
2011-07-10 21:47:08 -03:00
|
|
|
#ifndef THROTTLE_IMAX
|
2011-09-05 14:06:08 -03:00
|
|
|
# define THROTTLE_IMAX 150
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Crosstrack compensation
|
|
|
|
//
|
|
|
|
#ifndef XTRACK_ENTRY_ANGLE
|
2011-07-10 21:47:08 -03:00
|
|
|
# define XTRACK_ENTRY_ANGLE 30 // deg
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
|
|
|
|
2011-07-10 21:47:08 -03:00
|
|
|
#ifndef XTRACK_P
|
|
|
|
# define XTRACK_P 2 // trying a lower val
|
|
|
|
#endif
|
|
|
|
#ifndef XTRACK_I
|
|
|
|
# define XTRACK_I 0.00 //with 4m error, 12.5s windup
|
|
|
|
#endif
|
|
|
|
#ifndef XTRACK_D
|
|
|
|
# define XTRACK_D 0.00 // upped with filter
|
|
|
|
#endif
|
|
|
|
#ifndef XTRACK_IMAX
|
|
|
|
# define XTRACK_IMAX 10
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2010-12-19 12:40:33 -04:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// DEBUGGING
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// DEBUG_LEVEL
|
|
|
|
//
|
|
|
|
#ifndef DEBUG_LEVEL
|
|
|
|
# define DEBUG_LEVEL SEVERITY_LOW
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2011-04-17 20:08:16 -03:00
|
|
|
#ifndef CHANNEL_6_TUNING
|
|
|
|
# define CHANNEL_6_TUNING CH6_NONE
|
|
|
|
#endif
|
|
|
|
|
2011-05-25 02:48:33 -03:00
|
|
|
|
2010-12-19 12:40:33 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Dataflash logging control
|
|
|
|
//
|
2011-07-17 07:31:07 -03:00
|
|
|
|
|
|
|
#ifndef LOGGING_ENABLED
|
|
|
|
# define LOGGING_ENABLED ENABLED
|
|
|
|
#endif
|
|
|
|
|
2010-12-19 12:40:33 -04:00
|
|
|
#ifndef LOG_ATTITUDE_FAST
|
|
|
|
# define LOG_ATTITUDE_FAST DISABLED
|
|
|
|
#endif
|
|
|
|
#ifndef LOG_ATTITUDE_MED
|
2011-06-28 03:31:18 -03:00
|
|
|
# define LOG_ATTITUDE_MED DISABLED
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
|
|
|
#ifndef LOG_GPS
|
|
|
|
# define LOG_GPS ENABLED
|
|
|
|
#endif
|
|
|
|
#ifndef LOG_PM
|
|
|
|
# define LOG_PM ENABLED
|
|
|
|
#endif
|
|
|
|
#ifndef LOG_CTUN
|
2011-06-28 03:31:18 -03:00
|
|
|
# define LOG_CTUN ENABLED
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
|
|
|
#ifndef LOG_NTUN
|
2011-06-28 03:31:18 -03:00
|
|
|
# define LOG_NTUN ENABLED
|
2010-12-19 12:40:33 -04:00
|
|
|
#endif
|
|
|
|
#ifndef LOG_MODE
|
|
|
|
# define LOG_MODE ENABLED
|
|
|
|
#endif
|
|
|
|
#ifndef LOG_RAW
|
|
|
|
# define LOG_RAW DISABLED
|
|
|
|
#endif
|
|
|
|
#ifndef LOG_CMD
|
|
|
|
# define LOG_CMD ENABLED
|
|
|
|
#endif
|
2011-07-30 17:42:54 -03:00
|
|
|
// current
|
|
|
|
#ifndef LOG_CUR
|
|
|
|
# define LOG_CUR DISABLED
|
|
|
|
#endif
|
|
|
|
// quad motor PWMs
|
|
|
|
#ifndef LOG_MOTORS
|
|
|
|
# define LOG_MOTORS DISABLED
|
|
|
|
#endif
|
|
|
|
// guess!
|
|
|
|
#ifndef LOG_OPTFLOW
|
|
|
|
# define LOG_OPTFLOW DISABLED
|
2011-01-16 23:44:12 -04:00
|
|
|
#endif
|
2011-07-17 07:31:17 -03:00
|
|
|
|
2011-08-01 07:06:15 -03:00
|
|
|
// calculate the default log_bitmask
|
|
|
|
#define LOGBIT(_s) (LOG_##_s ? MASK_LOG_##_s : 0)
|
|
|
|
|
|
|
|
#define DEFAULT_LOG_BITMASK \
|
|
|
|
LOGBIT(ATTITUDE_FAST) | \
|
|
|
|
LOGBIT(ATTITUDE_MED) | \
|
|
|
|
LOGBIT(GPS) | \
|
|
|
|
LOGBIT(PM) | \
|
|
|
|
LOGBIT(CTUN) | \
|
|
|
|
LOGBIT(NTUN) | \
|
|
|
|
LOGBIT(MODE) | \
|
|
|
|
LOGBIT(RAW) | \
|
|
|
|
LOGBIT(CMD) | \
|
|
|
|
LOGBIT(CUR) | \
|
|
|
|
LOGBIT(MOTORS) | \
|
|
|
|
LOGBIT(OPTFLOW)
|
|
|
|
|
2011-05-31 02:29:06 -03:00
|
|
|
// if we are using fast, Disable Medium
|
2011-06-03 02:36:39 -03:00
|
|
|
//#if LOG_ATTITUDE_FAST == ENABLED
|
|
|
|
// #undef LOG_ATTITUDE_MED
|
|
|
|
// #define LOG_ATTITUDE_MED DISABLED
|
|
|
|
//#endif
|
2011-05-31 02:29:06 -03:00
|
|
|
|
2011-02-17 03:09:13 -04:00
|
|
|
#ifndef DEBUG_PORT
|
|
|
|
# define DEBUG_PORT 0
|
|
|
|
#endif
|
2010-12-19 12:40:33 -04:00
|
|
|
|
2011-02-17 03:09:13 -04:00
|
|
|
#if DEBUG_PORT == 0
|
|
|
|
# define SendDebug_P(a) Serial.print_P(PSTR(a))
|
|
|
|
# define SendDebugln_P(a) Serial.println_P(PSTR(a))
|
|
|
|
# define SendDebug Serial.print
|
|
|
|
# define SendDebugln Serial.println
|
|
|
|
#elif DEBUG_PORT == 1
|
|
|
|
# define SendDebug_P(a) Serial1.print_P(PSTR(a))
|
|
|
|
# define SendDebugln_P(a) Serial1.println_P(PSTR(a))
|
|
|
|
# define SendDebug Serial1.print
|
|
|
|
# define SendDebugln Serial1.println
|
|
|
|
#elif DEBUG_PORT == 2
|
|
|
|
# define SendDebug_P(a) Serial2.print_P(PSTR(a))
|
|
|
|
# define SendDebugln_P(a) Serial2.println_P(PSTR(a))
|
|
|
|
# define SendDebug Serial2.print
|
|
|
|
# define SendDebugln Serial2.println
|
|
|
|
#elif DEBUG_PORT == 3
|
|
|
|
# define SendDebug_P(a) Serial3.print_P(PSTR(a))
|
|
|
|
# define SendDebugln_P(a) Serial3.println_P(PSTR(a))
|
|
|
|
# define SendDebug Serial3.print
|
|
|
|
# define SendDebugln Serial3.println
|
|
|
|
#endif
|
2010-12-19 12:40:33 -04:00
|
|
|
|
2011-02-17 03:09:13 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Navigation defaults
|
|
|
|
//
|
|
|
|
#ifndef WP_RADIUS_DEFAULT
|
|
|
|
# define WP_RADIUS_DEFAULT 3
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef LOITER_RADIUS_DEFAULT
|
|
|
|
# define LOITER_RADIUS_DEFAULT 10
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef ALT_HOLD_HOME
|
|
|
|
# define ALT_HOLD_HOME 8
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef USE_CURRENT_ALT
|
|
|
|
# define USE_CURRENT_ALT FALSE
|
|
|
|
#endif
|
|
|
|
|
2011-03-19 07:18:21 -03:00
|
|
|
|
2011-06-01 02:50:17 -03:00
|
|
|
#ifndef AUTO_RESET_LOITER
|
|
|
|
# define AUTO_RESET_LOITER 1 // enables Loiter to reset it's current location based on stick input.
|
|
|
|
#endif
|
|
|
|
#ifndef CUT_MOTORS
|
|
|
|
# define CUT_MOTORS 1 // do we cut the motors with no throttle?
|
|
|
|
#endif
|
|
|
|
|
2011-06-28 03:31:18 -03:00
|
|
|
#ifndef BROKEN_SLIDER
|
|
|
|
# define BROKEN_SLIDER 0 // 1 = yes (use Yaw to enter CLI mode)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MOTOR_LEDS
|
|
|
|
# define MOTOR_LEDS 1 // 0 = off, 1 = on
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2011-03-19 07:18:21 -03:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// RC override
|
|
|
|
//
|
|
|
|
#ifndef ALLOW_RC_OVERRIDE
|
|
|
|
# define ALLOW_RC_OVERRIDE DISABLED
|
|
|
|
#endif
|
2011-07-17 07:34:05 -03:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Developer Items
|
|
|
|
//
|
|
|
|
|
|
|
|
// use this to completely disable the CLI
|
|
|
|
#ifndef CLI_ENABLED
|
|
|
|
# define CLI_ENABLED ENABLED
|
|
|
|
#endif
|
2011-09-05 02:12:13 -03:00
|
|
|
|
|
|
|
// delay to prevent Xbee bricking, in milliseconds
|
|
|
|
#ifndef MAVLINK_TELEMETRY_PORT_DELAY
|
|
|
|
# define MAVLINK_TELEMETRY_PORT_DELAY 2000
|
|
|
|
#endif
|