Skip to content

Commit

Permalink
Merge pull request #4482 from iNavFlight/dzikuvx-untangle-fw-d-ff-logic
Browse files Browse the repository at this point in the history
Move FW PID FF component to dedicated config structure
  • Loading branch information
DzikuVx authored Mar 9, 2019
2 parents 2f226f8 + 9d7b27c commit ad0d14e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/main/fc/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ groups:
min: 0
max: 200
- name: fw_ff_pitch
field: bank_fw.pid[PID_PITCH].D
field: bank_fw.pid[PID_PITCH].FF
min: 0
max: 200
- name: fw_p_roll
Expand All @@ -918,7 +918,7 @@ groups:
min: 0
max: 200
- name: fw_ff_roll
field: bank_fw.pid[PID_ROLL].D
field: bank_fw.pid[PID_ROLL].FF
min: 0
max: 200
- name: fw_p_yaw
Expand All @@ -930,7 +930,7 @@ groups:
min: 0
max: 200
- name: fw_ff_yaw
field: bank_fw.pid[PID_YAW].D
field: bank_fw.pid[PID_YAW].FF
min: 0
max: 200
- name: fw_p_level
Expand Down
8 changes: 4 additions & 4 deletions src/main/flight/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ PG_RESET_TEMPLATE(pidProfile_t, pidProfile,

.bank_fw = {
.pid = {
[PID_ROLL] = { 5, 7, 50, 0 },
[PID_PITCH] = { 5, 7, 50, 0 },
[PID_YAW] = { 6, 10, 60, 0 },
[PID_ROLL] = { 5, 7, 0, 50 },
[PID_PITCH] = { 5, 7, 0, 50 },
[PID_YAW] = { 6, 10, 0, 60 },
[PID_LEVEL] = {
.P = 20, // Self-level strength
.I = 5, // Self-leveing low-pass frequency (0 - disabled)
Expand Down Expand Up @@ -386,7 +386,7 @@ void FAST_CODE NOINLINE updatePIDCoefficients(void)
pidState[axis].kP = pidBank()->pid[axis].P / FP_PID_RATE_P_MULTIPLIER * tpaFactor;
pidState[axis].kI = pidBank()->pid[axis].I / FP_PID_RATE_I_MULTIPLIER * tpaFactor;
pidState[axis].kD = 0.0f;
pidState[axis].kFF = pidBank()->pid[axis].D / FP_PID_RATE_FF_MULTIPLIER * tpaFactor;
pidState[axis].kFF = pidBank()->pid[axis].FF / FP_PID_RATE_FF_MULTIPLIER * tpaFactor;
pidState[axis].kT = 0.0f;
}
else {
Expand Down

0 comments on commit ad0d14e

Please sign in to comment.