Skip to content

Add Vbat Sag Compensation #367

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

Merged
merged 1 commit into from
Oct 11, 2020
Merged
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
14 changes: 9 additions & 5 deletions src/SCRIPTS/BF/PAGES/pid_advanced.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,22 @@ if apiVersion >= 1.043 then
fields[#fields + 1] = { t = "Dynamic Idle", x = x, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 100, vals = { 50 } }
end

if apiVersion >= 1.016 then
if apiVersion >= 1.016 and apiVersion <= 1.043 then
fields[#fields + 1] = { t = "VBAT Compensation", x = x, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 1, vals = { 8 }, table = { [0]="OFF", "ON" } }
end

if apiVersion >= 1.044 then
fields[#fields + 1] = { t = "Vbat Sag Comp", x = x, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 150, vals = { 54 } }
end

if apiVersion >= 1.040 and apiVersion <= 1.041 then
fields[#fields + 1] = { t = "Smart Feedforward", x = x, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 1, vals = { 27 }, table = { [0] = "OFF", "ON" } }
end

if apiVersion >= 1.041 then
fields[#fields + 1] = { t = "Integrated Yaw", x = x, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 1, vals = { 45 }, table = { [0]="OFF", "ON" } }
end

if apiVersion >= 1.040 then
labels[#labels + 1] = { t = "I Term Relax", x = x, y = inc.y(lineSpacing) }
fields[#fields + 1] = { t = "Axes", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 4, vals = { 28 }, table = { [0]="NONE", "RP", "RPY", "RP (inc)", "RPY (inc)" } }
Expand All @@ -47,10 +55,6 @@ if apiVersion >= 1.040 then
end
end

if apiVersion >= 1.041 then
fields[#fields + 1] = { t = "Integrated Yaw", x = x, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 1, vals = { 45 }, table = { [0]="OFF", "ON" } }
end

if apiVersion >= 1.036 then
labels[#labels + 1] = { t = "Anti Gravity", x = x, y = inc.y(lineSpacing) }
if apiVersion >= 1.040 then
Expand Down