Putting robotics at your service™

Free shipping on orders over $200

Control SSC-32 from Arduino

Print view Share :
Previous topicNext topic

Page 1 of 2 [ 16 posts ]

1, 2
User avatar
Guru ( offline )
Posts: 9258
Posted: 2009-09-03 11:44 
Hope this helps!

http://learnhub.com/lesson/7437-moving- ... an-arduino

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


User avatar
Novice ( offline )
Posts: 93
Posted: 2009-09-03 18:51 
Nice Find!


Rookie ( offline )
Posts: 26
Posted: 2009-09-05 03:16 
I have source for driving an SSC-32 from an Arduino, the Arduino wireless over XBee to the remote SSC-32. It's trivially easy, but I can post it if you like.


User avatar
Novice ( offline )
Posts: 93
Posted: 2009-09-05 20:01 
Every little bit helps.


Guru ( offline )
Posts: 2251
Posted: 2010-09-20 12:36 
Below is some of my arduino test code (for version 18) that can interface with the ssc-32. The ssc-32 TTL tx/rx/ground is connected to the arduino rx/tx/ground pins. The ssc-32 board probably can be powered from the arduino +5v if needed (but no servos!). The below code can take a control string entered in the arduino serial monitor and send it to the ssc-32. The bottom code is for use with the arduino/ethernet shield combo. HTTP request are sent from a web page to the arduino, which processes the request and sends the control strings to the ssc-32 via its serial output (and also to the serial monitor. This is part of my routerbot testing.

Code:
//zoomkat 9-9-10 simple delimited ',' string parce
//from serial port input (via serial monitor)
//and print result out serial port
// CR/LF could also be a delimiter
// http://www.arduino.cc/en/Tutorial/TextString for WString.h

#include <WString.h> //provides easy string handling
String readString = String(100);

void setup() {
   Serial.begin(9600);
        }

void loop() {

        //expect a string like wer,qwe rty,123 456,hyre kjhg,
        //or like hello world,who are you?,bye!,
        while (Serial.available()) {
        delay(10);  //small delay to allow input buffer to fill
       if (Serial.available() >0) {
        char c = Serial.read();  //gets one byte from serial buffer
        if (c == ',') {break;}  //breaks out of capture loop to print readstring
        readString.append(c); } //makes the string readString
        }
     
      if (readString.length() >0) {
      Serial.println(readString); //prints string to serial port out
     
      readString=""; //clears variable for new input
      }
   }


Code:
//zoomkat 5-24-10
// http://www.arduino.cc/en/Tutorial/TextString for WString.h

#include <WString.h>
#include <Ethernet.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
byte ip[] = { 192, 168, 1, 102 }; // ip in lan
byte gateway[] = { 192, 168, 1, 1 }; // internet access via router
byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
Server server(84); //server port

String readString = String(100); //string for fetching data from address

///////////////////////
 String teststring = String(100);
 String finalstring = String(100);
 String flag = String(2);
 int ind1 = 0;
 int ind2 = 0;
 int pos = 0;
 //////////////////////

void setup(){

//start Ethernet
Ethernet.begin(mac, ip, gateway, subnet);
server.begin();

//enable serial data print
Serial.begin(9600); }

void loop(){
// Create a client connection
Client client = server.available();
if (client) {
while (client.connected()) {
if (client.available()) {
char c = client.read();

//read char by char HTTP request
if (readString.length() < 100) {

//store characters to string
readString.append(c);
}

//if HTTP request has ended
if (c == '\n') {

///////////////
//Serial.println(readString);
//readString looks like "GET /?-0p1555-1p500t1000 HTTP/1.1"

  if(readString.contains("-")) { //test for servo control sring
  readString.replace('-', '#');
  pos = readString.length(); //capture string length
  //find start of servo command string (#)
  ind1 = readString.indexOf('#');
  //capture front part of command string
  teststring = readString.substring(ind1, pos);
  //locate the end of the command string
  ind2 = teststring.indexOf(' ');
  //capturing the servo command string from readString
  finalstring = readString.substring(ind1, ind2+ind1);
  //print "finalstring" to com port;
  Serial.println(finalstring); //print string with CR
    }
  ////////////////////////
  //GET /?Slidervalue0=1800&Submit=Sub+0 HTTP/1.1
  if(readString.contains("Slidervalue")) {
  ind1 = readString.indexOf('u');
  ind2 = readString.indexOf('&');
  finalstring = readString.substring(ind1+1, ind2);
  finalstring.replace('e', '#');
  finalstring.replace('=', 'p');
  Serial.println(finalstring);
  }
  ///////////////////
 
  //now output HTML data header
  client.println("HTTP/1.1 204 Zoomkat");
  client.println();
  client.println();
  delay(1);
  //stopping client
client.stop();

/////////////////////
//clearing string for next read
readString="";
teststring="";
finalstring="";
 
}}}}}

_________________
Why I like my 2005 rio yellow Honda S2000 with the top down, and more!
http://youtube.com/watch?v=pWjMvrkUqX0
http://youtube.com/watch?v=qfyRA-g1nhI
http://web.comporium.net/~shb/S2000video.htm


User avatar
Expert ( offline )
Posts: 293
Posted: 2010-09-20 14:12 
From the post,
Quote:
There are two separate powering options that you will have to consider. The first is the power for the board, and the second is power for the servos. I highly recommend powering the board separately from the servos. For powering the board, I give the SSC-32 +5V from the Arduino. For powering the servos, I give it about 13V, which changes to about 10V under load. However, it is your choice about how you want to power it.

13V? I see dead servos...

dj

_________________
Heard in the workshop: PEBRAC...


New ( offline )
Posts: 7
Posted: 2012-11-20 16:46 
Thanks for sharing.

I'm building a tetrapod using a SSC 32 board and Arduino Mega. Soon I will post a link to my blog.


User avatar
Admin ( offline )
Posts: 1077
Posted: 2012-11-21 09:24 
Perhaps start a new thread? Looking forward to seeing it.

_________________
Coleman Benson

RobotShop inc.
Putting Robotics at your service!™
www.robotshop.com

Lynxmotion
Imagine it. Build it. Control it.™
http://www.Lynxmotion.com


New ( offline )
Posts: 7
Posted: 2012-11-21 17:32 
CBenson, I've taken your advice and I've started a post in the multi-leg forum.

Thanks for the support and interest.


Rookie ( offline )
Posts: 23
Posted: 2013-11-14 16:20 
From the documentation that is available for the ssc-32 I've understood you can just open a serial with the ssc-32 and use the following code:
Code:
   Serial.print("#0 P1500 T1000 <cr>");


And this will take the servo located at #0 to a value of 1500microseconds.
Am I taking my project too lightly or am I correct?

_________________
Amazed by and now making Robots!


User avatar
Expert ( offline )
Posts: 322
Posted: 2013-11-14 17:52 
Almost! You will actually want to do:
Code:
     Serial.println("#0 P1500 T1000");

The SSC-32 needs to receive ASCII character 13 (carriage return) to find the end of the command. In the SSC-32 documentation, that character is represented by <cr>. In Arduino, you can either use "\r", or you can just use println (instead of simply print) which automatically adds the carriage return character that's needed.

Note that the third part (T1000) is optional and specifies the transition time in milliseconds.

We hope this helps.

_________________
Jeffrey Arcand
Robotics Specialist

RobotShop inc.
Putting Robotics at your service!™
www.robotshop.com

Lynxmotion
Imagine it. Build it. Control it.™
www.lynxmotion.com


Rookie ( offline )
Posts: 23
Posted: 2013-11-16 05:21 
Awesome, this helps out great. Thank you for the fast response!

_________________
Amazed by and now making Robots!


New ( offline )
Posts: 9
Posted: 2013-12-21 22:24 
Hello. I would like to control my 10 DOF humanoid robot using ssc-32 and Botboarduino. I would like to control the ssc-32 from Botboarduino using the PS2 remote.

Thanks,
Iulian


User avatar
Admin ( offline )
Posts: 1077
Posted: 2013-12-23 09:19 
That's certainly possible. Do you have any specific questions?

_________________
Coleman Benson

RobotShop inc.
Putting Robotics at your service!™
www.robotshop.com

Lynxmotion
Imagine it. Build it. Control it.™
http://www.Lynxmotion.com


New ( offline )
Posts: 1
Posted: 2013-12-26 01:47 
Yes hello. I am new here and wish to attempt an ambitious humanoid robot. All I need to know is if I need any code in the Botboarduino to communicate to the SSC-32 using a ps2 controller.Please and thank you.


1, 2

All times are UTC - 5 hours [ DST ]. It is currently 2014-09-02 19:46
Feedback Form
Feedback Form