Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

CM510 as a slave...

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
20 postsPage 1 of 21, 2
20 postsPage 1 of 21, 2

CM510 as a slave...

Post by tedlarson » Fri Dec 10, 2010 11:40 pm

Post by tedlarson
Fri Dec 10, 2010 11:40 pm

I have a project where I would like to control the CM510 as a slave from another CPU over the serial port. I noticed that RoboPlus Terminal is a way to go right in and just send commands to it, like I can play a simple motion using the "play" command. However, there doesn't appear to be any documentation on all the commands you can enter via RoboPlus terminal. Does anyone know where I can find this?

It seems like all the foundation is there for the CM-510 to just be a slave device, and have it run the robot for me, by sending it commands, but there just isn't anything that describes the terminal interface.

Any help would be greatly appreciated.

Thanks,

-Ted
I have a project where I would like to control the CM510 as a slave from another CPU over the serial port. I noticed that RoboPlus Terminal is a way to go right in and just send commands to it, like I can play a simple motion using the "play" command. However, there doesn't appear to be any documentation on all the commands you can enter via RoboPlus terminal. Does anyone know where I can find this?

It seems like all the foundation is there for the CM-510 to just be a slave device, and have it run the robot for me, by sending it commands, but there just isn't anything that describes the terminal interface.

Any help would be greatly appreciated.

Thanks,

-Ted
tedlarson
Robot Builder
Robot Builder
Posts: 8
Joined: Fri Dec 10, 2010 11:33 pm

Post by Dewey » Sat Dec 11, 2010 2:34 pm

Post by Dewey
Sat Dec 11, 2010 2:34 pm

The easiest approach is to wrire a RoboPlus program that thinks it is accepting commands and sending responses (as coded integers) via the comms connector used for the infrared/radio link.

This protocol has been documented by me and others here, for the CM5.

Connect your Arduino (or whatever controller you choose) be carefull the CM510 port operates at 3.3v not sure it 5v complient!

Now in the Arduino write simple functions to encode decode the protocol. Basically the Arduino send integers as does say the RC100 remote but is it is directly connected of course. The CM510 can of course respond to the Arduino, not possible with the RC100.

Dewey
The easiest approach is to wrire a RoboPlus program that thinks it is accepting commands and sending responses (as coded integers) via the comms connector used for the infrared/radio link.

This protocol has been documented by me and others here, for the CM5.

Connect your Arduino (or whatever controller you choose) be carefull the CM510 port operates at 3.3v not sure it 5v complient!

Now in the Arduino write simple functions to encode decode the protocol. Basically the Arduino send integers as does say the RC100 remote but is it is directly connected of course. The CM510 can of course respond to the Arduino, not possible with the RC100.

Dewey
Dewey
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 78
Joined: Sat May 12, 2007 1:17 pm
Location: Worcester UK

Post by tedlarson » Sat Dec 11, 2010 9:55 pm

Post by tedlarson
Sat Dec 11, 2010 9:55 pm

Dewey wrote:This protocol has been documented by me and others here, for the CM5.


Where is this protocol documentation? Can you provide me a link?

Thanks,

-Ted
Dewey wrote:This protocol has been documented by me and others here, for the CM5.


Where is this protocol documentation? Can you provide me a link?

Thanks,

-Ted
tedlarson
Robot Builder
Robot Builder
Posts: 8
Joined: Fri Dec 10, 2010 11:33 pm

Post by Dewey » Sun Dec 12, 2010 2:25 pm

Post by Dewey
Sun Dec 12, 2010 2:25 pm

Dewey
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 78
Joined: Sat May 12, 2007 1:17 pm
Location: Worcester UK

Post by Fritzoid » Mon Dec 13, 2010 4:53 pm

Post by Fritzoid
Mon Dec 13, 2010 4:53 pm

Actually, the easiest thing would be to get someone like me to create a document that has all the information that you need in one handy place :wink:

See commands.zip in my files area

http://robosavvy.com/Builders/Fritzoid/
Actually, the easiest thing would be to get someone like me to create a document that has all the information that you need in one handy place :wink:

See commands.zip in my files area

http://robosavvy.com/Builders/Fritzoid/
Fritzoid
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 331
Joined: Mon Dec 18, 2006 1:00 am

Post by tedlarson » Mon Dec 13, 2010 8:37 pm

Post by tedlarson
Mon Dec 13, 2010 8:37 pm

Thanks for both of these replies. Both are good ways to go.

Fritz....I brought up RoboPlus Terminal and started fooling with the commands in there. Some commands only work in certain modes. Like MONITOR mode for example.

It is not clear from the document, for example, if I wanted to send a position command to a specific servo, in monitor mode, how I can format the command. There appears to be a H command that allows you to write directly to the dynamixel bus, but it isn't clear how to do it. I fiddled with trying things for like an hour but couldn't get any servos to move. Any ideas?

Thanks,

-Ted
Thanks for both of these replies. Both are good ways to go.

Fritz....I brought up RoboPlus Terminal and started fooling with the commands in there. Some commands only work in certain modes. Like MONITOR mode for example.

It is not clear from the document, for example, if I wanted to send a position command to a specific servo, in monitor mode, how I can format the command. There appears to be a H command that allows you to write directly to the dynamixel bus, but it isn't clear how to do it. I fiddled with trying things for like an hour but couldn't get any servos to move. Any ideas?

Thanks,

-Ted
tedlarson
Robot Builder
Robot Builder
Posts: 8
Joined: Fri Dec 10, 2010 11:33 pm

Post by Fritzoid » Mon Dec 13, 2010 9:11 pm

Post by Fritzoid
Mon Dec 13, 2010 9:11 pm

Assuming that you are in manage mode already (vM).

Say you want to write to the goal position on servo 001 (usually the right shoulder servo). First change the CID to servo 001 with the following command:

CID 1

The prompt should now read {[001:]}

Now, subsequent commands will be sent to servo 001.

To write to the goal position you need to supply an address and two bytes of data. i.e.

WR 30 57 1

The first number is the "goal position" address in the servo control table. The next two bytes are the data. The low byte of a two-byte field, like goal position, goes first (57) and the high byte goes second (1 in this case). The word value transmitted in this case would be 313 (1*256 + 57).

If you issue the HEX command first, then you can enter your parameters in hexadecimal. The above command would in hex would be

WR 1E 39 01

Responses will be displayed in hexadecimal too if you are in HEX mode. Use the DEC command to return to decimal mode.

READ, REG_WR, SYNC_WR etc. work in a similar manner.

To use the H command you need to supply the entire packet (header checksum and all) in hex digits following the command name. The equivalent command for setting the goal position would be something like this...

H FF FF 01 05 03 1E 57 01 80

Hope this helps a little.
Assuming that you are in manage mode already (vM).

Say you want to write to the goal position on servo 001 (usually the right shoulder servo). First change the CID to servo 001 with the following command:

CID 1

The prompt should now read {[001:]}

Now, subsequent commands will be sent to servo 001.

To write to the goal position you need to supply an address and two bytes of data. i.e.

WR 30 57 1

The first number is the "goal position" address in the servo control table. The next two bytes are the data. The low byte of a two-byte field, like goal position, goes first (57) and the high byte goes second (1 in this case). The word value transmitted in this case would be 313 (1*256 + 57).

If you issue the HEX command first, then you can enter your parameters in hexadecimal. The above command would in hex would be

WR 1E 39 01

Responses will be displayed in hexadecimal too if you are in HEX mode. Use the DEC command to return to decimal mode.

READ, REG_WR, SYNC_WR etc. work in a similar manner.

To use the H command you need to supply the entire packet (header checksum and all) in hex digits following the command name. The equivalent command for setting the goal position would be something like this...

H FF FF 01 05 03 1E 57 01 80

Hope this helps a little.
Fritzoid
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 331
Joined: Mon Dec 18, 2006 1:00 am

Post by tedlarson » Thu Dec 16, 2010 12:32 am

Post by tedlarson
Thu Dec 16, 2010 12:32 am

I am really stuck now......nothing works as I had hoped.

I tried both methods suggested above:

1) I tried sending commands to RoboPlus using RemoconRXD, but the command never makes it in. I can see the RX light flash on the CM-510, but the protocol of the FF 55..etc. doesn't seem to work for me. I was testing this by just pusing the command in, and then having it send back what it received using RemoconTXD. Nothing.

2) I tried using the monitor to control the robot. The problem is the serial port doesn't seem to behave the same way as the one in RoboPlus terminal. If I boot it without the USB dongle attached, I get a constant stream of error messegs out of the serial port. However, as soon as the serial dongle is attached, everything is fine.

All I want to do is send it the motion numbers over a serial port so that I can sequence the moves using an external microcontroller. This shouldn't be this hard. I have spent days on it at this point.

All this whacky behavior, is really frustrating. The lack of documentation really sucks. I am just wanting to throw the whole thing in the trash bin.

-Ted
I am really stuck now......nothing works as I had hoped.

I tried both methods suggested above:

1) I tried sending commands to RoboPlus using RemoconRXD, but the command never makes it in. I can see the RX light flash on the CM-510, but the protocol of the FF 55..etc. doesn't seem to work for me. I was testing this by just pusing the command in, and then having it send back what it received using RemoconTXD. Nothing.

2) I tried using the monitor to control the robot. The problem is the serial port doesn't seem to behave the same way as the one in RoboPlus terminal. If I boot it without the USB dongle attached, I get a constant stream of error messegs out of the serial port. However, as soon as the serial dongle is attached, everything is fine.

All I want to do is send it the motion numbers over a serial port so that I can sequence the moves using an external microcontroller. This shouldn't be this hard. I have spent days on it at this point.

All this whacky behavior, is really frustrating. The lack of documentation really sucks. I am just wanting to throw the whole thing in the trash bin.

-Ted
tedlarson
Robot Builder
Robot Builder
Posts: 8
Joined: Fri Dec 10, 2010 11:33 pm

Post by tedlarson » Thu Dec 16, 2010 1:35 am

Post by tedlarson
Thu Dec 16, 2010 1:35 am

Ok....Major Breakthrough.....I was fiddling more with option #1...i.e. building a RoboPlus program to take input from the serial port, and process it.

My RoboPlus application is dirt simple right now for testing. I thought I would just try to send data out of the CM-510 first, and then see if I could get something coming out of the unit. I just did this test, and it sends data, but the data rate is really wierd. I put it on the scope, and the rate is 2kbps..i.e. the pulses are 500uS long. I re-timed my UART on the receiving side to 2kbps, and I am receiving data properly now.

SOOOO.....How do I change the baud rate on RemoconTX to run at something other than 2k?

-Ted
Ok....Major Breakthrough.....I was fiddling more with option #1...i.e. building a RoboPlus program to take input from the serial port, and process it.

My RoboPlus application is dirt simple right now for testing. I thought I would just try to send data out of the CM-510 first, and then see if I could get something coming out of the unit. I just did this test, and it sends data, but the data rate is really wierd. I put it on the scope, and the rate is 2kbps..i.e. the pulses are 500uS long. I re-timed my UART on the receiving side to 2kbps, and I am receiving data properly now.

SOOOO.....How do I change the baud rate on RemoconTX to run at something other than 2k?

-Ted
tedlarson
Robot Builder
Robot Builder
Posts: 8
Joined: Fri Dec 10, 2010 11:33 pm

Post by Dewey » Thu Dec 16, 2010 8:53 am

Post by Dewey
Thu Dec 16, 2010 8:53 am

Ok, we need to be clear what hardware arrangement you are using. The Remocon Command operates over the 4pin CM510 IR/zig110 port. The Zig units are preset by Robotis to operate at 57600baud.

You cannot listen or send Remocon Commands and expect it to work over the cable programming jack port!

You need to connect Zig110 to the CM510 and at your computer end the Zig2Usb Unit and a Zig2Serial Unit with a Zig100 Unit mounted on it. Alternatively make a cable up to connect the CM510 IR/Zig110 port to a TTL to RS232 Level Converter and then to the USB2Serial Unit. Both methods will work fine for me.

I'm at a loss to understand any CM510 data transmission at 2K baud!!!


Dewey
Ok, we need to be clear what hardware arrangement you are using. The Remocon Command operates over the 4pin CM510 IR/zig110 port. The Zig units are preset by Robotis to operate at 57600baud.

You cannot listen or send Remocon Commands and expect it to work over the cable programming jack port!

You need to connect Zig110 to the CM510 and at your computer end the Zig2Usb Unit and a Zig2Serial Unit with a Zig100 Unit mounted on it. Alternatively make a cable up to connect the CM510 IR/Zig110 port to a TTL to RS232 Level Converter and then to the USB2Serial Unit. Both methods will work fine for me.

I'm at a loss to understand any CM510 data transmission at 2K baud!!!


Dewey
Dewey
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 78
Joined: Sat May 12, 2007 1:17 pm
Location: Worcester UK

Post by Fritzoid » Thu Dec 16, 2010 2:11 pm

Post by Fritzoid
Thu Dec 16, 2010 2:11 pm

tedlarsen wrote:
If I boot it without the USB dongle attached, I get a constant stream of error messegs out of the serial port


From what serial port number in what program ?

FYI, the ZigBee (serial) port on the robot is disabled when the serial cable is plugged-in.

Dewey wrote:

You cannot listen or send Remocon Commands and expect it to work over the cable programming jack port!


But, RoboPlus Manage has an feature that does exactly that!

Actually, data packets can be received from either source. The magic happens in the Task program.

Reading "Remocon Arrived" causes the firmware to scan the input buffer for another data packet (skipping anything else). If a complete packet is found in the buffer then the data bytes are saved and the read Remocon Arrived call returns True. A subsequent read of "Remocon RXD" will return the saved data.
tedlarsen wrote:
If I boot it without the USB dongle attached, I get a constant stream of error messegs out of the serial port


From what serial port number in what program ?

FYI, the ZigBee (serial) port on the robot is disabled when the serial cable is plugged-in.

Dewey wrote:

You cannot listen or send Remocon Commands and expect it to work over the cable programming jack port!


But, RoboPlus Manage has an feature that does exactly that!

Actually, data packets can be received from either source. The magic happens in the Task program.

Reading "Remocon Arrived" causes the firmware to scan the input buffer for another data packet (skipping anything else). If a complete packet is found in the buffer then the data bytes are saved and the read Remocon Arrived call returns True. A subsequent read of "Remocon RXD" will return the saved data.
Fritzoid
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 331
Joined: Mon Dec 18, 2006 1:00 am

Post by tedlarson » Fri Dec 17, 2010 12:41 am

Post by tedlarson
Fri Dec 17, 2010 12:41 am

Just to clarify some things. I am not using the Zig-100. I have another microcontroller, connected directly to the 4-pin serial port, instead of it. It is using 3V logic. I do NOT have the programming cable connected at the same time.

If I write the worlds simplest RoboPlus program:

START PROGRAM
{
Remocon TXD = 85
}

It will send out a hex 0x55, at 2kbps, properly packed in the packet format. It looks like this:
FF 55 55 AA 00 FF

This is undisputable at this point. I don't know why it picks this baud rate....it just does. However, I cannot receive a data packet into the CM-510 using the following simple program:

START PROGRAM
{
IF(Remocon Arrived == TRUE)
{
RXX = Remocon RXD
Aux LED = TRUE
}
}

I never get the light. Even if I send the packet properly formatted.

What I think is going on is....the Zig-100 doesn't just have a radio in it, it has an ATMega microcontroller in there. It does something to signal to the CM-150 when it is connected. Otherwise, by default it assumes you have the IR receiver for the remote control attached. This is why it uses a 2K send rate by default, for sending via the IR remote port.

Without putting a protocol analyzer between the zig-100 and the CM-510, there is no way to know for sure. Unless somone has some info they can post here that tells me the answer for sure, that will be my next step.

Thanks,

-Ted
Just to clarify some things. I am not using the Zig-100. I have another microcontroller, connected directly to the 4-pin serial port, instead of it. It is using 3V logic. I do NOT have the programming cable connected at the same time.

If I write the worlds simplest RoboPlus program:

START PROGRAM
{
Remocon TXD = 85
}

It will send out a hex 0x55, at 2kbps, properly packed in the packet format. It looks like this:
FF 55 55 AA 00 FF

This is undisputable at this point. I don't know why it picks this baud rate....it just does. However, I cannot receive a data packet into the CM-510 using the following simple program:

START PROGRAM
{
IF(Remocon Arrived == TRUE)
{
RXX = Remocon RXD
Aux LED = TRUE
}
}

I never get the light. Even if I send the packet properly formatted.

What I think is going on is....the Zig-100 doesn't just have a radio in it, it has an ATMega microcontroller in there. It does something to signal to the CM-150 when it is connected. Otherwise, by default it assumes you have the IR receiver for the remote control attached. This is why it uses a 2K send rate by default, for sending via the IR remote port.

Without putting a protocol analyzer between the zig-100 and the CM-510, there is no way to know for sure. Unless somone has some info they can post here that tells me the answer for sure, that will be my next step.

Thanks,

-Ted
tedlarson
Robot Builder
Robot Builder
Posts: 8
Joined: Fri Dec 10, 2010 11:33 pm

Post by tedlarson » Fri Dec 17, 2010 2:59 am

Post by tedlarson
Fri Dec 17, 2010 2:59 am

Leave it to me to solve my own problem....I have it working now.

The solution is cryptic but simple. The serial port defaults to 2k to talk to the IR remote control. The Zig-100 sends some commands to change the bit rate when it first powers up.

The solution to using the serial port WITHOUT a Zig-100 attached, to get the bit rate to 56k, is to set the RemoteID=255. This is obfuscated command that forces it to switch to 56k.

Glad it is working....sucks that it took days for something stupid simple like that.

-Ted
Leave it to me to solve my own problem....I have it working now.

The solution is cryptic but simple. The serial port defaults to 2k to talk to the IR remote control. The Zig-100 sends some commands to change the bit rate when it first powers up.

The solution to using the serial port WITHOUT a Zig-100 attached, to get the bit rate to 56k, is to set the RemoteID=255. This is obfuscated command that forces it to switch to 56k.

Glad it is working....sucks that it took days for something stupid simple like that.

-Ted
tedlarson
Robot Builder
Robot Builder
Posts: 8
Joined: Fri Dec 10, 2010 11:33 pm

Post by Fraser » Fri Dec 17, 2010 10:38 pm

Post by Fraser
Fri Dec 17, 2010 10:38 pm

@tedlarson
Glad to read you solved that cryptic problem.


Very handy page Fritzoid, thanks!

@All,

I'm thinking of getting a Zig2Serial to use with my Zig110 pair:
http://robosavvy.com/store/product_info.php/products_id/224

Q)
With no 2.5mm jack plugged in will the wireless serial link operate just the same as the cable (only limited to top baud of 250kbps)? Any small differences etc?
@tedlarson
Glad to read you solved that cryptic problem.


Very handy page Fritzoid, thanks!

@All,

I'm thinking of getting a Zig2Serial to use with my Zig110 pair:
http://robosavvy.com/store/product_info.php/products_id/224

Q)
With no 2.5mm jack plugged in will the wireless serial link operate just the same as the cable (only limited to top baud of 250kbps)? Any small differences etc?
Fraser
Savvy Roboteer
Savvy Roboteer
Posts: 84
Joined: Tue Nov 30, 2010 2:16 pm

Post by siempre.aprendiendo » Sat Dec 18, 2010 12:56 pm

Post by siempre.aprendiendo
Sat Dec 18, 2010 12:56 pm

Ummm, but at ZIG2Serial page of Robotis it says "Basic Communication Speed : 57600bps"

Do you know what they mean with "basic"?
Ummm, but at ZIG2Serial page of Robotis it says "Basic Communication Speed : 57600bps"

Do you know what they mean with "basic"?
siempre.aprendiendo
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 559
Joined: Wed Aug 08, 2007 9:13 pm
Location: Barcelona

Next
20 postsPage 1 of 21, 2
20 postsPage 1 of 21, 2