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
//
2012-01-01 15:44:51 -04:00
# ifndef __ARDUCOPTER_CONFIG_H__
# define __ARDUCOPTER_CONFIG_H__
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
///
2012-04-18 16:16:02 -03:00
# ifdef USE_CMAKE_APM_CONFIG
2012-08-21 23:19:50 -03:00
# include "APM_Config_cmake.h" // <== Prefer cmake config if it exists
2012-04-18 16:16:02 -03:00
# else
2012-08-21 23:19:50 -03:00
# include "APM_Config.h" // <== THIS INCLUDE, DO NOT EDIT IT. EVER.
2012-04-18 16:16:02 -03:00
# endif
2010-12-19 12:40:33 -04:00
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// HARDWARE CONFIGURATION AND CONNECTIONS
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
2012-12-13 20:32:36 -04:00
# ifndef CONFIG_HAL_BOARD
# error CONFIG_HAL_BOARD must be defined to build ArduCopter
# endif
2013-04-05 10:48:10 -03:00
2014-07-06 23:05:28 -03:00
//////////////////////////////////////////////////////////////////////////////
// HIL_MODE OPTIONAL
# ifndef HIL_MODE
# define HIL_MODE HIL_MODE_DISABLED
# endif
# if HIL_MODE != HIL_MODE_DISABLED // we are in HIL mode
# undef CONFIG_BARO
# define CONFIG_BARO HAL_BARO_HIL
# undef CONFIG_COMPASS
# define CONFIG_COMPASS HAL_COMPASS_HIL
# endif
# define MAGNETOMETER ENABLED
2015-03-13 03:25:08 -03:00
// low power cpus are not supported
2014-08-01 02:26:34 -03:00
# if HAL_CPU_CLASS < HAL_CPU_CLASS_75
2015-03-13 03:25:08 -03:00
# error ArduCopter ver3.3 and higher is not supported on APM1, APM2 boards
2011-11-12 23:39:41 -04:00
# endif
2015-03-22 21:28:02 -03:00
// run at 400Hz on all systems
# define MAIN_LOOP_RATE 400
# define MAIN_LOOP_SECONDS 0.0025f
# define MAIN_LOOP_MICROS 2500
2014-02-25 18:40:29 -04:00
2010-12-19 12:40:33 -04:00
//////////////////////////////////////////////////////////////////////////////
// FRAME_CONFIG
2011-02-19 22:03:01 -04:00
//
2010-12-19 12:40:33 -04:00
# ifndef FRAME_CONFIG
2012-08-21 23:19:50 -03:00
# define FRAME_CONFIG QUAD_FRAME
2010-12-19 12:40:33 -04:00
# endif
2012-08-16 19:40:28 -03:00
2014-09-27 02:35:02 -03:00
# if FRAME_CONFIG == QUAD_FRAME
# define FRAME_CONFIG_STRING "QUAD"
# elif FRAME_CONFIG == TRI_FRAME
# define FRAME_CONFIG_STRING "TRI"
# elif FRAME_CONFIG == HEXA_FRAME
# define FRAME_CONFIG_STRING "HEXA"
# elif FRAME_CONFIG == Y6_FRAME
# define FRAME_CONFIG_STRING "Y6"
# elif FRAME_CONFIG == OCTA_FRAME
# define FRAME_CONFIG_STRING "OCTA"
# elif FRAME_CONFIG == OCTA_QUAD_FRAME
# define FRAME_CONFIG_STRING "OCTA_QUAD"
# elif FRAME_CONFIG == HELI_FRAME
# define FRAME_CONFIG_STRING "HELI"
# elif FRAME_CONFIG == SINGLE_FRAME
# define FRAME_CONFIG_STRING "SINGLE"
# elif FRAME_CONFIG == COAX_FRAME
# define FRAME_CONFIG_STRING "COAX"
# else
# define FRAME_CONFIG_STRING "UNKNOWN"
# endif
2012-12-08 15:49:38 -04:00
/////////////////////////////////////////////////////////////////////////////////
2013-08-28 01:05:01 -03:00
// TradHeli defaults
2012-12-08 15:49:38 -04:00
# if FRAME_CONFIG == HELI_FRAME
2013-12-15 10:15:44 -04:00
# define RC_FAST_SPEED 125
# define WP_YAW_BEHAVIOR_DEFAULT WP_YAW_BEHAVIOR_LOOK_AHEAD
# define RATE_ROLL_D 0
# define RATE_PITCH_D 0
# define MPU6K_FILTER 10
# define HELI_STAB_COLLECTIVE_MIN_DEFAULT 0
# define HELI_STAB_COLLECTIVE_MAX_DEFAULT 1000
# define THR_MIN_DEFAULT 0
2014-02-02 03:58:36 -04:00
# define AUTOTUNE_ENABLED DISABLED
2012-12-08 21:41:05 -04:00
# endif
2012-12-08 15:49:38 -04:00
2013-08-28 01:05:01 -03:00
/////////////////////////////////////////////////////////////////////////////////
// Y6 defaults
# if FRAME_CONFIG == Y6_FRAME
2013-11-03 00:55:49 -03:00
# define RATE_ROLL_P 0.1f
# define RATE_ROLL_D 0.006f
# define RATE_PITCH_P 0.1f
# define RATE_PITCH_D 0.006f
# define RATE_YAW_P 0.150f
# define RATE_YAW_I 0.015f
2013-08-28 01:05:01 -03:00
# endif
2011-10-12 02:20:23 -03:00
//////////////////////////////////////////////////////////////////////////////
// PWM control
2012-09-13 09:31:13 -03:00
// default RC speed in Hz
2012-03-02 02:24:44 -04:00
# ifndef RC_FAST_SPEED
2012-12-08 15:49:38 -04:00
# define RC_FAST_SPEED 490
2012-03-02 02:24:44 -04:00
# endif
2011-11-27 02:07:00 -04:00
//////////////////////////////////////////////////////////////////////////////
// Barometer
//
# ifndef CONFIG_BARO
2012-08-21 23:19:50 -03:00
# define CONFIG_BARO AP_BARO_BMP085
2011-11-27 02:07:00 -04:00
# endif
2011-02-20 19:09:28 -04:00
//////////////////////////////////////////////////////////////////////////////
// Sonar
//
2011-06-16 14:03:26 -03:00
2011-11-12 23:39:41 -04:00
# ifndef CONFIG_SONAR
2012-08-21 23:19:50 -03:00
# define CONFIG_SONAR ENABLED
2011-11-12 23:39:41 -04:00
# endif
2013-01-08 03:41:07 -04:00
# ifndef SONAR_ALT_HEALTH_MAX
# define SONAR_ALT_HEALTH_MAX 3 // number of good reads that indicates a healthy sonar
# endif
2013-08-18 21:52:59 -03:00
# ifndef SONAR_RELIABLE_DISTANCE_PCT
# define SONAR_RELIABLE_DISTANCE_PCT 0.60f // we trust the sonar out to 60% of it's maximum range
# endif
2013-04-20 03:58:36 -03:00
# ifndef SONAR_GAIN_DEFAULT
2013-12-01 03:25:47 -04:00
# define SONAR_GAIN_DEFAULT 0.8 // gain for controlling how quickly sonar range adjusts target altitude (lower means slower reaction)
2013-01-08 03:41:07 -04:00
# endif
# ifndef THR_SURFACE_TRACKING_VELZ_MAX
2013-08-18 21:52:59 -03:00
# define THR_SURFACE_TRACKING_VELZ_MAX 150 // max vertical speed change while surface tracking with sonar
2013-01-08 03:41:07 -04:00
# endif
2014-08-14 07:37:00 -03:00
# ifndef SONAR_TIMEOUT_MS
# define SONAR_TIMEOUT_MS 1000 // desired sonar alt will reset to current sonar alt after this many milliseconds without a good sonar alt
# endif
2014-09-10 07:13:58 -03:00
# ifndef SONAR_TILT_CORRECTION // by disable tilt correction for use of range finder data by EKF
# define SONAR_TILT_CORRECTION DISABLED
# endif
2011-02-24 01:56:59 -04:00
//////////////////////////////////////////////////////////////////////////////
// HIL_MODE OPTIONAL
2011-05-09 09:20:22 -03:00
# ifndef HIL_MODE
2012-08-21 23:19:50 -03:00
# define HIL_MODE HIL_MODE_DISABLED
2011-05-09 09:20:22 -03:00
# endif
2011-02-24 01:56:59 -04:00
2012-08-21 23:19:50 -03:00
# if HIL_MODE != HIL_MODE_DISABLED // we are in HIL mode
2011-05-09 12:46:56 -03:00
2011-12-11 23:59:39 -04:00
# undef CONFIG_SONAR
# define CONFIG_SONAR DISABLED
2014-02-26 17:16:20 -04:00
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
2011-05-09 12:46:56 -03:00
# ifndef MAV_SYSTEM_ID
2012-08-21 23:19:50 -03:00
# define MAV_SYSTEM_ID 1
2011-05-09 12:46:56 -03:00
# endif
2011-05-25 02:48:33 -03:00
2010-12-19 12:40:33 -04:00
//////////////////////////////////////////////////////////////////////////////
// Battery monitoring
//
2013-10-01 10:34:44 -03:00
# ifndef FS_BATT_VOLTAGE_DEFAULT
# define FS_BATT_VOLTAGE_DEFAULT 10.5f // default battery voltage below which failsafe will be triggered
2010-12-19 12:40:33 -04:00
# endif
2011-02-24 01:56:59 -04:00
2013-10-01 10:34:44 -03:00
# ifndef FS_BATT_MAH_DEFAULT
# define FS_BATT_MAH_DEFAULT 0 // default battery capacity (in mah) below which failsafe will be triggered
2011-09-18 21:12:28 -03:00
# endif
2013-05-28 09:50:31 -03:00
# ifndef BOARD_VOLTAGE_MIN
2014-02-13 02:12:10 -04:00
# define BOARD_VOLTAGE_MIN 4.3f // min board voltage in volts for pre-arm checks
2013-05-28 09:50:31 -03:00
# endif
2013-05-30 23:31:27 -03:00
# ifndef BOARD_VOLTAGE_MAX
2014-02-13 02:12:10 -04:00
# define BOARD_VOLTAGE_MAX 5.8f // max board voltage in volts for pre-arm checks
2013-05-30 23:31:27 -03:00
# endif
2015-03-12 23:05:30 -03:00
// prearm GPS hdop check
2013-08-15 01:04:43 -03:00
# ifndef GPS_HDOP_GOOD_DEFAULT
2014-12-14 21:45:50 -04:00
# define GPS_HDOP_GOOD_DEFAULT 230 // minimum hdop that represents a good position. used during pre-arm checks if fence is enabled
2013-08-15 01:04:43 -03:00
# endif
2010-12-19 12:40:33 -04:00
2013-04-29 09:30:22 -03:00
// GCS failsafe
# ifndef FS_GCS
# define FS_GCS DISABLED
# endif
# ifndef FS_GCS_TIMEOUT_MS
# define FS_GCS_TIMEOUT_MS 5000 // gcs failsafe triggers after 5 seconds with no GCS heartbeat
# endif
2014-07-16 15:02:32 -03:00
2014-07-16 23:41:43 -03:00
// Radio failsafe while using RC_override
# ifndef FS_RADIO_RC_OVERRIDE_TIMEOUT_MS
# define FS_RADIO_RC_OVERRIDE_TIMEOUT_MS 2000 // RC Radio failsafe triggers after 2 seconds while using RC_override from ground station
# endif
2014-07-16 15:02:32 -03:00
// Radio failsafe
2014-07-16 23:41:43 -03:00
# ifndef FS_RADIO_TIMEOUT_MS
# define FS_RADIO_TIMEOUT_MS 500 // RC Radio Failsafe triggers after 500 miliseconds with No RC Input
2014-07-16 15:02:32 -03:00
# endif
2013-04-29 09:30:22 -03:00
// possible values for FS_GCS parameter
# define FS_GCS_DISABLED 0
# define FS_GCS_ENABLED_ALWAYS_RTL 1
# define FS_GCS_ENABLED_CONTINUE_MISSION 2
2014-09-18 05:24:40 -03:00
// pre-arm baro vs inertial nav max alt disparity
2014-09-18 05:32:03 -03:00
# ifndef PREARM_MAX_ALT_DISPARITY_CM
2014-10-12 20:44:46 -03:00
# define PREARM_MAX_ALT_DISPARITY_CM 100 // barometer and inertial nav altitude must be within this many centimeters
2014-09-18 05:24:40 -03:00
# endif
2014-09-03 01:50:41 -03:00
// arming check's maximum acceptable accelerometer vector difference (in m/s/s) between primary and backup accelerometers
# ifndef PREARM_MAX_ACCEL_VECTOR_DIFF
2015-01-19 23:44:02 -04:00
# define PREARM_MAX_ACCEL_VECTOR_DIFF 0.70f // pre arm accel check will fail if primary and backup accelerometer vectors differ by 0.7m/s/s
2014-09-03 01:50:41 -03:00
# endif
2014-09-03 10:00:09 -03:00
// arming check's maximum acceptable rotation rate difference (in rad/sec) between primary and backup gyros
# ifndef PREARM_MAX_GYRO_VECTOR_DIFF
2015-01-19 23:44:02 -04:00
# define PREARM_MAX_GYRO_VECTOR_DIFF 0.0873f // pre arm gyro check will fail if primary and backup gyro vectors differ by 0.0873 rad/sec (=5deg/sec)
2014-09-03 10:00:09 -03:00
# endif
2014-07-21 07:07:15 -03:00
//////////////////////////////////////////////////////////////////////////////
2015-03-27 03:23:17 -03:00
// EKF Checker
2014-07-31 10:43:04 -03:00
# ifndef EKFCHECK_THRESHOLD_DEFAULT
2014-09-09 02:59:27 -03:00
# define EKFCHECK_THRESHOLD_DEFAULT 0.8f // EKF checker's default compass and velocity variance above which the EKF's horizontal position will be considered bad
2014-07-21 07:07:15 -03:00
# endif
2015-02-09 07:23:49 -04:00
# ifndef EKF_ORIGIN_MAX_DIST_M
# define EKF_ORIGIN_MAX_DIST_M 50000 // EKF origin and waypoints (including home) must be within 50km
# endif
2010-12-19 12:40:33 -04:00
//////////////////////////////////////////////////////////////////////////////
// MAGNETOMETER
2011-02-24 01:56:59 -04:00
# ifndef MAGNETOMETER
2012-08-21 23:19:50 -03:00
# define MAGNETOMETER ENABLED
2010-12-19 12:40:33 -04:00
# endif
2013-05-31 00:28:04 -03:00
// expected magnetic field strength. pre-arm checks will fail if 50% higher or lower than this value
2015-03-13 03:25:08 -03:00
# ifndef COMPASS_MAGFIELD_EXPECTED
# define COMPASS_MAGFIELD_EXPECTED 530 // pre arm will fail if mag field > 874 or < 185
2013-05-31 00:23:19 -03:00
# endif
2013-12-03 10:23:26 -04:00
// max compass offset length (i.e. sqrt(offs_x^2+offs_y^2+offs_Z^2))
# ifndef CONFIG_ARCH_BOARD_PX4FMU_V1
# ifndef COMPASS_OFFSETS_MAX
# define COMPASS_OFFSETS_MAX 600 // PX4 onboard compass has high offsets
# endif
2015-03-13 03:25:08 -03:00
# else // SITL, FLYMAPLE, etc
2013-12-03 10:23:26 -04:00
# ifndef COMPASS_OFFSETS_MAX
# define COMPASS_OFFSETS_MAX 500
# endif
# endif
2014-08-26 10:31:43 -03:00
// arming check's maximum acceptable vector difference between internal and external compass after vectors are normalized to field length of 1.0
# ifndef COMPASS_ACCEPTABLE_VECTOR_DIFF
# define COMPASS_ACCEPTABLE_VECTOR_DIFF 0.75 // pre arm compass check will fail if internal vs external compass direction differ by more than 45 degrees
# endif
2010-12-19 12:40:33 -04:00
//////////////////////////////////////////////////////////////////////////////
2011-07-21 20:14:53 -03:00
// OPTICAL_FLOW
2014-10-15 03:17:36 -03:00
# ifndef OPTFLOW
2015-01-03 00:53:49 -04:00
# if AP_AHRS_NAVEKF_AVAILABLE
2014-10-16 09:17:54 -03:00
# define OPTFLOW ENABLED
# else
# define OPTFLOW DISABLED
# endif
2011-07-21 20:14:53 -03:00
# endif
2013-10-04 03:49:19 -03:00
//////////////////////////////////////////////////////////////////////////////
// Auto Tuning
2014-02-02 03:58:36 -04:00
# ifndef AUTOTUNE_ENABLED
# define AUTOTUNE_ENABLED ENABLED
2013-10-04 03:49:19 -03:00
# endif
2012-01-09 00:53:54 -04:00
2013-08-04 11:20:21 -03:00
//////////////////////////////////////////////////////////////////////////////
// Crop Sprayer
# ifndef SPRAYER
# define SPRAYER DISABLED
# endif
2011-07-21 20:14:53 -03:00
2013-12-17 00:58:11 -04:00
//////////////////////////////////////////////////////////////////////////////
// EPM cargo gripper
# ifndef EPM_ENABLED
2014-09-17 08:50:04 -03:00
# define EPM_ENABLED ENABLED
2013-12-17 00:58:11 -04:00
# endif
2014-04-02 12:19:54 -03:00
//////////////////////////////////////////////////////////////////////////////
// Parachute release
# ifndef PARACHUTE
2014-05-27 02:43:33 -03:00
# define PARACHUTE ENABLED
2014-04-02 12:19:54 -03:00
# endif
2014-05-23 02:29:08 -03:00
//////////////////////////////////////////////////////////////////////////////
// Nav-Guided - allows external nav computer to control vehicle
# ifndef NAV_GUIDED
2014-10-13 00:00:53 -03:00
# define NAV_GUIDED ENABLED
2014-05-23 02:29:08 -03:00
# endif
2010-12-19 12:40:33 -04:00
//////////////////////////////////////////////////////////////////////////////
// RADIO CONFIGURATION
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// FLIGHT_MODE
//
2014-09-11 04:52:36 -03:00
# ifndef FLIGHT_MODE_1
2012-08-21 23:19:50 -03:00
# define FLIGHT_MODE_1 STABILIZE
2010-12-19 12:40:33 -04:00
# endif
2014-09-11 04:52:36 -03:00
# ifndef FLIGHT_MODE_2
2012-08-21 23:19:50 -03:00
# define FLIGHT_MODE_2 STABILIZE
2010-12-19 12:40:33 -04:00
# endif
2014-09-11 04:52:36 -03:00
# ifndef FLIGHT_MODE_3
2012-08-21 23:19:50 -03:00
# define FLIGHT_MODE_3 STABILIZE
2010-12-19 12:40:33 -04:00
# endif
2014-09-11 04:52:36 -03:00
# ifndef FLIGHT_MODE_4
2012-08-21 23:19:50 -03:00
# define FLIGHT_MODE_4 STABILIZE
2010-12-19 12:40:33 -04:00
# endif
2014-09-11 04:52:36 -03:00
# ifndef FLIGHT_MODE_5
2012-08-21 23:19:50 -03:00
# define FLIGHT_MODE_5 STABILIZE
2010-12-19 12:40:33 -04:00
# endif
2014-09-11 04:52:36 -03:00
# ifndef FLIGHT_MODE_6
2012-08-21 23:19:50 -03:00
# define FLIGHT_MODE_6 STABILIZE
2010-12-19 12:40:33 -04:00
# endif
//////////////////////////////////////////////////////////////////////////////
2012-12-10 10:38:43 -04:00
// Throttle Failsafe
2010-12-19 12:40:33 -04:00
//
2012-12-10 10:38:43 -04:00
# ifndef FS_THR_VALUE_DEFAULT
# define FS_THR_VALUE_DEFAULT 975
2010-12-19 12:40:33 -04:00
# endif
2012-11-11 09:11:12 -04:00
2012-11-24 09:50:09 -04:00
# ifndef LAND_SPEED
# define LAND_SPEED 50 // the descent speed for the final stage of landing in cm/s
# endif
2013-01-08 03:41:07 -04:00
# ifndef LAND_START_ALT
# define LAND_START_ALT 1000 // altitude in cm where land controller switches to slow rate of descent
# endif
# ifndef LAND_DETECTOR_TRIGGER
# define LAND_DETECTOR_TRIGGER 50 // number of 50hz iterations with near zero climb rate and low throttle that triggers landing complete.
# endif
2014-08-29 03:25:37 -03:00
# ifndef LAND_DETECTOR_MAYBE_TRIGGER
# define LAND_DETECTOR_MAYBE_TRIGGER 10 // number of 50hz iterations with near zero climb rate and low throttle that means we might be landed (used to reset horizontal position targets to prevent tipping over)
# endif
2014-09-03 08:43:51 -03:00
# ifndef LAND_DETECTOR_CLIMBRATE_MAX
# define LAND_DETECTOR_CLIMBRATE_MAX 30 // vehicle climb rate must be between -30 and +30 cm/s
# endif
2015-01-31 04:23:43 -04:00
# ifndef LAND_DETECTOR_DESIRED_CLIMBRATE_MAX
# define LAND_DETECTOR_DESIRED_CLIMBRATE_MAX -20 // vehicle desired climb rate must be below -20cm/s
# endif
2014-09-03 08:43:51 -03:00
# ifndef LAND_DETECTOR_ROTATION_MAX
# define LAND_DETECTOR_ROTATION_MAX 0.50f // vehicle rotation must be below 0.5 rad/sec (=30deg/sec for) vehicle to consider itself landed
# endif
2014-12-27 00:33:06 -04:00
# ifndef LAND_REQUIRE_MIN_THROTTLE_TO_DISARM
# define LAND_REQUIRE_MIN_THROTTLE_TO_DISARM DISABLED // we do not require pilot to reduce throttle to minimum before vehicle will disarm in AUTO, LAND or RTL
2014-01-14 22:31:00 -04:00
# endif
2014-07-06 06:05:43 -03:00
# ifndef LAND_REPOSITION_DEFAULT
2014-08-30 22:44:09 -03:00
# define LAND_REPOSITION_DEFAULT 1 // by default the pilot can override roll/pitch during landing
2014-07-06 06:05:43 -03:00
# endif
2014-07-06 06:16:27 -03:00
# ifndef LAND_WITH_DELAY_MS
# define LAND_WITH_DELAY_MS 4000 // default delay (in milliseconds) when a land-with-delay is triggered during a failsafe event
# endif
2011-06-19 02:31:33 -03:00
2012-07-10 19:39:13 -03:00
//////////////////////////////////////////////////////////////////////////////
// CAMERA TRIGGER AND CONTROL
//
# ifndef CAMERA
2013-04-05 10:48:10 -03:00
# define CAMERA ENABLED
2012-07-10 19:39:13 -03:00
# endif
//////////////////////////////////////////////////////////////////////////////
// MOUNT (ANTENNA OR CAMERA)
//
# ifndef MOUNT
2013-04-05 10:48:10 -03:00
# define MOUNT ENABLED
2012-07-10 19:39:13 -03:00
# endif
2011-09-04 21:15:36 -03:00
//////////////////////////////////////////////////////////////////////////////
2014-02-03 08:07:30 -04:00
// Flight mode definitions
2011-09-04 21:15:36 -03:00
//
2013-01-25 02:57:55 -04:00
// Acro Mode
2014-02-03 08:07:30 -04:00
# ifndef ACRO_RP_P
# define ACRO_RP_P 4.5f
2013-01-25 02:57:55 -04:00
# endif
2014-02-03 08:07:30 -04:00
# ifndef ACRO_YAW_P
# define ACRO_YAW_P 4.5f
2013-01-25 02:57:55 -04:00
# endif
2013-08-04 05:46:04 -03:00
# ifndef ACRO_LEVEL_MAX_ANGLE
# define ACRO_LEVEL_MAX_ANGLE 3000
# endif
2014-02-03 08:07:30 -04:00
# ifndef ACRO_BALANCE_ROLL
# define ACRO_BALANCE_ROLL 1.0f
2012-12-12 10:28:26 -04:00
# endif
2014-02-03 08:07:30 -04:00
# ifndef ACRO_BALANCE_PITCH
# define ACRO_BALANCE_PITCH 1.0f
2012-12-12 10:28:26 -04:00
# endif
2014-08-12 23:25:59 -03:00
# ifndef ACRO_EXPO_DEFAULT
# define ACRO_EXPO_DEFAULT 0.3f
# endif
2014-02-03 08:07:30 -04:00
// Stabilize (angle controller) gains
# ifndef STABILIZE_ROLL_P
# define STABILIZE_ROLL_P 4.5f
2011-09-04 21:15:36 -03:00
# endif
2014-02-03 08:07:30 -04:00
# ifndef STABILIZE_PITCH_P
# define STABILIZE_PITCH_P 4.5f
2011-09-04 21:15:36 -03:00
# endif
2014-02-03 08:07:30 -04:00
# ifndef STABILIZE_YAW_P
# define STABILIZE_YAW_P 4.5f
2011-09-04 21:15:36 -03:00
# endif
2012-06-26 14:38:33 -03:00
2012-02-15 13:09:42 -04:00
// RTL Mode
2012-11-29 08:08:19 -04:00
# ifndef RTL_ALT_FINAL
2013-08-29 22:34:23 -03:00
# define RTL_ALT_FINAL 0 // the altitude the vehicle will move to as the final stage of Returning to Launch. Set to zero to land.
2012-07-19 21:48:48 -03:00
# endif
2012-11-29 08:08:19 -04:00
# ifndef RTL_ALT
# define RTL_ALT 1500 // default alt to return to home in cm, 0 = Maintain current altitude
2012-02-15 13:09:42 -04:00
# endif
2012-12-21 01:39:48 -04:00
# ifndef RTL_LOITER_TIME
# define RTL_LOITER_TIME 5000 // Time (in milliseconds) to loiter above home before begining final descent
2012-11-10 01:45:02 -04:00
# endif
2014-02-03 08:07:30 -04:00
// AUTO Mode
# ifndef WP_YAW_BEHAVIOR_DEFAULT
# define WP_YAW_BEHAVIOR_DEFAULT WP_YAW_BEHAVIOR_LOOK_AT_NEXT_WP_EXCEPT_RTL
2010-12-19 12:40:33 -04:00
# endif
2014-02-03 08:07:30 -04:00
# ifndef AUTO_YAW_SLEW_RATE
# define AUTO_YAW_SLEW_RATE 60 // degrees/sec
2011-10-27 15:55:13 -03:00
# endif
2012-12-08 01:23:32 -04:00
# ifndef YAW_LOOK_AHEAD_MIN_SPEED
2013-08-01 02:12:55 -03:00
# define YAW_LOOK_AHEAD_MIN_SPEED 100 // minimum ground speed in cm/s required before copter is aimed at ground course
2012-11-26 22:36:32 -04:00
# endif
2014-02-03 08:07:30 -04:00
// Super Simple mode
# ifndef SUPER_SIMPLE_RADIUS
# define SUPER_SIMPLE_RADIUS 1000
# endif
2011-10-27 15:55:13 -03:00
//////////////////////////////////////////////////////////////////////////////
// Stabilize Rate Control
2010-12-19 12:40:33 -04:00
//
2013-08-11 00:51:08 -03:00
# ifndef ROLL_PITCH_INPUT_MAX
# define ROLL_PITCH_INPUT_MAX 4500 // roll, pitch input range
2012-11-10 17:11:11 -04:00
# endif
2013-08-11 00:51:08 -03:00
# ifndef DEFAULT_ANGLE_MAX
# define DEFAULT_ANGLE_MAX 4500 // ANGLE_MAX parameters default value
2012-11-10 17:11:11 -04:00
# endif
2013-10-27 10:34:42 -03:00
# ifndef ANGLE_RATE_MAX
# define ANGLE_RATE_MAX 18000 // default maximum rotation rate in roll/pitch axis requested by angle controller used in stabilize, loiter, rtl, auto flight modes
# endif
2014-02-03 08:07:30 -04:00
//////////////////////////////////////////////////////////////////////////////
// Rate controller gains
//
2014-04-17 18:15:19 -03:00
2011-07-31 17:09:27 -03:00
# ifndef RATE_ROLL_P
2013-01-10 14:42:24 -04:00
# define RATE_ROLL_P 0.150f
2010-12-19 12:40:33 -04:00
# endif
2011-07-31 17:09:27 -03:00
# ifndef RATE_ROLL_I
2013-01-10 14:42:24 -04:00
# define RATE_ROLL_I 0.100f
2012-01-29 02:00:05 -04:00
# endif
# ifndef RATE_ROLL_D
2013-01-10 14:42:24 -04:00
# define RATE_ROLL_D 0.004f
2010-12-19 12:40:33 -04:00
# endif
2011-07-31 17:09:27 -03:00
# ifndef RATE_ROLL_IMAX
2014-08-03 23:31:02 -03:00
# define RATE_ROLL_IMAX 1000
2011-07-10 21:47:08 -03:00
# endif
2015-03-03 23:47:05 -04:00
# ifndef RATE_ROLL_FILT_HZ
# define RATE_ROLL_FILT_HZ 20.0f
# endif
2011-07-10 21:47:08 -03:00
# ifndef RATE_PITCH_P
2013-01-10 14:42:24 -04:00
# define RATE_PITCH_P 0.150f
2011-07-10 21:47:08 -03:00
# endif
# ifndef RATE_PITCH_I
2013-01-10 14:42:24 -04:00
# define RATE_PITCH_I 0.100f
2012-01-29 02:00:05 -04:00
# endif
# ifndef RATE_PITCH_D
2013-01-10 14:42:24 -04:00
# define RATE_PITCH_D 0.004f
2011-07-10 21:47:08 -03:00
# endif
# ifndef RATE_PITCH_IMAX
2014-10-07 09:06:43 -03:00
# define RATE_PITCH_IMAX 1000
2010-12-19 12:40:33 -04:00
# endif
2015-03-03 23:47:05 -04:00
# ifndef RATE_PITCH_FILT_HZ
# define RATE_PITCH_FILT_HZ 20.0f
# endif
2010-12-19 12:40:33 -04:00
2011-07-10 21:47:08 -03:00
# ifndef RATE_YAW_P
2013-03-31 23:49:50 -03:00
# define RATE_YAW_P 0.200f
2011-07-10 21:47:08 -03:00
# endif
# ifndef RATE_YAW_I
2013-07-11 00:18:52 -03:00
# define RATE_YAW_I 0.020f
2012-01-29 02:00:05 -04:00
# endif
# ifndef RATE_YAW_D
2013-01-10 14:42:24 -04:00
# define RATE_YAW_D 0.000f
2011-07-10 21:47:08 -03:00
# endif
# ifndef RATE_YAW_IMAX
2014-08-03 23:31:02 -03:00
# define RATE_YAW_IMAX 1000
2010-12-19 12:40:33 -04:00
# endif
2015-03-03 23:47:05 -04:00
# ifndef RATE_YAW_FILT_HZ
2015-03-06 03:07:52 -04:00
# define RATE_YAW_FILT_HZ 5.0f
2015-03-03 23:47:05 -04:00
# endif
2011-06-30 21:19:10 -03:00
2010-12-19 12:40:33 -04:00
//////////////////////////////////////////////////////////////////////////////
2013-02-18 02:01:22 -04:00
// Loiter position control gains
2010-12-19 12:40:33 -04:00
//
2015-01-31 02:49:17 -04:00
# ifndef POS_XY_P
# define POS_XY_P 1.0f
2012-01-22 02:09:13 -04:00
# endif
2013-01-14 00:07:52 -04:00
2012-02-15 13:09:42 -04:00
//////////////////////////////////////////////////////////////////////////////
2015-01-29 02:51:21 -04:00
// Velocity (horizontal) gains
2012-02-15 13:09:42 -04:00
//
2015-01-29 02:51:21 -04:00
# ifndef VEL_XY_P
# define VEL_XY_P 1.0f
2012-02-15 13:09:42 -04:00
# endif
2015-01-29 02:51:21 -04:00
# ifndef VEL_XY_I
# define VEL_XY_I 0.5f
2012-02-15 13:09:42 -04:00
# endif
2015-01-29 02:51:21 -04:00
# ifndef VEL_XY_IMAX
# define VEL_XY_IMAX 1000
2012-02-15 13:09:42 -04:00
# endif
2015-01-29 02:51:21 -04:00
# ifndef VEL_XY_FILT_HZ
# define VEL_XY_FILT_HZ 5.0f
2015-03-03 23:47:05 -04:00
# endif
2012-02-15 13:09:42 -04:00
2014-04-11 05:15:09 -03:00
//////////////////////////////////////////////////////////////////////////////
2014-07-11 02:08:09 -03:00
// PosHold parameter defaults
2014-04-11 05:15:09 -03:00
//
2014-07-11 02:08:09 -03:00
# ifndef POSHOLD_ENABLED
# define POSHOLD_ENABLED ENABLED // PosHold flight mode enabled by default
2014-04-23 03:24:03 -03:00
# endif
2014-07-11 02:08:09 -03:00
# ifndef POSHOLD_BRAKE_RATE_DEFAULT
# define POSHOLD_BRAKE_RATE_DEFAULT 8 // default POSHOLD_BRAKE_RATE param value. Rotation rate during braking in deg/sec
2014-04-11 05:15:09 -03:00
# endif
2014-07-11 02:08:09 -03:00
# ifndef POSHOLD_BRAKE_ANGLE_DEFAULT
# define POSHOLD_BRAKE_ANGLE_DEFAULT 3000 // default POSHOLD_BRAKE_ANGLE param value. Max lean angle during braking in centi-degrees
2014-04-11 05:15:09 -03:00
# endif
2010-12-19 12:40:33 -04:00
//////////////////////////////////////////////////////////////////////////////
// Throttle control gains
//
2013-10-13 08:41:11 -03:00
# ifndef THR_MID_DEFAULT
# define THR_MID_DEFAULT 500 // Throttle output (0 ~ 1000) when throttle stick is in mid position
# endif
# ifndef THR_MIN_DEFAULT
# define THR_MIN_DEFAULT 130 // minimum throttle sent to the motors when armed and pilot throttle above zero
# endif
2015-03-16 01:35:57 -03:00
# define THR_MAX 1000 // maximum throttle input and output sent to the motors
2013-10-13 08:41:11 -03:00
2013-10-27 10:13:42 -03:00
# ifndef THR_DZ_DEFAULT
# define THR_DZ_DEFAULT 100 // the deadzone above and below mid throttle while in althold or loiter
2013-09-12 10:31:42 -03:00
# endif
2012-01-29 02:00:05 -04:00
# ifndef ALT_HOLD_P
2013-06-16 03:31:36 -03:00
# define ALT_HOLD_P 1.0f
2011-10-02 15:36:23 -03:00
# endif
2015-01-31 02:49:17 -04:00
// Velocity (vertical) control gains
# ifndef VEL_Z_P
# define VEL_Z_P 5.0f
2014-09-07 10:14:40 -03:00
# endif
2015-01-31 02:49:17 -04:00
// Accel (vertical) control gains
# ifndef ACCEL_Z_P
# define ACCEL_Z_P 0.50f
2014-09-07 10:14:40 -03:00
# endif
2015-01-31 02:49:17 -04:00
# ifndef ACCEL_Z_I
# define ACCEL_Z_I 1.00f
2014-09-07 10:14:40 -03:00
# endif
2015-01-31 02:49:17 -04:00
# ifndef ACCEL_Z_D
# define ACCEL_Z_D 0.0f
2014-09-07 10:14:40 -03:00
# endif
2015-01-31 02:49:17 -04:00
# ifndef ACCEL_Z_IMAX
# define ACCEL_Z_IMAX 800
2010-12-19 12:40:33 -04:00
# endif
2015-01-31 02:49:17 -04:00
# ifndef ACCEL_Z_FILT_HZ
# define ACCEL_Z_FILT_HZ 20.0f
2015-03-03 23:47:05 -04:00
# endif
2010-12-19 12:40:33 -04:00
2014-04-30 00:05:02 -03:00
// default maximum vertical velocity and acceleration the pilot may request
2012-12-21 23:52:49 -04:00
# ifndef PILOT_VELZ_MAX
# define PILOT_VELZ_MAX 250 // maximum vertical velocity in cm/s
# endif
2014-04-30 00:05:02 -03:00
# ifndef PILOT_ACCEL_Z_DEFAULT
# define PILOT_ACCEL_Z_DEFAULT 250 // vertical acceleration in cm/s/s while altitude is under pilot control
# endif
2012-11-25 05:07:33 -04:00
2013-03-17 01:24:49 -03:00
// max distance in cm above or below current location that will be used for the alt target when transitioning to alt-hold mode
# ifndef ALT_HOLD_INIT_MAX_OVERSHOOT
# define ALT_HOLD_INIT_MAX_OVERSHOOT 200
# endif
// the acceleration used to define the distance-velocity curve
# ifndef ALT_HOLD_ACCEL_MAX
2013-05-31 09:04:10 -03:00
# define ALT_HOLD_ACCEL_MAX 250 // if you change this you must also update the duplicate declaration in AC_WPNav.h
2013-03-17 01:24:49 -03:00
# endif
2010-12-19 12:40:33 -04:00
//////////////////////////////////////////////////////////////////////////////
// Dataflash logging control
//
2013-04-05 10:48:10 -03:00
# ifndef LOGGING_ENABLED
2012-08-21 23:19:50 -03:00
# define LOGGING_ENABLED ENABLED
2011-07-17 07:31:07 -03:00
# endif
2015-03-13 03:25:08 -03:00
// Default logging bitmask
# ifndef DEFAULT_LOG_BITMASK
2013-12-05 03:04:52 -04:00
# define DEFAULT_LOG_BITMASK \
MASK_LOG_ATTITUDE_MED | \
MASK_LOG_GPS | \
MASK_LOG_PM | \
MASK_LOG_CTUN | \
MASK_LOG_NTUN | \
MASK_LOG_RCIN | \
MASK_LOG_IMU | \
MASK_LOG_CMD | \
MASK_LOG_CURRENT | \
MASK_LOG_RCOUT | \
2014-12-07 22:16:53 -04:00
MASK_LOG_OPTFLOW | \
2013-12-05 03:04:52 -04:00
MASK_LOG_COMPASS | \
2015-03-04 02:21:01 -04:00
MASK_LOG_CAMERA | \
2015-03-18 09:08:30 -03:00
MASK_LOG_MOTBATT
2012-11-07 06:03:30 -04:00
# endif
2011-07-17 07:31:17 -03:00
2012-07-16 15:46:43 -03:00
//////////////////////////////////////////////////////////////////////////////
// AP_Limits Defaults
//
// Enable/disable AP_Limits
2013-04-26 06:51:07 -03:00
# ifndef AC_FENCE
# define AC_FENCE ENABLED
2012-07-16 15:46:43 -03:00
# endif
2014-04-06 22:18:43 -03:00
# ifndef AC_RALLY
2014-05-27 02:43:33 -03:00
# define AC_RALLY ENABLED
2014-04-06 22:18:43 -03:00
# endif
2012-07-16 15:46:43 -03:00
2011-07-17 07:34:05 -03:00
//////////////////////////////////////////////////////////////////////////////
// Developer Items
//
// use this to completely disable the CLI
# ifndef CLI_ENABLED
2012-08-21 23:19:50 -03:00
# define CLI_ENABLED ENABLED
2011-07-17 07:34:05 -03:00
# endif
2011-09-05 02:12:13 -03:00
2014-07-28 19:25:40 -03:00
//use this to completely disable FRSKY TELEM
# ifndef FRSKY_TELEM_ENABLED
# define FRSKY_TELEM_ENABLED ENABLED
# endif
2013-11-08 07:29:29 -04:00
/*
build a firmware version string .
GIT_VERSION comes from Makefile builds
*/
# ifndef GIT_VERSION
# define FIRMWARE_STRING THISFIRMWARE
# else
# define FIRMWARE_STRING THISFIRMWARE " (" GIT_VERSION ")"
# endif
2012-01-01 15:44:51 -04:00
# endif // __ARDUCOPTER_CONFIG_H__