Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Pages: [1] 2   Go Down
Author Topic: Detect rotation speed (and direction?)  (Read 2216 times)
0 Members and 1 Guest are viewing this topic.
Colorado
Offline Offline
Edison Member
*
Karma: 47
Posts: 1562
Reviving dead brain cells with Arduinos.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 207
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Colorado
Offline Offline
Edison Member
*
Karma: 47
Posts: 1562
Reviving dead brain cells with Arduinos.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: May 27, 2013, 01:52:11 am by KirAsh4 » Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 207
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Colorado
Offline Offline
Edison Member
*
Karma: 47
Posts: 1562
Reviving dead brain cells with Arduinos.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.)
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 207
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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°   
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 152
Posts: 5838
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...?

 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:

http://www.ebay.com/sch/i.html?_nkw=arduino+accelerometer



Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

UK
Offline Offline
Faraday Member
**
Karma: 100
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 100
Posts: 4869
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 152
Posts: 5838
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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).
Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

UK
Offline Offline
Faraday Member
**
Karma: 100
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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).
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 100
Posts: 4869
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

UK
Offline Offline
Faraday Member
**
Karma: 100
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 100
Posts: 4869
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Colorado
Offline Offline
Edison Member
*
Karma: 47
Posts: 1562
Reviving dead brain cells with Arduinos.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1] 2   Go Up
Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Jump to: