Rev 1869 | Rev 1874 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1869 | Rev 1872 | ||
---|---|---|---|
Line 65... | Line 65... | ||
65 | * Growth of the integral per degree: |
65 | * Growth of the integral per degree: |
66 | * The hiResXXXX value per deg / s * INTEGRATION_FREQUENCY samples / sec * correction / a number divided by |
66 | * The hiResXXXX value per deg / s * INTEGRATION_FREQUENCY samples / sec * correction / a number divided by |
67 | * HIRES_GYRO_INTEGRATION_FACTOR (why???) before integration. |
67 | * HIRES_GYRO_INTEGRATION_FACTOR (why???) before integration. |
68 | * The value of this expression should be about 1250 (by setting HIRES_GYRO_INTEGRATION_FACTOR to something suitable). |
68 | * The value of this expression should be about 1250 (by setting HIRES_GYRO_INTEGRATION_FACTOR to something suitable). |
69 | */ |
69 | */ |
70 | #define GYRO_DEG_FACTOR_PITCHROLL (int)(GYRO_RATE_FACTOR_PITCHROLL * INTEGRATION_FREQUENCY * GYRO_PITCHROLL_CORRECTION / HIRES_GYRO_INTEGRATION_FACTOR) |
70 | #define GYRO_DEG_FACTOR_PITCHROLL (uint16_t)(GYRO_RATE_FACTOR_PITCHROLL * INTEGRATION_FREQUENCY * GYRO_PITCHROLL_CORRECTION / HIRES_GYRO_INTEGRATION_FACTOR) |
71 | #define GYRO_DEG_FACTOR_YAW (int)(GYRO_RATE_FACTOR_YAW * INTEGRATION_FREQUENCY * GYRO_YAW_CORRECTION) |
71 | #define GYRO_DEG_FACTOR_YAW (uint16_t)(GYRO_RATE_FACTOR_YAW * INTEGRATION_FREQUENCY * GYRO_YAW_CORRECTION) |
Line 72... | Line 72... | ||
72 | 72 | ||
73 | /* |
73 | /* |
74 | * This is ([gyro integral value] / degree) / (degree / acc. sensor value) = gyro integral value / acc.sensor value |
74 | * This is ([gyro integral value] / degree) / (degree / acc. sensor value) = gyro integral value / acc.sensor value |
75 | * = the factor an acc. sensor should be multiplied by to get the gyro integral |
75 | * = the factor an acc. sensor should be multiplied by to get the gyro integral |
Line 105... | Line 105... | ||
105 | 105 | ||
Line 106... | Line 106... | ||
106 | void updateCompass(void); |
106 | void updateCompass(void); |
107 | 107 | ||
108 | /* |
108 | /* |
109 | * Dynamic gyro offsets. These are signed values that are subtracted from the gyro measurements, |
109 | * Dynamic gyro offsets. These are signed values that are subtracted from the gyro measurements, |
110 | * to help cancelling out drift and vibration noise effects. The dynamic offsets themselves |
110 | * to help canceling out drift and vibration noise effects. The dynamic offsets themselves |
111 | * can be updated in flight by different ways, for example: |
111 | * can be updated in flight by different ways, for example: |
112 | * - Just taking them from parameters, so the pilot can trim manually in a PC or mobile tool |
112 | * - Just taking them from parameters, so the pilot can trim manually in a PC or mobile tool |
113 | * - Summing up how much acc. meter correction was done to the gyro integrals over the last n |
113 | * - Summing up how much acc. meter correction was done to the gyro integrals over the last n |