From 80c6252c0a2ea87acf94a375a5209fa3ee3a5fed Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 9 Sep 2012 22:18:21 +0200 Subject: [PATCH] Limited Z-compensation much stronger to prevent throttle jumps --- apps/multirotor_att_control/multirotor_attitude_control.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/multirotor_att_control/multirotor_attitude_control.c b/apps/multirotor_att_control/multirotor_attitude_control.c index 38fe13bfed..db2d286017 100644 --- a/apps/multirotor_att_control/multirotor_attitude_control.c +++ b/apps/multirotor_att_control/multirotor_attitude_control.c @@ -252,15 +252,15 @@ void multirotor_control_attitude(const struct vehicle_attitude_setpoint_s *att_s */ float zcompensation = 1.0f; - if (fabsf(att->roll) > 1.0f) { - zcompensation *= 1.85081571768f; + if (fabsf(att->roll) > 0.3f) { + zcompensation *= 1.04675160154f; } else { zcompensation *= 1.0f / cosf(att->roll); } - if (fabsf(att->pitch) > 1.0f) { - zcompensation *= 1.85081571768f; + if (fabsf(att->pitch) > 0.3f) { + zcompensation *= 1.04675160154f; } else { zcompensation *= 1.0f / cosf(att->pitch);