Calculating the time needed to run a straight between two turns in the micromouse contest

When a micromouse robot is trying to determine the best path from start to goal, it is helpful to be able to calculate the amount of time it will take to run along the straight path that connects two turns. This is not an obviously simple calculation because there is the question of how fast the robot is travelling at the start and end of the straight, the available acceleration and the maximum speed limit.

Some simplifying assumptions will help a lot. First, assume that the start and end speed for the straight is the same That is, all turns are made at the same speed. Second, assume that the robot is always either accelerating or decelerating. That is, there is no top speed limit. For many actual straight section in the maze, that is likely to be the case. Finally, assume that the acceleration and deceleration is the same so that the straight run is symmetrical.

Orthogonal moves

The classical equations of motion give an expression for the time taken to move by a distance, s, if the acceleration, a, and start speed, u, are known (suvat-rearranged)

(1)   \[t = {1 \over a }({\sqrt{2as + u^2}-u)\]

Considering orthogonal moves first, the distance, s, can be expressed as some multiple, n, of the length of one cell, x.

(2)   \[s = nx\]

Substitute into (1) to get:

(3)   \[t = {1 \over a }({\sqrt{2anx + u^2}-u)\]

It is now convenient to specify the start speed, u, as some constant, k, times the distance through one cell.

    \[u = kx.mm/s\]

and the acceleration, a, as

    \[a = k^2x.mm/s/s\]

For example, for k = 10, a classic micromouse might be able to turn at 1800mm/s and accelerate at 18,000 mm/s/s.

Substituting into (2):

(4)   \[t = {1 \over k^2x }({\sqrt{2k^2x^2n + k^2x^2}-kx)\]

)

    \[t = {1 \over k^2x }(kx{\sqrt{2n + 1}-kx)\tag5}\]

(6)   \[t = {1 \over k }({\sqrt{2n + 1}-1)\]

Equation 6 describes the time taken to accelerate to some top speed over n cells. The micromouse robot will accelerate for half that number of cells and then brake for the remaining half. Split the motion into two parts:

    \[t = {1 \over k }(({\sqrt{n + 1}-1)+{\sqrt{n + 1}-1))\]

(7)   \[t = {2 \over k }({\sqrt{n + 1}-1)\]

This result is easily pre-calculated in a table of ({\sqrt{n + 1}-1) for suitable values of n and so it will be easy to determine the time needed to run any straight or arbitrary length with a simple multiply. Note that this only works because of the common factor, k, in the speed and acceleration.

Diagonals

For diagonal movements, each cell traversed is x/\sqrt{2} mm long and so the time is calculated from:

(8)   \[t = {2 \over k }({\sqrt{{n \over {\sqrt{2}}} + 1}-1)\]

Note that you cannot simply multiply the result from equation (7) by 1/\sqrt{2}.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.