-
Notifications
You must be signed in to change notification settings - Fork 5
/
PDOB.hpp
58 lines (50 loc) · 1.14 KB
/
PDOB.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
50
51
52
53
54
55
56
57
58
/*
Test for the PDOB - Periodic-Disturbance Observer.
@author: Hisayoshi Muramatsu
@date: 2020.08.26
*/
#ifndef DEF_PDOB
#define DEF_PDOB
class PDOB{
public:
PDOB(
// Sampling time [s]
double IN_Tk,
// Cutoff frequency for the Q-filter [rad/s]
double IN_gp,
// Design parameter for the Q-filter
double IN_gam,
// Fundamental frequency [rad/s]
double IN_HatOmega0
);
// Q-filter for periodic disturbance estimation
double Qfilter(double E);
private:
/*
* Design parameters
*/
// Sampling time [s]
const double Tk;
// Cutoff frequency for the Q-filter [rad/s]
const double gp;
// Design parameter for the Q-filter
const double gam;
// Fundamental frequency of the periodic disturbance [rad/s]
const double HatOmega;
/*
* Variables
*/
// Variables for computation
double LPFQ_InZ1, LPFQ_OutZ1;
// Variables for the delay
int DelayCount, DelayNum, DelayCountReset;
std::vector<double> DelayMemory;
/*
* Functions
*/
// Low-pass filter for the Q-filter
double FirstOrderLPFQ(double E);
//Delay
double Delay(double HatD, int N);
};
#endif