-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathATS_int.h
More file actions
70 lines (53 loc) · 1.54 KB
/
Copy pathATS_int.h
File metadata and controls
70 lines (53 loc) · 1.54 KB
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
/**
* This file contains a number of macros and data structure defitions that are
* common to the entire ATS library.
*/
/* uncomment this line to compile for Arduino */
/* #include "Arduino.h" */
#include <math.h>
/* the number of different variables that make up a state */
#define N_STATE_TYPES 3
/* the number of variables that influence drag coefficient, including base drag */
#define N_D_IMPACTORS 3
/**
* the number of coefficients that contribute to the total drag coefficient
* contribution from each of the N_D_IMPACTORS variables
*/
#define N_D_COEFF_TERMS 5
/**
* each of these three macros is the drag model row that corresponds to the drag coefficients
* for that variable
*/
#define STATIC_COEFF 0
#define FLAP_COEFF 1
#define V_COEFF 2
/**
* the number of terms that makes up the model describing the mapping from
* flap extension to servo angle, if the vehicle uses a servo motor to
* deploy the flaps
*/
#define N_SERVO_COEFFS 10
#define N_ALTIMETERS 4
/* SAMPLE_T must be an integer multiple of DT for the simulation to work
* properly
**/
/* state updating period */
#define SAMPLE_T 0.200
/* timestep used for numerical approximation of predicted state */
#define DT 0.100
struct state
{
double velocity;
double altitude;
double theta;
};
typedef struct state* state_t;
struct error
{
/* instantenous error */
double inst;
/* accumulated error */
double acc;
};
typedef struct error* error_t;
typedef double control_t;