Skip to content

Commit d60688e

Browse files
committed
Tuned PID for LineFollow
1 parent cb3b9c2 commit d60688e

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

FLLMaster/DriveLibraries.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class Robot:
1010
from ev3dev2.button import Button
1111
from ev3dev2.led import Leds, LED_COLORS, LED_DEFAULT_COLOR, LED_GROUPS, LEDS
1212
import math
13+
import time
1314

1415
def __init__(self, filename):
1516
from configparser import SafeConfigParser

FLLMaster/Main.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,16 @@
1313
# Write Code Here ----------------------------------------
1414

1515
def left(state):
16-
if state:
17-
R1.kpLine = R1.kpLine - 0.01
18-
print(R1.kpLine)
19-
16+
pass
2017
def right(state):
21-
if state:
22-
R1.kpLine = R1.kpLine + 0.01
23-
print(R1.kpLine)
24-
18+
pass
2519
def up(state):
2620
pass
2721
def down(state):
2822
pass
2923
def enter(state):
3024
if state:
31-
R1.LineFollow(50, 20, True)
25+
R1.DriveAtHeading(0, 50, 50, True)
3226
def backspace(state):
3327
pass
3428

FLLMaster/robot.cfg

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ GyroPort=INPUT_2
1616
InfraredPort=INPUT_4
1717
TouchPort= 0
1818
UltrasonicPort=INPUT_3
19-
kpLine = 0.5
20-
kiLine = 0.01
21-
kdLine = 0.5
19+
kpLine = 0.45
20+
kiLine = 0.01163
21+
kdLine = 2.528
2222

2323
[AuxMotors]
2424
AuxMotor1 = 0
2525
AuxMotor2 = 0
2626

2727
[Other]
28-
ForFLL = TRUE
28+
ForFLL = TRUE
29+
ku = 0.4
30+
tu = 60.1923

0 commit comments

Comments
 (0)