summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2011-07-10 20:13:39 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2011-07-10 20:13:39 +0200
commit989bd0960ed65739ae7a6112094eced7203276b7 (patch)
treeae60731b2aa29242571dc25849139cb57006dc1f
parent87661d895702981d81bf0d595ff2a272e17e5689 (diff)
More tuning.
-rw-r--r--main.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/main.cpp b/main.cpp
index 7cc835e..72c0389 100644
--- a/main.cpp
+++ b/main.cpp
@@ -81,8 +81,8 @@ int main() {
TIM2.CR1 = 0x05;
- PID pid_pitch(2000, 0, 0);
- PID pid_roll(2000, 0, 0);
+ PID pid_pitch(3000, 0, 0);
+ PID pid_roll(3000, 0, 0);
PID pid_yaw(2000, 0, 0);
while(1) {
@@ -97,9 +97,9 @@ int main() {
// Generate motor mix.
int16_t throttle = ppmsum.channels[2] - 1000;
- int16_t pitch = pid_pitch.update((ppmsum.channels[1] - 1500) - gyro.x);
- int16_t roll = pid_roll.update((ppmsum.channels[0] - 1500) - gyro.y);
- int16_t yaw = pid_yaw.update((ppmsum.channels[3] - 1500) - gyro.z);
+ int16_t pitch = pid_pitch.update((ppmsum.channels[1] - 1500) * 3 - gyro.x);
+ int16_t roll = pid_roll.update((ppmsum.channels[0] - 1500) * 3 - gyro.y);
+ int16_t yaw = pid_yaw.update((ppmsum.channels[3] - 1500) * 5 - gyro.z);
int16_t max = throttle > 250 ? 250 : throttle;
saturate(pitch, max);