From 7dc9fc8de459511eacf40de656efd77a9c5ec63d Mon Sep 17 00:00:00 2001 From: daisenryaku Date: Mon, 1 Jan 2018 19:35:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E9=80=9F=E5=BA=A6=E8=AE=A1=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=E6=8E=A7=E5=88=B6=E5=88=B0=E5=BA=A6=E6=AF=8F=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/p10-ANO/application/pid.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/project/p10-ANO/application/pid.c b/project/p10-ANO/application/pid.c index c477ab7..6fb4651 100644 --- a/project/p10-ANO/application/pid.c +++ b/project/p10-ANO/application/pid.c @@ -137,9 +137,9 @@ void CtrlAttiRate(void) yaw_rate_PID.Desired = range_trans(u16Rcvr_ch4, 5); uint32_t tnow = msTimerCounter; - PID_postion_cal(&roll_rate_PID, gyro[0], tnow-told); // DMP_GYRO_SCALE - PID_postion_cal(&pitch_rate_PID, gyro[1], tnow-told); - PID_postion_cal(&yaw_rate_PID, gyro[2], tnow-told); + PID_postion_cal(&roll_rate_PID, gyro[0] / DMP_GYRO_SCALE, tnow-told); // DMP_GYRO_SCALE + PID_postion_cal(&pitch_rate_PID, gyro[1] / DMP_GYRO_SCALE, tnow-told); + PID_postion_cal(&yaw_rate_PID, gyro[2] / DMP_GYRO_SCALE, tnow-told); told = tnow; }