Most Helpful Member
That's because it is using a number of "channel" times, some real and some dummy ones, to get to the total time before it repeats.If I'm correct, that the ENVELOPE is over 24ms,
The repeat time is not in any way critical; 20mS (50Hz) is a historical value, it's supposed to be somewhere around 40Hz to 200Hz repeat rate, so 5 - 25mS but that's not too critical with most servos.
Some do not like too high repeat rates and that can cause jitter.
If you want is slightly shorter, change this:
If index > 15 Then //15 * average 1.5mS = 22.5mS, a reasonable frame repeat time
eg. changing 15 to 12 would reduce the cycle duration by 4.5mS
It will vary with total length of the servo pulses at that exact instant, though. That's the cost of not having any separate reset timing system.
Use 14 instead of 15 if you want it just slightly faster.