-
Notifications
You must be signed in to change notification settings - Fork 1
/
pid.h
55 lines (45 loc) · 1.02 KB
/
pid.h
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
#ifndef PID_H
#define PID_H
#include <QThread>
class PID : public QThread
{
public:
PID(float kp, float ki, float kd, int axis);
void motorControl(double speed, int motorLead1, int motorLead2, bool forward);
void run();
private:
double returnPID(float kp, float ki, float kd, int axis);
double returnTime();
void report();
void whileLoop();
bool whichDirection(double increment);
struct datetime
{
int year;
int month;
int day;
int hour;
int minute;
double second;
double fraction;
};
double clampAlt(double zen);
bool turnForward(int axis);
datetime getTime(std::string str);
struct timeval newTime, oldTime;
double errSum;
double lastError;
float KP;
float KI;
float KD;
int axisID;
bool limitFlag;
double lastInput;
double hourAngle;
double CIOdec;
double CIORA;
double EqOrigins;
int timeInterval;
int debugTime;
};
#endif // PID_H