From 65779a48bd1aa009f33b6a09021f45f3e1d69b4f Mon Sep 17 00:00:00 2001 From: RCmags Date: Wed, 8 Nov 2023 13:00:23 -0400 Subject: [PATCH] update coefficients --- controller/parameters.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/controller/parameters.h b/controller/parameters.h index d26aad1..e617d80 100755 --- a/controller/parameters.h +++ b/controller/parameters.h @@ -4,7 +4,7 @@ //---------------------------------------------------------- #define GAIN_PITCH 0.8 // Pitch servo #define GAIN_ROLL 0.8 // Roll servo -#define GAIN_YAW 1.2 // Yaw servo / Tail ESC +#define GAIN_YAW 1.6 // Yaw servo / Tail ESC //---------------------------------------------------------- // 2A. Heading stabilization @@ -12,23 +12,23 @@ /* NOTE: For a given axis, the propotional, integral and derivative terms must have the same sign */ // I. Proportional: // Proportional gain. Adjusts damping response. Increase to retard rotation. -#define GAIN_PROP_ROLL 100.0 -#define GAIN_PROP_PITCH 400.0 -#define GAIN_PROP_YAW 15.0 +#define GAIN_PROP_ROLL 140.0 +#define GAIN_PROP_PITCH 350.0 +#define GAIN_PROP_YAW 18.0 // II. Integral: // Integral gain. Adjusts spring respose. Increase to have a stronger restoring force. -#define GAIN_INT_ROLL 800.0 -#define GAIN_INT_PITCH 1000.0 +#define GAIN_INT_ROLL 700.0 +#define GAIN_INT_PITCH 900.0 #define GAIN_INT_YAW 150.0 // III. Derivative: // Derivative gain. Reduces oscillations of proportional term. Magnifies vibration noise. #define GAIN_DERIV_ROLL 8.0 -#define GAIN_DERIV_PITCH 12.0 -#define GAIN_DERIV_YAW 0.5 +#define GAIN_DERIV_PITCH 10.0 +#define GAIN_DERIV_YAW 1.0 // IV. Phase angle -#define STAT_ANGLE 55.0 // deg // Pitch-roll coupling angle. Adjust until control axes respond independently. -#define DYN_ANGLE 55.0 // deg +#define STAT_ANGLE 60.0 // deg // Pitch-roll coupling angle. Adjust until control axes respond independently. +#define DYN_ANGLE 60.0 // deg // V. Other: #define NEGATE_ROLL // Uncomment to reverse roll deflection @@ -63,7 +63,7 @@ #define NUMBER_MEAN 50 // number of readings used for input calibration #define INPUT_DEADBAND 24 // us // deadband near center-stick to prevent integrator drift. #define INPUT_CHANGE 4 // us // Change in PWM signal needed to update receiver inputs -#define ALPHA 0.6 /* Gain of alpha-beta filter applied to sensor input. +#define ALPHA 0.4 /* Gain of alpha-beta filter applied to sensor input. A smaller value smoothens the derivative at the cost of slower response */ //---------------------------------------------------------- // 5. Tail rotor counter-torque