mc_pos_control: migrate MPC_*_VEL_* parameter to acceleration scaling

Before #14212 the velocity control gains used in the multicopter
position controller were defined as a scale between velocity error in
one axis (or it's integral and derivative respectively) and the unit
thrust vector. The problem with this is that the normalization of the
unit thrust vector changes per vehicle or even vehicle configuration
as 0 and 100% thrust get a different physical response. That's why
the gains are now defined as scale between velocity error
(integral/derivative) and the output acceleration in m/s².
This commit is contained in:
Matthias Grob
2020-05-26 14:44:41 +02:00
parent e482081f91
commit d92e66863a
25 changed files with 123 additions and 96 deletions
@@ -34,6 +34,7 @@
#include <gtest/gtest.h>
#include <Takeoff.hpp>
#include <drivers/drv_hrt.h>
#include <lib/ecl/geo/geo.h>
TEST(TakeoffTest, Initialization)
{
@@ -46,7 +47,7 @@ TEST(TakeoffTest, RegularTakeoffRamp)
Takeoff takeoff;
takeoff.setSpoolupTime(1.f);
takeoff.setTakeoffRampTime(2.0);
takeoff.generateInitialRampValue(.5f, 1.f);
takeoff.generateInitialRampValue(CONSTANTS_ONE_G / 0.5f);
// disarmed, landed, don't want takeoff
takeoff.updateTakeoffState(false, true, false, 1.f, false, 0);