aboutsummaryrefslogtreecommitdiff
path: root/apps/fixedwing_att_control/fixedwing_att_control_rate.c
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2012-10-28 11:54:02 +0100
committerThomas Gubler <thomasgubler@gmail.com>2012-10-28 11:54:02 +0100
commit62581fe55b0fb138f88bd0dcd89dffdbf99496ef (patch)
treeefdcb5c6faa475ba9bb39078bb54959aa6a88e4a /apps/fixedwing_att_control/fixedwing_att_control_rate.c
parent17772afdaabd446ba5b7ddccca1f8d4fed433d39 (diff)
downloadpx4-firmware-62581fe55b0fb138f88bd0dcd89dffdbf99496ef.tar.gz
px4-firmware-62581fe55b0fb138f88bd0dcd89dffdbf99496ef.tar.bz2
px4-firmware-62581fe55b0fb138f88bd0dcd89dffdbf99496ef.zip
fw control: attitude, added pid elements
Diffstat (limited to 'apps/fixedwing_att_control/fixedwing_att_control_rate.c')
-rw-r--r--apps/fixedwing_att_control/fixedwing_att_control_rate.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/apps/fixedwing_att_control/fixedwing_att_control_rate.c b/apps/fixedwing_att_control/fixedwing_att_control_rate.c
index 24dce199f..4b7e2c2ba 100644
--- a/apps/fixedwing_att_control/fixedwing_att_control_rate.c
+++ b/apps/fixedwing_att_control/fixedwing_att_control_rate.c
@@ -116,10 +116,6 @@ static int parameters_init(struct fw_rate_control_param_handles *h)
h->yawrate_awu = param_find("FW_YAWRATE_AWU");
h->yawrate_lim = param_find("FW_YAWRATE_LIM");
-
-// if(h->attrate_i == PARAM_INVALID)
-// printf("FATAL MC_ATTRATE_I does not exist\n");
-
return OK;
}
@@ -163,19 +159,19 @@ int fixedwing_att_control_rates(const struct vehicle_rates_setpoint_s *rate_sp,
{
parameters_init(&h);
parameters_update(&h, &p);
- pid_init(&roll_rate_controller, p.rollrate_p, p.rollrate_i, 0, p.rollrate_awu, p.rollrate_lim, PID_MODE_DERIVATIV_SET); // set D part to 0 because the controller layout is with a PI rate controller
- pid_init(&pitch_rate_controller, p.pitchrate_p, p.pitchrate_i, 0, p.pitchrate_awu, p.pitchrate_lim, PID_MODE_DERIVATIV_SET); // set D part to 0 because the contpitcher layout is with a PI rate contpitcher
- pid_init(&yaw_rate_controller, p.yawrate_p, p.yawrate_i, 0, p.yawrate_awu, p.yawrate_lim, PID_MODE_DERIVATIV_SET); // set D part to 0 because the contpitcher layout is with a PI rate contpitcher
+ pid_init(&roll_rate_controller, p.rollrate_p, p.rollrate_i, 0, p.rollrate_awu, p.rollrate_lim, PID_MODE_DERIVATIV_NONE); // set D part to 0 because the controller layout is with a PI rate controller
+ pid_init(&pitch_rate_controller, p.pitchrate_p, p.pitchrate_i, 0, p.pitchrate_awu, p.pitchrate_lim, PID_MODE_DERIVATIV_NONE); // set D part to 0 because the contpitcher layout is with a PI rate contpitcher
+ pid_init(&yaw_rate_controller, p.yawrate_p, p.yawrate_i, 0, p.yawrate_awu, p.yawrate_lim, PID_MODE_DERIVATIV_NONE); // set D part to 0 because the contpitcher layout is with a PI rate contpitcher
initialized = true;
}
/* load new parameters with lower rate */
if (counter % 100 == 0) {
/* update parameters from storage */
+ parameters_update(&h, &p);
pid_set_parameters(&roll_rate_controller, p.rollrate_p, p.rollrate_i, 0, p.rollrate_awu, p.rollrate_lim);
pid_set_parameters(&pitch_rate_controller, p.pitchrate_p, p.pitchrate_i, 0, p.pitchrate_awu, p.pitchrate_lim);
pid_set_parameters(&yaw_rate_controller, p.yawrate_p, p.yawrate_i, 0, p.yawrate_awu, p.yawrate_lim);
- parameters_update(&h, &p);
}