Library containing Crazyflie 2.0 controller classes: - Attitude estimator - Horizontal estimator - Vertical estimator - Attitude controller - Horizontal controller - Vertical controller - Mixer
Diff: AttitudeController/AttitudeController.h
- Revision:
- 3:e782fe31ace2
- Parent:
- 2:7e01bc32bf4c
- Child:
- 4:8c7b42745080
--- a/AttitudeController/AttitudeController.h Thu Sep 13 13:08:58 2018 +0000 +++ b/AttitudeController/AttitudeController.h Wed Sep 26 15:01:03 2018 +0000 @@ -4,12 +4,12 @@ #include "mbed.h" // Controller time constants (s) -float const t_phi = 0.16f; -float const t_theta = 0.16f; -float const t_psi = 0.2f; -float const t_p = 0.04f; -float const t_q = 0.04f; -float const t_r = 0.1f; +float const T_phi = 0.16f; +float const T_theta = 0.16f; +float const T_psi = 0.2f; +float const T_p = 0.04f; +float const T_q = 0.04f; +float const T_r = 0.1f; // Quadcopter moments of inertia (kg.m^2) float const I_xx = 16.0e-6f; @@ -21,13 +21,13 @@ public: // Class constructor AttitudeController(); - // Calculate torques given reference angles and current angles and rates + // Control torques given reference angles and current angles and angular velocities void control(float phi_r, float theta_r, float psi_r, float phi, float theta, float psi, float p, float q, float r); // Torques (N.m) float tau_phi, tau_theta, tau_psi; private: - // Calculate torque given reference angle and current angle and rate (with given gains and moment of inertia) - float cascate_control(float angle_r, float angle, float rate, float K_angle, float K_rate, float I); + // Control torques given reference angles and current angles and angular velocities (with given time constants and moments of inertia) + float control_single(float angle_r, float angle, float rate, float T_angle, float T_rate, float I); }; -#endif +#endif \ No newline at end of file