-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAno_AttCtrl.h
79 lines (60 loc) · 1.75 KB
/
Ano_AttCtrl.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __ATT_CTRL_H
#define __ATT_CTRL_H
/* Includes ------------------------------------------------------------------*/
#include "Ano_FcData.h"
#include "Ano_Filter.h"
#include "Ano_Math.h"
#include "Ano_Pid.h"
/* Exported types ------------------------------------------------------------*/
enum
{
ROLL_END=0,
ROLL_UP,
ROLL_ROLLING,
ROLL_KEEP,
};
typedef struct
{
u8 roll_mode;
u8 rolling_step;
u8 roll_thr_step;
float rol_angle[2];
s16 ref_height;
s16 up_height;
u16 keep_cnt;
s16 roll_up_speed;
u8 roll_height_ok;
// s16 roll_acc_fix;
}_rolling_flag_st;
extern _rolling_flag_st rolling_flag;
typedef struct
{
float set_yaw_speed;
float exp_angular_velocity[VEC_RPY];
float fb_angular_velocity[VEC_RPY];
}_att_1l_ct_st;
extern _att_1l_ct_st att_1l_ct;
typedef struct
{
float yaw_err;
float exp_rol_adj;
float exp_pit_adj;
float exp_rol,exp_pit,exp_yaw; // ÆÚÍûµÄ rol,pit,yaw
float fb_rol,fb_pit,fb_yaw; // ·´À¡³öÀ´µÄ rol,pit,yaw
}_att_2l_ct_st;
extern _att_2l_ct_st att_2l_ct;
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void Att_2level_PID_Init(void);
void Att_1level_PID_Init(void);
void Set_Att_1level_Ki(u8 mode);
void Set_Att_2level_Ki(u8 mode);
void Att_2level_Ctrl(float dT,s16 *CH_N);
void Att_1level_Ctrl(float dT);
extern _PID_arg_st arg_2[VEC_RPY] ;
extern _PID_arg_st arg_1[VEC_RPY] ;
extern _PID_val_st val_2[VEC_RPY];
extern _PID_val_st val_1[VEC_RPY];
#endif