From 69e938aac3183780b1afcc3715f232c8e092994a Mon Sep 17 00:00:00 2001 From: Thomas Gubler Date: Sun, 28 Oct 2012 16:56:05 +0100 Subject: moved elevator (-1) multipliction, ultimately this has to go into the mixer --- apps/fixedwing_att_control/fixedwing_att_control_main.c | 2 +- apps/fixedwing_att_control/fixedwing_att_control_rate.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'apps/fixedwing_att_control') diff --git a/apps/fixedwing_att_control/fixedwing_att_control_main.c b/apps/fixedwing_att_control/fixedwing_att_control_main.c index 869fb16e4..d4fc0afae 100644 --- a/apps/fixedwing_att_control/fixedwing_att_control_main.c +++ b/apps/fixedwing_att_control/fixedwing_att_control_main.c @@ -80,7 +80,7 @@ PARAM_DEFINE_FLOAT(FW_ROLL_P, 9.0f); PARAM_DEFINE_FLOAT(FW_PITCH_RCOMP, 0.1f); //Pitch control parameters -PARAM_DEFINE_FLOAT(FW_PITCHR_P, -0.8f); +PARAM_DEFINE_FLOAT(FW_PITCHR_P, 0.8f); PARAM_DEFINE_FLOAT(FW_PITCHR_I, 0.2f); PARAM_DEFINE_FLOAT(FW_PITCHR_AWU, 0.8f); PARAM_DEFINE_FLOAT(FW_PITCHR_LIM, 0.35f); // Pitch rate limit in radians/sec, applies to the pitch controller diff --git a/apps/fixedwing_att_control/fixedwing_att_control_rate.c b/apps/fixedwing_att_control/fixedwing_att_control_rate.c index ec3039dd6..21b3eeb4e 100644 --- a/apps/fixedwing_att_control/fixedwing_att_control_rate.c +++ b/apps/fixedwing_att_control/fixedwing_att_control_rate.c @@ -170,9 +170,9 @@ int fixedwing_att_control_rates(const struct vehicle_rates_setpoint_s *rate_sp, /* Roll Rate (PI) */ actuators->control[0] = pid_calculate(&roll_rate_controller, rate_sp->roll, rates[0], 0, deltaT); - //XXX TODO disabled for now - actuators->control[1] = pid_calculate(&pitch_rate_controller, rate_sp->pitch, rates[1], 0, deltaT); - actuators->control[2] = 0;//pid_calculate(&yaw_rate_controller, rate_sp->yaw, rates[2], 0, deltaT); + + actuators->control[1] = -pid_calculate(&pitch_rate_controller, rate_sp->pitch, rates[1], 0, deltaT); //TODO: (-) sign comes from the elevator (positive --> deflection downwards), this has to be moved to the mixer... + actuators->control[2] = 0;//pid_calculate(&yaw_rate_controller, rate_sp->yaw, rates[2], 0, deltaT); //XXX TODO disabled for now counter++; -- cgit v1.2.3