@Okidoki has this math right — and you already know the distance between the cogs (the pitch, Pitch) because you have used an array modifier.
Here it is in a 5 images. First some simple (massive!) tracks. Note that I use a constant offset of 1.1,
Let’s assume you want 12 teeth (Z) on the cog. You have the circumference,
Circumference = Z * Pitch = 12 * 1.1 = 13.20
To find the radius,
C = 2 * pi * r
r = C / (2*pi) = 13.20 / 6.2832 = 2.10
Make a cog that fits the width of the tread slot. I’ve made a temporary array (using 1.1 constant offset). You should be able to overlay the track and the cogs will fit (sorry, didn’t take that image),
To setup for spinning, first remove the array modifier from the cog. Shift the cog to the origin and move it up 2.10. Note that the origin of the cog is centered at the base of the cog to make it easy to get it into position.
Now spin around the Y axis 12 steps. Remove doubles. Shift the origin to the center.
You have lots more work to do but this image shows that a gear wheel built this way will “roll” along the tracks.
To experiment with different size gears, the dimension of the cog doesn’t change, you just need to calculate the new radius based on the tooth count.