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

How can sensors be read from PC with usb2dynamixel or toss?

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

How can sensors be read from PC with usb2dynamixel or toss?

Post by siempre.aprendiendo » Sat Apr 24, 2010 9:53 pm

Post by siempre.aprendiendo
Sat Apr 24, 2010 9:53 pm

I have found information about how to get values from the new premium sensors using roboplus and embedded C, but not using usb2dynamixel or toss mode.

As the new sensors are not in the dynamixel bus I suppose it's necessary to use the CM-510, isn't it?

For example, I think that should be possible to write a program like the monitor function but with the added funcionality of answering to a "virtual ID", to get values from the new sensors. But my knowledge of AVR/CM-5/CM-510 is very scarce :(

Searching for some examples I have found this one, usarts.c, is this the correct way?

Thanks!
I have found information about how to get values from the new premium sensors using roboplus and embedded C, but not using usb2dynamixel or toss mode.

As the new sensors are not in the dynamixel bus I suppose it's necessary to use the CM-510, isn't it?

For example, I think that should be possible to write a program like the monitor function but with the added funcionality of answering to a "virtual ID", to get values from the new sensors. But my knowledge of AVR/CM-5/CM-510 is very scarce :(

Searching for some examples I have found this one, usarts.c, is this the correct way?

Thanks!
siempre.aprendiendo
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 559
Joined: Wed Aug 08, 2007 9:13 pm
Location: Barcelona

Post by billyzelsnack » Sun Apr 25, 2010 1:45 am

Post by billyzelsnack
Sun Apr 25, 2010 1:45 am

The code posted here might be useful to build upon..

http://support.robotis.com/en/software/ ... 10_700.htm

I believe it uses a version of the dynamixel sdk that runs on the cm-510 itself.
The code posted here might be useful to build upon..

http://support.robotis.com/en/software/ ... 10_700.htm

I believe it uses a version of the dynamixel sdk that runs on the cm-510 itself.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by siempre.aprendiendo » Sun Apr 25, 2010 9:37 am

Post by siempre.aprendiendo
Sun Apr 25, 2010 9:37 am

Thanks, billyzelsnack.

I have been reading this code too. But one of my doubts is how can the dynamixel bus be read without specifyng an ID, is it possible to read with the broadcast (0XFE) id?

I hope today I can do some tests...
Thanks, billyzelsnack.

I have been reading this code too. But one of my doubts is how can the dynamixel bus be read without specifyng an ID, is it possible to read with the broadcast (0XFE) id?

I hope today I can do some tests...
siempre.aprendiendo
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 559
Joined: Wed Aug 08, 2007 9:13 pm
Location: Barcelona

Post by FabinovX » Sun Apr 25, 2010 10:55 am

Post by FabinovX
Sun Apr 25, 2010 10:55 am

Hi,
maybe i'm wrong but i don't think you will be able to read datas with
broadcast Id, you will just be able to write datas with this special Id.
In order to read data sensors through cm510 and USB2Dynamixel, roboplus manager do it, so i think we can do it too.
unfortunately i don't know how ...
you may ask at ROBOTIS BOARD, i'm shure they will tell you how to do it.
Hi,
maybe i'm wrong but i don't think you will be able to read datas with
broadcast Id, you will just be able to write datas with this special Id.
In order to read data sensors through cm510 and USB2Dynamixel, roboplus manager do it, so i think we can do it too.
unfortunately i don't know how ...
you may ask at ROBOTIS BOARD, i'm shure they will tell you how to do it.
FabinovX
Savvy Roboteer
Savvy Roboteer
Posts: 74
Joined: Mon Feb 01, 2010 4:12 pm

Post by billyzelsnack » Sun Apr 25, 2010 9:08 pm

Post by billyzelsnack
Sun Apr 25, 2010 9:08 pm

I guess since you are using roboplus that complicates things. I can see it as possible by writing your own firmware that can interpret the Roboplus tsk, but that's a whole lot of extra work.
I guess since you are using roboplus that complicates things. I can see it as possible by writing your own firmware that can interpret the Roboplus tsk, but that's a whole lot of extra work.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by siempre.aprendiendo » Sun Apr 25, 2010 11:24 pm

Post by siempre.aprendiendo
Sun Apr 25, 2010 11:24 pm

Nop, I'm not using roboplus. My doubts is about how to do it using embedded C. But if there is an easier way to read the sensors from a PC (with usb2dynamixel) I have no problem of using it :)

Code: Select all
usb2dynamixel (PC) <-> embedded C (CM-510) <-> sensors

            ^                                           ^
send query to CM-510      receives query from PC,
                                         read data from the sensors
                                         send data to PC
Nop, I'm not using roboplus. My doubts is about how to do it using embedded C. But if there is an easier way to read the sensors from a PC (with usb2dynamixel) I have no problem of using it :)

Code: Select all
usb2dynamixel (PC) <-> embedded C (CM-510) <-> sensors

            ^                                           ^
send query to CM-510      receives query from PC,
                                         read data from the sensors
                                         send data to PC
siempre.aprendiendo
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 559
Joined: Wed Aug 08, 2007 9:13 pm
Location: Barcelona

Post by Fritzoid » Mon Apr 26, 2010 11:36 am

Post by Fritzoid
Mon Apr 26, 2010 11:36 am

A program can easily read the analog sensors using command mode. CID 200 (0xC8) is the servo ID for the the main controller (CM-5 or CM-510). The analog sensor readings are saved in the control table and are accessible using a read data instruction. The address you use is 80 (0x50). For some strange reason there are additional sets of sensor readings at other addresses (0x56 and 0x68). You can see them all if you use the dump command after setting your CID to 200.

This functionality is provided by the firmware's command processor so the input must come from the PC serial connection. You could not send it from another device on the dynamixel bus and expect a response. I would not expect it to work in Toss mode either.

If you monitor the traffic between your controller and RoboPlus Manager when it's displaying the ext. equipment page you can see how Robotis does it.
A program can easily read the analog sensors using command mode. CID 200 (0xC8) is the servo ID for the the main controller (CM-5 or CM-510). The analog sensor readings are saved in the control table and are accessible using a read data instruction. The address you use is 80 (0x50). For some strange reason there are additional sets of sensor readings at other addresses (0x56 and 0x68). You can see them all if you use the dump command after setting your CID to 200.

This functionality is provided by the firmware's command processor so the input must come from the PC serial connection. You could not send it from another device on the dynamixel bus and expect a response. I would not expect it to work in Toss mode either.

If you monitor the traffic between your controller and RoboPlus Manager when it's displaying the ext. equipment page you can see how Robotis does it.
Fritzoid
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 331
Joined: Mon Dec 18, 2006 1:00 am

Post by billyzelsnack » Mon Apr 26, 2010 5:13 pm

Post by billyzelsnack
Mon Apr 26, 2010 5:13 pm

If you're not using roboplus then I don't think there is a problem as long as you follow the dynamixel protocol/conventions in your new firmware.

Write a firmware that can interpret the basic dynamixel packet protocol ( 0xff, 0xff, id, length, .. , checksum ( off the top of my head ) ). If the packet has the made up id for your sensors then read the sensor and write it back in a response packet. The actual packet data is up to you.

Or.. Maybe I still am completely not understanding you? Doh.
If you're not using roboplus then I don't think there is a problem as long as you follow the dynamixel protocol/conventions in your new firmware.

Write a firmware that can interpret the basic dynamixel packet protocol ( 0xff, 0xff, id, length, .. , checksum ( off the top of my head ) ). If the packet has the made up id for your sensors then read the sensor and write it back in a response packet. The actual packet data is up to you.

Or.. Maybe I still am completely not understanding you? Doh.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by siempre.aprendiendo » Mon Apr 26, 2010 6:46 pm

Post by siempre.aprendiendo
Mon Apr 26, 2010 6:46 pm

That is the problem, billyzelsnack

The new sensors are not supported/included in the dynamixel protocol, they are not another dynamixel element, as it is the AX-S1, for example.
That is the problem, billyzelsnack

The new sensors are not supported/included in the dynamixel protocol, they are not another dynamixel element, as it is the AX-S1, for example.
siempre.aprendiendo
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 559
Joined: Wed Aug 08, 2007 9:13 pm
Location: Barcelona

Post by siempre.aprendiendo » Mon Apr 26, 2010 6:54 pm

Post by siempre.aprendiendo
Mon Apr 26, 2010 6:54 pm

Fritzoid wrote:A program can easily read the analog sensors using command mode. CID 200 (0xC8) is the servo ID for the the main controller (CM-5 or CM-510). The analog sensor readings are saved in the control table and are accessible using a read data instruction. The address you use is 80 (0x50). For some strange reason there are additional sets of sensor readings at other addresses (0x56 and 0x68). You can see them all if you use the dump command after setting your CID to 200.

This functionality is provided by the firmware's command processor so the input must come from the PC serial connection. You could not send it from another device on the dynamixel bus and expect a response. I would not expect it to work in Toss mode either.

If you monitor the traffic between your controller and RoboPlus Manager when it's displaying the ext. equipment page you can see how Robotis does it.


Humm, very interesting. It's a pity that Robotis doesn't open source their CM-5/CM-510 code, as Lego Mindstorms do in their advanced site

[Edited] Well, a least Robotis has published the source code of the dynamixel SDK :)

I think I only would need the monitor firmware source code :)


Thanks for the information!
Fritzoid wrote:A program can easily read the analog sensors using command mode. CID 200 (0xC8) is the servo ID for the the main controller (CM-5 or CM-510). The analog sensor readings are saved in the control table and are accessible using a read data instruction. The address you use is 80 (0x50). For some strange reason there are additional sets of sensor readings at other addresses (0x56 and 0x68). You can see them all if you use the dump command after setting your CID to 200.

This functionality is provided by the firmware's command processor so the input must come from the PC serial connection. You could not send it from another device on the dynamixel bus and expect a response. I would not expect it to work in Toss mode either.

If you monitor the traffic between your controller and RoboPlus Manager when it's displaying the ext. equipment page you can see how Robotis does it.


Humm, very interesting. It's a pity that Robotis doesn't open source their CM-5/CM-510 code, as Lego Mindstorms do in their advanced site

[Edited] Well, a least Robotis has published the source code of the dynamixel SDK :)

I think I only would need the monitor firmware source code :)


Thanks for the information!
Last edited by siempre.aprendiendo on Sat May 15, 2010 11:48 pm, edited 2 times in total.
siempre.aprendiendo
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 559
Joined: Wed Aug 08, 2007 9:13 pm
Location: Barcelona

Post by FabinovX » Mon Apr 26, 2010 9:22 pm

Post by FabinovX
Mon Apr 26, 2010 9:22 pm

you can try here to get some datas from sensors using personal firmware :
http://support.robotis.com/en/software/ ... sensor.htm
then make your own packet.

which kind of link do you use between PC and CM510 ?
if you use ZIG you can also have a look at :
http://support.robotis.com/en/software/ ... zigbee.htm

and you will also really interested in zig2serial SDK.

I have zig2serial connected to my USB2Dynamixel and have started a project a month ago to get position of AX12 and some sensors values from CM510 using a .tsk dedicated program.
but i'm at the limit of tsk possibilities and i will need some arrays when programming the CM510.
Unfortunatly there is no way to use arrays in roboplus task.
i asked ROBOTIS the possibility to emulate arrays through virtual out of range dynamixel ID, but they told me they didn't plan for that kind of thing for the moment.
My ability to program firmware is near absolut 0,
i'm new in robotics and i'm learning c++ since i got my Premium but visual c++ is quite hard to master when you're a beginner, so it will be a long way for me to reach my goal which is to use my PC as a controller/'brain' for my bioloid.

if you have the same goal, then maybe we can join our efforts to get some results more quickly.

hasta la vista.
Cheers
FabinovX
you can try here to get some datas from sensors using personal firmware :
http://support.robotis.com/en/software/ ... sensor.htm
then make your own packet.

which kind of link do you use between PC and CM510 ?
if you use ZIG you can also have a look at :
http://support.robotis.com/en/software/ ... zigbee.htm

and you will also really interested in zig2serial SDK.

I have zig2serial connected to my USB2Dynamixel and have started a project a month ago to get position of AX12 and some sensors values from CM510 using a .tsk dedicated program.
but i'm at the limit of tsk possibilities and i will need some arrays when programming the CM510.
Unfortunatly there is no way to use arrays in roboplus task.
i asked ROBOTIS the possibility to emulate arrays through virtual out of range dynamixel ID, but they told me they didn't plan for that kind of thing for the moment.
My ability to program firmware is near absolut 0,
i'm new in robotics and i'm learning c++ since i got my Premium but visual c++ is quite hard to master when you're a beginner, so it will be a long way for me to reach my goal which is to use my PC as a controller/'brain' for my bioloid.

if you have the same goal, then maybe we can join our efforts to get some results more quickly.

hasta la vista.
Cheers
FabinovX
FabinovX
Savvy Roboteer
Savvy Roboteer
Posts: 74
Joined: Mon Feb 01, 2010 4:12 pm

Post by billyzelsnack » Tue Apr 27, 2010 9:24 pm

Post by billyzelsnack
Tue Apr 27, 2010 9:24 pm

If you only have minimal elements required for your array you can emulate them with a couple function calls and a lot of if statements. It's not only tedious and error prone, but you also only have a limited number of variables in Roboplus. However.. You can make it to work. I used it for my Bioloid bigtrak project..

http://robosavvy.com/forum/viewtopic.ph ... highlight=
If you only have minimal elements required for your array you can emulate them with a couple function calls and a lot of if statements. It's not only tedious and error prone, but you also only have a limited number of variables in Roboplus. However.. You can make it to work. I used it for my Bioloid bigtrak project..

http://robosavvy.com/forum/viewtopic.ph ... highlight=
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by siempre.aprendiendo » Sat May 15, 2010 11:23 am

Post by siempre.aprendiendo
Sat May 15, 2010 11:23 am

Sorry for the delay, I have been very busy with other non-bioloid project I have in mind :)

FabinovX wrote:you can try here to get some datas from sensors using personal firmware :
http://support.robotis.com/en/software/ ... sensor.htm
then make your own packet.


I know there are examples about how to read sensors and dynamixel data. Anyway, thanks for answering :)


But my doubt is about

[Edited] how to program the CM-5/CM-510 to act as it "was" another dynamixel, that could be queried from the usb2dynamixel using certain ID

which kind of link do you use between PC and CM510 ?


I use a serial<->bluetooth adaptor

...

I have zig2serial connected to my USB2Dynamixel and have started a project a month ago to get position of AX12 and some sensors values from CM510 using a .tsk dedicated program.
but i'm at the limit of tsk possibilities and i will need some arrays when programming the CM510.


May be you can use the tsk program as only a connector , read/write from/to the sensors and servos to/from the PC.

My ability to program firmware is near absolut 0,
i'm new in robotics and i'm learning c++ since i got my Premium but visual c++ is quite hard to master when you're a beginner, so it will be a long way for me to reach my goal which is to use my PC as a controller/'brain' for my bioloid.


Do you know any other programming language (Java, C#, ... )?

if you have the same goal, then maybe we can join our efforts to get some results more quickly.


I usually use the PDA/PC as the brain. You can AntOne 2 and BudaOne as two examples in my youtube channel or website (spanish/english)

hasta la vista.


¿"Hablas" español? :D ¿De dónde eres?
(Do you speak spanish? Where are you from?)
Sorry for the delay, I have been very busy with other non-bioloid project I have in mind :)

FabinovX wrote:you can try here to get some datas from sensors using personal firmware :
http://support.robotis.com/en/software/ ... sensor.htm
then make your own packet.


I know there are examples about how to read sensors and dynamixel data. Anyway, thanks for answering :)


But my doubt is about

[Edited] how to program the CM-5/CM-510 to act as it "was" another dynamixel, that could be queried from the usb2dynamixel using certain ID

which kind of link do you use between PC and CM510 ?


I use a serial<->bluetooth adaptor

...

I have zig2serial connected to my USB2Dynamixel and have started a project a month ago to get position of AX12 and some sensors values from CM510 using a .tsk dedicated program.
but i'm at the limit of tsk possibilities and i will need some arrays when programming the CM510.


May be you can use the tsk program as only a connector , read/write from/to the sensors and servos to/from the PC.

My ability to program firmware is near absolut 0,
i'm new in robotics and i'm learning c++ since i got my Premium but visual c++ is quite hard to master when you're a beginner, so it will be a long way for me to reach my goal which is to use my PC as a controller/'brain' for my bioloid.


Do you know any other programming language (Java, C#, ... )?

if you have the same goal, then maybe we can join our efforts to get some results more quickly.


I usually use the PDA/PC as the brain. You can AntOne 2 and BudaOne as two examples in my youtube channel or website (spanish/english)

hasta la vista.


¿"Hablas" español? :D ¿De dónde eres?
(Do you speak spanish? Where are you from?)
siempre.aprendiendo
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 559
Joined: Wed Aug 08, 2007 9:13 pm
Location: Barcelona

Post by siempre.aprendiendo » Sat May 15, 2010 10:53 pm

Post by siempre.aprendiendo
Sat May 15, 2010 10:53 pm

I think I have found the answer in the source code generously shared by Jon & Dave Hylands.

Again, BIG thanks to them.

Of course, if I'm able to achieve it to work, I will publish it
I think I have found the answer in the source code generously shared by Jon & Dave Hylands.

Again, BIG thanks to them.

Of course, if I'm able to achieve it to work, I will publish it
siempre.aprendiendo
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 559
Joined: Wed Aug 08, 2007 9:13 pm
Location: Barcelona

Post by siempre.aprendiendo » Sun May 16, 2010 1:52 am

Post by siempre.aprendiendo
Sun May 16, 2010 1:52 am

billyzelsnack wrote:If you're not using roboplus then I don't think there is a problem as long as you follow the dynamixel protocol/conventions in your new firmware.

Write a firmware that can interpret the basic dynamixel packet protocol ( 0xff, 0xff, id, length, .. , checksum ( off the top of my head ) ). If the packet has the made up id for your sensors then read the sensor and write it back in a response packet. The actual packet data is up to you.

Or.. Maybe I still am completely not understanding you? Doh.


Thanks billyzelsnack.

I didn't understand your solution because I thought that every dynamixel only receives the packets addressed to them.

But reading some code from Jon Hylands it seems that they receives all the packets, as you said.

Today is very late (0:52 + 2), tomorrow I will do some tests :)
billyzelsnack wrote:If you're not using roboplus then I don't think there is a problem as long as you follow the dynamixel protocol/conventions in your new firmware.

Write a firmware that can interpret the basic dynamixel packet protocol ( 0xff, 0xff, id, length, .. , checksum ( off the top of my head ) ). If the packet has the made up id for your sensors then read the sensor and write it back in a response packet. The actual packet data is up to you.

Or.. Maybe I still am completely not understanding you? Doh.


Thanks billyzelsnack.

I didn't understand your solution because I thought that every dynamixel only receives the packets addressed to them.

But reading some code from Jon Hylands it seems that they receives all the packets, as you said.

Today is very late (0:52 + 2), tomorrow I will do some tests :)
siempre.aprendiendo
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 559
Joined: Wed Aug 08, 2007 9:13 pm
Location: Barcelona

Next
18 postsPage 1 of 21, 2
18 postsPage 1 of 21, 2