PositionControl: deconflict hover thrust estimator, acceleration control

- Avoid constantly adjusting the velocity gains with the HTE
- Make sure the hover thrust integral update doesn't break
  even though its unit is acceleration and not unit thrust anymore

We need to convert the velocity gains to not contain/depend on the
hover thrust. In horizontal direction it doesn't make sense to scale
them with the hover thrust and in vertical direction the adjustments are
already done in the acceleration to collective thrust conversion.
This commit is contained in:
Matthias Grob
2020-03-20 11:50:25 +01:00
parent 466b5db36f
commit cdf37ca557
4 changed files with 11 additions and 17 deletions
@@ -76,7 +76,7 @@ public:
PositionControlBasicTest()
{
_position_control.setPositionGains(Vector3f(1.f, 1.f, 1.f));
_position_control.setVelocityGains(Vector3f(1.f, 1.f, 1.f), Vector3f(1.f, 1.f, 1.f), Vector3f(1.f, 1.f, 1.f));
_position_control.setVelocityGains(Vector3f(20.f, 20.f, 20.f), Vector3f(20.f, 20.f, 20.f), Vector3f(20.f, 20.f, 20.f));
_position_control.setVelocityLimits(1.f, 1.f, 1.f);
_position_control.setThrustLimits(0.1f, 0.9f);
_position_control.setTiltLimit(1.f);
@@ -387,6 +387,4 @@ TEST_F(PositionControlBasicTest, UpdateHoverThrust)
// THEN: the integral is updated to avoid discontinuities and
// the output is still the same
EXPECT_EQ(_output_setpoint.thrust[2], -hover_thrust);
const Vector3f integrator_new(_position_control.getIntegral());
EXPECT_EQ(integrator_new(2) - hover_thrust_new, -hover_thrust);
}