Skip to content

Commit 55a446f

Browse files
committed
Retuned Tune
1 parent 49ec83a commit 55a446f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

XRPLib/differential_drive.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,18 +235,21 @@ def turn(self, turn_degrees: float, max_speed: float = 40, timeout: float = None
235235

236236
if main_controller is None:
237237
main_controller = PID(
238-
kp = .015,
239-
kd = 0.0012,
240-
minOutput = 0.25,
241-
maxOutput = max_speed,
238+
kp = 0.02,
239+
ki = 0.005,
240+
kd = 0.012,
241+
minOutput = 0.35,
242+
maxOutput = 0.5,
243+
maxDerivative = 0.5,
244+
maxIntegral = 50,
242245
tolerance = 0.5,
243-
toleranceCount = 3
246+
toleranceCount = 2
244247
)
245248

246249
# Secondary controller to keep encoder values in sync
247250
if secondary_controller is None:
248251
secondary_controller = PID(
249-
kp = 0.0175,
252+
kp = 1,
250253
)
251254

252255
if use_imu and (self.imu is not None):

0 commit comments

Comments
 (0)