Hello All!
I have two questions about the SSC32u board used on my hexapod:
- 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!!