Robotics Fundamentals 1, Chapter 1: Challenge 2 solution (loop rate and stopping distance) Formulas: T = 1 / f t(lat) = t(sensor) + T + t(compute) + t(actuator) d(react) = v x t(lat) d(brake) = v^2 / (2 a) d(stop) = d(react) + d(brake) (a) At v = 0.8 m/s, f = 25 Hz, a = 1.5 m/s^2: T = 1 / 25 = 0.040 s = 40 ms t(lat) = 25 + 40 + 5 + 30 = 100 ms = 0.100 s d(react) = 0.8 x 0.100 = 0.080 m = 80 mm d(brake) = 0.8^2 / (2 x 1.5) = 0.64 / 3 = 0.2133 m = 213 mm d(stop) = 0.080 + 0.2133 = 0.2933 m = 293 mm (b) Highest speed that stops within the sensor range of 0.5 m: v x 0.100 + v^2 / (2 x 1.5) = 0.5 -> v^2 / 3 + 0.1 v - 0.5 = 0 -> v^2 + 0.3 v - 1.5 = 0 Quadratic formula: v = ( -0.3 + sqrt(0.3^2 + 4 x 1.5) ) / 2 = ( -0.3 + sqrt(6.09) ) / 2 = ( -0.3 + 2.4678 ) / 2 = 1.084 m/s Check: 1.084 x 0.1 = 0.108 m; 1.084^2 / 3 = 0.392 m; total 0.500 m. With only half the range (0.25 m) as the margin: v^2 / 3 + 0.1 v - 0.25 = 0 -> v^2 + 0.3 v - 0.75 = 0 -> v = ( -0.3 + sqrt(0.09 + 3.0) ) / 2 = ( -0.3 + 1.7578 ) / 2 = 0.729 m/s So with a 2 times margin, the speed limit is about 0.73 m/s (0.8 m/s would be too fast). (c) At 100 Hz: T = 1 / 100 = 10 ms t(lat) = 25 + 10 + 5 + 30 = 70 ms = 0.070 s d(react) = 0.8 x 0.070 = 0.056 m = 56 mm d(stop) = 0.056 + 0.2133 = 0.2693 m = 269 mm The faster loop saves 293.3 - 269.3 = 24 mm of stopping distance. Compared with the braking distance of 213 mm, that is only 11 %, because the braking distance did not change. (d) First, slow down (or brake harder): the braking distance goes with the square of the speed and dominates, while a faster loop only trims the reaction part. A longer-range sensor would help too. Check on method: the braking distance uses v^2 / (2a), so halving the speed quarters it. A common slip is to treat the reaction and braking distances as both proportional to speed.