-
Notifications
You must be signed in to change notification settings - Fork 1
/
QDOB.hpp
49 lines (40 loc) · 1.1 KB
/
QDOB.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
QDOB - Quasi-periodic Disturbance Observer
@author: Hisayoshi Muramatsu
@date: 2024.06.04
*/
#ifndef DEF_QDOB
#define DEF_QDOB
class QDOB{
public:
QDOB(
int mu_int, // Switch for estimation only or compensation
int l, // The number of stages
int Nmax, // Maximum order
double wa, // Cutoff frequency
double wb, // Cutoff frequency
double wc, // Cutoff frequency
double L, // Period
double M, // Mass / Moment of inertia
double T // Sampling time
);
~QDOB();
QDOB(const QDOB&)=delete; // copy ctor
QDOB& operator=(const QDOB&)=delete; // copy assignment
// Controller based on the QDOB
double Ctrl(double& hd, const double& r, const double& y);
private:
const double mu;
const int l;
int N;
const double wb, L, M, T, p;
int eta;
double y[3], lam[3], xi[2];
std::vector<double> U, bU, theta, gamma, w;
std::vector<Delay*> ThDelay;
Delay* LamDelay;
double fun_P(const double& lam_k1);
double sub_h(const int& n, const double& wi, const double& Ui);
double sub_w(const int& n, const int& N);
};
#endif