Well, I got a bit suspicious of how fast a spike trap can cycle given that a 140 tick repeater I made earlier didn't cycle the spikes at 140, but instead the spikes had a cycle of 280 ticks (this was on a single plate repeater). This morning I decided to bite the bullet and hook up a spike trap to a lever and then manually toggle the lever using the lever command in dfhack with the cheat option. When manually flipping the lever at 40 ticks, the spike trap only caught every 4th flip and toggled slowly... But when I manually toggled the lever every 41 ticks, it caught every toggle. So it looks like a spike trap will respond to a signal source either 40 or 41 ticks after the source sends it depending upon built order, but will at best only toggle every 41 ticks. With that said, here are the two repeaters I came up with last night and this morning ....
A three phase repeater with each pressure plate being activated exactly 47 ticks apart. A spike trap connected to all three plates will cycle every 94 ticks. The 4 track stops are all medium friction. The launcher at the bottom left corner isn't strictly part of the repeater and may be safely omitted if you wish to simply have a dwarf push a minecart instead.
A four phase repeater. A spike trap connected to all four plates will cycle every 82 ticks (the fastest possible speed). The impulse ramps at the top left, and bottom right corner are a N/S ramp where the cart enters the arrangement and then 2 N/E or S/W ramps. The two track stops are medium friction and once again, the launcher at the bottom left corner isn't strictly needed and you can instead have a dwarf push the minecart onto the repeater (if you do have a dwarf push a cart, I would suggest pushing towards the east onto the long E/W track segment at the very bottom, or pushing towards the west along the E/W segment at the very top. I'm injecting the minecart with my launcher further north than my suggestion because my launcher pushes a lot harder than a dwarf and by injecting further north, I take up less vertical space for the entire construction.) One word of warning on the four phase repeater. If you incorrectly introduce a minecart to it and it gets in the wrong phase with the spike trap, it will settle down into a steady state where the spike trap will cycle every 164 ticks. Definitely not what you want. I haven't personally seen that happen, but in any case, the pressure plate after either of the groups of impulse ramps
must be the first plate triggered when starting the repeater. As a little puzzle, it turns out that there are nine different arrangements of four pressure plates that will work. Any other arrangement will not permit the spike trap to have a 41/41 cycle. Can you figure out the other eight arrangements?
Build order is not critical. As long as the spike trap you're connecting to has been built before
any of the pressure plates, or after
all of the pressure plates have been built, then it will work fine.
Now to mention a happy coincidence. On the three phase repeater, if you connect a spike trap to only one pressure plate, it will have a 141 tick cycle which just happens to be the fastest possible cycle time for a single plate repeater. So with the above two repeaters, you actually have the three fastest possible repeaters with cycle times of 141, 94, and 82 ticks. Now about that hypothetical kobold that needs to be introduced to a set of spikes and how much it would cost to do that....
Assuming you want at least one encounter with a spike trap for a creature taking 7 ticks to move each tile.
141 cycle trap - takes 21 traps (210 spears, 42 mechanisms, 252 total)
94 cycle trap - takes 14 traps (140 spears, 84 mechanisms, 224 total)
82 cycle trap - takes 12 traps (120 spears, 96 mechanisms, 216 total)
Given that mechanisms are generally cheaper than spears (rock vs metal), the 82 cycle trap wins even though is uses the most mechanisms. If you're targeting a slower creature, the balance shifts slightly. For instance, sometime that takes 8 ticks/tile to move would require 18, 12, or 11 traps depending upon speed resulting in 216, 192, or 198 objects giving the advantage to the 94 tick repeater. As the speed of the creature goes down, the difference between the 94 tick and 82 tick spike traps converges to almost nothing.
In conclusion, I would suggest using the three phase repeater. For spike traps that aren't critical (danger rooms and the like), connect the spike trap to one of the pressure plates giving you a nice 141 cycle trap. For those areas more critical (you wish to maximize damage to a creature, have a relatively short corridor, etc), then connect all three plates to those traps.