fw control: added Dougs horizontal navigation controller

This commit is contained in:
Thomas Gubler
2012-10-28 18:35:08 +01:00
parent 69e938aac3
commit b692c300d0
4 changed files with 92 additions and 48 deletions
@@ -72,23 +72,23 @@ struct fw_att_control_params {
float pitch_roll_compensation_p;
};
struct fw_pos_control_params_handle {
float roll_p;
float rollrate_lim;
float pitch_p;
float pitch_lim;
float pitchrate_lim;
float yawrate_lim;
float pitch_roll_compensation_p;
struct fw_pos_control_param_handles {
param_t roll_p;
param_t rollrate_lim;
param_t pitch_p;
param_t pitch_lim;
param_t pitchrate_lim;
param_t yawrate_lim;
param_t pitch_roll_compensation_p;
};
/* Internal Prototypes */
static int parameters_init(struct fw_pos_control_params_handle *h);
static int parameters_update(const struct fw_pos_control_params_handle *h, struct fw_att_control_params *p);
static int parameters_init(struct fw_pos_control_param_handles *h);
static int parameters_update(const struct fw_pos_control_param_handles *h, struct fw_att_control_params *p);
static int parameters_init(struct fw_pos_control_params_handle *h)
static int parameters_init(struct fw_pos_control_param_handles *h)
{
/* PID parameters */
h->roll_p = param_find("FW_ROLL_P");
@@ -102,7 +102,7 @@ static int parameters_init(struct fw_pos_control_params_handle *h)
return OK;
}
static int parameters_update(const struct fw_pos_control_params_handle *h, struct fw_att_control_params *p)
static int parameters_update(const struct fw_pos_control_param_handles *h, struct fw_att_control_params *p)
{
param_get(h->roll_p, &(p->roll_p));
param_get(h->rollrate_lim, &(p->rollrate_lim));
@@ -122,7 +122,7 @@ int fixedwing_att_control_attitude(const struct vehicle_attitude_setpoint_s *att
static bool initialized = false;
static struct fw_att_control_params p;
static struct fw_pos_control_params_handle h;
static struct fw_pos_control_param_handles h;
static PID_t roll_controller;
static PID_t pitch_controller;
@@ -76,7 +76,7 @@ PARAM_DEFINE_FLOAT(FW_ROLLR_P, 0.9f);
PARAM_DEFINE_FLOAT(FW_ROLLR_I, 0.2f);
PARAM_DEFINE_FLOAT(FW_ROLLR_AWU, 0.9f);
PARAM_DEFINE_FLOAT(FW_ROLLR_LIM, 0.7f); // Roll rate limit in radians/sec, applies to the roll controller
PARAM_DEFINE_FLOAT(FW_ROLL_P, 9.0f);
PARAM_DEFINE_FLOAT(FW_ROLL_P, 4.0f);
PARAM_DEFINE_FLOAT(FW_PITCH_RCOMP, 0.1f);
//Pitch control parameters
@@ -77,15 +77,15 @@ struct fw_rate_control_params {
};
struct fw_rate_control_param_handles {
float rollrate_p;
float rollrate_i;
float rollrate_awu;
float pitchrate_p;
float pitchrate_i;
float pitchrate_awu;
float yawrate_p;
float yawrate_i;
float yawrate_awu;
param_t rollrate_p;
param_t rollrate_i;
param_t rollrate_awu;
param_t pitchrate_p;
param_t pitchrate_i;
param_t pitchrate_awu;
param_t yawrate_p;
param_t yawrate_i;
param_t yawrate_awu;
};