Detect rotation speed (and direction?)

Say I have a short stick tied to a string and I swing it around in circles parallel to my body (think of a propeller) ... is there a way to:
a) detect the rotation direction
b) the speed of the rotation

If you're swinging the stick surely you would know which way you're swinging it? What exactly are you trying to accomplish? I have a feeling it's something other than swinging a stick.

No, not swinging. Spinning. It's for a POV display on an LED poi. The issue here is that the direction of rotation can (or rather will) change, so I need to detect which way it's being rotated so I know how to display the data. And everything needs to remain enclosed inside of the LED bar. The performer is holding a leather loop which is attached to a chain to which the LED bar is attached to.

And I also need to detect the rotation speed so what's being displayed stays in one spot or right side up, regardless of whether the performer is spinning it fast or slow.

I imagine that would take quite a bit of ingenuity to accomplish. I'm not familiar with the exact hardware you're using, nor can I be sure that the led strip will only travel in a 2 dimensional plane relative to the hand, so forgive me if the following ideas are useless. Generally one would have a magnet attached to the stationary object (the leather loop), and a hall effect sensor on the spinning object or vice versa. However, this might not work reliably if the two are too far apart when they pass by. Another solution might be to attach a gyroscope/accelerometer chip onto the spinning part. I assume you already have a microcontroller somewhere in the mix, so interfacing shouldn't be difficult.

Actually now that I think of it, the hall effect sensor won't give rotational info. Scratch that idea.

That's what I'm trying to figure out, if it's a gyro and accel combination is what I need or something else. And like I mentioned, everything needs to be contained inside of the LED bar. Nothing can be anywhere else, not on the chains, not on the loops, nothing.

But, you did make me realize something else though. You're right about the 2D plane part. While, for the most part, those things are rotated in front of the performer's body in a vertical plane so the audience can see them, occasionally they do get swung up above the performer's head in which case the plane rotates and is parallel to the ground. BUT ... at this stage I'm not concerned about that. At this stage I'm just looking for a way to detect whether the thing is being spun, whether it's clockwise or counter clockwise, and how fast. I'm not sure I can detect speed, but that's only because I'm familiar with setups where there's a stationary magnet that influences the thing being rotated (like your hall effect suggestion.)

I'm sure it's all possible with a 3 axis accelerometer (even if the plane of rotation changes), but it would probably be incredibly difficult to conjure up a piece of software to manipulate all the accelerometer outputs into something useful.
If, however, you decide to ditch the 3rd dimension then it would probably be easier. Angle relative the the ground could be found using trigonometry (imagine a 90°

KirAsh4:
No, not swinging. Spinning. It's for a POV display on an LED poi.

A minor detail that you didn't think was worth mentioning...?

KirAsh4:
The issue here is that the direction of rotation can (or rather will) change

An accelerometer might be able to do it, but be prepared to write some challenging code:

An accelerometer can detect changes in speed. It also detects gravitational and centrifugal force. The accelerometer can detect how fast it is swinging (proportional to the centrifugal force) and any changes in direction. The centrifugal force, and the rotation of the end of the poi means that "down" will almost always (depending on speed) be pointing outwards from the circle at the point where the poi is.

Gyroscopes detect angular momentum, or how fast / far they are being twisted. They are better at fixing the position of a rotating object than an accelerometer is. They are not affected by the centrifugal force, but cannot detect linear (or near linear) changes in velocity.

For this kind of motion you would really want both to be accurate.

And then, as has been mentioned, you have the maths. 3D trigonometry is not easy at the best of times. When you add time into the equation to make it 4D trigonometry your brain starts to ooze out of your ears.

Have you ever looked inside the old type mouse?

The ball turns 2 spoked wheels, X and Y. Each wheel uses 2 sensors placed such that when one is completely covered by a spoke, the other is open. They are 90 degrees out of phase.

The algorithm to detect movement is like 2 bit Gray Code. It makes more sense to me when I work it out on paper which I did back in the 90's. It can tell direction because the pattern is 4 steps long.

majenko:
An accelerometer can detect changes in speed. It also detects gravitational and centrifugal force. The accelerometer can detect how fast it is swinging (proportional to the centrifugal force) and any changes in direction. The centrifugal force, and the rotation of the end of the poi means that "down" will almost always (depending on speed) be pointing outwards from the circle at the point where the poi is.

The accelerometer would have to have enough sensitivity to detect gravity in between all the swinging and it would only work if you swing in a vertical axis. It wouldn't work if you swing it around above your head.

Maybe much easier to attach it to a rigid handle instead of a string and put a more conventional sensor on the handle (eg. hall effect device+magnet).

fungus:

majenko:
An accelerometer can detect changes in speed. It also detects gravitational and centrifugal force. The accelerometer can detect how fast it is swinging (proportional to the centrifugal force) and any changes in direction. The centrifugal force, and the rotation of the end of the poi means that "down" will almost always (depending on speed) be pointing outwards from the circle at the point where the poi is.

The accelerometer would have to have enough sensitivity to detect gravity in between all the swinging and it would only work if you swing in a vertical axis. It wouldn't work if you swing it around above your head.

The centrifugal force would easily overpower the gravitational pull. It's the centrifugal force you're interested in as that gives the rotational speed. It would also give changes in the velocity in 3 dimensions. (note the use of "speed" and "velocity" there - speed is directionless, velocity has a direction).

With a vertical spin, centrifugal force will be +1G at the bottom and -1G at the top. But it won't tell you spin direction at all.

GoForSmoke:
With a vertical spin, centrifugal force will be +1G at the bottom and -1G at the top. But it won't tell you spin direction at all.

You're thinking in 1 dimension. Add 2 more and see what that would give you. And forgetting the gyros that I mentioned you would want for getting the angular momentum.

The gyros would get direction. Spin does want to stay in 2 dimensions though.

Still, +1G at the bottom and -1G at the top which is how it is in aircraft and amusement park rides.

You can put a bar magnet on the spin axis and use a Hall sensor to get the angle of the spinning arm far cheaper than a gyro-accelerometer in both cost and code. Or print a circle with spokes and use that with an optical setup, also very cheap. I've taken patterns to a local office store and had them printed on transparency, it might cost 50 cents a page by now. It's a lot easier than hand working metal.

fungus:
Maybe much easier to attach it to a rigid handle instead of a string and put a more conventional sensor on the handle (eg. hall effect device+magnet).

No can do unfortunately. The leather loop goes around the performer's wrist to make sure it doesn't go flying off. And it needs the chains or ropes because every once in a while they get intertwined on purpose. And they're detachable as well, so the performer can use their own custom loops with a variety of pois. This is why I said everything needs to stay within the LED bars.

At this point I'm not concerned about the angle of the spinning plane. I want to know the direction of rotation and how fast it's going, so that when an image or text is displayed, it "stays put" regardless of speed and direction of rotation. Some performers will spin one ay while others spin the other.

Strap around the wrist is where 2 Hall sensors could be placed and 1 magnet on the swinging part would need to pass closer than not. You might get direction that way.

But why not a handle like a jump rope handle? You could build sensors right into that.

GoForSmoke:
With a vertical spin, centrifugal force will be +1G at the bottom and -1G at the top. But it won't tell you spin direction at all.

Centripetal acceleration, not centrifugal force. 1g, not 1G, and its wrong anyway:

minimum centripetal acceleration at top = 1g (or gravity wins), minimum at bottom is 5g
(since acceleration changes by 4g between top and bottom due to potential energy changing
to kinetic energy. Sign is always positive because its towards the centre always.

Thus the absolute acceleration at the top is >= 0g, at bottom >= 6g

Isn't centripetal force what keeps an independent body in orbit around another, and centrifugal force what throws a body out from a rotating point?

The poi isn't independent - it's attached by a chain to a rotating point.

"A centripetal force is that by which bodies are drawn or impelled, or in any way tend, towards a point as to a centre."

Cut the chain, and the poi won't move towards the centre - it'll fly off at a tangent and hit someone in the face.

GoForSmoke:
But why not a handle like a jump rope handle? You could build sensors right into that.

Two reasons:
a) The distance between the handle and the object being spun (whether it's a ball, a straight tube-like bar, or anything else) is too great for a magnet/hall sensor setup. We're talking several inches to as much as a foot or longer sometimes. Some are rope, some are chains (I work with chains for the LED bars.)

b) You can't let go of the jump rope handle ... and I have performers who let go of the chain and let it spin on the loop that's around their wrist. The loop is there more as a safety thing, so the object being spun doesn't go flying off due to slippery hands. Think of the strap that's on a Wii nunchuck.

KirAsh4:

GoForSmoke:
But why not a handle like a jump rope handle? You could build sensors right into that.

Two reasons:
a) The distance between the handle and the object being spun (whether it's a ball, a straight tube-like bar, or anything else) is too great for a magnet/hall sensor setup. We're talking several inches to as much as a foot or longer sometimes. Some are rope, some are chains (I work with chains for the LED bars.)

b) You can't let go of the jump rope handle ... and I have performers who let go of the chain and let it spin on the loop that's around their wrist. The loop is there more as a safety thing, so the object being spun doesn't go flying off due to slippery hands. Think of the strap that's on a Wii nunchuck.

There will probably be more tension on the pulling side of the loop when the spin is started.

I guess that nothing as crass as a direction switch or button is acceptable?