Specific command breaks SSC32U

Hi All,

Recently I’ve purchased an SSC32U + Botboarduino + PS2 controller. I setup the wirings shown in the documentation. I am powering the controller with 6v wall adapter. I have 3DOF SQ3 with HS645mg servos.

I’ve written a simple Arduino code to update my servos. If I update the board with following code

#include <SoftwareSerial.h>
SoftwareSerial mySerial(13, 12); // RX, TX
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
 ; // wait for serial port to connect. Needed for native USB port only
}
// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
}
void loop() {
mySerial.println("#0P1499#1P613#2P1076");
mySerial.println("#3P1501#4P2100#5P1923");
mySerial.println("#6P1501#7P2100#8P1923");
mySerial.println("#9P1499#10P613#11P1076");
}

Everything works fine I can see that servos move initially and then stay still. However, if I change my loop as follow,

...
void loop() {
 mySerial.println("#0P1499#1P613#2P1076");
mySerial.println("#3P1501#4P2200#5P1923");
mySerial.println("#6P1501#7P2100#8P1923");
mySerial.println("#9P1499#10P613#11P1076");
}
...

All servos start moving randomly. Notice that I change pwm for #4 from 2100 to 2200. I tried adding delay after each call, didn’t help. Also tried to read servo status by sending Q and waiting ‘.’ in this case I never get ‘.’ character at all.

Any idea what can cause this behavior?

Hi,

Any position command should only be sent once (not in a infinite loop). Basically, the first time a position command reaches the SSC-32U for a specific channels, it calculates the movement (based on parameters provided) to be made and executes it. If you send a new position command to the SSC-32U for the same channel while the previous command is still executing, it will cancel that command and execute the new one. If you send commands for the same channel continuously, it is possible it will do something weird/undefined.

Reading the result of the “Q” command will most likely not help in your case. We recommend that you setup delay() or use millis() to time your commands with the expected duration.

We recommend that you try again the same code but move your block of position commands to the setup() function instead of the loop() function.

Let us know if this produces a different result.

Sincerely,

void loop() {
mySerial.println("#0P1499#1P613#2P1076");
mySerial.println("#3P1501#4P2200#5P1923");
mySerial.println("#6P1501#7P2100#8P1923");
mySerial.println("#9P1499#10P613#11P1076");
delay(1000);
}

ideally that should work right? but i am having the same result with this code snippet as well. Side note, this code comes from github.com/Lynxmotion/Quadrupeds. I was trying to execute that project and having a weird behavior and debugged spending several hours and narrow down the problem into that specific loop I entioned above. Is is possible that card was not working properly? How can I test it? If I comment one of the lines above it works fine.

We tried to find the code you posted but could not find it anywhere in our libraries or projects for the quadrupeds. Please provide us with the file name and line number where you found this code.

Concerning the following code:

Please note that not all RC servomotors support an extended range of motion. Some only function properly in the typical 1000-2000 us range (more info here and here). A servomotor receiving a non-supported pulse could easily cause high current drain or noise and prevent the other servomotors from functioning properly.

Have you tried running the exact same code with nothing connected to channel #4. If so, what happens?

It would help greatly if you could provide the following:

]One or more pictures of your setup, showing clearly all components (SSC-32U, its jumpers and connections, the servomotors, power source, etc.)/:m]
]A link to a short video of the issue in action./:m]

Sincerely,