Skip to content

Commit

Permalink
update coefficients
Browse files Browse the repository at this point in the history
  • Loading branch information
RCmags committed Nov 8, 2023
1 parent b5337c9 commit 65779a4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions controller/parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@
//----------------------------------------------------------
#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
//---------------------------s-------------------------------
/* 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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 65779a4

Please sign in to comment.