From abd701c4f4cdd4510e8716c95c083e8fd38f9527 Mon Sep 17 00:00:00 2001 From: Shengwen Cheng Date: Sat, 1 Jun 2024 17:34:49 +0800 Subject: [PATCH] Tune quadrotor parameters --- user/quadrotor/quadrotor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/user/quadrotor/quadrotor.c b/user/quadrotor/quadrotor.c index aa61f98..b314ca3 100644 --- a/user/quadrotor/quadrotor.c +++ b/user/quadrotor/quadrotor.c @@ -62,7 +62,7 @@ typedef struct { static pid_control_t pid_roll = { .kp = 0.008f, - .kd = 0.0035f, + .kd = 0.003f, .output_max = +1.0f, //+100% .output_min = -1.0f, //-100% .enable = true, @@ -70,7 +70,7 @@ static pid_control_t pid_roll = { static pid_control_t pid_pitch = { .kp = 0.008f, - .kd = 0.0035f, + .kd = 0.003f, .output_max = +1.0f, .output_min = -1.0f, .enable = true, @@ -319,7 +319,7 @@ void flight_control_task(void) setprogname("flight control"); /* Initialize Madgwick Filter for attitude estimation */ - madgwick_init(&madgwick_ahrs, 400, 0.13); + madgwick_init(&madgwick_ahrs, 400, 0.105); /* Open RGB LED */ int led_fd = open("/dev/led", 0);