Serial overload with group move?

Hello.
I am controlling 30 servo from a single ssc32. I can easily control each servo with discrete commands
like

#1P1500
#2P1500

But I have to command 30 servos at the same time. thus, I used a group command.

#0P1500#1P1200#2P1000(…)#29P800

the first command grouping 30 different pulses works perfectly, but the next ones seem to overload the serial port, is this possible?
I tried to update the 30 pulses group command every 30ms… but the steppers went erratic or did not answer
I had to delay commands every 400 ms but looses smooth moves
If someone could help me with this issue, I would be glad.
Thanks

Can you send us the full versions of both the first (the one that works) and second (the one that doesn’t) commands so we can examine them further? I wonder if the second would happen to be longer than the first, and possibly larger than the serial RX buffer…

Not enough information here to get an idea of what is going on. What are you using to send the commands to the SSC-32? PC? Microcontroller? As Jeffrey mentioned would help to see the actual code to know what is going on.

I strongly doubt that you are overflowing any buffer on the SSC-32. It simply takes each byte as it comes along and parses it sets values into memory that it uses when it receives the to start the actual move…

But may be a max buffer issue on the sending side, or could be other issues.
Kurt

Hello, thanks for your reply.
the 1st one is a group move with a position for 30 servos:

#17P1375T330#18P1850T330#9P1375T330#10P1850T330#13P1375T330#14P1850T330#11P1375T330#12P1850T330#5P1375T330#6P1850T330#1P1375T330#2P1850T330#21P1375T330#22P1850T330#19P1375T330#20P1850T330#3P1375T330#4P1850T330#27P1375T330#28P1850T330#23P1375T330#24P1850T330#15P1375T330#16P1850T330#7P1375T330#8P1850T330

followed by a carriage return…

The following commands are the same length but with updated positions.
These following commands are executed a few seconds later ( maybe 4 or 5 s) , while I 'm not sending any new command. my software sometimes freezes…
It seem to be a bottleneck somewhere…

I am using vvvv to translate this to ascii.
I am quite new to serial communication. Is the serial RX buffer possible issue on the computer side or on the ssc32?

I guess the board is made for receiving 32 move at the same time? am I right?
How many byte can I send at once? at which frequency?

thanks

If your software is freezing for a bit, there might be a power problem and the microcontroller on the SSC-32 is resetting. Could you tell us what power sources you have connected to VL, VS1 and VS2? Also, can you tell us the models of your servos?

For more information on power, you can see this blog post: robotshop.com/blog/en/guide- … lers-12178

As for the limits of the serial connection speeds, can you tell us how (adapter?) you have your SSC-32 connected to your computer or microcontroller, and tell us which baud rate you are using?

Again hard to know what is going on with so little information. Are you using a PC or another board? How are they connected? Did you write a program to do this? If so in what computer language? Do you output the string hard coded all in one output or are there multiple output statements that output the data? Again it helps to see the actual code.

As for output buffering again depends on platform. Arduinos running 1.0.x I believe typically (by default) set up a 64 byte output queues. If your code outputs more than the 64 bytes (plus a few more for the ones that get sent while you are adding the bytes to the queue), the program will hard loop in the Serial output code until there is room in the queue for the next byte… Some other systems may have issues and instead may either toss the output or overwrite some previous characters, but my guess is that this would be rare.

But again maybe you are using some platform like a Basic Atom Pro to output the strings, using something a Serial stream that is software generated instead of controlled by hardware. In these cases, there could be issues on your platform with other stuff going on. Things like if your processor is having to service an interrupt, it may easily cause the timings of the software serial to get off and corrupt the data… So again need more information.

sorry for the lack of informations, I am really a newcomer in the ssc32 world
I am using this basic servo
servodatabase.com/servo/modelcraft/rs-2
I am feeding VL, VS1 and VS2 with the same power supply, which is a strong one (30A 5.7V)
I double-checked the jumpers and I am using a serial adapter sold with my ssc32 at robotshop
I do not think the board is resetting due to a lack of power, because if there is enough time between my group command, the board is working properly. but I will try a higher voltage for the logic to exclude a power problem

VVVV is a software like Pure Data. that allows to do many thing including talking to micro controllers.
I use it to convert the command to ascii characters before sending it to the serial port.

How many bytes represent the command I posted earlier if translated to ascii?
I will try to power the VL apart from the VS…

5.7V seems quite low for logic voltage, especially considering there is a voltage decrease in the conversion. Try a separate 9V if you can for VL.

The VL terminal does have a 0.7V low-drop-out regulator, which means the input voltage needs to be at least 0.7 volts higher than the 5 volts needed for the microcontroller. 5.7 volts is indeed just on the threshold and might drop a bit if the servos consume a large amount of current at the same time. Using a 9V battery for VL would be an easy test.

As for your command string, determining the number of bytes is a simple as counting the characters: 304 in this case. Since this command does work, then you are not likely have buffer problems on the SSC-32. At this point, I strongly suspect it’s a VL power issue.

yes I will try this tomorrow and will come back to tell you if it has solved the problem.
Do also you think my group command is too long for the ssc32? should I rather send my 30 positions update in two different commands for instance? will it make a difference for the board? ( I used 115200 baud rate )

(by the way, I wondered if there was a short command to tell all the servos plugged to the board to go to the same position.)

edit: did not see your post jarcand.

I will try to power VL with a 10V power supply I have .
I don’t know why I thought 5V was enough to feed VL, :blush:

thanks again everybody

Since the first one works okay, I don’t think your group command is too long, however if the VL power test doesn’t help then I might try dividing the command into two…

Unfortunately the SSC-32 doesn’t support a method of addressing multiple servos at once and sending a single position value.

I would always suggest that you try separate voltages for VL. Note however the actual processor I do believe is specked to allow a Vcc in the range of 2.7-5.5V so it will be interesting to see if it actually is the problem.

My guess is the issue may be with VVVV, that you are overflowing some of it’s buffers or the like. You might try breaking the output to multiple writes and see if that helps. Again the SSC-32 will not do anything with the command until the CR is hit. Detecting overflows of buffers is sometimes difficult, some programs simply overwrite memory, so the first time it may go through fine, and then later on could crash or hang or… depending on what type of memory that was corrupted.

Note: there is no real short command to tell all of the servos to move to the same place. However if you want a smaller command to output to the SSC-32, some versions of the firmware support a binary command mode, which I believe cuts the command length down to about half the length. More details in the online manual: lynxmotion.com/p-395-ssc-32- … oller.aspx

Kurt