From f61ec9af0a77a10e2d829b5bea8540680aec901c Mon Sep 17 00:00:00 2001 From: borisbstyle Date: Wed, 20 Jul 2016 01:31:32 +0200 Subject: [PATCH] rcCommandSmooth for level mode --- src/main/flight/pid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/flight/pid.c b/src/main/flight/pid.c index b77ea8f039..41c8ef838b 100644 --- a/src/main/flight/pid.c +++ b/src/main/flight/pid.c @@ -159,10 +159,10 @@ static void pidBetaflight(const pidProfile_t *pidProfile, uint16_t max_angle_inc if ((FLIGHT_MODE(ANGLE_MODE) || FLIGHT_MODE(HORIZON_MODE)) && axis != YAW) { // calculate error angle and limit the angle to the max inclination #ifdef GPS - const float errorAngle = (constrain(2 * rcCommand[axis] + GPS_angle[axis], -((int) max_angle_inclination), + const float errorAngle = (constrain(2 * rcCommandSmooth[axis] + GPS_angle[axis], -((int) max_angle_inclination), +max_angle_inclination) - attitude.raw[axis] + angleTrim->raw[axis]) / 10.0f; // 16 bits is ok here #else - const float errorAngle = (constrain(2 * rcCommand[axis], -((int) max_angle_inclination), + const float errorAngle = (constrain(2 * rcCommandSmooth[axis], -((int) max_angle_inclination), +max_angle_inclination) - attitude.raw[axis] + angleTrim->raw[axis]) / 10.0f; // 16 bits is ok here #endif if (FLIGHT_MODE(ANGLE_MODE)) {