From 0ef677970179f48f0d8e0042893955560d9220c5 Mon Sep 17 00:00:00 2001 From: abeck70 Date: Sat, 9 May 2015 23:03:53 +1000 Subject: [PATCH] OP-1848 altvario tidyup of NE controllers in pathfollower Change ILimit variable name to Beta in multiple PID loops that now use pid2 implementation. Change velocity controller yaw from axislock to rate. --- .../modules/PathFollower/vtolautotakeoffcontroller.cpp | 2 +- flight/modules/PathFollower/vtolbrakecontroller.cpp | 2 +- flight/modules/PathFollower/vtolflycontroller.cpp | 4 ++-- flight/modules/PathFollower/vtollandcontroller.cpp | 2 +- flight/modules/PathFollower/vtolvelocitycontroller.cpp | 4 ++-- .../uavobjectdefinition/vtolpathfollowersettings.xml | 10 +++++----- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/flight/modules/PathFollower/vtolautotakeoffcontroller.cpp b/flight/modules/PathFollower/vtolautotakeoffcontroller.cpp index 729f65097..2c4bdc569 100644 --- a/flight/modules/PathFollower/vtolautotakeoffcontroller.cpp +++ b/flight/modules/PathFollower/vtolautotakeoffcontroller.cpp @@ -126,7 +126,7 @@ void VtolAutoTakeoffController::SettingsUpdated(void) controlNE.UpdateParameters(vtolPathFollowerSettings->HorizontalVelPID.Kp, vtolPathFollowerSettings->HorizontalVelPID.Ki, vtolPathFollowerSettings->HorizontalVelPID.Kd, - vtolPathFollowerSettings->HorizontalVelPID.ILimit, + vtolPathFollowerSettings->HorizontalVelPID.Beta, dT, vtolPathFollowerSettings->HorizontalVelMax); diff --git a/flight/modules/PathFollower/vtolbrakecontroller.cpp b/flight/modules/PathFollower/vtolbrakecontroller.cpp index 208e862f7..862011057 100644 --- a/flight/modules/PathFollower/vtolbrakecontroller.cpp +++ b/flight/modules/PathFollower/vtolbrakecontroller.cpp @@ -132,7 +132,7 @@ void VtolBrakeController::SettingsUpdated(void) controlNE.UpdateParameters(vtolPathFollowerSettings->BrakeHorizontalVelPID.Kp, vtolPathFollowerSettings->BrakeHorizontalVelPID.Ki, vtolPathFollowerSettings->BrakeHorizontalVelPID.Kd, - vtolPathFollowerSettings->BrakeHorizontalVelPID.ILimit, + vtolPathFollowerSettings->BrakeHorizontalVelPID.Beta, dT, 10.0f * vtolPathFollowerSettings->HorizontalVelMax); // avoid constraining initial fast entry into brake controlNE.UpdatePositionalParameters(vtolPathFollowerSettings->HorizontalPosP); diff --git a/flight/modules/PathFollower/vtolflycontroller.cpp b/flight/modules/PathFollower/vtolflycontroller.cpp index e76c09d54..0160d0e79 100644 --- a/flight/modules/PathFollower/vtolflycontroller.cpp +++ b/flight/modules/PathFollower/vtolflycontroller.cpp @@ -127,7 +127,7 @@ void VtolFlyController::SettingsUpdated(void) controlNE.UpdateParameters(vtolPathFollowerSettings->HorizontalVelPID.Kp, vtolPathFollowerSettings->HorizontalVelPID.Ki, vtolPathFollowerSettings->HorizontalVelPID.Kd, - vtolPathFollowerSettings->HorizontalVelPID.ILimit, + vtolPathFollowerSettings->HorizontalVelPID.Beta, dT, vtolPathFollowerSettings->HorizontalVelMax); controlNE.UpdatePositionalParameters(vtolPathFollowerSettings->HorizontalPosP); @@ -136,7 +136,7 @@ void VtolFlyController::SettingsUpdated(void) controlDown.UpdateParameters(vtolPathFollowerSettings->VerticalVelPID.Kp, vtolPathFollowerSettings->VerticalVelPID.Ki, vtolPathFollowerSettings->VerticalVelPID.Kd, - vtolPathFollowerSettings->VerticalVelPID.ILimit, // TODO Change to BETA + vtolPathFollowerSettings->VerticalVelPID.Beta, dT, vtolPathFollowerSettings->VerticalVelMax); controlDown.UpdatePositionalParameters(vtolPathFollowerSettings->VerticalPosP); diff --git a/flight/modules/PathFollower/vtollandcontroller.cpp b/flight/modules/PathFollower/vtollandcontroller.cpp index 96b4a40c7..97a7d466f 100644 --- a/flight/modules/PathFollower/vtollandcontroller.cpp +++ b/flight/modules/PathFollower/vtollandcontroller.cpp @@ -120,7 +120,7 @@ void VtolLandController::SettingsUpdated(void) controlNE.UpdateParameters(vtolPathFollowerSettings->HorizontalVelPID.Kp, vtolPathFollowerSettings->HorizontalVelPID.Ki, vtolPathFollowerSettings->HorizontalVelPID.Kd, - vtolPathFollowerSettings->HorizontalVelPID.ILimit, + vtolPathFollowerSettings->HorizontalVelPID.Beta, dT, vtolPathFollowerSettings->HorizontalVelMax); diff --git a/flight/modules/PathFollower/vtolvelocitycontroller.cpp b/flight/modules/PathFollower/vtolvelocitycontroller.cpp index 84ba99daa..68018c5ea 100644 --- a/flight/modules/PathFollower/vtolvelocitycontroller.cpp +++ b/flight/modules/PathFollower/vtolvelocitycontroller.cpp @@ -107,7 +107,7 @@ void VtolVelocityController::SettingsUpdated(void) controlNE.UpdateParameters(vtolPathFollowerSettings->HorizontalVelPID.Kp, vtolPathFollowerSettings->HorizontalVelPID.Ki, vtolPathFollowerSettings->HorizontalVelPID.Kd, - vtolPathFollowerSettings->HorizontalVelPID.ILimit, + vtolPathFollowerSettings->HorizontalVelPID.Beta, dT, vtolPathFollowerSettings->HorizontalVelMax); @@ -181,7 +181,7 @@ int8_t VtolVelocityController::UpdateStabilizationDesired(__attribute__((unused) ManualControlCommandData manualControl; ManualControlCommandGet(&manualControl); - stabDesired.StabilizationMode.Yaw = STABILIZATIONDESIRED_STABILIZATIONMODE_AXISLOCK; + stabDesired.StabilizationMode.Yaw = STABILIZATIONDESIRED_STABILIZATIONMODE_RATE; stabDesired.Yaw = stabSettings.MaximumRate.Yaw * manualControl.Yaw; // default thrust mode to altvario diff --git a/shared/uavobjectdefinition/vtolpathfollowersettings.xml b/shared/uavobjectdefinition/vtolpathfollowersettings.xml index 86eea36bc..4f6758035 100644 --- a/shared/uavobjectdefinition/vtolpathfollowersettings.xml +++ b/shared/uavobjectdefinition/vtolpathfollowersettings.xml @@ -7,8 +7,8 @@ - - + + @@ -21,10 +21,10 @@ - + - - + +