Skip to content

Commit

Permalink
Change cyclic cross-coupling scale
Browse files Browse the repository at this point in the history
- Change the CC gain x10 stronger
- Change the CC cutoff /10 lower
  • Loading branch information
pmattila committed Aug 13, 2024
1 parent 82bdf75 commit 71eb96b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/main/flight/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ void INIT_CODE pidInitProfile(const pidProfile_t *pidProfile)
pid.cyclicCrossCouplingGain[FD_ROLL] = pid.cyclicCrossCouplingGain[FD_PITCH] * pidProfile->cyclic_cross_coupling_ratio / -100.0f;

// Cross-coupling derivative filters
difFilterInit(&pid.crossCouplingFilter[FD_PITCH], pidProfile->cyclic_cross_coupling_cutoff, pid.freq);
difFilterInit(&pid.crossCouplingFilter[FD_ROLL], pidProfile->cyclic_cross_coupling_cutoff, pid.freq);
difFilterInit(&pid.crossCouplingFilter[FD_PITCH], pidProfile->cyclic_cross_coupling_cutoff / 10.0f, pid.freq);
difFilterInit(&pid.crossCouplingFilter[FD_ROLL], pidProfile->cyclic_cross_coupling_cutoff / 10.0f, pid.freq);

// Initialise sub-profiles
governorInitProfile(pidProfile);
Expand Down
2 changes: 1 addition & 1 deletion src/main/flight/pid.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#define YAW_F_TERM_SCALE 0.000025f
#define YAW_B_TERM_SCALE 1.0e-6f

#define CROSS_COUPLING_SCALE 0.1e-6f
#define CROSS_COUPLING_SCALE 1.0e-6f

typedef struct {
float P;
Expand Down
4 changes: 2 additions & 2 deletions src/main/pg/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ void resetPidProfile(pidProfile_t *pidProfile)
.yaw_collective_dynamic_gain = 0,
.yaw_collective_dynamic_decay = 25,
.pitch_collective_ff_gain = 0,
.cyclic_cross_coupling_gain = 25,
.cyclic_cross_coupling_gain = 10,
.cyclic_cross_coupling_ratio = 0,
.cyclic_cross_coupling_cutoff = 15,
.cyclic_cross_coupling_cutoff = 100,
.angle.level_strength = 40,
.angle.level_limit = 55,
.horizon.level_strength = 40,
Expand Down

0 comments on commit 71eb96b

Please sign in to comment.