From 989bd0960ed65739ae7a6112094eced7203276b7 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sun, 10 Jul 2011 20:13:39 +0200 Subject: More tuning. --- main.cpp | 10 +++++----- 1 file 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); -- cgit v1.2.3