Dynamic Spike Calculator

Forward (→) and reverse (←) multiple spikes in Spikemark: what to type in, where they will go, and why.

Build a spike

Say which way to turn, how many times to pass the 0 mark, and where to stop. The calculator gives you the spike to type into Spikemark and shows where it will go from its starting position.

Already have a spike in Spikemark? Use Check my spike to type it in exactly as it is and see where it goes.

Forward = position numbers go up. Nearest = whichever way is shorter.

Check my spike

Type in the spike exactly as it is in Spikemark's spike list, and where the machine is when the cue loads. You'll see where it goes and whether it goes the way you expect.

Name
Type
Value
Factor
Offset

Work it out by hand

A dynamic spike doesn't store a position. Each time its cue is loaded, Spikemark works the position out again from where the machine is right then. The number in the spike list's Value column is only the last answer it got.

Two ideas make it easy:

  • Factor is the size of one repeat, or "period". For a turntable that's one turn: 360.
  • Offset says where to stop and how many extra turns to make: Offset = (N × Factor) + L, where L is where to stop inside the turn and N is how many times to pass the 0 mark. N is positive going forward and negative going in reverse.
In this example the turntable is not sitting at a tidy number. It's at −417.6, which is more than a turn below zero, so the dial shows 302.4°. We want it to go in reverse, pass the 0 mark twice, and stop at 135°.
  1. Where are we? Find the turn and the angle

    Divide the position by the Factor and round down, toward minus infinity. That's the turn number k. What's left over is the angle you'd see on the dial.

    k = round down( P ÷ Factor ) = round down( −417.6 ÷ 360 ) = round down( −1.16 ) = −2 (rounding down from −1.16 goes to −2, not −1) start of this turn = k × Factor = −2 × 360 = −720 angle on the dial = P − (k × Factor) = −417.6 − (−720) = 302.4°
  2. Choose the Offset

    Reverse means N is negative: passing the 0 mark twice is N = −2. Stop at L = 135.

    Offset = (N × Factor) + L = (−2 × 360) + 135 = −720 + 135 = −585

    The spike to type into Spikemark is: Reverse multiple, Factor 360, Offset −585.

  3. First try: this turn plus the Offset

    Spikemark adds the Offset to the start of the current turn:

    try 1 = (k × Factor) + Offset = (−2 × 360) + (−585) = −720 − 585 = −1305
  4. Is it on the right side?

    A reverse spike must end up below where it starts, and a forward one above.

    Reverse: is −1305 below −417.6? Yes → Value = −1305 (If it weren't, Spikemark would take one more Factor off: try 2 = try 1 − Factor. Going forward it adds one: try 2 = try 1 + Factor.)
  5. Check the answer

    distance = −417.6 − (−1305) = 887.4° in reverse 0 marks passed: −720 and −1080 → 2 passes ✔ where it stops: −1305 − (round down(−1305 ÷ 360) × 360) = −1305 − (−4 × 360) = −1305 + 1440 = 135° ✔
  6. Same move from anywhere

    That's the point of a dynamic spike. Run the same spike (reverse, 360, −585) from other places and it always passes the 0 mark twice and stops at 135°. The distance depends on whether the start angle is past 135° or not:

The same thing going forward

From the same start (−417.6), go forward, pass the 0 mark twice, and stop at 135°:

Offset = (N × Factor) + L = (2 × 360) + 135 = 855 → Forward multiple, Factor 360, Offset 855 try 1 = (k × Factor) + Offset = (−2 × 360) + 855 = −720 + 855 = 135 Forward: is 135 above −417.6? Yes → Value = 135 0 marks passed: −360 and 0 → 2 passes ✔ stops at 135° ✔ distance 552.6° forward

Short version

1. k = round down( Position ÷ Factor ) 2. Offset = (N × Factor) + L N = passes of the 0 mark: + forward, − reverse 3. try = (k × Factor) + Offset 4. Reverse: if try is not below Position → try − Factor Forward: if try is not above Position → try + Factor 5. Destination Target Position = try (Spikemark shows it in the Value column)

"Not below" and "not above" include landing within the motor's Target Tolerance of where it already is: it doesn't count a spike it's already sitting on.

Troubleshooting

These came out of real support cases and testing. Use the Check my spike tab to try any of them.

The spike goes the wrong way (a reverse spike goes forward, or the other way round)

Cause: the Offset's sign doesn't match the spike's direction. This usually happens when a spike is switched between Forward and Reverse and the Offset isn't changed to match.

Example: Reverse multiple, Factor 360, Offset 810, from 25:

k = round down(25 ÷ 360) = 0 try 1 = (0 × 360) + 810 = 810 not below 25 → take one Factor off try 2 = 810 − 360 = 450 still not below 25! Value = 450 → the "reverse" spike drives FORWARD 425°

810 is (2 × 360) + 90, which is the forward recipe. For reverse, N has to be negative: (−2 × 360) + 90 = −630.

Reverse, 360, −630 from 25: try 1 = (0 × 360) − 630 = −630 below 25 ✔ → Value −630 (passes 0 and −360, stops at 90°) Forward, 360, 810 from 25: try 1 = (0 × 360) + 810 = 810 above 25 ✔ → Value 810 (passes 360 and 720, stops at 90°)

Rule: a reverse spike needs an Offset below its Factor, which is negative for extra turns. A forward spike needs an Offset of 0 or more. Also check the spike's name matches its type: in one test a spike named "CW" had been set to Reverse, and the "CCW" one to Forward.

In the log: the move says Running … (fwd target) or (rev target). A reverse spike whose move says fwd target has the wrong sign.

The Value column keeps changing

That's normal. The Value column shows the last time Spikemark worked the spike out: when the show was opened, when the spike was edited, or when its cue was loaded. Each time, it starts from wherever the machine was then. The value saved in the show file is ignored when the show opens.

It turns fewer times than expected (e.g. 120° instead of 4⅓ turns)

Cause: the extra turns were put in the Factor instead of the Offset. A forward or reverse multiple never adds turns of its own. It goes to the nearest stop in its direction, and the stops are every Factor apart.

Example: Reverse, Factor 1440, Offset 120, from +240. The stops are …, −1320, 120, 1560, … and the nearest one below 240 is 120, so it only turns 120°.

Fix: keep the Factor at one turn and put the turns in the Offset: Reverse, Factor 360, Offset −1320 ((−4 × 360) + 120). From 240 that's (0 × 360) − 1320 = −1320, so 1560° in reverse.

A bigger Factor does reach a far-away target from one particular start, but its stops are at fixed positions, so from somewhere else it does a different move. That isn't what a dynamic spike is for. If the cue always starts from the same place, a simple spike is easier.

It worked in the simulator (or after homing) but not when running the show

The spike is worked out from where the machine is when the cue loads. Testing a cue on its own, often from 0 after opening the show, starts it from a different place than running the cues in order. Run the cues in order in the simulator from where the show really starts, and watch where each one goes.

It makes an extra turn when the cue is loaded while the machine is still moving

If a cue is loaded while the motor is moving, and the spike's stop is too close to slow down in time with the cue's deceleration, Spikemark moves the stop one more Factor along so it has room to stop.

A forward spike goes backward when the machine is exactly on a multiple

With a negative Offset on a forward spike, starting exactly on a multiple of the Factor (e.g. exactly 0 or 720), Spikemark can pick a stop behind the machine. Example: at exactly 0, Forward, Factor 720, Offset −360 goes to −360. Keep forward Offsets at 0 or more and this can't happen.

After a multi-turn cue, the next cue unwinds all the turns

After several turns the position number is far from 0 (e.g. −3240). A simple spike like "Zero = 0" then drives all the way back. Either reset the position at a known point, or use dynamic spikes for the cues after the multi-turn moves.

Checklist
  1. Factor = one turn (360) unless the machine repeats on a different period.
  2. Offset = (N × Factor) + L, with N negative for reverse.
  3. Reverse Offset below the Factor, forward Offset 0 or more.
  4. The spike's name matches its type (CW/CCW).
  5. Test from a few different starting positions: it should pass 0 the same number of times and stop at the same angle each time.
  6. Run the cue list in order in the simulator from the show's real starting point.