aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2012-10-29 23:04:00 +0100
committerThomas Gubler <thomasgubler@gmail.com>2012-10-29 23:09:07 +0100
commit9ad9d62f3476e6092c8fbbf33f4e6a141fd641c3 (patch)
treee55b1517fa169dfb97fa3ed00d56926bbc8e74ec
parentdb8d369c55d091b988a054ad39fd323e945a9bb0 (diff)
downloadpx4-firmware-9ad9d62f3476e6092c8fbbf33f4e6a141fd641c3.tar.gz
px4-firmware-9ad9d62f3476e6092c8fbbf33f4e6a141fd641c3.tar.bz2
px4-firmware-9ad9d62f3476e6092c8fbbf33f4e6a141fd641c3.zip
Corrected some bugs, thanks to Doug for spotting them
-rw-r--r--apps/fixedwing_att_control/fixedwing_att_control_att.c7
-rw-r--r--apps/fixedwing_att_control/fixedwing_att_control_att.h2
-rw-r--r--apps/fixedwing_att_control/fixedwing_att_control_rate.h2
3 files changed, 4 insertions, 7 deletions
diff --git a/apps/fixedwing_att_control/fixedwing_att_control_att.c b/apps/fixedwing_att_control/fixedwing_att_control_att.c
index 29e9ee1bc..18b290f99 100644
--- a/apps/fixedwing_att_control/fixedwing_att_control_att.c
+++ b/apps/fixedwing_att_control/fixedwing_att_control_att.c
@@ -66,7 +66,6 @@ struct fw_att_control_params {
float roll_p;
float rollrate_lim;
float pitch_p;
- float pitch_lim;
float pitchrate_lim;
float yawrate_lim;
float pitch_roll_compensation_p;
@@ -76,7 +75,6 @@ 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;
@@ -94,7 +92,6 @@ static int parameters_init(struct fw_pos_control_param_handles *h)
h->roll_p = param_find("FW_ROLL_P");
h->rollrate_lim = param_find("FW_ROLLR_LIM");
h->pitch_p = param_find("FW_PITCH_P");
- h->pitch_lim = param_find("FW_PITCH_LIM");
h->pitchrate_lim = param_find("FW_PITCHR_LIM");
h->yawrate_lim = param_find("FW_YAWR_LIM");
h->pitch_roll_compensation_p = param_find("FW_PITCH_RCOMP");
@@ -141,7 +138,7 @@ int fixedwing_att_control_attitude(const struct vehicle_attitude_setpoint_s *att
if (counter % 100 == 0) {
/* update parameters from storage */
parameters_update(&h, &p);
- pid_set_parameters(&roll_controller, p.roll_p, 0, 0, 0, p.pitchrate_lim);
+ pid_set_parameters(&roll_controller, p.roll_p, 0, 0, 0, p.rollrate_lim);
pid_set_parameters(&pitch_controller, p.pitch_p, 0, 0, 0, p.pitchrate_lim);
}
@@ -150,7 +147,7 @@ int fixedwing_att_control_attitude(const struct vehicle_attitude_setpoint_s *att
/* Pitch (P) */
float pitch_sp_rollcompensation = att_sp->pitch_tait_bryan + p.pitch_roll_compensation_p * att_sp->roll_tait_bryan;
- rates_sp->pitch = pid_calculate(&pitch_controller, att_sp->pitch_tait_bryan, att->pitch, 0, 0);
+ rates_sp->pitch = pid_calculate(&pitch_controller, pitch_sp_rollcompensation, att->pitch, 0, 0);
/* Yaw (from coordinated turn constraint or lateral force) */
//TODO
diff --git a/apps/fixedwing_att_control/fixedwing_att_control_att.h b/apps/fixedwing_att_control/fixedwing_att_control_att.h
index f4d3eca7c..ca7c14b43 100644
--- a/apps/fixedwing_att_control/fixedwing_att_control_att.h
+++ b/apps/fixedwing_att_control/fixedwing_att_control_att.h
@@ -33,7 +33,7 @@
*
****************************************************************************/
-/* @file Main system state machine definition */
+/* @file Fixed Wing Attitude Control */
#ifndef FIXEDWING_ATT_CONTROL_ATT_H_
#define FIXEDWING_ATT_CONTROL_ATT_H_
diff --git a/apps/fixedwing_att_control/fixedwing_att_control_rate.h b/apps/fixedwing_att_control/fixedwing_att_control_rate.h
index 2023353eb..d394c3dac 100644
--- a/apps/fixedwing_att_control/fixedwing_att_control_rate.h
+++ b/apps/fixedwing_att_control/fixedwing_att_control_rate.h
@@ -33,7 +33,7 @@
*
****************************************************************************/
-/* @file Main system state machine definition */
+/* @file Fixed Wing Attitude Rate Control */
#ifndef FIXEDWING_ATT_CONTROL_RATE_H_
#define FIXEDWING_ATT_CONTROL_RATE_H_