I'm going to assume for the sake of this discussion that a person is holding a stick with the three axis accelerometer on the far end. The user is spinning around and pivoting the near end of the stick so the far end (with the accel) can 'touch' any point on the surface of the imaginary sphere the user is in. Your description will work, but as you know you'll have a lot of error over time for the "RPM". Also note that centripetal force is going to drastically affect the Y and Z accelerometers depending on the angle of the stick relative to the angle of the spin. However, this may be to your advantage since the outward force of those two combine will also give you some information about how fast the user is spinning. You should expect to see several degrees of error per second on the rotation while spinning at a constant rate. You should expect to see much more error when the spinning is starting or stopping. Fo the most part (assuming this is an entertainment toy, and not a remote surgical robot control) these effects are probably not important, and may even be used for creative purposes. If you want to add to your workload and still keep it cheap, I'd consider adding a phototransistor to the tip of the stick. Put a diffuse screen over it, and low pass filter it to drop frequencies above 5Hz. As the user spins around this will output a signal whose lowest major frequency is very likely to be the spin rate of the user. The diffuse screen helps give the same signal while the user "raises" and "lowers" the stick. Since you already know the ballpark spin rate due to the accelerometer you can use that to digitally filter the signal and give yourself a synchronizing pulse to correct the accelerometer's error. Sounds like fun. I've always wanted to do essentaily this with soft foam swords for play fighting. Video tape it, and perform automatic rotoscoping. Keep score of electronic hits, perform accurate sound effects, etc. But it's near the bottom of a very long list of interesting projects... Good luck! -Adam On 2/22/06, Jake Brownson wrote: > I'm trying to measure relative rotation within a sphere. I have an ACA302 > (http://www.star-micronics.co.jp/eng/products/sensor/se01.htm). > > So, imagine holding a pole with an accel attached at the end, you can > spin in place (horizontal rotation), and raise the pole up and down > (vertical rotation), but the accelerometer stays a fixed radius > (approximately) from a central point. (Note that the accelerometer is > not always level) > > Let's establish some terminology. The Z axis is pointing up from the > accelerometer, the X axis is pointing out from the middle of the > sphere and the Y axis is normal to the plane made by Z and X. The > origin is at the accel, and moves as the accel moves. > > okay, I hope I've painted a good picture... here's how I'm trying to do it... > > I'm assuming that the person's rotations will be _relatively_ slow and > smooth, so the vertical rotation can be measured by looking for an > acceleration of 1G between the Z and X axes. technically there are > some problems with this, but this will be close enough. > > The horizontal rotation will be a little more tricky... theoretically > I can do a numerical 'integration': > > 1. Get the acceleration along the Y axis > 2. Linear Velocity += sample period * acceleration > 3. Angular velocity = linear velocity * 360/(2 * 3.14 * r) (or > something like that) > 4. Horizontal rotation = sample period * Angular velocity > 5. Repeat as fast as possible > > I've been looking at the accel on the scope and it seems like for the > slow movements that would be used there is just a lot of noise. Also > I'm concerned that if the zero point for the accelerometer isn't > calibrated _exactly_ the drift will add up very quickly. > > So is this idea insane? Do I need a more accurate accelerometer? Is > there another sensor that would be better? > > I'm aware of digital compass modules, and that is a possibility, > however those need to be level to operate, and this is a portable > system so that might be a bit of trouble. I also have a very low > budget for this, and anything over $50 might be a problem. > > By the way this is for a student project at Oregon Institute of > Technology if anybody is curious. > > ~Jake B > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist