Is there any straightforward algorithm y'all like to use with the onboard accelerometers on a uP or breakout board to measure the angular velocity of a rotating body in the vertical plane? Like a wheel, say.
Neither the update speed or the accuracy would be terribly critical, maybe to within 1Hz every second or so.
I did not realize that a wheel was an algorithm. I thought it was a thing. :)
Dunno about standard, but if the thing is close enough to the axis of rotation that the centripetal acceleration is much less than 1G, you could lock onto the sine wave with a PLL. If you had an X-Y accelerometer right at the wheel center (and if the delay between the two channels was negligible) you could take the arctan. If the centripetal acceleration wasn't negligible, and you knew the diameter, you could use it for a rough estimate, then lock onto the AC component with a PLL.
All should be easy enough if you understand PLLs. Digital PLLs are fun, because some of the most irritating aspects of analog PLLs aren't there in a digital system.
-- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | STV, Queen Creek, AZ 85142 Skype: skypeanalog | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at
For the application I had in mind, a sensor that relied on having the rotating thingie attached to another fixed object would be difficult. That probably includes optoelectronic solutions.
The specifics of the application is that I've been approached by a local theater group if it might be possible to construct several custom batons (you know, like the type used for twirling in a parade) with LED strip lighting that incorporate a "POV display" something like this desktop thing:
formatting link
Except that the "raster" would be rotational in the vertical plane, rather than horizontal. To select an appropriate "frame rate" it would be good to know how fast the performer is spinning their toy.
A three-axis accelerometer in each end and 3 crossed gyros to keep track of the vertical. You could do it with just one of each, but I expect the rapid spin might cause accuracy problems.
Alternatively a couple of those 3-axis magnetic orientation sensors would work in some volume. I don't know what their range is though.
Thanks! What sort of math would I have to run in the uP to obtain a regularly updated estimate of the angular velocity? And can you recommend any particular products that might be available on a breakout board for a quick prototype?
Hmm it might be easier to put a variable raster knob on the thing, and get the actors to adjust the speed of their "twirl". Getting it a little wrong will just compress or expand the image... which doesn't seem like it would be all that bad.
No, getting it a little wrong would have the image "lose synch" with the batton's motion; the message would "creep" from one rotation to the next. (imagine the message being updated at 1 hz while you are twirling at 1.2Hz) You need a point to call "home" (i.e., TDC) from which to begin your "scan".
I'm also unsure as to how "constant" (i.e., within a single revolution) the "speed" is. I've never examined the mechanics of those folks as they twirled their batons (is it smooth motion? or, does it just *appear* to be such?)
Twirling an LED array on a *string* can yield reasonably good results (this *is* relatively smooth motion) as the user can adjust the length of the string (twirl rate) to coincide with a STATIONARY display.
I'd put a 3-axis accelerometer and a 3-axis gyro in the center. That should be plenty. Just an accelerometer would not, I think, keep up with changes in rotation rate.
Check SparkFun. The inertial sensor world is changing pretty rapidly: gyros and accelerometers just get better and cheaper every month. At one point ST had a board with a microprocessor and 6-axes of IMU; they probably still do.
Alternately, you could look for an open-source hardware quadcopter board (for which there is open source software). You may lack pins for easy LED driving, but that's probably fixable.
For just rotation rate, look at the output of the gyro axes that are normal to the baton axis. Integrate that into an angle and you're done. If you want a "down" reference then life is harder because you'll be dealing with 3D angles. Quaternions are fun in a "let's drop acid!" sort of way; otherwise they can be exceedingly tedious -- but AFAIK (and I looked into this pretty seriously several years ago) they're the bee's knees for this sort of thing.
If you can afford outside help send me an email -- I've done stuff related to this, and may be a useful resource.
Yes. Visualizing this thing being swung and tossed in the air, having an ov erdetermined measurement system allows you to generate an internal error es timate. Two three-axis accelerometers would do that too, but I suspect that angular errors may be more of a worry.
Hmm, seems like an ill-posed problem to me. At least, one that's probably solvable but only after a lot of hackery?
Note that the baton isn't in free-fall, but bears wind resistance. So the rotation slows down during a toss, and you'll need to model it on a constantly-decaying tone burst, rather than a static PLL. Acceleration can be quite fast (a mere flick of the wrist), so it will need to be event driven as well (a loosely filtered PLL, or FLL, may be good enough).
The signal should be pretty clean, at least, since the only remaining noise sources should be turbulence, and whatever resonant modes the baton supports (ref: the wobble of an arrow in flight, if you've seen it before).
You can make the assumption that the baton is cylindrically symmetrical, and, taking the axis as Z, and the cross plane as X and Y, do quadrature detection of the acceleration. Probably, get R = magnitude X-Y (i.e., R = sqrt(X^2 + Y^2)) first, then do a complex Hilbert transform of Z and R so as to get the angle as a function of time.
Downside being, you need to do the transform in real time, not after-the-fact, which isn't what transforms were made for...
The X and Y axes will have wobble as well (depending on where the sensor is, and which modes resonate), but that will be high frequency (>10Hz?) and can be filtered out.
There should exist an algorithm which performs the transform, as a function of time, under the assumption that the solved-for result must best-fit a line. The slope will be slightly negative (because rotation is slowing), and in a modest range.
It may well be that a simple PLL matches that nicely. A Hilbert transform is a rather heavy-handed, but simple, way to describe the idea. (Well, not so simple if you don't know what it is...)
You'll also need "init" and "stop" detection, perhaps the detection of a "surge" (a large acceleration, enough to reach nominal speed -- the amount of which also serves as a seed for the tracking loop -- with a modest time scale, such that human hands might produce, and not, say, a drop on the ground!), or the accumulation of excessive error (the loop is unable to track it because it's not approximating a straight line). Those would be signals to start and stop the blinkenlites.
Of course, batons are twirled in the fingers and hands, as well, but I don't know how stable that is. Can you get a twirler to phase lock one to a stroboscope? Then set the strobe to harmonics, and see how consistent the fractional positions are? (Visual position, by strobe, will give exactly the positions that the LEDs will light up, so if the velocity is really uneven, you'll see the distortion without having to build anything at all!)
And, contact with lumpy-shaped hands and fingers will add far more noise (probably harmonic noise, at that) to the system, making it that much more difficult to track.
So, I think the free-spinning tracker would be easiest, but if it can be made noise-immune enough, it should work for both positions anyway.
Huh.. ok we are seeing very different things.... I imagine there is music playing and dancer's waving sticks around sorta in sync. Each "rotation/ wave" will be it's own "event" for the eye.. ??? (I've probably got the wrong image.) How fast is the spinning?
overdetermined measurement system allows you to generate an internal error estimate. Two three-axis accelerometers would do that too, but I suspect th at angular errors may be more of a worry.
OK I figured you meant something like that. Have you seen quad copter tricks? and do they use closure?
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.