OK, I think I know what the problem is. It is related to the algorithm for making the first move when a sequence is started. I tried to be clever and ended up causing this issue.
In the sequence with the problem, step 35 and step 0 have almost exactly the same servo positions. In moving from step 35 to step 0, only 6 servos move and they only move by 1us each. In other words, the total move “distance” is 6 (the sum of the move distance of all the servos). The move time is 300ms. This tells the SSC-32 that the intention is for this step to proceed slowly in terms of servo speed.
When the sequence is started, the SSC-32 adds up the total move distance from the current servo positions to the target position. It then uses this number, combined with the total move distance and move time from the sequence, to determine the move time to the start position. The equation for move time is
==> t = seq_move_time * actual_distance / seq_distance
where
==> t = move time
==> seq_move_time = total move time from the sequence
==> seq_distance = total move distance from the sequence
==> actual_distance = total move distance from current position to start position
For example, suppose the servos are at the positions of step 35, except that servo 0 is at 1620 (the sequence has #0 at 1500 in step 35). Then we would have
==> seq_move_time = 300
==> seq_distance = 6 (6 servos move 1us each)
==> actual_distance = 126 (#0 needs to move 120, 6 other servos need to move 1 each)
and the calculated move time would be
==> t = 300 * 126 / 6 = 6300ms = 6.3 seconds
Thus, there would be a 6.3 second move at the start of the sequence as the servos got to their initial position. Now suppose that several servos are away from the step 0 position. The startup move time would be very large. The SSC-32 limits the startup move time to 60 seconds, and the QPL command can only return up to 25.5 seconds.
To illustrate this, try the following commands:
SQ6 IX35 (goto step 35)
PL0 SQ6 (start the sequence, plays with no pause)
SQ6 IX35
#0 P1620 (move servo 0 to 120 away from start position)
PL0 SQ6 (approx 6 second delay as servo 0 slowly moves to position)
SQ6 IX35
#0 P2000 (move servo 0 to 2000 away from start position)
PL0 SQ6 (approx 25 second delay as servo 0 slowly moves to position)
(In the last example, 300 * 2006 / 6 = 25300ms = 25.3 seconds.)
The calculation that is causing trouble when starting sequences is actually very useful during a sequence, when changing the speed. It does a good job of estimating the time to complete a move at the new speed. But I shouldn’t have used it for starting a sequence.
So, in summary, I think I know what the problem is. But I am not sure of the best way to resolve it. This post is getting long, so I will follow up with another post asking about how the time should be calculated for the initial move when starting a sequence.
Mike