PDA

View Full Version : robotis CM-530 + arduino + serial



ozopled
09-25-2015, 03:54 PM
Has anybody been able to send direct commands to a bioloid controller (such as the CM-530) using serial.write from Arduino?

KurtEck
09-25-2015, 07:19 PM
I have not talked to any controllers, but have talked to AX-12 servos, obviously with with Arbotix-m processors, but also with Ardruino Megas as well as Teensy 3.1s. The Serial class of the earlier Arduino releases like 1.05 had issues where the Serial class had too much overhead to work and as such the code for the Arbotix was setup to use custom code. However there were a lot of improvements with the Serial code in later releases which makes it possible. I have versions of the Bioloid library that you can pass in which serial port you wish to use.

With the Arduino megas, you need to rig up where the TX/RX pins for a USART are connected to each other to handle the half duplex protocol. The Teensy 3.1s have half duplex support in the processor.

Again as I said I have not tried talking to any of the controllers...

tician
09-25-2015, 08:29 PM
The default robotis firmware of the CM-5/510/530/700 only permit the use of the robotis 'zigbee' packet documented on the robotis support site (http://support.robotis.com), which is limited to two bytes of data contained in a six byte packet. The four pin zigbee/bluetooth connector is a JST PH connector using 3.3V logic levels, so will require level translation to prevent a 5V arduino from destroying the 3.3V input on the CM-530.

ozopled
09-26-2015, 08:54 AM
Thanks KurtEck and tician for your replies :)

I've been able to talk directly to AX servos using a combination of an Arduino + a SN74LS241N chip, but I'd like to be able to send commands to the CM-530 directly.

Using a serial monitor I monitored the zigbee signals sent from the remocon with success. For example, the U button sends this:


ff 55 01 fe 00 ff
ff 55 01 fe 00 ff
ff 55 01 fe 00 ff
ff 55 01 fe 00 ff
ff 55 01 fe 00 ff
ff 55 00 ff 00 ff

Sends six packets... the first five are the button itself and the last one seems to be a stop motion one.


Then from the Arduino I tried several combinations of this code:



const uint8_t moveFoward[6] = {0xFF, 0x55, 0x01, 0xFE, 0x00, 0xFF};
const uint8_t* moveFoward_ptr = moveFoward;

void setup() {
Serial.begin(57600); // I've tried different baud rates
}

void loop()
{
moveRobotForward();
delay(1000);
}

void moveRobotForward()
{
Serial.write(moveFoward_ptr, 3);
delay(210);
Serial.write(moveFoward_ptr+3, 3);
}

I was wiring the Arduino directly to the CM-530 four pin zigbee connector. Didn't realize it needs to read 3.3v, in any case it didn't burn so I'm glad. I will try level translation, although I need to get a logic level converter for that :)

Thanks again!