diff --git a/ArduCopter/Attitude.pde b/ArduCopter/Attitude.pde index c443cf9456c..c9506b91b38 100644 --- a/ArduCopter/Attitude.pde +++ b/ArduCopter/Attitude.pde @@ -83,7 +83,7 @@ get_stabilize_yaw(int32_t target_angle) static int get_acro_roll(int32_t target_rate) { - target_rate = target_rate * g.acro_P; + target_rate = target_rate * g.acro_p; target_rate = constrain(target_rate, -10000, 10000); return get_rate_roll(target_rate); } @@ -91,7 +91,7 @@ get_acro_roll(int32_t target_rate) static int get_acro_pitch(int32_t target_rate) { - target_rate = target_rate * g.acro_P; + target_rate = target_rate * g.acro_p; target_rate = constrain(target_rate, -10000, 10000); return get_rate_pitch(target_rate); } diff --git a/ArduCopter/Parameters.h b/ArduCopter/Parameters.h index 1ef65531441..a4e952f6f55 100644 --- a/ArduCopter/Parameters.h +++ b/ArduCopter/Parameters.h @@ -171,6 +171,7 @@ public: // 220: PI/D Controllers // k_param_stabilize_d = 220, + k_param_acro_p, k_param_pid_rate_roll, k_param_pid_rate_pitch, k_param_pid_rate_yaw, @@ -293,7 +294,7 @@ public: AP_Float stabilize_d; // PI/D controllers - AP_Float acro_P; + AP_Float acro_p; AC_PID pid_rate_roll; AC_PID pid_rate_pitch; @@ -399,6 +400,7 @@ public: camera_pitch_gain (CAM_PITCH_GAIN), camera_roll_gain (CAM_ROLL_GAIN), stabilize_d (STABILIZE_D), + acro_p (ACRO_P), // PID controller initial P initial I initial D initial imax //----------------------------------------------------------------------------------------------------- diff --git a/ArduCopter/Parameters.pde b/ArduCopter/Parameters.pde index ee103f2234e..7de53403b43 100644 --- a/ArduCopter/Parameters.pde +++ b/ArduCopter/Parameters.pde @@ -108,6 +108,7 @@ static const AP_Param::Info var_info[] PROGMEM = { GSCALAR(camera_pitch_gain, "CAM_P_G"), GSCALAR(camera_roll_gain, "CAM_R_G"), GSCALAR(stabilize_d, "STAB_D"), + GSCALAR(acro_p, "ACRO_P"), // PID controller //--------------- diff --git a/ArduCopter/config.h b/ArduCopter/config.h index d86b929d789..eb9cc0bf976 100644 --- a/ArduCopter/config.h +++ b/ArduCopter/config.h @@ -558,6 +558,13 @@ # define STABILIZE_D .06 #endif + + +#ifndef ACRO_P +# define ACRO_P 4.5 +#endif + + // Good for smaller payload motors. #ifndef STABILIZE_ROLL_P # define STABILIZE_ROLL_P 4.5