Skip to content

Commit

Permalink
Update simplified_tuning.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
klutvott123 committed Oct 10, 2021
1 parent 94cd4da commit b75cd1d
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/SCRIPTS/BF/PAGES/simplified_tuning.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,30 @@ local inc = { x = function(val) x = x + val return x end, y = function(val) y =
local labels = {}
local fields = {}

labels[#labels + 1] = { t = "Simplified Pid", x = x, y = inc.y(lineSpacing) }
fields[#fields + 1] = { t = "Pid Tuning", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 2, vals = { 1 }, table = { [0] = "OFF", "RP", "RPY" } }
fields[#fields + 1] = { t = "Master Mult", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 50, max = 200, vals = { 2 }, scale = 100, mult = 5 }
fields[#fields + 1] = { t = "R/P Ratio", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 50, max = 200, vals = { 3 }, scale = 100, mult = 5 }
fields[#fields + 1] = { t = "I Gain", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 50, max = 200, vals = { 4 }, scale = 100, mult = 5 }
fields[#fields + 1] = { t = "P/D Ratio", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 50, max = 200, vals = { 5 }, scale = 100, mult = 5 }
fields[#fields + 1] = { t = "PD Gain", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 50, max = 200, vals = { 6 }, scale = 100, mult = 5 }
fields[#fields + 1] = { t = "Dmin Ratio", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 50, max = 200, vals = { 7 }, scale = 100, mult = 5 }
fields[#fields + 1] = { t = "FF Gain", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 50, max = 200, vals = { 8 }, scale = 100, mult = 5 }
labels[#labels + 1] = { t = "Simplified PID", x = x, y = inc.y(lineSpacing) }
fields[#fields + 1] = { t = "PID Tuning", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 2, vals = { 1 }, table = { [0] = "OFF", "RP", "RPY" } }
fields[#fields + 1] = { t = "Master Mult", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 200, vals = { 2 }, scale = 100, mult = 5 }
fields[#fields + 1] = { t = "PI Gain", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 200, vals = { 6 }, scale = 100, mult = 5 }
fields[#fields + 1] = { t = "D Gain", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 200, vals = { 5 }, scale = 100, mult = 5 }
fields[#fields + 1] = { t = "FF Gain", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 200, vals = { 8 }, scale = 100, mult = 5 }
fields[#fields + 1] = { t = "I Gain", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 200, vals = { 4 }, scale = 100, mult = 5 }
fields[#fields + 1] = { t = "D Max Gain", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 200, vals = { 7 }, scale = 100, mult = 5 }
fields[#fields + 1] = { t = "Pitch D Gain", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 200, vals = { 3 }, scale = 100, mult = 5 }
fields[#fields + 1] = { t = "Pitch PIF Gain", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 200, vals = { 9 }, scale = 100, mult = 5 }

labels[#labels + 1] = { t = "Simplified Filter", x = x, y = inc.y(lineSpacing) }
fields[#fields + 1] = { t = "Gyro Tuning", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 1, vals = { 9 }, table = { [0] = "OFF", "ON" } }
fields[#fields + 1] = { t = "Gyro Mult", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 50, max = 200, vals = { 10 }, scale = 100, mult = 5 }
fields[#fields + 1] = { t = "D Tuning", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 1, vals = { 11 }, table = { [0] = "OFF", "ON" } }
fields[#fields + 1] = { t = "D Mult", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 50, max = 200, vals = { 12 }, scale = 100, mult = 5 }
fields[#fields + 1] = { t = "Gyro Tuning", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 1, vals = { 12 }, table = { [0] = "OFF", "ON" } }
fields[#fields + 1] = { t = "Gyro Mult", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 200, vals = { 13 }, scale = 100, mult = 5 }
fields[#fields + 1] = { t = "D Tuning", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 1, vals = { 10 }, table = { [0] = "OFF", "ON" } }
fields[#fields + 1] = { t = "D Mult", x = x + indent, y = inc.y(lineSpacing), sp = x + sp, min = 0, max = 200, vals = { 11 }, scale = 100, mult = 5 }

return {
read = 140, -- MSP_SIMPLIFIED_TUNING
write = 141, -- MSP_SET_SIMPLIFIED_TUNING
title = "Simplified Tuning",
reboot = false,
eepromWrite = true,
minBytes = 12,
minBytes = 13,
labels = labels,
fields = fields,
}

0 comments on commit b75cd1d

Please sign in to comment.