CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/libraries/AC_PID/AC_HELI_PID.h
Views: 1798
1
#pragma once
2
3
/// @file AC_HELI_PID.h
4
/// @brief Helicopter Specific Rate PID algorithm, with EEPROM-backed storage of constants.
5
6
#include <AP_Common/AP_Common.h>
7
#include <AP_Param/AP_Param.h>
8
#include <stdlib.h>
9
#include <cmath>
10
#include "AC_PID.h"
11
12
static const float AC_PID_LEAK_MIN = 0.1f; // Default I-term Leak Minimum
13
14
/// @class AC_HELI_PID
15
/// @brief Heli PID control class
16
class AC_HELI_PID : public AC_PID {
17
public:
18
19
CLASS_NO_COPY(AC_HELI_PID);
20
21
/// Constructor for PID
22
AC_HELI_PID(const AC_PID::Defaults &defaults) :
23
AC_PID{defaults}
24
{
25
_last_requested_rate = 0;
26
}
27
28
/// update_leaky_i - replacement for get_i but output is leaked at leak_rate
29
void update_leaky_i(float leak_rate);
30
31
static const struct AP_Param::GroupInfo var_info[];
32
33
private:
34
AP_Float _leak_min;
35
36
float _last_requested_rate; // Requested rate from last iteration, used to calculate rate change of requested rate
37
};
38
39