Library containing Crazyflie 2.0 controller classes: - Attitude estimator - Horizontal estimator - Vertical estimator - Attitude controller - Horizontal controller - Vertical controller - Mixer

Committer:
fbob
Date:
Thu Sep 27 18:55:22 2018 +0000
Revision:
8:d05fe9f8bfb6
Parent:
7:220ce3839be8
Child:
9:15058b4fa090
Included horizontal controller

Who changed what in which revision?

UserRevisionLine numberNew contents of line
fbob 5:b9947e3d20cf 1 #ifndef Parameters_h
fbob 5:b9947e3d20cf 2 #define Parameters_h
fbob 5:b9947e3d20cf 3
fbob 5:b9947e3d20cf 4 // Motor constants
fbob 5:b9947e3d20cf 5 const float alpha = 1.16e-07f;
fbob 5:b9947e3d20cf 6 const float beta = 7.149e-10f;
fbob 5:b9947e3d20cf 7
fbob 5:b9947e3d20cf 8 // Propeller constants
fbob 5:b9947e3d20cf 9 const float kl = 1.726e-08f; // N.s^2/rad^2
fbob 5:b9947e3d20cf 10 const float kd = 1.426e-10f; // N.m.s^2/rad^2
fbob 5:b9947e3d20cf 11
fbob 5:b9947e3d20cf 12 // Quadcopter dimensions
fbob 5:b9947e3d20cf 13 const float l = 0.033f; // m
fbob 5:b9947e3d20cf 14 const float m = 0.030f; // kg
fbob 5:b9947e3d20cf 15 const float I_xx = 16.0e-6f; // kg.m^2
fbob 5:b9947e3d20cf 16 const float I_yy = 16.0e-6f; // kg.m^2
fbob 5:b9947e3d20cf 17 const float I_zz = 29.0e-6f; // kg.m^2
fbob 5:b9947e3d20cf 18
fbob 7:220ce3839be8 19 //
fbob 7:220ce3839be8 20 const float g = 9.81f;
fbob 7:220ce3839be8 21
fbob 5:b9947e3d20cf 22 // Attitude estimator parameters
fbob 5:b9947e3d20cf 23 const float dt_att = 0.005f; // s
fbob 5:b9947e3d20cf 24 const float rho = 0.02f;
fbob 5:b9947e3d20cf 25
fbob 5:b9947e3d20cf 26 // Attitude controller time constants
fbob 7:220ce3839be8 27 const float T_phi = 0.12; //0.2f; // s
fbob 7:220ce3839be8 28 const float T_theta = 0.12; //0.2f; // s
fbob 5:b9947e3d20cf 29 const float T_psi = 0.2f; // s
fbob 5:b9947e3d20cf 30 const float T_p = 0.04f; // s
fbob 5:b9947e3d20cf 31 const float T_q = 0.04f; // s
fbob 5:b9947e3d20cf 32 const float T_r = 0.1f; // s
fbob 5:b9947e3d20cf 33
fbob 7:220ce3839be8 34 // Position estimator parameters
fbob 7:220ce3839be8 35 float const dt_pos = 0.05f; // s
fbob 7:220ce3839be8 36
fbob 7:220ce3839be8 37 // Vertical controller time constants
fbob 7:220ce3839be8 38 const float zeta = 0.7f;
fbob 7:220ce3839be8 39 const float omega_n = 2.0f; // rad/s
fbob 7:220ce3839be8 40 const float K_z = pow(omega_n,2);
fbob 8:d05fe9f8bfb6 41 const float K_w = 2*zeta*omega_n;
fbob 8:d05fe9f8bfb6 42
fbob 8:d05fe9f8bfb6 43 // Horizontal controller time constants
fbob 8:d05fe9f8bfb6 44 const float T_u = 2.0f;
fbob 8:d05fe9f8bfb6 45 const float T_v = 2.0f;
fbob 7:220ce3839be8 46
fbob 6:3188b00263e8 47 #endif