Exact match. Not showing close matches.
**
PICList
Thread
**

**
'[EE] Accelerometer orientation for Omni directiona'
**

2007\02\08@132036
by
James Newtons Massmind

This may be fun for some on the list to think about. I'm not asking for

help, but wanted to share this challenge, which has totally kicked my butt.

The goal is to trip an alarm when excessive (defined by the customer) motion

is experienced in any direction.

The obvious solution is to have 3 accelerometer sensors each oriented along

one of the standard x, y and z axis. Motion in any one axis will generate a

signal that will trip the alarm depending on the set point. Motion along TWO

or more axis must be vector summed which implies a microcontroller with

pretty good math, perhaps even requiring floating point. This introduces

digital noise, RF, and cost / speed issues, all of which can be solved.

One could just arithmetically sum the sensors, but then there is an error

introduced when e.g. something moves the unit in both x and y directions at

once. Assuming motion at 45' (exactly half way between the X and Y) at 1

unit of acceleration, the signal is going to be ~0.707 rather than half from

each affected sensor so the result is off by ~.414 making the alarm over

sensitive when motion in more than one axis is involved.

The sensors in use require enough excitation current to prevent more than 2

of them being run from a 4-20mA line. They also cost a heck of a lot.

It was pointed out that if only two sensors were used, and each was rotated

and tipped a few degrees off the standard axis, the error is less when using

arithmetic sums. E.g. take the X axis sensor and rotate it 30 degrees around

the Z axis (here I'm assuming X and Y are horizontal like the surface of

your desk and Z is vertical) then tip it forward a 30 degrees around its own

horizontal axis. Then take the Y sensor and rotate it 30 degrees in the

opposite direction around the Z axis, then tip it forward 30 degrees. You

end up with them "huddled" with their "arms over each others shoulders" and

their "heads" together as if they were looking down at a strategy drawn on

the field.

If you then do all the math, you find out that the same motion at 45 degrees

between the x and y axis causes a signal of .5 from each sensor resulting in

no error for that vector after a simple sum. Of course, other vectors are

now going to have a different error, but it does not seem that the error

would be as much as it was with the sensors aligned along the standard axis.

Some error is acceptable in this application. The goal is minimum error with

a quiet, low cost device (2 sensors, 4/20 power only, analog sum and limit.)

Ok, given all that...

The question is: What 3 dimensional orientation of 2 sensors allows for the

minimum error in all directions assuming that the output signals are

combined via a simple arithmetic sum?

My first reaction was that no matter how you position the 2, there will be

some vector of motion that will cause the maximum error just like when they

were aligned with the standard axis. After trying a few test cases, I have

come to believe that there probably is an ideal position where the error in

all directions is minimal. Finding that orientation appears to me to be a

math problem of stunning proportion.

Dogpile says no-one has "been there, done that" and then published the

t-shirt.

Just wanted to share the pain. <grin>

---

James.

2007\02\08@140008 by David VanHorn

problem.

Placing the X and Y sensors level ignores Z, but if you rotate the sensors

45 degrees around the opposite axis, then Z motion causes output in both the

X and Y.

2007\02\08@143807 by Robert Rolf

> Interesting problem. Feels a lot like the old two-tube color TV camera

> problem.

>

> Placing the X and Y sensors level ignores Z, but if you rotate the sensors

> 45 degrees around the opposite axis, then Z motion causes output in both the

> X and Y.

Any motion along the rotated accelerometers nonexistent Z axis will give ZERO output from

the sensors, thereby failing to trip the alarm.

Is the motion constrained to a plane? If not, there will be a 'dead axis'.

Why can you not strobe the sensors to reduce the current loading?

Use a sample and hold for your math inputs to 'carry over' the value of the 'not on' sensor.

You can also do 'analog' math with log op-amp circuits.

A PIC would be simpler. SIN/COS lookup to do the vector decomposition and use

integer math with offset binary point.

R

2007\02\08@155035 by David VanHorn

>

> Any motion along the rotated accelerometers nonexistent Z axis will give

> ZERO output from

> the sensors, thereby failing to trip the alarm.

> Is the motion constrained to a plane? If not, there will be a 'dead axis'.

True..

Picture two accelerometers, sitting normal to the absolute X and Y axes.

Rotate the X axis unit 45 degrees along the Y

Rotate the Y axis unit 45 in X and Z.

I don't think there's any longer a common axis in any direction with zero

output.

2007\02\08@160600 by PAUL James

Isn't this what is known as the galperin position?

Where all axis' have basically the same output.

Regards,

Jim

{Original Message removed}

2007\02\08@160646 by Marcel Birthelmer

> >

> >

> > Any motion along the rotated accelerometers nonexistent Z axis will give

> > ZERO output from

> > the sensors, thereby failing to trip the alarm.

> > Is the motion constrained to a plane? If not, there will be a 'dead axis'.

>

>

> True..

>

> Picture two accelerometers, sitting normal to the absolute X and Y axes.

> Rotate the X axis unit 45 degrees along the Y

> Rotate the Y axis unit 45 in X and Z.

>

> I don't think there's any longer a common axis in any direction with zero

> output.

But by the tenets of Linear Algebra, spanning vectors, etc., there has

to be. You still have two axes, that's not enough to describe a

3-dimensional space.

2007\02\08@173628 by James Newtons Massmind

> > give ZERO output from the sensors, thereby failing to trip

> the alarm.

> > Is the motion constrained to a plane? If not, there will be

> a 'dead axis'.

>

> True..

Err.. No. Since both sensors are rotated towards each other, one or the

other will always be out of plane and give a reading.

> Picture two accelerometers, sitting normal to the absolute X

> and Y axes.

> Rotate the X axis unit 45 degrees along the Y

> Rotate the Y axis unit 45 in X and Z.

>

> I don't think there's any longer a common axis in any

> direction with zero

> output.

Correct.

Dave made a very nice picture of that which is a bit large for the list, but

which I have put up at:

http://www.piclist.com/images/temp/test.jpg the standard alignment for a 3

axis system. Showing two sensors (x and y) only. They would be sensitive

along their own access only.

http://www.piclist.com/images/temp/test.jpg 45 degree rotations of the

sensors. Notice that movement in any direction should have some alignment

with a sensitive axis of one or both sensors.

But again, the challenge here is to find the orientation where the

arithmetic sum of the sensor outputs is closest to the vector sum of the

unit motion in any direction.

---

James.

2007\02\08@173959 by David VanHorn

> But by the tenets of Linear Algebra, spanning vectors, etc., there has

> to be. You still have two axes, that's not enough to describe a

> 3-dimensional space.

Yup. I see that now. Bummer.

No matter how you twist, there's always a vector that's 90 degrees out from

both of them.

I can email a jpg that shows this, if anyone's interested.

2007\02\08@174015 by James Newtons Massmind

> there has to be. You still have two axes, that's not enough

> to describe a 3-dimensional space.

But the axis are not aligned exactly with X, Y, Z. Each sensor is on an axis

that has some X, some Y and some Z component to it. And the two sensors have

different amounts of X, Y, and Z between them. E.g. if sensor 1 has 45'X,

45'Y, 45'Z and sensor 2 has -45'X, -45Y, -45Z then there is no way that

motion in some direction could NOT produce a signal.

---

James.

2007\02\08@175619 by David VanHorn

>

> But the axis are not aligned exactly with X, Y, Z. Each sensor is on an

> axis

> that has some X, some Y and some Z component to it. And the two sensors

> have

> different amounts of X, Y, and Z between them. E.g. if sensor 1 has 45'X,

> 45'Y, 45'Z and sensor 2 has -45'X, -45Y, -45Z then there is no way that

> motion in some direction could NOT produce a signal.

Nope, he's right.. (BTW the second link should be to test2.jpg)

I have test3.jpg where I added a disc in the insensitive plane for each

sensor, and there is always a position where I'm edge-on to both discs.

2007\02\08@180132 by James Newtons Massmind

> No matter how you twist, there's always a vector that's 90

> degrees out from both of them.

Only if you insist on twisting them 45'. Try 20' or 30' or anything else.

---

James.

2007\02\08@181731 by Timothy Weber

> http://www.piclist.com/images/temp/test.jpg 45 degree rotations of the

> sensors. Notice that movement in any direction should have some alignment

> with a sensitive axis of one or both sensors.

If you want to find the direction that will have no effect on either

sensor, can't you just take the cross product of both unit vectors? By

definition it's perpendicular to both.

--

Timothy J. Weber

http://timothyweber.org

2007\02\08@182538 by olin piclist

> But the axis are not aligned exactly with X, Y, Z. Each sensor is on

> an axis that has some X, some Y and some Z component to it. And the

> two sensors have different amounts of X, Y, and Z between them. E.g.

> if sensor 1 has 45'X, 45'Y, 45'Z and sensor 2 has -45'X, -45Y, -45Z

> then there is no way that motion in some direction could NOT produce

> a signal.

Yes there is. This is basic vector math. Each sensor senses motion along a

single direction, in other words a vector. Given any two vectors in 3D

space, there is always a vector perpendicular to both. This is fundamental

math you can't get away from. You can compute such a vector by taking the

cross product of the first two.

You can't measure 3 degrees of freedom with two scalar values.

Go ahead, give me X, Y, and Z coordinates for any two directions you chose

to align your sensors in, the I can give you the X, Y, and Z coordinates for

a orthagonal direction to both of them. I could even write a program to

prove this point where you enter two sets of X,Y,Z and it gives you a

unitized vector in the orthagonal direction, but that's more trouble than I

want to bother with.

********************************************************************

Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products

(978) 742-9014. Gold level PIC consultants since 2000.

2007\02\08@184842 by David VanHorn

>

> Go ahead, give me X, Y, and Z coordinates for any two directions you chose

> to align your sensors in, the I can give you the X, Y, and Z coordinates

> for

> a orthagonal direction to both of them. I could even write a program to

> prove this point where you enter two sets of X,Y,Z and it gives you a

> unitized vector in the orthagonal direction, but that's more trouble than

> I

> want to bother with.

Yup.. It looked good there for a minute, but it dosen't work.

Possibly you can do something tricky, and translate motion in the third axis

into rotation, or motion along one of the other axes.

M=sqrt(x^2+y^2+z^2). Floating point is not necessary, and neither is the square

root, just say m0 is the setpoint and set M=m0^2. Now you have x^2+y^2+z^2>=m0^2

as condition, where m0 is the setpoint. This will not detect rotation. For

rotation you also need three gyro rate accelerometers, one per axis. The outputs

of those can be square-summed as above and compared against a squared setpoint

as above. When squaring relatively small numbers (e.g. 7 bit inputs, corresponds

to >1% resolution) you always end up with at most 16 bits. Summing three of

these will still yield less than 16 bits. So all you need is squaring 8->16

bits, adding 16 bits and comparing (substracting) 16 bits, all unsigned. This is

not going to require a PhD imho.

One problem is gravity which will appear in M and m0. To get rid of it you can

use rate accelerometers. These consume much less power than your standard

accelerometers. But you have to define 'motion' first. It is possible that a

simple ball bearing in a microphone capsule will outperform your high tech

contraption under certain circumstances.

What you are trying to build is a mini-inertial navigation system. I don't think

that it can be done with your power supply and budget (I assume), at least not

without cutting corners. A 4-20mA circuit used to the hilt can supply about

0.4Watts (20mA*20V -> ~3V*130mA @eta=100%). This is not so little power.

Peter

2007\02\08@210712 by James Newtons Massmind

> motion along a single direction, in other words a vector.

> Given any two vectors in 3D space, there is always a vector

> perpendicular to both. This is fundamental math you can't

> get away from. You can compute such a vector by taking the

> cross product of the first two.

Oh. Ok, now that you put it that way, I can see it. Thanks.

Darn it.

---

James.

2007\02\08@212631 by Timothy J. Weber

>> Yup. I see that now. Bummer.

>> No matter how you twist, there's always a vector that's 90

>> degrees out from both of them.

>

> Only if you insist on twisting them 45'. Try 20' or 30' or anything else.

Cross product is sufficient, but here's the non-jargony intuitive proof:

1. Shifting your sensors around makes no difference; the orientation is

all that matters. So, put them (or their representative vectors) with

their tails together. Their heads can be at any angle you like. (This

step isn't essential, but it simplifies things in my head.)

2. Rotate your pair of vectors together so that one of them lines up

with the absolute X axis. Or, to put it another way, define the X axis

as coming out of one of your vectors.

3. Now rotate the pair together around X so that the other vector is in

the X-Y plane.

You can always perform those operations on any two vectors. Once you've

done it, the Z axis is your perpendicular.

Yet another way to put it: Any two vectors define a plane.

--

Timothy J. Weber

http://timothyweber.org

2007\02\08@222843 by John Chung

the picture for both of them are the same. Could you

pls post the picture for the 45 degrees?

John

--- James Newtons Massmind <.....jamesnewtonKILLspam@spam@massmind.org>

wrote:

{Quote hidden}

> --

2007\02\08@235007 by James Newtons Massmind

>

> the picture for both of them are the same. Could you pls post

> the picture for the 45 degrees?

Oops:

http://www.piclist.com/images/temp/test2.jpg 45 degree

http://www.piclist.com/images/temp/test3.jpg 45 degree with disks

I really should have been able to see that line along which no signal could

come from either sensor. It is defined by the intersection of the planes of

the two disks.

---

James.

More... (looser matching)

- Last day of these posts

- In 2007
, 2008 only

- Today

- New search...