2011-09-28 21:51:12 -03:00
|
|
|
/*
|
|
|
|
* QuadArducopter.h
|
|
|
|
*
|
|
|
|
* Created on: May 1, 2011
|
|
|
|
* Author: jgoppert
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QUADARDUCOPTER_H_
|
|
|
|
#define QUADARDUCOPTER_H_
|
|
|
|
|
2011-12-07 17:31:56 -04:00
|
|
|
using namespace apo;
|
|
|
|
|
2011-09-28 21:51:12 -03:00
|
|
|
// vehicle options
|
2011-12-07 17:31:56 -04:00
|
|
|
static const AP_Board::options_t options = AP_Board::opt_gps | AP_Board::opt_baro | AP_Board::opt_compass;
|
2011-11-29 14:59:44 -04:00
|
|
|
static const MAV_TYPE vehicle = MAV_QUADROTOR;
|
2011-12-07 17:31:56 -04:00
|
|
|
//static const apo::AP_Board::mode_e boardMode = apo::AP_Board::MODE_HIL_CNTL;
|
|
|
|
static const apo::AP_Board::mode_e boardMode = apo::AP_Board::MODE_LIVE;
|
2011-11-19 22:39:14 -04:00
|
|
|
static const uint8_t heartBeatTimeout = 0;
|
2011-09-28 21:51:12 -03:00
|
|
|
|
|
|
|
// algorithm selection
|
|
|
|
#define CONTROLLER_CLASS ControllerQuad
|
|
|
|
#define GUIDE_CLASS MavlinkGuide
|
2011-12-07 17:31:56 -04:00
|
|
|
#define NAVIGATOR_CLASS Navigator_Dcm
|
2011-09-28 21:51:12 -03:00
|
|
|
|
2011-12-07 17:31:56 -04:00
|
|
|
//// hardware selection
|
|
|
|
//#define BOARD_TYPE Board_APM1
|
|
|
|
//#define BOARD_TYPE Board_APM1_2560
|
|
|
|
#define BOARD_TYPE Board_APM2
|
2011-10-12 21:05:01 -03:00
|
|
|
|
|
|
|
// baud rates
|
2011-09-28 21:51:12 -03:00
|
|
|
// optional sensors
|
2011-12-07 17:31:56 -04:00
|
|
|
static const bool gpsEnabled = false;
|
2011-12-05 21:57:19 -04:00
|
|
|
static const bool baroEnabled = true;
|
2011-10-12 21:05:01 -03:00
|
|
|
static const bool compassEnabled = true;
|
|
|
|
static const Matrix3f compassOrientation = AP_COMPASS_COMPONENTS_UP_PINS_FORWARD;
|
|
|
|
// compass orientation: See AP_Compass_HMC5843.h for possible values
|
2011-09-28 21:51:12 -03:00
|
|
|
|
2011-10-16 03:55:34 -03:00
|
|
|
// battery monitoring
|
2011-12-07 17:31:56 -04:00
|
|
|
static const bool batteryMonitorEnabled = false;
|
2011-10-16 03:55:34 -03:00
|
|
|
static const uint8_t batteryPin = 0;
|
|
|
|
static const float batteryVoltageDivRatio = 6;
|
|
|
|
static const float batteryMinVolt = 10.0;
|
|
|
|
static const float batteryMaxVolt = 12.4;
|
|
|
|
|
2011-10-12 21:05:01 -03:00
|
|
|
static const bool rangeFinderFrontEnabled = false;
|
|
|
|
static const bool rangeFinderBackEnabled = false;
|
|
|
|
static const bool rangeFinderLeftEnabled = false;
|
|
|
|
static const bool rangeFinderRightEnabled = false;
|
|
|
|
static const bool rangeFinderUpEnabled = false;
|
|
|
|
static const bool rangeFinderDownEnabled = false;
|
2011-09-28 21:51:12 -03:00
|
|
|
|
|
|
|
// loop rates
|
2011-12-07 17:31:56 -04:00
|
|
|
static const float loopRate = 250; // attitude nav
|
2011-10-19 21:09:06 -03:00
|
|
|
static const float loop0Rate = 50; // controller
|
|
|
|
static const float loop1Rate = 10; // pos nav/ gcs fast
|
2011-10-16 03:55:34 -03:00
|
|
|
static const float loop2Rate = 1; // gcs slow
|
|
|
|
static const float loop3Rate = 0.1;
|
2011-09-28 21:51:12 -03:00
|
|
|
|
|
|
|
// position control loop
|
2011-11-22 17:42:51 -04:00
|
|
|
static const float PID_TILT_P = 0.1;
|
|
|
|
static const float PID_TILT_I = 0;
|
|
|
|
static const float PID_TILT_D = 0.1;
|
|
|
|
static const float PID_TILT_LIM = 0.04; // about 2 deg
|
|
|
|
static const float PID_TILT_AWU = 0.02; // about 1 deg
|
|
|
|
static const float PID_TILT_DFCUT = 10; // cut derivative feedback at 10 hz
|
2011-11-29 18:37:42 -04:00
|
|
|
|
2011-11-29 19:06:38 -04:00
|
|
|
static const float PID_SPD_P = 1;
|
2011-11-29 18:37:42 -04:00
|
|
|
static const float PID_SPD_I = 0;
|
|
|
|
static const float PID_SPD_D = 0.1;
|
|
|
|
static const float PID_SPD_LIM = 0.04; // about 2 deg
|
|
|
|
static const float PID_SPD_AWU = 0.02; // about 1 deg
|
|
|
|
static const float PID_SPD_DFCUT = 10; // cut derivative feedback at 10 hz
|
|
|
|
|
2011-11-19 22:39:14 -04:00
|
|
|
static const float PID_POS_Z_P = 0.1;
|
2011-09-28 21:51:12 -03:00
|
|
|
static const float PID_POS_Z_I = 0;
|
2011-11-19 22:39:14 -04:00
|
|
|
static const float PID_POS_Z_D = 0.2;
|
|
|
|
static const float PID_POS_Z_LIM = 0.1;
|
2011-09-28 21:51:12 -03:00
|
|
|
static const float PID_POS_Z_AWU = 0;
|
2011-11-22 17:42:51 -04:00
|
|
|
static const float PID_POS_Z_DFCUT = 10; // cut derivative feedback at 10 hz
|
2011-09-28 21:51:12 -03:00
|
|
|
|
|
|
|
// attitude control loop
|
2011-10-16 03:55:34 -03:00
|
|
|
static const float PID_ATT_P = 0.17;
|
2011-10-14 19:28:29 -03:00
|
|
|
static const float PID_ATT_I = 0.5;
|
2011-10-16 03:55:34 -03:00
|
|
|
static const float PID_ATT_D = 0.06;
|
2011-10-18 21:11:14 -03:00
|
|
|
static const float PID_ATT_LIM = 0.05; // 5 % motors
|
2011-10-16 03:55:34 -03:00
|
|
|
static const float PID_ATT_AWU = 0.005; // 0.5 %
|
|
|
|
static const float PID_ATT_DFCUT = 25; // cut derivative feedback at 25 hz
|
2011-11-29 19:06:38 -04:00
|
|
|
static const float PID_YAWPOS_P = 1;
|
2011-09-28 21:51:12 -03:00
|
|
|
static const float PID_YAWPOS_I = 0;
|
2011-11-29 19:06:38 -04:00
|
|
|
static const float PID_YAWPOS_D = 0.1;
|
|
|
|
static const float PID_YAWPOS_LIM = 1; // 1 rad/s
|
2011-09-28 21:51:12 -03:00
|
|
|
static const float PID_YAWPOS_AWU = 0; // 1 rad/s
|
2011-10-14 19:28:29 -03:00
|
|
|
static const float PID_YAWSPEED_P = 0.5;
|
2011-09-28 21:51:12 -03:00
|
|
|
static const float PID_YAWSPEED_I = 0;
|
|
|
|
static const float PID_YAWSPEED_D = 0;
|
2011-10-18 21:11:14 -03:00
|
|
|
static const float PID_YAWSPEED_LIM = .05; // 5 % motors
|
2011-09-28 21:51:12 -03:00
|
|
|
static const float PID_YAWSPEED_AWU = 0.0;
|
|
|
|
static const float PID_YAWSPEED_DFCUT = 3.0; // 3 Radians, about 1 Hz
|
|
|
|
static const float THRUST_HOVER_OFFSET = 0.475;
|
|
|
|
|
2011-10-25 20:40:07 -03:00
|
|
|
// guidance
|
2011-11-29 19:06:38 -04:00
|
|
|
static const float velCmd = 0.3; // m/s
|
2011-10-25 20:40:07 -03:00
|
|
|
static const float xt = 10; // cross track gain
|
|
|
|
static const float xtLim = 90; // cross track angle limit, deg
|
|
|
|
|
2011-09-28 21:51:12 -03:00
|
|
|
#include "ControllerQuad.h"
|
|
|
|
|
|
|
|
#endif /* QUADARDUCOPTER_H_ */
|
2011-10-26 14:25:06 -03:00
|
|
|
// vim:ts=4:sw=4:expandtab
|