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

First step towards cheapo IMU.

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
33 postsPage 2 of 31, 2, 3
33 postsPage 2 of 31, 2, 3

Post by billyzelsnack » Sat Aug 23, 2008 2:46 am

Post by billyzelsnack
Sat Aug 23, 2008 2:46 am

Let us know how well it works.
Let us know how well it works.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by billyzelsnack » Mon Aug 25, 2008 6:37 am

Post by billyzelsnack
Mon Aug 25, 2008 6:37 am

So I was thinking.. Maybe putting a magnetometer in a non 100% plastic robot is a bad plan? Seems like something so sensitive really is not going to like all this bits of metal constantly moving about in such close proximity. Though maybe it's insignificant and the real issue is a large masses of of metal ( desks and such ) near by bending the field lines. Anyone with experience here?
So I was thinking.. Maybe putting a magnetometer in a non 100% plastic robot is a bad plan? Seems like something so sensitive really is not going to like all this bits of metal constantly moving about in such close proximity. Though maybe it's insignificant and the real issue is a large masses of of metal ( desks and such ) near by bending the field lines. Anyone with experience here?
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by JonHylands » Tue Aug 26, 2008 1:09 pm

Post by JonHylands
Tue Aug 26, 2008 1:09 pm

Well, I got my HMC6343 yesterday, and it took about an hour to write the code to interface to it, which worked the first time. Of course, the I2C code I ended up using had a couple nice examples, so it was easy to adapt them.

So it works really well - its very responsive, and will update its internal sensor values at either 1 Hz, 5 Hz (default), or 10 Hz.

I'm impressed - the hardest part of the whole thing was building the cable, with some built-in pullup resistors.

I used one of my General I/O boards, which has pin sockets for the two pins (C4 and C5) that are used for I2C, with a 3.3 volt regulator and a hacked in serial port. I grabbed some I2C interface code from here:

http://www.uoxray.uoregon.edu/orangutan/i2c.zip

which worked perfectly.

My code looked like this:

Code: Select all
      i2c_start_wait (COMPASS_ADDRESS_WRITE);

      i2c_write (COMPASS_HEADING_COMMAND);
      i2c_rep_start (COMPASS_ADDRESS_READ);
      heading = (i2c_readAck () * 256) + i2c_readAck ();
      pitch = (i2c_readAck () * 256) + i2c_readAck ();
      roll = (i2c_readAck () * 256) + i2c_readNak ();
      i2c_stop ();

      printf ("Heading: %4d   Pitch: %4d   Roll: %4d\n", heading, pitch, roll);


- Jon
Well, I got my HMC6343 yesterday, and it took about an hour to write the code to interface to it, which worked the first time. Of course, the I2C code I ended up using had a couple nice examples, so it was easy to adapt them.

So it works really well - its very responsive, and will update its internal sensor values at either 1 Hz, 5 Hz (default), or 10 Hz.

I'm impressed - the hardest part of the whole thing was building the cable, with some built-in pullup resistors.

I used one of my General I/O boards, which has pin sockets for the two pins (C4 and C5) that are used for I2C, with a 3.3 volt regulator and a hacked in serial port. I grabbed some I2C interface code from here:

http://www.uoxray.uoregon.edu/orangutan/i2c.zip

which worked perfectly.

My code looked like this:

Code: Select all
      i2c_start_wait (COMPASS_ADDRESS_WRITE);

      i2c_write (COMPASS_HEADING_COMMAND);
      i2c_rep_start (COMPASS_ADDRESS_READ);
      heading = (i2c_readAck () * 256) + i2c_readAck ();
      pitch = (i2c_readAck () * 256) + i2c_readAck ();
      roll = (i2c_readAck () * 256) + i2c_readNak ();
      i2c_stop ();

      printf ("Heading: %4d   Pitch: %4d   Roll: %4d\n", heading, pitch, roll);


- Jon
JonHylands
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 512
Joined: Thu Nov 09, 2006 1:00 am
Location: Ontario, Canada

Post by billyzelsnack » Tue Aug 26, 2008 7:16 pm

Post by billyzelsnack
Tue Aug 26, 2008 7:16 pm

Is the data consistently nice and clean? What about when near metal objects? What about near an operating Bioloid?

Looks like it gives you a heading/pitch/roll. So that's an actual absolute 3-axis orientation ( minus gimble lock? )? I don't fully understand the implication of adding in the magnetometer. What's your understanding of how it pairs with an accelerometer?
Is the data consistently nice and clean? What about when near metal objects? What about near an operating Bioloid?

Looks like it gives you a heading/pitch/roll. So that's an actual absolute 3-axis orientation ( minus gimble lock? )? I don't fully understand the implication of adding in the magnetometer. What's your understanding of how it pairs with an accelerometer?
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by billyzelsnack » Tue Aug 26, 2008 7:34 pm

Post by billyzelsnack
Tue Aug 26, 2008 7:34 pm

So I went and did a little more research.

Looks like you don't get an 3 axis absolute orientation. It gives you basically the same data as an accelerometer except its data is not going to be corrupted by translations. However its data can be corrupted by nearby metal objects.
So I went and did a little more research.

Looks like you don't get an 3 axis absolute orientation. It gives you basically the same data as an accelerometer except its data is not going to be corrupted by translations. However its data can be corrupted by nearby metal objects.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by JonHylands » Tue Aug 26, 2008 10:02 pm

Post by JonHylands
Tue Aug 26, 2008 10:02 pm

This is an example data set, with the compass board held down in one place:

Code: Select all
Heading: 286.9   Pitch:   2.1   Roll:    0.3
Heading: 287.6   Pitch:   2.2   Roll:    0.2
Heading: 287.4   Pitch:   2.2   Roll:    0.5
Heading: 286.8   Pitch:   2.1   Roll:    0.3
Heading: 285.9   Pitch:   1.8   Roll:    0.4
Heading: 287.0   Pitch:   2.1   Roll:    0.3
Heading: 287.6   Pitch:   2.3   Roll:    0.3
Heading: 286.7   Pitch:   2.1   Roll:    0.4
Heading: 287.1   Pitch:   2.1   Roll:    0.4
Heading: 287.3   Pitch:   2.2   Roll:    0.4
Heading: 287.3   Pitch:   2.2   Roll:    0.2
Heading: 286.0   Pitch:   1.8   Roll:    0.3
Heading: 286.6   Pitch:   1.9   Roll:    0.3
Heading: 286.9   Pitch:   2.0   Roll:    0.3
Heading: 287.3   Pitch:   2.2   Roll:    0.2
Heading: 286.4   Pitch:   1.8   Roll:    0.5
Heading: 287.4   Pitch:   2.3   Roll:    0.3
Heading: 286.1   Pitch:   2.0   Roll:    0.3
Heading: 286.0   Pitch:   2.0   Roll:    0.0
Heading: 286.6   Pitch:   2.0   Roll:    0.2
Heading: 286.4   Pitch:   2.0   Roll:    0.3
Heading: 286.1   Pitch:   1.9   Roll:    0.3
Heading: 287.0   Pitch:   2.0   Roll:    0.3


The only point of having the accelerometer is to allow the actual level orientation to be extracted from the 3-axis magnetometer. Of course, if the compass is being bumped around a lot, you won't get a stable heading.

I'll try and do a test with it mounted on MicroRaptor soon...

- Jon
This is an example data set, with the compass board held down in one place:

Code: Select all
Heading: 286.9   Pitch:   2.1   Roll:    0.3
Heading: 287.6   Pitch:   2.2   Roll:    0.2
Heading: 287.4   Pitch:   2.2   Roll:    0.5
Heading: 286.8   Pitch:   2.1   Roll:    0.3
Heading: 285.9   Pitch:   1.8   Roll:    0.4
Heading: 287.0   Pitch:   2.1   Roll:    0.3
Heading: 287.6   Pitch:   2.3   Roll:    0.3
Heading: 286.7   Pitch:   2.1   Roll:    0.4
Heading: 287.1   Pitch:   2.1   Roll:    0.4
Heading: 287.3   Pitch:   2.2   Roll:    0.4
Heading: 287.3   Pitch:   2.2   Roll:    0.2
Heading: 286.0   Pitch:   1.8   Roll:    0.3
Heading: 286.6   Pitch:   1.9   Roll:    0.3
Heading: 286.9   Pitch:   2.0   Roll:    0.3
Heading: 287.3   Pitch:   2.2   Roll:    0.2
Heading: 286.4   Pitch:   1.8   Roll:    0.5
Heading: 287.4   Pitch:   2.3   Roll:    0.3
Heading: 286.1   Pitch:   2.0   Roll:    0.3
Heading: 286.0   Pitch:   2.0   Roll:    0.0
Heading: 286.6   Pitch:   2.0   Roll:    0.2
Heading: 286.4   Pitch:   2.0   Roll:    0.3
Heading: 286.1   Pitch:   1.9   Roll:    0.3
Heading: 287.0   Pitch:   2.0   Roll:    0.3


The only point of having the accelerometer is to allow the actual level orientation to be extracted from the 3-axis magnetometer. Of course, if the compass is being bumped around a lot, you won't get a stable heading.

I'll try and do a test with it mounted on MicroRaptor soon...

- Jon
JonHylands
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 512
Joined: Thu Nov 09, 2006 1:00 am
Location: Ontario, Canada

Post by billyzelsnack » Wed Aug 27, 2008 6:52 am

Post by billyzelsnack
Wed Aug 27, 2008 6:52 am

I was messing around with getting data out of heli gyros again tonight. I came across this post..

http://www.arduino.cc/cgi-bin/yabb2/YaB ... 926139/1#1

Grabbing data this way would be nice because the load on the uc is not much so it scales better for sampling multiple gyros.

I gave it a go and it didn't work out so well. I would get many different values and they may or may not of been changing in response to mucking the gyros. My electronics skill is zero so this probably is way off, but would I need to be sampling this at a specific rate? I guess I don't understand how it magically turns the digital PWM into a single analog value.
I was messing around with getting data out of heli gyros again tonight. I came across this post..

http://www.arduino.cc/cgi-bin/yabb2/YaB ... 926139/1#1

Grabbing data this way would be nice because the load on the uc is not much so it scales better for sampling multiple gyros.

I gave it a go and it didn't work out so well. I would get many different values and they may or may not of been changing in response to mucking the gyros. My electronics skill is zero so this probably is way off, but would I need to be sampling this at a specific rate? I guess I don't understand how it magically turns the digital PWM into a single analog value.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by billyzelsnack » Wed Aug 27, 2008 7:00 am

Post by billyzelsnack
Wed Aug 27, 2008 7:00 am

billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by billyzelsnack » Wed Aug 27, 2008 7:04 am

Post by billyzelsnack
Wed Aug 27, 2008 7:04 am

More infos on converting PWM to analog.

http://www.ontrak.net/pwm.htm
More infos on converting PWM to analog.

http://www.ontrak.net/pwm.htm
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by billyzelsnack » Wed Aug 27, 2008 7:18 am

Post by billyzelsnack
Wed Aug 27, 2008 7:18 am

More much infos and a much more elaborate method..

http://homepages.which.net/~paul.hills/ ... coder.html
More much infos and a much more elaborate method..

http://homepages.which.net/~paul.hills/ ... coder.html
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by JonHylands » Wed Aug 27, 2008 12:36 pm

Post by JonHylands
Wed Aug 27, 2008 12:36 pm

billyzelsnack wrote:haha..

Look at the author..

http://www.nabble.com/Re%3A-How-to-read ... 61252.html


Dave is my brother, in case you were wondering...

- Jon
billyzelsnack wrote:haha..

Look at the author..

http://www.nabble.com/Re%3A-How-to-read ... 61252.html


Dave is my brother, in case you were wondering...

- Jon
JonHylands
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 512
Joined: Thu Nov 09, 2006 1:00 am
Location: Ontario, Canada

Post by billyzelsnack » Wed Aug 27, 2008 7:06 pm

Post by billyzelsnack
Wed Aug 27, 2008 7:06 pm

Yeah I know. I just thought it was funny that I go searching for some random thing to post in a thread that another Hylands would most likely read.
Yeah I know. I just thought it was funny that I go searching for some random thing to post in a thread that another Hylands would most likely read.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by billyzelsnack » Sun Aug 31, 2008 6:29 am

Post by billyzelsnack
Sun Aug 31, 2008 6:29 am

PS3 gamepads have a 3 axis accelerometer ( I knew that ) AND a gyro! Combined with bluetooth this might be a pretty easy ( almost ) solution.

IF YOU CAN GET IT TO WORK. haha.

I tried for a couple of hours and could not get any of the various Windows drivers found via google searching to work.

The SIXAXIS controller is being discontinued so pretty soon it should be possible to find these suckers for cheap.



http://www.kako.com/neta/2006-018/2006-018.html
Could the gyro be the one with the connector!!!! Man. If so I am going to start buying broken controllers on ebay.
PS3 gamepads have a 3 axis accelerometer ( I knew that ) AND a gyro! Combined with bluetooth this might be a pretty easy ( almost ) solution.

IF YOU CAN GET IT TO WORK. haha.

I tried for a couple of hours and could not get any of the various Windows drivers found via google searching to work.

The SIXAXIS controller is being discontinued so pretty soon it should be possible to find these suckers for cheap.



http://www.kako.com/neta/2006-018/2006-018.html
Could the gyro be the one with the connector!!!! Man. If so I am going to start buying broken controllers on ebay.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by billyzelsnack » Sun Aug 31, 2008 6:50 am

Post by billyzelsnack
Sun Aug 31, 2008 6:50 am

Ok this is funny..

http://www.murata.com/catalog/s42e.pdf

Apparently that's the gyro in the SIXAXIS. Which I think is the same gyro inside the RC heli gyro I've been messing with. Which also is the same gyro that's in lower end heli 4-in-1 controllers. So I have literally 8 of these things laying around in my workshop. haha.

So after looking at that spec and then looking at the actual gyro on the RC gyro board.. 4 pins!!! How did I not notice this before. I can easily just unsolder it and not mess around with reading the PWM! I guess it is nice to be able to read it because that makes it plug and play with my high-end heli gyros when I end up daring to test them.

One other thing.. I also saw in my readings ( and mentioned in that pdf above ) that you can't put multiple gyros in the same circuit. I guess they mess with each other. Hopefully that's just power and they can share the same ground.
Ok this is funny..

http://www.murata.com/catalog/s42e.pdf

Apparently that's the gyro in the SIXAXIS. Which I think is the same gyro inside the RC heli gyro I've been messing with. Which also is the same gyro that's in lower end heli 4-in-1 controllers. So I have literally 8 of these things laying around in my workshop. haha.

So after looking at that spec and then looking at the actual gyro on the RC gyro board.. 4 pins!!! How did I not notice this before. I can easily just unsolder it and not mess around with reading the PWM! I guess it is nice to be able to read it because that makes it plug and play with my high-end heli gyros when I end up daring to test them.

One other thing.. I also saw in my readings ( and mentioned in that pdf above ) that you can't put multiple gyros in the same circuit. I guess they mess with each other. Hopefully that's just power and they can share the same ground.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by billyzelsnack » Fri Sep 12, 2008 6:12 am

Post by billyzelsnack
Fri Sep 12, 2008 6:12 am

JonHylands wrote:I'll try and do a test with it mounted on MicroRaptor soon...

- Jon


Did you do the test yet? I'm really interested in how much interference a bioloid based robot will create. I'm thinking of ordering one of these..

http://www.pnicorp.com/products/all/sen-xy

and want to know if I should even bother if the interfence is going to make the data useless.
JonHylands wrote:I'll try and do a test with it mounted on MicroRaptor soon...

- Jon


Did you do the test yet? I'm really interested in how much interference a bioloid based robot will create. I'm thinking of ordering one of these..

http://www.pnicorp.com/products/all/sen-xy

and want to know if I should even bother if the interfence is going to make the data useless.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

PreviousNext
33 postsPage 2 of 31, 2, 3
33 postsPage 2 of 31, 2, 3