Skip to content
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
69 changes: 23 additions & 46 deletions src/SCRIPTS/BF/PAGES/filters1.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,96 +18,73 @@ local fields = {}

if apiVersion >= 1.041 then
labels[#labels + 1] = { t = "Gyro Lowpass 1 Dynamic", x = x, y = inc.y(lineSpacing) }
labels[#labels + 1] = { t = "Min Cutoff", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1000, vals = { 30, 31 } }
labels[#labels + 1] = { t = "Max Cutoff", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1000, vals = { 32, 33 } }
labels[#labels + 1] = { t = "Filter Type", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 25 }, table = { [0] = "PT1", [1] = "BIQUAD" } }
fields[#fields + 1] = { t = "Min Cutoff", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 1000, vals = { 30, 31 } }
fields[#fields + 1] = { t = "Max Cutoff", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 1000, vals = { 32, 33 } }
fields[#fields + 1] = { t = "Filter Type", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 1, vals = { 25 }, table = { [0] = "PT1", [1] = "BIQUAD" } }
end

if apiVersion >= 1.016 then
labels[#labels + 1] = { t = "Gyro Lowpass 1", x = x, y = inc.y(lineSpacing) }
if apiVersion >= 1.039 then
labels[#labels + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 16000, vals = { 21, 22 } }
labels[#labels + 1] = { t = "Filter Type", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 25 }, table = { [0] = "PT1", [1] = "BIQUAD" } }
fields[#fields + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 16000, vals = { 21, 22 } }
fields[#fields + 1] = { t = "Filter Type", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 1, vals = { 25 }, table = { [0] = "PT1", [1] = "BIQUAD" } }
else
labels[#labels + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 255, vals = { 1 } }
fields[#fields + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 255, vals = { 1 } }
end
end

if apiVersion >= 1.039 then
labels[#labels + 1] = { t = "Gyro Lowpass 2", x = x, y = inc.y(lineSpacing) }
labels[#labels + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 16000, vals = { 23, 24 } }
labels[#labels + 1] = { t = "Filter Type", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 26 }, table = { [0] = "PT1", [1] = "BIQUAD" } }
fields[#fields + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 16000, vals = { 23, 24 } }
fields[#fields + 1] = { t = "Filter Type", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 1, vals = { 26 }, table = { [0] = "PT1", [1] = "BIQUAD" } }
end

if apiVersion >= 1.020 then
labels[#labels + 1] = { t = "Gyro Notch 1", x = x, y = inc.y(lineSpacing) }
labels[#labels + 1] = { t = "Center", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 16000, vals = { 6, 7 } }
labels[#labels + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 16000, vals = { 8, 9 } }
fields[#fields + 1] = { t = "Center", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 16000, vals = { 6, 7 } }
fields[#fields + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 16000, vals = { 8, 9 } }
end

if apiVersion >= 1.021 then
labels[#labels + 1] = { t = "Gyro Notch 2", x = x, y = inc.y(lineSpacing) }
labels[#labels + 1] = { t = "Center", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 16000, vals = { 14, 15 } }
labels[#labels + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 16000, vals = { 16, 17 } }
fields[#fields + 1] = { t = "Center", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 16000, vals = { 14, 15 } }
fields[#fields + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 16000, vals = { 16, 17 } }
end

if apiVersion >= 1.041 then
labels[#labels + 1] = { t = "D Term Lowpass 1 Dynamic", x = x, y = inc.y(lineSpacing) }
labels[#labels + 1] = { t = "Min Cutoff", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1000, vals = { 34, 35 } }
labels[#labels + 1] = { t = "Max Cutoff", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1000, vals = { 36, 37 } }
labels[#labels + 1] = { t = "Filter Type", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 18 }, table = { [0] = "PT1", [1] = "BIQUAD" } }
fields[#fields + 1] = { t = "Min Cutoff", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 1000, vals = { 34, 35 } }
fields[#fields + 1] = { t = "Max Cutoff", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 1000, vals = { 36, 37 } }
fields[#fields + 1] = { t = "Filter Type", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 1, vals = { 18 }, table = { [0] = "PT1", [1] = "BIQUAD" } }
end

if apiVersion >= 1.016 then
labels[#labels + 1] = { t = "D Term Lowpass 1", x = x, y = inc.y(lineSpacing) }
labels[#labels + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 16000, vals = { 2, 3 } }
fields[#fields + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 16000, vals = { 2, 3 } }
if apiVersion >= 1.036 and apiVersion <= 1.038 then
labels[#labels + 1] = { t = "Filter Type", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 2, vals = { 18 }, table = { [0] = "PT1", [1] = "BIQUAD", [2] = "FIR" } }
fields[#fields + 1] = { t = "Filter Type", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 2, vals = { 18 }, table = { [0] = "PT1", [1] = "BIQUAD", [2] = "FIR" } }
elseif apiVersion >= 1.039 then
labels[#labels + 1] = { t = "Filter Type", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 18 }, table = { [0] = "PT1", [1] = "BIQUAD" } }
fields[#fields + 1] = { t = "Filter Type", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 1, vals = { 18 }, table = { [0] = "PT1", [1] = "BIQUAD" } }
end
end

if apiVersion >= 1.039 then
labels[#labels + 1] = { t = "D Term Lowpass 2", x = x, y = inc.y(lineSpacing) }
labels[#labels + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 16000, vals = { 27, 28 } }
fields[#fields + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 16000, vals = { 27, 28 } }
if apiVersion >= 1.041 then
labels[#labels + 1] = { t = "Filter Type", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 29 }, table = { [0] = "PT1", [1] = "BIQUAD" } }
fields[#fields + 1] = { t = "Filter Type", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 1, vals = { 29 }, table = { [0] = "PT1", [1] = "BIQUAD" } }
end
end

if apiVersion >= 1.020 then
labels[#labels + 1] = { t = "D Term Notch", x = x, y = inc.y(lineSpacing) }
labels[#labels + 1] = { t = "Center", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 16000, vals = { 10, 11 } }
labels[#labels + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 16000, vals = { 12, 13 } }
fields[#fields + 1] = { t = "Center", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 16000, vals = { 10, 11 } }
fields[#fields + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 16000, vals = { 12, 13 } }
end

if apiVersion >= 1.016 then
labels[#labels + 1] = { t = "Yaw Lowpass", x = x, y = inc.y(lineSpacing) }
labels[#labels + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 500, vals = { 4, 5 } }
fields[#fields + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 500, vals = { 4, 5 } }
end

return {
Expand Down
18 changes: 6 additions & 12 deletions src/SCRIPTS/BF/PAGES/filters2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,13 @@ local fields = {}

if apiVersion >= 1.042 then
labels[#labels + 1] = { t = "Gyro RPM Filter", x = x, y = inc.y(lineSpacing) }
labels[#labels + 1] = { t = "Harmonics", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 3, vals = { 44 } }
labels[#labels + 1] = { t = "Min Frequency", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 50, max = 200, vals = { 45 } }
fields[#fields + 1] = { t = "Harmonics", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 3, vals = { 44 } }
fields[#fields + 1] = { t = "Min Frequency", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 50, max = 200, vals = { 45 } }
labels[#labels + 1] = { t = "Dynamic Notch Filter", x = x, y = inc.y(lineSpacing) }
labels[#labels + 1] = { t = "Range", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 3, vals = { 38 }, table = { [0]="HIGH", "MEDIUM", "LOW", "AUTO" } }
labels[#labels + 1] = { t = "Width %", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 20, vals = { 39 } }
labels[#labels + 1] = { t = "Q", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 1, max = 1000, vals = { 40, 41 } }
labels[#labels + 1] = { t = "Min Frequency", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 60, max = 1000, vals = { 42, 43 } }
fields[#fields + 1] = { t = "Range", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 3, vals = { 38 }, table = { [0]="HIGH", "MEDIUM", "LOW", "AUTO" } }
fields[#fields + 1] = { t = "Width %", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 20, vals = { 39 } }
fields[#fields + 1] = { t = "Q", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 1, max = 1000, vals = { 40, 41 } }
fields[#fields + 1] = { t = "Min Frequency", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 60, max = 1000, vals = { 42, 43 } }
end

return {
Expand Down
39 changes: 13 additions & 26 deletions src/SCRIPTS/BF/PAGES/pid_advanced.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,53 +18,40 @@ local fields = {}

if apiVersion >= 1.040 then
labels[#labels + 1] = { t = "Acro Trainer", x = x, y = inc.y(lineSpacing) }
labels[#labels + 1] = { t = "Angle Limit", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 20, max = 80, vals = { 32 } }
labels[#labels + 1] = { t = "Throttle Boost", x = x, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 100, vals = { 31 } }
labels[#labels + 1] = { t = "Absolute Control", x = x, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 20, vals = { 30 } }
labels[#labels + 1] = { t = "I Term Rotation", x = x, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 26 }, table = { [0]="OFF", "ON" } }
fields[#fields + 1] = { t = "Angle Limit", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 20, max = 80, vals = { 32 } }
fields[#fields + 1] = { t = "Throttle Boost", x = x, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 100, vals = { 31 } }
fields[#fields + 1] = { t = "Absolute Control", x = x, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 20, vals = { 30 } }
fields[#fields + 1] = { t = "I Term Rotation", x = x, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 1, vals = { 26 }, table = { [0]="OFF", "ON" } }
end

if apiVersion >= 1.016 then
labels[#labels + 1] = { t = "VBAT Compensation", x = x, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 8 }, table = { [0]="OFF", "ON" } }
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.040 and apiVersion <= 1.041 then
labels[#labels + 1] = { t = "Smart Feedforward", x = x, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 27 }, table = { [0] = "OFF", "ON" } }
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.040 then
labels[#labels + 1] = { t = "I Term Relax", x = x, y = inc.y(lineSpacing) }
labels[#labels + 1] = { t = "Axes", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 4, vals = { 28 }, table = { [0]="NONE", "RP", "RPY", "RP (inc)", "RPY (inc)" } }
labels[#labels + 1] = { t = "Type", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 29 }, table = { [0]="Gyro", "Setpoint" } }
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)" } }
fields[#fields + 1] = { t = "Type", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 1, vals = { 29 }, table = { [0]="Gyro", "Setpoint" } }
if apiVersion >= 1.042 then
labels[#labels + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 1, max = 100, vals = { 47 } }
fields[#fields + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 1, max = 100, vals = { 47 } }
end
end

if apiVersion >= 1.041 then
labels[#labels + 1] = { t = "Integrated Yaw", x = x, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 45 }, table = { [0]="OFF", "ON" } }
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
labels[#labels + 1] = { t = "Mode", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 39 }, table = { [0]="Smooth", "Step" } }
fields[#fields + 1] = { t = "Mode", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 1, vals = { 39 }, table = { [0]="Smooth", "Step" } }
end
labels[#labels + 1] = { t = "Gain", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 1000, max = 30000, vals = { 22, 23 }, scale = 1000, mult = 100 }
labels[#labels + 1] = { t = "Threshold", x = x + indent, y = inc.y(lineSpacing) }
fields[#fields + 1] = { x = x + sp, y = y, min = 20,max = 1000, vals = { 20, 21 } }
fields[#fields + 1] = { t = "Gain", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 1000, max = 30000, vals = { 22, 23 }, scale = 1000, mult = 100 }
fields[#fields + 1] = { t = "Threshold", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 20,max = 1000, vals = { 20, 21 } }
end

return {
Expand Down
Loading