diff options
author | Julian Oes <julian@oes.ch> | 2013-11-20 13:17:49 +0100 |
---|---|---|
committer | Julian Oes <julian@oes.ch> | 2013-11-20 13:17:49 +0100 |
commit | c33d61693519ee48f50e49fa086602f52eab47ec (patch) | |
tree | 9c1028e93fe34d275594b6d0edec95afdd985b4a /src/lib/ecl/attitude_fw/ecl_pitch_controller.h | |
parent | a27c7e831945f0a6b95b50b9ac68364b28a49362 (diff) | |
parent | 37ef10ceead77876108847e31f56ae68015f5784 (diff) | |
download | px4-firmware-c33d61693519ee48f50e49fa086602f52eab47ec.tar.gz px4-firmware-c33d61693519ee48f50e49fa086602f52eab47ec.tar.bz2 px4-firmware-c33d61693519ee48f50e49fa086602f52eab47ec.zip |
Merge remote-tracking branch 'thomasgubler_private/fw_autoland_att_tecs' into navigator_wip_merge_test
Conflicts:
src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp
Diffstat (limited to 'src/lib/ecl/attitude_fw/ecl_pitch_controller.h')
-rw-r--r-- | src/lib/ecl/attitude_fw/ecl_pitch_controller.h | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/lib/ecl/attitude_fw/ecl_pitch_controller.h b/src/lib/ecl/attitude_fw/ecl_pitch_controller.h index 1e6cec6a1..2ca0490fd 100644 --- a/src/lib/ecl/attitude_fw/ecl_pitch_controller.h +++ b/src/lib/ecl/attitude_fw/ecl_pitch_controller.h @@ -36,6 +36,7 @@ * Definition of a simple orthogonal pitch PID controller. * * @author Lorenz Meier <lm@inf.ethz.ch> + * @author Thomas Gubler <thomasgubler@gmail.com> * * Acknowledgements: * @@ -51,13 +52,18 @@ #include <stdbool.h> #include <stdint.h> -class __EXPORT ECL_PitchController +class __EXPORT ECL_PitchController //XXX: create controller superclass { public: ECL_PitchController(); - float control(float pitch_setpoint, float pitch, float pitch_rate, float roll, float scaler = 1.0f, - bool lock_integrator = false, float airspeed_min = 0.0f, float airspeed_max = 0.0f, float airspeed = (0.0f / 0.0f)); + float control_attitude(float pitch_setpoint, float roll, float pitch, float airspeed); + + + float control_bodyrate(float roll, float pitch, + float pitch_rate, float yaw_rate, + float yaw_rate_setpoint, + float airspeed_min = 0.0f, float airspeed_max = 0.0f, float airspeed = (0.0f / 0.0f), float scaler = 1.0f, bool lock_integrator = false); void reset_integrator(); @@ -67,21 +73,30 @@ public: void set_k_p(float k_p) { _k_p = k_p; } + void set_k_i(float k_i) { _k_i = k_i; } void set_k_d(float k_d) { _k_d = k_d; } + + void set_k_ff(float k_ff) { + _k_ff = k_ff; + } + void set_integrator_max(float max) { _integrator_max = max; } + void set_max_rate_pos(float max_rate_pos) { _max_rate_pos = max_rate_pos; } + void set_max_rate_neg(float max_rate_neg) { _max_rate_neg = max_rate_neg; } + void set_roll_ff(float roll_ff) { _roll_ff = roll_ff; } @@ -94,6 +109,10 @@ public: return _rate_setpoint; } + float get_desired_bodyrate() { + return _bodyrate_setpoint; + } + private: uint64_t _last_run; @@ -101,6 +120,7 @@ private: float _k_p; float _k_i; float _k_d; + float _k_ff; float _integrator_max; float _max_rate_pos; float _max_rate_neg; @@ -109,7 +129,7 @@ private: float _integrator; float _rate_error; float _rate_setpoint; - float _max_deflection_rad; + float _bodyrate_setpoint; }; #endif // ECL_PITCH_CONTROLLER_H |