Skip to content
Snippets Groups Projects
Commit 51eb1b1e authored by Raul Radu's avatar Raul Radu
Browse files

[WingController] PIController constants are now set in the config file

parent 46919718
Branches
Tags
No related merge requests found
......@@ -71,6 +71,9 @@ constexpr int WING_ALTITUDE_TRIGGER_CONFIDENCE = 10; // [number of sample]
constexpr int WING_ALTITUDE_TRIGGER_FALL = 50; // [meters]
constexpr int WING_STRAIGHT_FLIGHT_TIMEOUT = 15 * 1000000; // [us]
constexpr float PI_CONTROLLER_SATURATION_MAX_LIMIT = 0.1;
constexpr float PI_CONTROLLER_SATURATION_MIN_LIMIT = -0.1;
struct WingConfigStruct
{
......
......@@ -45,8 +45,9 @@ AutomaticWingAlgorithm::AutomaticWingAlgorithm(float Kp, float Ki,
GuidanceAlgorithm& guidance)
: WingAlgorithm(servo1, servo2), guidance(guidance)
{
controller =
new PIController(Kp, Ki, WING_UPDATE_PERIOD / 1000.0f, -0.1, 0.1);
controller = new PIController(Kp, Ki, WING_UPDATE_PERIOD / 1000.0f,
PI_CONTROLLER_SATURATION_MIN_LIMIT,
PI_CONTROLLER_SATURATION_MAX_LIMIT);
}
AutomaticWingAlgorithm::~AutomaticWingAlgorithm() { delete (controller); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment