Library containing Crazyflie 2.0 controller classes: - Attitude estimator - Horizontal estimator - Vertical estimator - Attitude controller - Horizontal controller - Vertical controller - Mixer
Diff: Parameters/Parameters.h
- Revision:
- 22:5f2323e30cdc
- Parent:
- 21:169cc2b1d2ff
- Child:
- 23:4905fbc2b31a
--- a/Parameters/Parameters.h Wed Oct 24 14:24:56 2018 +0000 +++ b/Parameters/Parameters.h Thu Oct 25 12:41:50 2018 +0000 @@ -43,7 +43,7 @@ // Attitude controller gains (yaw) const float Ts_psi = 0.8f; // s -const float OS_psi = 0.005f; // % +const float OS_psi = 0.005f; // % const float zeta_psi = abs(log(OS_psi))/sqrt(pow(log(OS_psi),2)+pow(pi,2)); const float omega_n_psi = 4.0f/(Ts_psi*zeta_psi); const float kd_psi = pow(omega_n_psi,2.0f); @@ -53,21 +53,25 @@ const float rho_ver = 0.3f; // Vertical controller gains (z) -const float Ts_z = 2.0f; // s -const float OS_z = 0.005f; // % +const float Ts_z = 2.0f; // s +const float OS_z = 0.005f; // % const float zeta_z = abs(log(OS_z))/sqrt(pow(log(OS_z),2)+pow(pi,2)); const float omega_n_z = 4.0f/(Ts_z*zeta_z); const float kp_z = pow(omega_n_z,2.0f); const float kd_z = 2.0f*zeta_z*omega_n_z; +// Optical flow sensor constant +const float gamma = 42.0f; +const float resolution = 420.0f; +const float sigma = (1.0f/dt_flow)*(2.0f*tan((gamma*pi/180.0f)/2.0f))/resolution; + // Horizontal estimator weighthing (measurement X prediction) -const float rho_hor = 0.3f; +const float rho_hor = 0.3f; // Horizontal controller gains (x/y) -const float Ts_x = 4.0f; // s -const float OS_x = 0.005f; // % +const float Ts_x = 4.0f; // s +const float OS_x = 0.005f; // % const float zeta_x = abs(log(OS_x))/sqrt(pow(log(OS_x),2)+pow(pi,2)); -//const float zeta_x = 1.5; const float omega_n_x = 4.0f/(Ts_x*zeta_x); const float kp_x = pow(omega_n_x,2.0f); const float kd_x = 2.0f*zeta_x*omega_n_x;