[MOD]: PID

This commit is contained in:
but0n 2016-10-08 22:15:43 +08:00
parent 35b4898d93
commit c34ebfd30a
2 changed files with 21 additions and 25 deletions

View File

@ -10,6 +10,15 @@ extern float g_Yaw, g_Pitch, g_Roll; //eular
#define SUM_ERRO_MAX 900
#define SUM_ERRO_MIN -900
typedef struct {
float Cache;
float Erro;
float p;
float i;
float d;
short output;
} pid_st, *pid_pst;
void pid(float setPoint, float d);
#endif

37
pid.md
View File

@ -42,29 +42,16 @@
- 存储角速度
## Code
先定义结构体以及结构体指针, 把运算过程使用的大量变量封装起来, 在专属函数中对其解析和利用
``` c
typedef struct {
float Cache;
float Erro;
float p;
float i;
float d;
short output;
} pid_st, *pid_pst;
```