Skip to content

Commit

Permalink
Merge pull request #212 from klutvott123/add-throttle-limit
Browse files Browse the repository at this point in the history
Add throttle limit
  • Loading branch information
mikeller authored Apr 19, 2019
2 parents 138f8b3 + 6bd0fc0 commit bbb244d
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 143 deletions.
91 changes: 48 additions & 43 deletions src/SCRIPTS/BF/HORUS/rates.lua
Original file line number Diff line number Diff line change
@@ -1,45 +1,50 @@
return {
read = 111, -- MSP_RC_TUNING
write = 204, -- MSP_SET_RC_TUNING
title = "Rates",
reboot = false,
eepromWrite = true,
minBytes = 12,
text = {
{ t = "RC", x = 100, y = 52 },
{ t = "Rate", x = 94, y = 70 },
{ t = "Super", x = 148, y = 52 },
{ t = "Rate", x = 152, y = 70 },
{ t = "RC", x = 214, y = 52 },
{ t = "Expo", x = 207, y = 70 },
{ t = "Throttle", x = 288, y = 68 },
{ t = "Mid", x = 288, y = 100 },
{ t = "Exp", x = 288, y = 150 },
{ t = "TPA", x = 374, y = 68 },
{ t = "Thr", x = 374, y = 100 },
{ t = "Brk", x = 374, y = 150 },
{ t = "ROLL", x = 28, y = 100 },
{ t = "PITCH", x = 28, y = 150 },
{ t = "YAW", x = 28, y = 200 },
},
fields = {
-- RC Rates
{ x = 102, y = 125, vals = { 1 }, min = 0, max = 255, scale = 100, to=MIDSIZE },
{ x = 102, y = 150, vals = { 13 }, min = 0, max = 255, scale = 100, to=MIDSIZE },
{ x = 102, y = 200, vals = { 12 }, min = 0, max = 255, scale = 100, to=MIDSIZE },
-- Super Rates
{ x = 158, y = 100, vals = { 3 }, min = 0, max = 100, scale = 100, to=MIDSIZE },
{ x = 158, y = 150, vals = { 4 }, min = 0, max = 100, scale = 100, to=MIDSIZE },
{ x = 158, y = 200, vals = { 5 }, min = 0, max = 255, scale = 100, to=MIDSIZE },
-- RC Expo
{ x = 216, y = 125, vals = { 2 }, min = 0, max = 100, scale = 100, to=MIDSIZE },
{ x = 216, y = 150, vals = { 14 }, min = 0, max = 100, scale = 100, to=MIDSIZE },
{ x = 216, y = 200, vals = { 11 }, min = 0, max = 100, scale = 100, to=MIDSIZE },
-- Throttle
{ x = 330, y = 100, vals = { 7 }, min = 0, max = 100, scale = 100, to=MIDSIZE },
{ x = 330, y = 150, vals = { 8 }, min = 0, max = 100, scale = 100, to=MIDSIZE },
-- TPA
{ x = 416, y = 100, vals = { 6 } , min = 0, max = 100, scale = 100, to=MIDSIZE },
{ x = 416, y = 150, vals = { 9, 10 }, min = 1000, max = 2000, to=MIDSIZE }
},
read = 111, -- MSP_RC_TUNING
write = 204, -- MSP_SET_RC_TUNING
title = "Rates",
reboot = false,
eepromWrite = true,
minBytes = 16,
text = {
{ t = "RC", x = 100, y = 52 },
{ t = "Rate", x = 94, y = 70 },
{ t = "Super", x = 148, y = 52 },
{ t = "Rate", x = 152, y = 70 },
{ t = "RC", x = 214, y = 52 },
{ t = "Expo", x = 207, y = 70 },
{ t = "ROLL", x = 28, y = 100 },
{ t = "PITCH", x = 28, y = 150 },
{ t = "YAW", x = 28, y = 200 },

{ t = "Throttle", x = 290, y = 60 },
{ t = "Mid", x = 300, y = 80, to = SMLSIZE },
{ t = "Expo", x = 300, y = 100, to = SMLSIZE },
{ t = "Limit Type", x = 300, y = 120, to = SMLSIZE },
{ t = "Limit %", x = 300, y = 140, to = SMLSIZE },
{ t = "TPA", x = 290, y = 160 },
{ t = "Rate", x = 300, y = 180, to = SMLSIZE },
{ t = "Breakpoint", x = 300, y = 200, to = SMLSIZE },
},
fields = {
-- RC Rates
{ x = 102, y = 100, vals = { 1 }, min = 0, max = 255, scale = 100, to = MIDSIZE },
{ x = 102, y = 150, vals = { 13 }, min = 0, max = 255, scale = 100, to = MIDSIZE },
{ x = 102, y = 200, vals = { 12 }, min = 0, max = 255, scale = 100, to = MIDSIZE },
-- Super Rates
{ x = 158, y = 100, vals = { 3 }, min = 0, max = 100, scale = 100, to = MIDSIZE },
{ x = 158, y = 150, vals = { 4 }, min = 0, max = 100, scale = 100, to = MIDSIZE },
{ x = 158, y = 200, vals = { 5 }, min = 0, max = 255, scale = 100, to = MIDSIZE },
-- RC Expo
{ x = 216, y = 100, vals = { 2 }, min = 0, max = 100, scale = 100, to = MIDSIZE },
{ x = 216, y = 150, vals = { 14 }, min = 0, max = 100, scale = 100, to = MIDSIZE },
{ x = 216, y = 200, vals = { 11 }, min = 0, max = 100, scale = 100, to = MIDSIZE },
-- Throttle
{ x = 390, y = 80, vals = { 7 }, min = 0, max = 100, scale = 100 },
{ x = 390, y = 100, vals = { 8 }, min = 0, max = 100, scale = 100 },
{ x = 390, y = 120, vals = { 15 }, min = 0, max = 2, table = { [0] = "OFF", "SCALE", "CLIP" } },
{ x = 390, y = 140, vals = { 16 }, min = 25, max = 100 },
-- TPA
{ x = 390, y = 180, vals = { 6 }, min = 0, max = 100, scale = 100 },
{ x = 390, y = 200, vals = { 9, 10 }, min = 1000, max = 2000 },
},
}
52 changes: 52 additions & 0 deletions src/SCRIPTS/BF/X7/rates.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
return {
read = 111, -- MSP_RC_TUNING
write = 204, -- MSP_SET_RC_TUNING
title = "Rates",
reboot = false,
eepromWrite = true,
minBytes = 16,
yMinLimit = 11,
yMaxLimit = 52,
text = {
{ t = "RC", x = 43, y = 11, to = SMLSIZE },
{ t = "Rate", x = 38, y = 18, to = SMLSIZE },
{ t = "Super", x = 63, y = 11, to = SMLSIZE },
{ t = "Rate", x = 66, y = 18, to = SMLSIZE },
{ t = "RC", x = 99, y = 11, to = SMLSIZE },
{ t = "Expo", x = 94, y = 18, to = SMLSIZE },
{ t = "ROLL", x = 10, y = 26, to = SMLSIZE },
{ t = "PITCH", x = 10, y = 36, to = SMLSIZE },
{ t = "YAW", x = 10, y = 46, to = SMLSIZE },

{ t = "Throttle", x = 10, y = 60, to = SMLSIZE },
{ t = "Mid", x = 20, y = 68, to = SMLSIZE },
{ t = "Expo", x = 20, y = 76, to = SMLSIZE },
{ t = "Limit Type", x = 20, y = 84, to = SMLSIZE },
{ t = "Limit %", x = 20, y = 92, to = SMLSIZE },
{ t = "TPA", x = 10, y = 100, to = SMLSIZE },
{ t = "Rate", x = 20, y = 108, to = SMLSIZE },
{ t = "Breakpoint", x = 20, y = 116, to = SMLSIZE },
},
fields = {
-- RC Rates
{ x = 39, y = 26, vals = { 1 }, min = 0, max = 255, scale = 100, to = SMLSIZE },
{ x = 39, y = 36, vals = { 13 }, min = 0, max = 255, scale = 100, to = SMLSIZE },
{ x = 39, y = 46, vals = { 12 }, min = 0, max = 255, scale = 100, to = SMLSIZE },
-- Super Rates
{ x = 66, y = 26, vals = { 3 }, min = 0, max = 100, scale = 100, to = SMLSIZE },
{ x = 66, y = 36, vals = { 4 }, min = 0, max = 100, scale = 100, to = SMLSIZE },
{ x = 66, y = 46, vals = { 5 }, min = 0, max = 255, scale = 100, to = SMLSIZE },
-- RC Expo
{ x = 94, y = 26, vals = { 2 }, min = 0, max = 100, scale = 100, to = SMLSIZE },
{ x = 94, y = 36, vals = { 14 }, min = 0, max = 100, scale = 100, to = SMLSIZE },
{ x = 94, y = 46, vals = { 11 }, min = 0, max = 100, scale = 100, to = SMLSIZE },
-- Throttle
{ x = 70, y = 68, vals = { 7 }, min = 0, max = 100, scale = 100, to = SMLSIZE },
{ x = 70, y = 76, vals = { 8 }, min = 0, max = 100, scale = 100, to = SMLSIZE },
{ x = 70, y = 84, vals = { 15 }, min = 0, max = 2, to = SMLSIZE, table = { [0] = "OFF", "SCALE", "CLIP" } },
{ x = 70, y = 92, vals = { 16 }, min = 25, max = 100, to = SMLSIZE },
-- TPA
{ x = 70, y = 108, vals = { 6 } , min = 0, max = 100, scale = 100, to = SMLSIZE },
{ x = 70, y = 116, vals = { 9, 10 }, min = 1000, max = 2000, to = SMLSIZE },
},
}
33 changes: 0 additions & 33 deletions src/SCRIPTS/BF/X7/rates1.lua

This file was deleted.

22 changes: 0 additions & 22 deletions src/SCRIPTS/BF/X7/rates2.lua

This file was deleted.

3 changes: 1 addition & 2 deletions src/SCRIPTS/BF/X7/x7pre.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ PageFiles =
{
"pids1.lua",
"pids2.lua",
"rates1.lua",
"rates2.lua",
"rates.lua",
"pid_advanced.lua",
"filters.lua",
"pwm.lua",
Expand Down
93 changes: 50 additions & 43 deletions src/SCRIPTS/BF/X9/rates.lua
Original file line number Diff line number Diff line change
@@ -1,45 +1,52 @@
return {
read = 111, -- MSP_RC_TUNING
write = 204, -- MSP_SET_RC_TUNING
title = "Rates",
reboot = false,
eepromWrite = true,
minBytes = 12,
text = {
{ t = "RC", x = 43, y = 11, to = SMLSIZE },
{ t = "Rate", x = 38, y = 18, to = SMLSIZE },
{ t = "Super", x = 63, y = 11, to = SMLSIZE },
{ t = "Rate", x = 66, y = 18, to = SMLSIZE },
{ t = "RC", x = 99, y = 11, to = SMLSIZE },
{ t = "Expo", x = 94, y = 18, to = SMLSIZE },
{ t = "Throttle", x = 126, y = 18, to = SMLSIZE },
{ t = "Mid", x = 126, y = 31, to = SMLSIZE },
{ t = "Exp", x = 126, y = 46, to = SMLSIZE },
{ t = "TPA", x = 186, y = 18, to = SMLSIZE },
{ t = "Thr", x = 168, y = 31, to = SMLSIZE },
{ t = "Brk", x = 168, y = 46, to = SMLSIZE },
{ t = "ROLL", x = 8, y = 26, to = SMLSIZE },
{ t = "PITCH", x = 8, y = 36, to = SMLSIZE },
{ t = "YAW", x = 8, y = 46, to = SMLSIZE },
},
fields = {
-- RC Rates
{ x = 39, y = 26, vals = { 1 }, min = 0, max = 255, scale = 100, to = SMLSIZE },
{ x = 39, y = 36, vals = { 13 }, min = 0, max = 255, scale = 100, to = SMLSIZE },
{ x = 39, y = 46, vals = { 12 }, min = 0, max = 255, scale = 100, to = SMLSIZE },
-- Super Rates
{ x = 66, y = 26, vals = { 3 }, min = 0, max = 100, scale = 100, to = SMLSIZE },
{ x = 66, y = 36, vals = { 4 }, min = 0, max = 100, scale = 100, to = SMLSIZE },
{ x = 66, y = 46, vals = { 5 }, min = 0, max = 255, scale = 100, to = SMLSIZE },
-- RC Expo
{ x = 94, y = 26, vals = { 2 }, min = 0, max = 100, scale = 100, to = SMLSIZE },
{ x = 94, y = 36, vals = { 14 }, min = 0, max = 100, scale = 100, to = SMLSIZE },
{ x = 94, y = 46, vals = { 11 }, min = 0, max = 100, scale = 100, to = SMLSIZE },
-- Throttle
{ x = 144, y = 31, vals = { 7 }, min = 0, max = 100, scale = 100, to = SMLSIZE },
{ x = 144, y = 46, vals = { 8 }, min = 0, max = 100, scale = 100, to = SMLSIZE },
-- TPA
{ x = 186, y = 31, vals = { 6 } , min = 0, max = 100, scale = 100, to = SMLSIZE },
{ x = 186, y = 46, vals = { 9, 10 }, min = 1000, max = 2000, to = SMLSIZE },
},
read = 111, -- MSP_RC_TUNING
write = 204, -- MSP_SET_RC_TUNING
title = "Rates",
reboot = false,
eepromWrite = true,
minBytes = 16,
yMinLimit = 11,
yMaxLimit = 52,
text = {
{ t = "RC", x = 43, y = 11, to = SMLSIZE },
{ t = "Rate", x = 38, y = 18, to = SMLSIZE },
{ t = "Super", x = 63, y = 11, to = SMLSIZE },
{ t = "Rate", x = 66, y = 18, to = SMLSIZE },
{ t = "RC", x = 99, y = 11, to = SMLSIZE },
{ t = "Expo", x = 94, y = 18, to = SMLSIZE },
{ t = "ROLL", x = 8, y = 26, to = SMLSIZE },
{ t = "PITCH", x = 8, y = 36, to = SMLSIZE },
{ t = "YAW", x = 8, y = 46, to = SMLSIZE },

{ t = "Throttle", x = 120, y = 12, to = SMLSIZE },
{ t = "Mid", x = 130, y = 20, to = SMLSIZE },
{ t = "Expo", x = 130, y = 28, to = SMLSIZE },
{ t = "Limit Type", x = 130, y = 36, to = SMLSIZE },
{ t = "Limit %", x = 130, y = 44, to = SMLSIZE },
{ t = "TPA", x = 120, y = 52, to = SMLSIZE },
{ t = "Rate", x = 130, y = 60, to = SMLSIZE },
{ t = "Breakpoint", x = 130, y = 68, to = SMLSIZE },
},
fields = {
-- RC Rates
{ x = 39, y = 26, vals = { 1 }, min = 0, max = 255, scale = 100, to = SMLSIZE },
{ x = 39, y = 36, vals = { 13 }, min = 0, max = 255, scale = 100, to = SMLSIZE },
{ x = 39, y = 46, vals = { 12 }, min = 0, max = 255, scale = 100, to = SMLSIZE },
-- Super Rates
{ x = 66, y = 26, vals = { 3 }, min = 0, max = 100, scale = 100, to = SMLSIZE },
{ x = 66, y = 36, vals = { 4 }, min = 0, max = 100, scale = 100, to = SMLSIZE },
{ x = 66, y = 46, vals = { 5 }, min = 0, max = 255, scale = 100, to = SMLSIZE },
-- RC Expo
{ x = 94, y = 26, vals = { 2 }, min = 0, max = 100, scale = 100, to = SMLSIZE },
{ x = 94, y = 36, vals = { 14 }, min = 0, max = 100, scale = 100, to = SMLSIZE },
{ x = 94, y = 46, vals = { 11 }, min = 0, max = 100, scale = 100, to = SMLSIZE },
-- Throttle
{ x = 180, y = 20, vals = { 7 }, min = 0, max = 100, scale = 100, to = SMLSIZE },
{ x = 180, y = 28, vals = { 8 }, min = 0, max = 100, scale = 100, to = SMLSIZE },
{ x = 180, y = 36, vals = { 15 }, min = 0, max = 2, to = SMLSIZE, table = { [0] = "OFF", "SCALE", "CLIP" } },
{ x = 180, y = 44, vals = { 16 }, min = 25, max = 100, to = SMLSIZE },
-- TPA
{ x = 180, y = 60, vals = { 6 } , min = 0, max = 100, scale = 100, to = SMLSIZE },
{ x = 180, y = 68, vals = { 9, 10 }, min = 1000, max = 2000, to = SMLSIZE },
},
}

0 comments on commit bbb244d

Please sign in to comment.