Subversion Repositories FlightCtrl

Rev

Rev 1612 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1612 Rev 1646
1
#ifndef _INVENSENSE_H
1
#ifndef _INVENSENSE_H
2
#define _INVENSENSE_H
2
#define _INVENSENSE_H
3
 
3
 
4
#include "sensors.h"
4
#include "sensors.h"
5
 
5
 
6
#define GYRO_HW_NAME "ISens"
6
#define GYRO_HW_NAME "ISens"
7
 
7
 
8
/*
-
 
9
 * Configuration for my prototype board with InvenSense gyros.
-
 
10
 * The FC 1.3 board is installed upside down, therefore 2 acc. meters are reversed.
-
 
11
 */
-
 
12
#define ACC_REVERSE_ROLLAXIS yes
-
 
13
#define ACC_REVERSE_ZAXIS yes
-
 
14
 
-
 
15
/*
8
/*
16
 * The InvenSense gyros have a lower sensitivity than for example the ADXRS610s on the FC 2.0 ME,
9
 * The InvenSense gyros have a lower sensitivity than for example the ADXRS610s on the FC 2.0 ME,
17
 * but they have a wider range too.
10
 * but they have a wider range too.
18
 * 2mV/deg/s gyros and no amplifiers:
11
 * 2mV/deg/s gyros and no amplifiers:
19
 * H = 0.002 V / deg / s * 1 * 1024 / 3V = 0.6827 units/(deg/s)
12
 * H = 0.002 V / deg / s * 1 * 1024 / 3V = 0.6827 units/(deg/s)
20
 */
13
 */
21
#define GYRO_HW_FACTOR 0.6827f
14
#define GYRO_HW_FACTOR 0.6827f
22
 
15
 
23
/*
16
/*
24
 * Correction factor - determined experimentally: Hold the copter in the hand, and turn it 90 degrees.
17
 * Correction factor - determined experimentally: Hold the copter in the hand, and turn it 90 degrees.
25
 * If AnglePitch or AngleRoll in debug in MK-Tool changes by x degrees, multiply the value here by x/90.
18
 * If AnglePitch or AngleRoll in debug in MK-Tool changes by x degrees, multiply the value here by x/90.
26
 * If the hardware related contants are set correctly, flight should be OK without bothering to
19
 * If the hardware related contants are set correctly, flight should be OK without bothering to
27
 * make any adjustments here. It is only for luxury.
20
 * make any adjustments here. It is only for luxury.
28
 */
21
 */
29
#define GYRO_PITCHROLL_CORRECTION 0.93f
22
#define GYRO_PITCHROLL_CORRECTION 0.93f
30
 
23
 
31
/*
24
/*
32
 * Same for yaw.
25
 * Same for yaw.
33
 */
26
 */
34
#define GYRO_YAW_CORRECTION 0.97f
27
#define GYRO_YAW_CORRECTION 0.97f
35
 
-
 
36
/*
-
 
37
 * Yaw axis is reverse.
-
 
38
 */
-
 
39
#define GYRO_REVERSE_YAW yes
-
 
40
 
28
 
41
#endif
29
#endif
42
 
30