AL5D speed control using Arduino Uno and SSC-32

Hi,

I’m using a AL5D robotic arm for a school project and I have a problem with it’s speed control.

[code]/SETUP************/
Hardware:

  • SSC-32
  • Arduino Uno
  • AL5D robotic arm

The Arduino Uno is connected to SSC-32 as follows: Tx(Uno)->Rx(SSC-32)
GND(Uno)->GND(SSC-32)

The code is the one bellow:
void setup()
{
/ * data, parity and stop bits are the default one: SERIAL_8N1 /
Serial.begin(9600);
}
void loop()
{
Serial.write("#0P1500 T15000\r");
delay(15000);
}
/END OF SETUP
**********/
[/code]
When the command is executed the SSC-32 is behaving like the time was not set so it’s using the default speed.I’ve tried the same command with lynxTermprogram though the RS-232 and it worked correctly.

I don’t see where I got it wrong.
Can someone please help me with the issue?

Thanks,
Marian

Hi Marian and welcome to our forums!

We have tested your code using an Arduino board connected by serial to a SSC-32U and it worked nicely, but with a few small modifications for testing.

We would also like to point out it is possible that the first command sent to the SSC-32 board by serial may happen instantly, independent of the ‘T’ parameter.
In your example code, you had only one command in the loop. Therefore it may happen instantly, but the following ones would move with respect to the ‘T’ parameter.
Since you had only one command (no position change after the first one is sent) you would not be able to see if it works as expected for the next commands.

Here is the sample code:

/*******************************************************************SETUP*******************************************************************************/
/*
Hardware:
-  SSC-32
-  Arduino Uno
-  AL5D robotic arm

The Arduino Uno is connected to SSC-32 as follows: Tx(Uno)->Rx(SSC-32) 
GND(Uno)->GND(SSC-32)
*/

// The code is the one bellow:
void setup()
{
/* data, parity and stop bits are the default one: SERIAL_8N1 */
Serial.begin(9600);
}

void loop()
{
Serial.write("#0P1500 T10000\r");
delay(12500);
Serial.write("#0P1000 T10000\r");
delay(12500);
Serial.write("#0P1500 T10000\r");
delay(12500);
Serial.write("#0P2000 T10000\r");
delay(12500);
}
/****************************************************************END OF SETUP***************************************************************************/

This code will cause the arm to center itself. Then it will travel from left to right. Every movement is completed over 10s and there is a delay of 12.5s (the arm doesn’t move for 2.5s).

Let us know if this example code works for you.

Hi Sebastien,

I’ve tried as you suggested and it’s working when controlling only one servo but for group command it doesn’t.

This is how I’ve modified the loop:

[code]void loop()
{
Serial.write("#0P1000#1P1900#2P2200#3P1750#4P1800 T1500\r");
delay(2000);

Serial.write("#0P1347#1P1126#2P1182#3P651#4P2000 T15000\r");
delay(18000);
}[/code]

When the first command is sent the arm it’s moving for like 0.5s then stops. When the second command is sent it will behave in the same.

Tried with the lynxTerm as well and it’s working. My SSC32 version is ssc33-v2.03XE. Do you think I should try a firmware update?

I will appreciate your help on this one as well.

Thanks,
Marian

After searching a little bit more on the forum I’ve found this post that sound similar to my issue: robotshop.com/forum/problem-with-ssc-32-out-of-the-box-t9199.

I realized that I’ve power my board incorrectly so after changing the power supply to one of 9v for VL it fixed my issue.

Hi Marian,

I’m glad you have fixed your issue! The RobotShop forums are a great resource for help from the community.

It is important to note that the initial position command sent to any servo after start-up ignores the ‘T’ and ‘S’ parameters and executes that command instantly.

Do the following change in the “void setup()” function:

void setup()
{
Serial.begin(9600);
Serial.write("#0P1000 #1P2100 #2P2150 #3P1000\r");
}

This will give an initial position to every servo you intend to use. In this example, we have used a default resting position for the Lynxmotion AL5D.
Follow-up commands will then observe the ‘T’ parameter for these servos.

This has worked both in LynxTerm and using the Arduino sketches with no issues.

Hope this helps!