PDA

View Full Version : Accelerometer Rotation



CumQuaT
11-19-2010, 01:46 AM
Hi all,

I understand that a Gyroscope or Compass module would be more suited to this, but humour me on this one...

Has anyone had any success using something like the H48C Tri-Axis accelerometer to measure yaw rotation and find a heading compared to an initial value? If so, any idea on the maths behind that?

Just curious...

CumQuaT
11-19-2010, 03:24 AM
To clarify, I'm trying to build an air-mouse of sorts, and I have a couple of tri-axis accelerometers, but no gyros. Just want to know if it's at all possible without making a new order. International shipping to Australia is expensive as hell!

wjsteele
11-19-2010, 03:28 AM
The accelerometer object (in the Obex) does this already.

As for shipping, you might want to consider asking a company for samples of the sensors you want... they usually will ship for free.

Bill

CumQuaT
11-19-2010, 03:56 AM
Hi,

I've already had a play with the OBEX objects for it, and I can't get it to recognize rotation at all. Pitching and rolling, quite well, but not yaw rotation.

I even contacted the generous Beau Schwabe who gave me his older version of the object that draws the 3D cube, and it didn't like Yaw rotation at all...

Phil Pilgrim (PhiPi)
11-19-2010, 04:25 AM
There is not a static way to detect yaw with accelerometers, since gravity doesn't work in that direction. It may be possible to detect it dynamically with two accelerometers at opposite ends of an arm that rotates about the Z-axis. You would have to integrate the centripetal accelerations to determine an angular displacement, though, and your success will depend on the resolution of the sensors and the lack of drift in the differential readings between the two.

-Phil

CumQuaT
11-19-2010, 04:28 AM
That's not a bad idea, but it's sounding more and more like a gyroscope and a 2-axis accelerometer would be the way to go to simulate an accurate 3D mouse. Would you agree?

Beau Schwabe
11-19-2010, 04:32 AM
CumQuaT,

You can measure the pitch & roll from accelerometer because earth's gravity will always show a 1 G component on the downward direction, but for yaw you need alternative arrangement.

The H48C will not provide any information when rotated on Z axis, however if the Z axis of the H48C is offset by a distance from the actual center of rotation then it will provide acceleration. <- Edit Basically what Phil is describing above with two Accelerometers, but simplified down to only one accelerometer.

The best solution though is to use a Compass or Gyro to determine yaw.

CumQuaT
11-19-2010, 04:42 AM
Some great food for thought there. In the rig that I'm setting up, the air mouse will always be at arms length, which means the point of rotation will be at the shoulder, allowing me to pick up that movement... Should be fun to play around with!

Thanks for the help (again) Beau!

Phil Pilgrim (PhiPi)
11-19-2010, 04:44 AM
Beau is correct about using one accelerometer, assuming you know where the center of rotation is and assuming (given a 2-axis unit) there's no roll involved. With two accelerometers, roll and any uncertainties about the center cancel in the yaw computation, since it uses a differential measurement. But I'm with Beau and keeping things simple with an accelerometer and a gyro.

-Phil

Beau Schwabe
11-19-2010, 04:52 AM
I do have another version of the Memsic2125 driver that provides tHx as well as Tx. With that you can derive a better ratio metric value if the clock happens to be slightly skewed from one accelerometer verses another accelerometer.

The current version only provides tHx and assumes that the clock is always 100Hz.

I will clean up the new version and post it to the OBEX soon.

CumQuaT
11-19-2010, 04:52 AM
Yeah, thanks for all the help.

I know what MY weekend project is!

Cluso99
11-19-2010, 04:55 AM
CumQuat: I have a few ITG-3200 3axis gyros and I'm in Oz. PM me if interested.

zoopydogsit
11-19-2010, 05:15 AM
Hey CumQuat,

I don't know where in Oz you are, but I have a spare sparkfun 5D0F (bought a couple of them through dings and dents last year) that I'd be happy to send to you. Though be aware as it's a "ding and dent" then it's likely to miss one of it's functions (from memory the accellerometer doesn't do Z properly). http://www.sparkfun.com/products/9268

I bought them to do some interesting stuff with robotics (rather than using collision switches I was going to read the change in accelleration, look at ground gradient changes with the gyro, look into spacial recognition from looking at the sensor set simultaenously (great use of the prop)). I've got some potential product spin-offs that I wanted to research.

So I'd be interested in your code if your willing to share.

IM me if you are interested.

max72
11-19-2010, 01:32 PM
Consider also the WII objects. A 3 axis Gyro, 3.3V, I2C, available in any games store, for 10-20$

Massimo

CumQuaT
11-19-2010, 03:05 PM
I thought that the nunchuck only has a 3 axis accelerometer, not a gyro?

max72
11-19-2010, 03:21 PM
There is also the motion plus. It is a Gyro.
http://en.wikipedia.org/wiki/Wii_MotionPlus
The object works with both, individually or together. In fact the I2C address is the same, so if you use both the object shuts down one, reads from the other and vice versa.
Here Nunchuck and Motion Plus cost more or less the same.
If you already have the accelerometer a motion plus would be a good and cheap companion.
Massimo

Cluso99
11-19-2010, 09:34 PM
max72: Good suggestion. However the Wii Motion Plus is only a 2axis gyro. Not sure if this matters.

Surely there must be a Wii that has both accelerometer and gyro (both 3 axis)? It's nearly always cheaper to hack a high volume product but then you have to interface it and use the footprint of it.

max72
11-19-2010, 09:59 PM
I think wikipedia missed one accelerometer..
I'm pretty confident is has a 2 axis and a 1 axis accelerometer.
If you have a tri-winged screwdriver or you want to force open the toy you get an extremely small board, so maybe a little bit of hot glue would be enough..
Obviously this is not a mass production solution, but for an hack or a hobby project getting 6 DOF from your games store is not so bad..

Massimo

CumQuaT
11-20-2010, 06:50 AM
Yeah, I've noticed a very large number of community hacks involving the Nunchuk. I didn't even think of the MotionPlus. Hopefully a tuning fork gyro will do rotation nicely.

Good find!

cessnapilot
11-21-2010, 11:27 AM
Hi CumQuaT

A low drift 100 Hz 6DOF IMU made from 4 H48C accelerometers is working well for more than 6 months. It gives an accurate ECEF output of its position on Earth (X, Y, Z :[m]) and of its attitude (yaw, pitch, roll :[deg]). Although it uses 2 FPUs, it is basically a Propeller based project. Every SPIN/PASM/FPU software to reproduce it was posted on OBEX. Namely

"uM-FPU v3.1 SPI driver demo" http://obex.parallax.com/objects/286/
"General MEMS Sensor Model" http://obex.parallax.com/objects/464/
"H48C synchronized driver" http://obex.parallax.com/objects/430/
"INS Math WGS84 Earth" http://obex.parallax.com/objects/335/

The device has automatic temperature calibration on the field to get high accuracy. The method is included in the General MEMS Sensor Model firmware. When you couple such IMU thing with magnetic data using

"HM55B Dual Compass Driver" http://obex.parallax.com/objects/448/
"FPU Extended KF" http://obex.parallax.com/objects/320/
"World Magnetic Model 2010" not yet published on OBEX

then you can have a precise navigation aid for your car, boat or plane. Such devices will be commonplace within the next 3-4 years.

Or, you can fuse the ECEF data with GPS receiver outputs, using for example

"GPS Float Demo" http://obex.parallax.com/objects/405/

to have a stable, IMU filtered uninterrupted NMEA receiver. To collect data for the calibration and debugging, you can use the high speed and bulletproof object with full FAT32 support

"UART Datalogger" http://obex.parallax.com/objects/542/

with a separate Propeller.

I cannot attach a latest and detailed pdf doc of most of the project to this post because of the size restriction, but I can email it if you are interested.

Cheers

Istvan

Sapieha
11-21-2010, 12:48 PM
Hi cessnapilot.

Maybe if You ZIP them that can be possible.

ZIP's can be 7.5MB



Hi CumQuaT

A low drift 100 Hz 6DOF IMU made from 4 H48C accelerometers is working well for more than 6 months. It gives an accurate ECEF output of its position on Earth (X, Y, Z :[m]) and of its attitude (yaw, pitch, roll :[deg]). Although it uses 2 FPUs, it is basically a Propeller based project. Every SPIN/PASM/FPU software to reproduce it was posted on OBEX. Namely

"uM-FPU v3.1 SPI driver demo" http://obex.parallax.com/objects/286/
"General MEMS Sensor Model" http://obex.parallax.com/objects/464/
"H48C synchronized driver" http://obex.parallax.com/objects/430/
"INS Math WGS84 Earth" http://obex.parallax.com/objects/335/

The device has automatic temperature calibration on the field to get high accuracy. The method is included in the General MEMS Sensor Model firmware. When you couple such IMU thing with magnetic data using

"HM55B Dual Compass Driver" http://obex.parallax.com/objects/448/
"FPU Extended KF" http://obex.parallax.com/objects/320/
"World Magnetic Model 2010" not yet published on OBEX

then you can have a precise navigation aid for your car, boat or plane. Such devices will be commonplace within the next 3-4 years.

Or, you can fuse the ECEF data with GPS receiver outputs, using for example

"GPS Float Demo" http://obex.parallax.com/objects/405/

to have a stable, IMU filtered uninterrupted NMEA receiver. To collect data for the calibration and debugging, you can use the high speed and bulletproof object with full FAT32 support

"UART Datalogger" http://obex.parallax.com/objects/542/

with a separate Propeller.

I cannot attach a latest and detailed pdf doc of most of the project to this post because of the size restriction, but I can email it if you are interested.

Cheers

Istvan

cessnapilot
11-22-2010, 07:27 AM
Thanks Sapieha,

I should read the instructions next time. I remembered a 64K limit...

The mentioned pdf doc is attached.

Cheers,

Istvan