Arduino and 32Channel Servo controller - only one sequence is executed.

Hi guys,

starting from few days ago I have this strange problem. I'm building hexapod and I needed a servo controller. I bought this 32channel servo controller (produced by chinese Torobot company). I connected it to arduino Uno and I send simple "#1P1500#T1000" comands over serial connection (I use SoftwareServo and PIN 10 and 11) to move a servos.
Problem is that I can send only once a commands. If arduino finish all comands within setup() method there is no way to send them again. This means:

  • if I restart arduino (using reset button on board) - it won't start to move servos
  • if I upload new version of software - it won't start.

Only way to exec new sequence is to turn everything (even servo controller) off and then to start again.

I have separated power source for servos, connected to VS and GND. I supply arduino and controller chip from USB port. I tried to use same external power source for both chip and servo but the result is the same.

In some way, servo does not want to accept a commands after arduino execute everything.

What could be the problem?

thanks in advance.

p.s. this is simple code:

#include <SoftwareSerial.h>

SoftwareSerial usc(10,11);

void setup() {
  Serial.begin(9600);
  delay(2000);
  usc.begin(9600);
  usc.println("#23P1500T1000");

  delay(2000);
  usc.println("#23P900T1000");

  delay(2000);
  usc.println("#23P1900T1000");
  Serial.println("#23P1900T1000"); // to check if previous lines are executed
}

void loop() {
}

Try changing the order of the commands. It appears that the last command is causing the servo controller to freeze somehow. Do you have the right end-of-line indicator?

I tried to change parameters, but behaviour was still the same. I also tried to insert into a loop() method and it goes perfectly until I press reset button. Then it stops.
I don't understand what happens when arduino is restarted but it sends some signal or close the port or something else which makes servo controller freeze.

thank you for answer

It only freezes after reset?
Then it is possibly some sort of error with initializing the servo controller. However, this is really strange.

Yes, I identified 3 cases when it freeze:

  1. After sequence in setup() method is executed I restet and nothing happes
  2. If I insert code into loop() it runs movement infinitely but if I press reset button it freezes.
  3. If I upload a new version of software after which board is reset, it does not start.

In some way, arduino restart make a controller freeze. At the begining everything worked fine.

It might be that the controller needs a specific initialization, or has a timeout after which it freezes. Maybe you could try sending commands over the serial monitor to the controller.

This is strange. I tried to connect ServoController USC-32 directly to Uno's serial port (PIN 0 and 1) and I does not work. I changed a code so instead to write to SoftSerial object it writes to Serial. Now, nothing moves. I see on TX Led (Uno) that arduino is writing but the servo does not move anything.

Try switching the RX and TX lines on the servo board.

Thank you so much for your code, You are a lifesaver..

I dit it with 996R Servo and it Constantly moving until power-offed, though, I am tryinf for a solution...