Skip to content

Commit d9f8c50

Browse files
committed
Add PID advanced features
1 parent c880e24 commit d9f8c50

13 files changed

+155
-74
lines changed

src/SCRIPTS/BF/HORUS/horuspre.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ PageFiles =
22
{
33
"pids1.lua",
44
"pids2.lua",
5-
"rates1.lua",
6-
"rates2.lua",
5+
"rates.lua",
6+
"pid_advanced.lua",
77
"filters.lua",
88
"pwm.lua",
99
"rx.lua",

src/SCRIPTS/BF/HORUS/pid_advanced.lua

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
return {
2+
read = 94, -- MSP_PID_ADVANCED
3+
write = 95, -- MSP_SET_PID_ADVANCED
4+
title = "PID Advanced",
5+
reboot = false,
6+
eepromWrite = true,
7+
minBytes = 46,
8+
outputBytes = 46,
9+
yMinLimit = 35,
10+
yMaxLimit = 215,
11+
text = {
12+
{ t = "Acro Trainer", x = 5, y = 35 },
13+
{ t = "Angle Limit", x = 15, y = 55, to = SMLSIZE },
14+
15+
{ t = "Throttle Boost", x = 5, y = 75 },
16+
{ t = "Absolute Control", x = 5, y = 95 },
17+
{ t = "I Term Rotation", x = 5, y = 115 },
18+
{ t = "VBAT Compensation", x = 5, y = 135 },
19+
20+
{ t = "I Term Relax", x = 5, y = 155 },
21+
{ t = "Axes", x = 15, y = 175, to = SMLSIZE },
22+
{ t = "Type", x = 15, y = 195, to = SMLSIZE },
23+
24+
{ t = "Integrated Yaw", x = 5, y = 215 },
25+
26+
{ t = "Anti Gravity", x = 5, y = 235 },
27+
{ t = "Mode", x = 15, y = 255, to = SMLSIZE },
28+
{ t = "Gain", x = 15, y = 275, to = SMLSIZE },
29+
{ t = "Threshold", x = 15, y = 295, to = SMLSIZE },
30+
},
31+
fields = {
32+
{ x = 200, y = 55, min = 20, max = 80, vals = { 32 } },
33+
34+
{ x = 200, y = 75, min = 0, max = 100, vals = { 31 } },
35+
{ x = 200, y = 95, min = 0, max = 20, vals = { 30 } },
36+
{ x = 200, y = 115, min = 0, max = 1, vals = { 26 }, table = { [0]="OFF", "ON" } },
37+
{ x = 200, y = 135, min = 0, max = 1, vals = { 8 }, table = { [0]="OFF", "ON" } },
38+
39+
{ x = 200, y = 175, min = 0, max = 4, vals = { 28 }, table = { [0]="NONE", "RP", "RPY", "RP (increment only)", "RPY (increment only)" } },
40+
{ x = 200, y = 195, min = 0, max = 1, vals = { 29 }, table = { [0]="Gyro", "Setpoint" } },
41+
42+
{ x = 200, y = 215, min = 0, max = 1, vals = { 45 }, table = { [0]="OFF", "ON" } },
43+
44+
{ x = 200, y = 255, min = 0, max = 1, vals = { 39 }, table = { [0]="Smooth", "Step" } },
45+
{ x = 200, y = 275, min = 1000, max = 30000, vals = { 22, 23 }, scale = 1000, mult = 100 },
46+
{ x = 200, y = 295, min = 20, max = 1000, vals = { 20, 21 } },
47+
}
48+
}

src/SCRIPTS/BF/HORUS/rates1.lua renamed to src/SCRIPTS/BF/HORUS/rates.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
return {
22
read = 111, -- MSP_RC_TUNING
33
write = 204, -- MSP_SET_RC_TUNING
4-
title = "Rates (1/2)",
4+
title = "Rates",
55
reboot = false,
66
eepromWrite = true,
77
minBytes = 12,
@@ -42,4 +42,4 @@ return {
4242
{ x = 416, y = 100, vals = { 6 } , min = 0, max = 100, scale = 100, to=MIDSIZE },
4343
{ x = 416, y = 150, vals = { 9, 10 }, min = 1000, max = 2000, to=MIDSIZE }
4444
},
45-
}
45+
}

src/SCRIPTS/BF/HORUS/rates2.lua

-23
This file was deleted.

src/SCRIPTS/BF/X7/pid_advanced.lua

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
return {
2+
read = 94, -- MSP_PID_ADVANCED
3+
write = 95, -- MSP_SET_PID_ADVANCED
4+
title = "PID Adv.",
5+
reboot = false,
6+
eepromWrite = true,
7+
minBytes = 46,
8+
outputBytes = 46,
9+
yMinLimit = 12,
10+
yMaxLimit = 52,
11+
text = {
12+
{ t = "Acro Trainer", x = 2, y = 12, to = SMLSIZE },
13+
{ t = "Angle Limit", x = 12, y = 20, to = SMLSIZE },
14+
15+
{ t = "Throttle Boost", x = 2, y = 28, to = SMLSIZE },
16+
{ t = "Absolute Control", x = 2, y = 36, to = SMLSIZE },
17+
{ t = "I Term Rotation", x = 2, y = 44, to = SMLSIZE },
18+
{ t = "VBAT Compensation", x = 2, y = 52, to = SMLSIZE },
19+
20+
{ t = "I Term Relax", x = 2, y = 60, to = SMLSIZE },
21+
{ t = "Axes", x = 12, y = 68, to = SMLSIZE },
22+
{ t = "Type", x = 12, y = 76, to = SMLSIZE },
23+
24+
{ t = "Integrated Yaw", x = 2, y = 84, to = SMLSIZE },
25+
26+
{ t = "Anti Gravity", x = 2, y = 92, to = SMLSIZE },
27+
{ t = "Mode", x = 12, y = 100, to = SMLSIZE },
28+
{ t = "Gain", x = 12, y = 108, to = SMLSIZE },
29+
{ t = "Threshold", x = 12, y = 116, to = SMLSIZE },
30+
},
31+
fields = {
32+
{ x = 87, y = 20, to=SMLSIZE, min = 20, max = 80, vals = { 32 } },
33+
34+
{ x = 87, y = 28, to=SMLSIZE, min = 0, max = 100, vals = { 31 } },
35+
{ x = 87, y = 36, to=SMLSIZE, min = 0, max = 20, vals = { 30 } },
36+
{ x = 87, y = 44, to=SMLSIZE, min = 0, max = 1, vals = { 26 }, table = { [0]="OFF", "ON" } },
37+
{ x = 87, y = 52, to=SMLSIZE, min = 0, max = 1, vals = { 8 }, table = { [0]="OFF", "ON" } },
38+
39+
{ x = 87, y = 68, to=SMLSIZE, min = 0, max = 4, vals = { 28 }, table = { [0]="NONE", "RP", "RPY", "RP (inc)", "RPY (inc)" } },
40+
{ x = 87, y = 76, to=SMLSIZE, min = 0, max = 1, vals = { 29 }, table = { [0]="Gyro", "Setpoint" } },
41+
42+
{ x = 87, y = 84, to=SMLSIZE, min = 0, max = 1, vals = { 45 }, table = { [0]="OFF", "ON" } },
43+
44+
{ x = 87, y = 100, to=SMLSIZE, min = 0, max = 1, vals = { 39 }, table = { [0]="Smooth", "Step" } },
45+
{ x = 87, y = 108, to=SMLSIZE, min = 1000, max = 30000, vals = { 22, 23 }, scale = 1000, mult = 100 },
46+
{ x = 87, y = 116, to=SMLSIZE, min = 20, max = 1000, vals = { 20, 21 } },
47+
}
48+
}

src/SCRIPTS/BF/X7/rates1.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
return {
22
read = 111, -- MSP_RC_TUNING
33
write = 204, -- MSP_SET_RC_TUNING
4-
title = "Rates (1/3)",
4+
title = "Rates (1/2)",
55
reboot = false,
66
eepromWrite = true,
77
minBytes = 12,

src/SCRIPTS/BF/X7/rates2.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
return {
22
read = 111, -- MSP_RC_TUNING
33
write = 204, -- MSP_SET_RC_TUNING
4-
title = "Rates (2/3)",
4+
title = "Rates (2/2)",
55
reboot = false,
66
eepromWrite = true,
77
minBytes = 12,

src/SCRIPTS/BF/X7/rates3.lua

-20
This file was deleted.

src/SCRIPTS/BF/X7/x7pre.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ PageFiles =
44
"pids2.lua",
55
"rates1.lua",
66
"rates2.lua",
7-
"rates3.lua",
7+
"pid_advanced.lua",
88
"filters1.lua",
99
"filters2.lua",
1010
"pwm.lua",

src/SCRIPTS/BF/X9/pid_advanced.lua

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
return {
2+
read = 94, -- MSP_PID_ADVANCED
3+
write = 95, -- MSP_SET_PID_ADVANCED
4+
title = "PID Advanced",
5+
reboot = false,
6+
eepromWrite = true,
7+
minBytes = 46,
8+
outputBytes = 46,
9+
yMinLimit = 12,
10+
yMaxLimit = 52,
11+
text = {
12+
{ t = "Acro Trainer", x = 2, y = 12, to = SMLSIZE },
13+
{ t = "Angle Limit", x = 12, y = 20, to = SMLSIZE },
14+
15+
{ t = "Throttle Boost", x = 2, y = 28, to = SMLSIZE },
16+
{ t = "Absolute Control", x = 2, y = 36, to = SMLSIZE },
17+
{ t = "I Term Rotation", x = 2, y = 44, to = SMLSIZE },
18+
{ t = "VBAT Compensation", x = 2, y = 52, to = SMLSIZE },
19+
20+
{ t = "I Term Relax", x = 2, y = 60, to = SMLSIZE },
21+
{ t = "Axes", x = 12, y = 68, to = SMLSIZE },
22+
{ t = "Type", x = 12, y = 76, to = SMLSIZE },
23+
24+
{ t = "Integrated Yaw", x = 2, y = 84, to = SMLSIZE },
25+
26+
{ t = "Anti Gravity", x = 2, y = 92, to = SMLSIZE },
27+
{ t = "Mode", x = 12, y = 100, to = SMLSIZE },
28+
{ t = "Gain", x = 12, y = 108, to = SMLSIZE },
29+
{ t = "Threshold", x = 12, y = 116, to = SMLSIZE },
30+
},
31+
fields = {
32+
{ x = 87, y = 20, to=SMLSIZE, min = 20, max = 80, vals = { 32 } },
33+
34+
{ x = 87, y = 28, to=SMLSIZE, min = 0, max = 100, vals = { 31 } },
35+
{ x = 87, y = 36, to=SMLSIZE, min = 0, max = 20, vals = { 30 } },
36+
{ x = 87, y = 44, to=SMLSIZE, min = 0, max = 1, vals = { 26 }, table = { [0]="OFF", "ON" } },
37+
{ x = 87, y = 52, to=SMLSIZE, min = 0, max = 1, vals = { 8 }, table = { [0]="OFF", "ON" } },
38+
39+
{ x = 87, y = 68, to=SMLSIZE, min = 0, max = 4, vals = { 28 }, table = { [0]="NONE", "RP", "RPY", "RP (increment only)", "RPY (increment only)" } },
40+
{ x = 87, y = 76, to=SMLSIZE, min = 0, max = 1, vals = { 29 }, table = { [0]="Gyro", "Setpoint" } },
41+
42+
{ x = 87, y = 84, to=SMLSIZE, min = 0, max = 1, vals = { 45 }, table = { [0]="OFF", "ON" } },
43+
44+
{ x = 87, y = 100, to=SMLSIZE, min = 0, max = 1, vals = { 39 }, table = { [0]="Smooth", "Step" } },
45+
{ x = 87, y = 108, to=SMLSIZE, min = 1000, max = 30000, vals = { 22, 23 }, scale = 1000, mult = 100 },
46+
{ x = 87, y = 116, to=SMLSIZE, min = 20, max = 1000, vals = { 20, 21 } },
47+
}
48+
}

src/SCRIPTS/BF/X9/rates1.lua renamed to src/SCRIPTS/BF/X9/rates.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
return {
22
read = 111, -- MSP_RC_TUNING
33
write = 204, -- MSP_SET_RC_TUNING
4-
title = "Rates (1/2)",
4+
title = "Rates",
55
reboot = false,
66
eepromWrite = true,
77
minBytes = 12,
@@ -42,4 +42,4 @@ return {
4242
{ x = 186, y = 31, vals = { 6 } , min = 0, max = 100, scale = 100, to = SMLSIZE },
4343
{ x = 186, y = 46, vals = { 9, 10 }, min = 1000, max = 2000, to = SMLSIZE },
4444
},
45-
}
45+
}

src/SCRIPTS/BF/X9/rates2.lua

-20
This file was deleted.

src/SCRIPTS/BF/X9/x9pre.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ PageFiles =
22
{
33
"pids1.lua",
44
"pids2.lua",
5-
"rates1.lua",
6-
"rates2.lua",
5+
"rates.lua",
6+
"pid_advanced.lua",
77
"filters.lua",
88
"pwm.lua",
99
"rx.lua",

0 commit comments

Comments
 (0)