CDS5500 working

In other news, I got the CDS5500 working like the AX-12+ and I must say I think I like it a bit better. Strange as it seems, I prefer the sound…a lower pitch. It also has metal gears as opposed to resin, and ball-bearings to boot. It’s also cheaper. Anyways, I will try try it out in the design. As long as it doesn’t require any significant changes to the scale I will likely switch.

Something to note with the CDS5500 is that the default velocity which is Zero means no velocity as opposed to maximum velocity for the AX-12+. This is why it didn’t move for me the first time I tried. Here’s my simple test program for the Arduino.

#define startByte 0xFF
#define ID 0x01

//— Control Table Address —
//EEPROM AREA
#define P_MODEL_NUMBER_L 0
#define P_MODEL_NUMBER_H 1
#define P_VERSION 2
#define P_ID 3
#define P_BAUD_RATE 4
#define P_RETURN_DELAY_TIME 5
#define P_CW_ANGLE_LIMIT_L 6
#define P_CW_ANGLE_LIMIT_H 7
#define P_CCW_ANGLE_LIMIT_L 8
#define P_CCW_ANGLE_LIMIT_H 9
#define P_SYSTEM_DATA2 10
#define P_LIMIT_TEMPERATURE 11
#define P_DOWN_LIMIT_VOLTAGE 12
#define P_UP_LIMIT_VOLTAGE 13
#define P_MAX_TORQUE_L 14
#define P_MAX_TORQUE_H 15
#define P_RETURN_LEVEL 16
#define P_ALARM_LED 17
#define P_ALARM_SHUTDOWN 18
#define P_OPERATING_MODE 19
#define P_DOWN_CALIBRATION_L 20
#define P_DOWN_CALIBRATION_H 21
#define P_UP_CALIBRATION_L 22
#define P_UP_CALIBRATION_H 23
#define P_TORQUE_ENABLE (24)
#define P_LED (25)
#define P_CW_COMPLIANCE_MARGIN (26)
#define P_CCW_COMPLIANCE_MARGIN (27)
#define P_CW_COMPLIANCE_SLOPE (28)
#define P_CCW_COMPLIANCE_SLOPE (29)
#define P_GOAL_POSITION_L (30)
#define P_GOAL_POSITION_H (31)
#define P_GOAL_SPEED_L (32)
#define P_GOAL_SPEED_H (33)
#define P_TORQUE_LIMIT_L (34)
#define P_TORQUE_LIMIT_H (35)
#define P_PRESENT_POSITION_L (36)
#define P_PRESENT_POSITION_H (37)
#define P_PRESENT_SPEED_L (38)
#define P_PRESENT_SPEED_H (39)
#define P_PRESENT_LOAD_L (40)
#define P_PRESENT_LOAD_H (41)
#define P_PRESENT_VOLTAGE (42)
#define P_PRESENT_TEMPERATURE (43)
#define P_REGISTERED_INSTRUCTION (44)
#define P_PAUSE_TIME (45)
#define P_MOVING (46)
#define P_LOCK (47)
#define P_PUNCH_L (48)
#define P_PUNCH_H (49)

//— Instruction —
#define INST_PING 0x01
#define INST_READ 0x02
#define INST_WRITE 0x03
#define INST_REG_WRITE 0x04
#define INST_ACTION 0x05
#define INST_RESET 0x06
#define INST_DIGITAL_RESET 0x07
#define INST_SYSTEM_READ 0x0C
#define INST_SYSTEM_WRITE 0x0D
#define INST_SYNC_WRITE 0x83
#define INST_SYNC_REG_WRITE 0x84

void setup()
{
Serial.begin(1000000);                        // start serial port at 1000000 bps:
}

void loop()
{
//  if (Serial.available() > 0) {              // if we get a valid byte
//    Serial.println( Serial.read() );            // get incoming byte:
//  }

// Instruction Packet OXFF 0XFF ID LENGTH INSTRUCTION PARAMETER1 …PARAMETER N CHECK SUM
// CDS5500 tech support suggests the following will work: FF FF 01 07 03 1E 00 02 00 02 D2
int pos = random(255);
int pos2 = random(3);
int vel = random(255);
int vel2 = random(3);
int messageLength = 5+2;

Serial.print(startByte, BYTE);              // send some data
Serial.print(startByte, BYTE);
Serial.print(ID, BYTE);
Serial.print(messageLength, BYTE);
Serial.print(INST_WRITE,BYTE);
Serial.print(P_GOAL_POSITION_L, BYTE);
Serial.print(pos, BYTE);
Serial.print(pos2, BYTE);
Serial.print(vel, BYTE);
Serial.print(vel2, BYTE);
Serial.print((~(ID + (messageLength) + INST_WRITE + P_GOAL_POSITION_L + pos + pos2 + vel + vel2))&0xFF, BYTE);
delay(1500);
}

Advertisements

5 Comments

Filed under Uncategorized

5 responses to “CDS5500 working

  1. Cid

    Congratulations!
    I’m from UPTECH Robotics.
    If you like, we can send you 1-2 free sample of our new CDS5516 servo and BDMC1203 motor controller.

  2. n3o

    hi, not sure if you can help. i just bought some cds5500 n trying to connect using arduino. i have tested you code but dont seems to work. may i know how actually you connect arduino to cds5500 ? just using tx(pin 1) is sufficient ?

    • Nicholas Stedman

      The communication pin is an RS485 pin. It’s used for both send and receive. So you have to use a line driver between the rx and tx pins of the arduino and the one communication pin on the CDS5500. See page 3 of the quick start guide for a schematic: http://www.robotshop.ca/content/PDF/CDS55xx_Robot_Servo_Quick_Start_EN.pdf

      You might be able to get away with hooking up the tx pin directly, but I can’t say for sure. I also don’t know if that is the only factor in your situation, but it is likely one. I’d also recommend googling AX-12+ in place of CDS5500 because they are for the most part the same, but the AX-12+ is better documented. Try the Robosavvy.org forums as well.

  3. n3o

    thx for responding, i did the page 3 circuit too, still no luck. i hooked up mcu_txen to 5v to make it always enable as ur code doesn’t enable/disable any line to control that.

    i am also suspecting my arduino tx/rx (pin 0 and 1) got some problem, but usb to pc seems working fine. I used multimeter to measure the voltage on pin0 n pin1 to gnd, pin0 having constant 3v+ and pin1 having constant 5v. really frustrated 😀

    anyway, this is only my first servo experience … haha

  4. n3o

    oh man, got it working, problem was due to the servo power source, i was using old pc power supply (12v to +ve and 5v to gnd) to get 7v. but it seems the servo dont like it, or maybe the signal line need real gnd to work. so now using 5v to +ve and gnd to gnd and finally it move … 😀

    thx man

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s