Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move FW PID FF component to dedicated config structure #4482

Merged
merged 1 commit into from
Mar 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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