Current chapter 11

This commit is contained in:
Danny Staple
2022-09-11 20:26:45 +01:00
parent df1d67e42d
commit 3c47ff9874
10 changed files with 30 additions and 41 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ class SpeedController:
current_ticks = self.encoder.read()
speed_in_ticks = (current_ticks - self.last_ticks) / dt
self.last_ticks = current_ticks
self.actual_speed = robot.ticks_to_mm(speed_in_ticks) / 1000
self.actual_speed = robot.ticks_to_m * speed_in_ticks
# calculate the error
error = (Settings.speed * Settings.motors_enabled) - self.actual_speed
# calculate the control signal