summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-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);