-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.h
62 lines (50 loc) · 2.32 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//////////////////////////////////////////////////////////////////////////////
// i2C comm definitions
//
#define I2C_ADDRESS 0x20 //7 bit address 0x40 write, 0x41 read
/* GPS Lead filter - predicts gps position based on the x/y speed. helps overcome the gps lag. */
#define GPS_LEAD_FILTER
/* Serial speed of the GPS */
#define GPS_SERIAL_SPEED 115200
/* GPS protocol
* NMEA - Standard NMEA protocol GGA, GSA and RMC sentences are needed
* UBLOX - U-Blox binary protocol, use the ublox config file (u-blox-config.ublox.txt) from the source tree
* MTK - MTK binary protocol with auto setup, load (AXN1.51_2722_3329_384.1151100.5.bin) firmware to the GPS module (MTK3329 chips only)
* With MTK and UBLOX you don't have to use GPS_FILTERING in multiwii code !!!
*
*/
//#define NMEA
#define UBLOX
//#define MTK
// Default PID variables
//////////////////////////////////////////////////////////////////////////////
// POSHOLD control gains
//
#define POSHOLD_P .11
#define POSHOLD_I 0.0
#define POSHOLD_IMAX 20 // degrees
#define POSHOLD_RATE_P 1.4 //
#define POSHOLD_RATE_I 0.2 // Wind control
#define POSHOLD_RATE_D 0.010 // try 2 or 3 for POSHOLD_RATE 1
#define POSHOLD_RATE_IMAX 20 // degrees
//////////////////////////////////////////////////////////////////////////////
// Navigation PID gains
//
#define NAV_P 1.4 //
#define NAV_I 0.20 // Wind control
#define NAV_D 0.006 //
#define NAV_IMAX 20 // degrees
////////////////////////////////////////////////////////////////////////////////////
// Navigational parameters and limiters initial values
//
#define CROSSTRACK_GAIN 1 // Weighting the cross track error
#define NAV_SPEED_MIN 100 // cm/sec minimum navigational speed when NAV_SLOW_NAV id false
#define NAV_SPEED_MAX 300 // cm/sec maximum navigational speed
#define NAV_BANK_MAX 2500 // 20deg max banking when navigating (just for security and testing)
////////////////////////////////////////////////////////////////////////////////////
// GPS data filtering - moving average filter vector length
//
#define GPS_FILTER_VECTOR_LENGTH 5
////////////////////////////////////////////////////////////////////////////////////
// HC-SR04 Ultrasonic Sonar
#define HCSR04