Question about the application of SSC32U for Hexapod project

Hello All!

I have two questions about the SSC32u board used on my hexapod:

  1. I hooked up the SSC32U to the arduino mega. I calculate the angles using inversed kinematics and send these angles to the servos through the serial command between the arduino mega and SSC32U board. The problem is that I have multiple points, or we can say coordinates (can be up to 15 coordinates or more) for each leg in the swinging phase (swing the leg in the air) and supporting phase (legs support the load and push the body forward.) In order to achieve this, I put the angles (or we can say pulses) in the matrices and send them one by one to the servos. I used the code something like below:

for (int count=0; count<15; count++){
Serial.print("#0 P"); Serial.print(myMatrixOne[count], DEC); Serial.print("#1 P");Serial.print(myMatrixTwo[count],DEC);Serial.print("#2 P"); Serial.print(myMatrixThree[count],DEC); //For leg 1
Serial.print("#3 P"); Serial.print(myMatrixFout[count], DEC); Serial.print("#4 P");Serial.print(myMatrixFive[count],DEC);Serial.print("#5 P"); Serial.print(myMatrixSix[count],DEC); //For leg 2

`````````````` (similar to above)   //For leg 4
``````````````  (similar to above)  //For leg5
``````````````  (similar to above) // For leg6
Serial.println("T100");
}

I simplify the code a little bit but I think you know what I am doing above. In the "For loop" I assign 15 pulses to all the servos with only a small amount of increment using "commend group" (Ex: when count=0, #0 receive 1500 pulse, when count=1, #0 receives 1550 pulse, when count=2, #0 receives 1620 pulse....); And from each pulse to the next pulse I set the time to be 100 milli seconds to complete. After I upload the code, it works, the robot can move, but the leg behaves like shaking and trembling so obviously, it does not look continuous at all.

And now here comes the problem! I commend out five lines of code in the "for" loop above, just like below:

for (int count=0; count<15; count++){
Serial.print("#0 P"); Serial.print(myMatrixOne[count], DEC); Serial.print("#1 P");Serial.print(myMatrixTwo[count],DEC);Serial.print("#2 P"); Serial.print(myMatrixThree[count],DEC);    //For leg 1
//Serial.print("#3 P"); Serial.print(myMatrixFout[count], DEC); Serial.print("#4 P");Serial.print(myMatrixFive[count],DEC);Serial.print("#5 P"); Serial.print(myMatrixSix[count],DEC);    //For leg 2
//```````````````    (similar to above)    // For leg 3
//`````````````` (similar to above)   //For leg 4
//``````````````  (similar to above)  //For leg5
//``````````````  (similar to above) // For leg6
Serial.println("T100");
}

I keep only one line of code in the for loop, and then the corresponding servos move very fluently and I did not even change the amount of coordinates. All I did is just to commend out five lines of code.
So the problem is as the amount of servos I am trying to control, the more discontinuously servos will behave!!
Is there anything that I can fix this?? 
My guess is that the "commend group" does not actually move multiple servos at the same time! There are some tiny intervals between them. But I don't think the interval could be that big to cause the servos trembling. And there are only 18 servos. The SSC32U could be capable of controlling up to 32 servos without issues.

2. The second question is very simply. I am thinking power the 18 digital servos using 7.4V 3500mAh LiPo battery (I kinda forgot about the exact value of mAh, but I think it doesn't matter in this question). I have a step-down voltage regulator and I can regulate the 7.4V to 6V. It is ok for me to use this LiPo battery on the SSC32U through VS1 terminal ? I just wanna double check it won't burn anything on SSC32U board.

Thanks for any replies. I really need help!! Especially the first question!! Thanks!!

What you have most likely discovered is that the Arduino libraries for Serial are ridiculously slow at processing strings. Therefore, as you remove lines of multiple print commands, the process is done much faster and therefore the update to the SSC-32U is closer to instantaneous, thus providing a smoother output.

Well, sprintf would be a good start. Basically, create a string of all of your values first and then do a single Serial.println command afterwards. This will most likely improve the fluidity of the movement by removing the excess delay between all those print calls (2 per servo + 1 for timing).

The output has of course physical limitations and therefore the updates to the different outputs are not instantaneous (i.e.: there is a small delay). That being said, we are talking of µs of delay, so it should not matter much, either. The SSC-32U uses 4 bus driving chips (8 channels each) to produce the RC control signals to alleviate the issue of driving 32 outputs simultaneously. Therefore, the SSC-32U is completely capable of controlling 32 servos without issue.

Yes, that is fine. There are a few concerns though (and not really for the SSC-32U):

  1. Make sure your step-down voltage regulator can handle the current spikes of 18 servomotors.
  2. The SSC-32U will keep on draining power from your LiPo (through the regulator) even when it goes to a voltage that is too low. Therefore, make sure to monitor that to ensure not damaging your battery pack. You could always connect a voltage divider to the VS1 input and wire it’s output (must always be between 0-5 V DC, for a 2S, that means you won’t need to divide the voltage much since the pack cna provide at most 8.4 V DC when fully charged) to one of the analog input pins of the SSC-32U. That way, you can use it to read its input voltage so you can monitor it more easily.

As for #1, if you determine your voltage regulator cannot do all 18 properly (which may also be an issue for group moves, btw), you can always place a 2nd step-down voltage regulator on VS2 (connected to the same battery), divide your servomotors equally between VS1 and VS2 and remove the jumpers that are named VS1=VS2 on the corner of the board (near the screw terminals for VS2).

We hope this helps.

Sincerely,