summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2011-05-21 13:18:42 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2011-05-21 13:18:42 +0200
commit422a7785c423d64b97f9ae06baf19921a859e380 (patch)
treec4bd97f27b968e956bd9444a0488d26854f66fba
parenteade9c9b347c5c0c2a2060828dd8d2a014824091 (diff)
Lower angle error proportional gain.
-rw-r--r--main.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.cpp b/main.cpp
index 4fe3a60..340817c 100644
--- a/main.cpp
+++ b/main.cpp
@@ -172,8 +172,8 @@ class I2CThread : public BaseThread<I2CThread, 256> {
saturate(pitch_angle_accum, 364088);
saturate(roll_angle_accum, 364088);
- int32_t pitch_rate_target = (pitch_angle_error * 4 * 65536 + pitch_angle_accum * 98) >> 16;
- int32_t roll_rate_target = (roll_angle_error * 4 * 65536 + roll_angle_accum * 98) >> 16;
+ int32_t pitch_rate_target = (pitch_angle_error * 2 * 65536 + pitch_angle_accum * 98) >> 16;
+ int32_t roll_rate_target = (roll_angle_error * 2 * 65536 + roll_angle_accum * 98) >> 16;
int16_t pitch_rate_comp = ((pitch_rate_target - (gyro.x * 4000 / 360)) * 6 * 36) >> 16;
int16_t roll_rate_comp = ((roll_rate_target - (gyro.y * 4000 / 360)) * 6 * 36) >> 16;