Accelerometer and calculating position, angle,time

In summary: The z-axis acceleration readings will be the tangential acceleration.You could integrate angular acceleration to get angular velocity instead. But then you hit the opposite problem. If the door slams you get very high and very sudden accelerations for modest velocities. Your equipment may not be able to register that accurately.You could cross-check the speed figures estimated from centripetal acceleration against the velocity figures dead-reckoned from angular acceleration.
  • #1
angier
10
0
I am working on a project where we will use a 3-axis accelerometer on the door and using the ax, ay, az data to calculate position and angle of the door. The accelerometer will be positioned near doorhandle. So the initial position of coordinate system will be there, where the accelerometer is.
While the door will be opening the position of coordinate system will be moving(rotating).
Need help with calculating the position and after that the angle of the door. Especially I don't know how to take into account that we have rotating coordinate system. It seems a tough problem...
 

Attachments

  • Accelerometer.JPG
    Accelerometer.JPG
    7.7 KB · Views: 765
Physics news on Phys.org
  • #2
Welcome to PF;
Your accelerometer is attached to the door - so that's your coordinates.
If you put x horizontal, y vertical, and z pointing away from the door, then any instantaneous acceleration in the z direction will be tangential to path the door makes - then you can predict which axis there will be reading in for the accelerometer.

You need to use your knowledge of rotational motion for this.
If the door opens with a constant angular velocity, which direction is it accelerating?
However, the door will have some angular acceleration too - can you relate angular and tangential acceleration and velocity?

That should get you started.
 
  • #3
Dear Simon! Can you be more specific, I need more help! Thanks in advance!
 
  • #4
I have been specific.
I cannot tell what more help you need unless you answer the questions.

...
...
"dear"? :/
 
  • #5
I prefer the natural system of axis orientation, so x is horizontal, y is away from the door and z vertical. So, the y-axis will be tangential to path the door makes. In this way also door is accelerating in y direction.
And yes, tangential acceleration is a product radius and angular acceleration. I know physics, I just need help with math...
 
  • #6
Fair enough - use whatever axis system you are comfortable with :)

I know physics, I just need help with math...
... it is not good enough that you know - you have to tell me or I'll waste time telling you stuff you already know ;)
The questions are supposed to tell me what you already know, identify weak spots, and guide you through the experiment design - which you are supposed to be doing yourself BTW.

Anyway, you just related some of the math you needed - so you do know some of the math.

From what you said:
The y-axis acceleration readings will be the tangential acceleration.
How would you measure the radius to use to get the angular acceleration?

Is the y-axis the only direction you should see an acceleration?
 
  • #7
Basically we get data from accelerometer, which means ax, ay and az. So if I set the coordinate system as I have described above, this means that ax=w2R(w-angular velocity, R-radius) will be radial acceleration, ay=aR(a-angular acceleration) will be tangential acceleration and az will measure gravitational acceleration-g. Correct me, if I am wrong. From ay I can calculate angular acceleration, from ax angular velocity and from there probably the angle the door makes? Radius is fixed and determined by the door size.
 
  • #8
angier said:
Basically we get data from accelerometer, which means ax, ay and az. So if I set the coordinate system as I have described above, this means that ax=w2R(w-angular velocity, R-radius) will be radial acceleration, ay=aR(a-angular acceleration) will be tangential acceleration and az will measure gravitational acceleration-g. Correct me, if I am wrong. From ay I can calculate angular acceleration, from ax angular velocity and from there probably the angle the door makes? Radius is fixed and determined by the door size.

Using centripetal acceleration (ax = ω2r) to compute angular velocity will, I suspect, tend to run into problems with resolution at low accelerations. Since centripetal acceleration scales as the square of angular velocity, a small velocity will be reflected as a very small acceleration.

Then too, you can only measure the door's angular speed, not velocity, based on centripetal acceleration. Opening and closing look the same.

You could integrate angular acceleration to get angular velocity instead. But then you hit the opposite problem. If the door slams you get very high and very sudden accelerations for modest velocities. Your equipment may not be able to register that accurately.

And you also have the problem that small systematic errors grow quadratically over time.

Possibly you want to apply some to sanity-checking to the measurements that you obtain -- cross-checking the speed figures estimated from centripetal acceleration against the velocity figures dead-reckoned from angular acceleration.

Possibly you want to figure out some heuristics to detect slamming events and coast-to-a-stop events.

If it were me, I'd be sanity-checking the z axis data as well. If somebody takes the door off the hinges, it'd be good to know.
 
  • #9
angier said:
Basically we get data from accelerometer, which means ax, ay and az. So if I set the coordinate system as I have described above, this means that ax=w2R(w-angular velocity, R-radius) will be radial acceleration, ay=aR(a-angular acceleration) will be tangential acceleration and az will measure gravitational acceleration-g. Correct me, if I am wrong. From ay I can calculate angular acceleration, from ax angular velocity and from there probably the angle the door makes? Radius is fixed and determined by the door size.
Now you are cooking :)

You know the equations for all those right?
Then you have all the math you need.

There are limits to how I can advise you because you haven't provided a lot of detail. I'm not going to wrestle the information from you - you don't want to tell me anything just say so and I'll leave you to it. Going only off what you've told me, I have to guess some stuff, i.e.

I'm guessing that the accelerometer is some device hooked to a computer that sends a time-series of acceleration data.
The data gets stored somehow and you have some sort of software to access it somehow.

You could, in principle, plot this data as acceleration vs time graphs.
Software typically provided with accelerometers has the ability to do this built in.
The area under the a-t graph is the velocity.
The area under the v-t is the displacement.
... again, software typically supplied is capable of computing these graphs from the data.
If not, then you will have to tell it how - hint: numerical integration.

Careful with centripetal acceleration.
Since the radius is fixed, what is wrong with using the tangential acceleration to get velocity and position?

Try to anticipate wrinkles. i.e.
The door will not generally be moving at a constant angular speed.
It is possible that the door can have accelerations that are too big or small to be measured by the instrument.
You have to figure what to do about this stuff ... and what else you can think of.

However - I am guessing that this is a teaching experiment set you so you can discover/learn about experimental design.
If that is the case, then you shouldn't stress about getting everything perfect. You'll quickly discover what sort of thing can go wrong when you do it - which is the whole point.
 
  • #10
Thnx to both, Simon Bridge and jbriggs444! I am aware of the problems you have mentioned, but we will try and we see what comes out. There is another challenge. What if the z axis is not exactly in the direction towards the center of the Earth and also the x-axis not exactly towards the origin of rotation etc. Then probably I will have to apply rotation matrix 3 times, to calculate the exact values of ax, ay and az? What do you think about it?
Also, the accelerometer has the sampling rate of about 250 Hz... and it's accuracy is 5 %, at least that's what they say...
 
  • #11
If the alignment of the accelerometer is off by a bit, that seems like a simple thing to deal with -- at least as long as the door behaves ideally.

All you need to do is rotate your as-measured acceleration readings in the accelerometer frame to ax, ay and az readings in the door frame. As long as the angle between accelerometer and door is fixed, that's a fixed 3x3 rotation matrix applied to the input 3-vector to produce the output 3-vector.

An accuracy of five percent... I'm not sure what to make of that. Sounds hideous. Which suggests that you have some calibration work to do. You need to figure out just how far you can trust your tools.
 
  • #12
A 5% accuracy is pretty bad for an accelerometer - it sounds like the sort of thing you get in a phone in fact [1][2] - but it means you probably don't have to be very accurate in setting it up. What level are you performing this experiment at? (It sounds like a HS exercise in rotational motion - but it could be part of a senior undergrad project in electronic and computational engineering.)

You can probably get away with using a spirit level and a set-square to set the alignment - you may want to tape a protractor to the door (use with a plumb-line) to see that it opens horizontally.

Note: it will probably be helpful to get something to read the position vs time directly.
Integrating the acceleration-time graph (once for velocity and twice for position) leads to very large errors.[3]

-----------------------

[1] Google Tech Talk, August 2, 2010 (~23:20)
[2] Manohar C., McRady C, et al, Laboratory evaluation of the accuracy of a triaxial accelerometer embedded into a cell phone platform for measuring physical activity; FASEB J. April 2010 - 24 (Meeting Abstract Supplement) 1044.5
[3] Weinberg H. Accelerometers - Fantasy and Reality (no date) - see "Personal Navigation".
 
  • #13
Dear jbriggs444,
did you mean applying 3x3 matrix 3-times probably, first around z-axis, then x-axis and on the end y-axis to get the new ax,ay,az vector of acceleration?
 

Attachments

  • z axis.JPG
    z axis.JPG
    4.5 KB · Views: 612
  • x axis.JPG
    x axis.JPG
    4.4 KB · Views: 575
  • 3 times matrix.JPG
    3 times matrix.JPG
    2.5 KB · Views: 502
  • #14
Dear Simon, I am working on a project for intelligent door, no study stuff anymore. :) We want to distinguish between different people entering the house or something and then apply the data to artificial intelligence software. How can you measure the distance vs time? What kind of sensor?
 
  • #15
A three dimensional rotation (or, indeed, any sequence of 3 dimensional rotations) through any combination of roll, pitch and yaw can always be expressed as a single 3x3 rotation matrix.

http://en.wikipedia.org/wiki/Rotation_matrix

So just one matrix multiplication.

You could decompose your rotation into a roll followed by a pitch followed by a yaw and you could express each of those as a simplified 3x3 matrix. See "Basic Rotations" in the wiki reference above. If you multiply those 3 basic rotation matrices together you get the composite rotation matrix. You can then multiply by that.

This works because matrix multiplication is associative.
 
  • #16
  • #17
angier said:
Dear Simon, I am working on a project for intelligent door, no study stuff anymore. :) We want to distinguish between different people entering the house or something and then apply the data to artificial intelligence software. How can you measure the distance vs time? What kind of sensor?
Well, a position sensor of course! :)
There are lots of different ways -
You probably already have various rotation sensors that talk to your computer.
If not you can rig something i.e put a potentiometer by the hinge rigged so the door turns the shaft - resistance is proportional to angle.
 
  • #18
I have some more questions regarding movement of the doors. Can we assume that while the doors are moving, we have uniform circular motion, at least in the middle of the period (definitely not in the beginning while we are pushing them with hands and in the end, when they slow down). By assuming this we have tangential acceleration equal zero and constant radial acceleration. I need this assumption for calculating the rotation matrix between the door frame and accelerometer frame of reference. Is it wrong to assume this?
 
  • #19
angier said:
I have some more questions regarding movement of the doors. Can we assume that while the doors are moving, we have uniform circular motion,
Not usually.

It depends on the control of the door ... i.e. if you open the door by giving it a shove (delivering an impulse) and the door opens on its own momentum, then the significant air resistance, as well as other losses, will guarantee non-uniform motion.

Of course, if you use a machine to open the door, and the machine is programmed to do so at a constant speed, then sure. You may get small fluctuations but the a-t graph should be close to zero for much of the motion.

Is it wrong to assume this?
Normally, yes.
It is certainly an assumption that you would be expected to justify from your data ... i.e. is there a period where your acceleration-time graph looks like it is trying to be horizontal - does it hover around a=0? If you do a linear regression on the ##\small \omega##-t graph, do you get a slope of zero?

Note: you don't need a constant angular velocity to get a rotation matrix - you just need to know how the angle varies with time.

-----

On another note - you will also get systematic errors from the orientation of the xyz accelerometer with the door ... i.e. if it is rotated slightly wrt the door frame, or tilted, or if the door is not quite square on to gravity... just in case you thought that experiments were not already messy enough ;)
 
Last edited:
  • #20
Thnx for your help! If we take into account also air resistance etc. the equations change definitely. How to write equations of motion for such a case, where also this forces are present?
 
  • #21
Air resistance usually depends on some power of the velocity ... and it is not usually a trivial calculation.
You have a bunch of data - you should be able to see if air resistance and other losses are significant and what effect they have.

For the purposes of data analysis, you should not assume anything about the motion without some observation to justify it: the observation may come from what someone else, say, some authority, has written.

Usually the motion of the door is smooth the the eye - but the data is jagged, indicating random uncertainties in the measurement (i.e. random vibrations of the door). The data should look like if judders about a curve and you want to try to find that curve. Look at the data and see what sort of curve makes sense: if you are lucky, it's a line.

Note: you can do an experiment and show that the data does not support some assumptions about the motion.
That counts as a successful experiment.
 
  • #22
Have you looked into a gyro? It would allow you to directly measure rotational velocity. In my experience with making inertial measurement units, accelerometers are not so good at rotations in the plane. Tilting against gravity they're ok but not rotations.
 
  • #23
The gyro will give orientation changes without needing to integrate twice ... but I suspect this is a "use this equipment to investigate" type project. i.e. stuck with the stopwatch, ruler, protractor, accelerometer, etc. provided.
 
  • #24
Simon Bridge said:
The gyro will give orientation changes without needing to integrate twice ... but I suspect this is a "use this equipment to investigate" type project. i.e. stuck with the stopwatch, ruler, protractor, accelerometer, etc. provided.

Oh, I wasn't aware of it being an exercise. My first thought when reading the OP was later mentioned by you as well: potentiometer in the hinge.
 
  • #25
Hi , I am using adxl335 accelerometer for my project.Can any of you tell how to calculate angles from voltage readings of x,y and z axis.
 
  • #26
@rskravi92: welcome to PF;
If you orient the y-axis up, the x-axis towards the hinge, and the z axis pointing in the direction the door is moving, then the x and y accelerations should be zero, and the z acceleration should be proportional to the angular acceleration of the door.
Do you know how to relate tangential acceleration to angular acceleration?
Do you know how to relate angular acceleration to angular position?
 

1. What is an accelerometer and how does it work?

An accelerometer is a device used to measure acceleration and changes in motion. It typically consists of a small microchip with tiny sensors that detect movement and changes in orientation. When the accelerometer moves, the sensors inside it detect the movement and convert it into an electrical signal, which can then be analyzed to determine the position, angle, and time of the movement.

2. How is position calculated using an accelerometer?

Position can be calculated using an accelerometer by integrating the acceleration data twice. This means taking the acceleration values and using them to determine velocity, and then using the velocity values to determine position over time. This process can be repeated continuously to track the movement and calculate the position at any given time.

3. Can an accelerometer be used to measure both linear and angular acceleration?

Yes, an accelerometer can measure both linear and angular acceleration. Linear acceleration refers to changes in motion along a straight line, while angular acceleration refers to changes in rotational motion. Most accelerometers are designed to measure both types of acceleration, making them useful for a wide range of applications.

4. How accurate is an accelerometer in calculating position and angle?

The accuracy of an accelerometer in calculating position and angle depends on various factors such as the quality of the sensors, the sampling rate, and the integration method used. Generally, modern accelerometers have a high level of accuracy and can provide precise measurements of position and angle.

5. What are some common applications of accelerometers?

Accelerometers have a wide range of applications in various fields, including navigation systems, robotics, virtual reality, and sports performance tracking. They are also commonly used in smartphones, fitness trackers, and other consumer electronics to detect and track movement and orientation.

Similar threads

  • Mechanics
Replies
10
Views
2K
Replies
12
Views
354
Replies
15
Views
5K
Replies
2
Views
986
Replies
5
Views
878
Replies
9
Views
916
Replies
9
Views
341
Replies
14
Views
1K
Back
Top