Richard Greenway wrote:

> Cathy:

>

> I've been playing with the math a bit, and here is what I come up with.

>

> Worst case path around the maze, assuming that the wheels never turn

> backwards and subtract encoder position counts. (A long spiral.) I get a

> total length (Assuming that my outside wheel exactly traced the outside

> wall of

>

> 50760mm

>

> With my wheel diameter of 82.5mm

>

> means I need a to anticipate 616 Revolutions of the wheel.

>

> with a 141:1 gear ratio, that means

>

> 86856 revolutions of the motor.

>

> Assuming then a 16 count encoder. (I really should just find some time

> to hook this up and get a accurate count on the number of encoder

> positions.)

>

> That means I need to be able to hold

>

> 1,389,696 (+/-)

>

> Which won't fit in a signed 16bit, but will with lots of room in a

> signed 32bit accumulator.

>

> If it were a 512ct encoder

> then I would need to hold

>

> 44,470,272 counts

>

> Richard

>

While I have no idea where the origin of this calculation is, a

micromouse will, in general, reset its motion counters for each phase of

movement. Thus, you do not need a variable to hold the longest possible

continuous path. In any case, while exploring the mouse will revisit

many locations and the path traveled could easily exceed the distance

you show.

The longest distance you can travel in the maze is about 14 cells

diagonally. This is 14*180*1.414 mm. Call it 3.5m. My mouse has 45mm

diameter wheels, 4:1 gearing, 512 count encoders on the motors and X2

decoding to give about 28 counts per mm of travel. To run the diagonal

therefore, I only need to be able to hold values less than 100,000 counts.

I also find it convenient to use a fixed point value for distance to

make the sums with acceleration and velocity easy. Distances on the

mouse are stored as a 24.8 quantity.

Pete Harrison