PDA

View Full Version : Accelerometer Sensor



Pesticida
- 20th August 2008, 20:10
Hello,

I make a Accelerometer Sensor Circuit for a Elevator,and I'm using a ADXL311J with a Rail to Rail OP Amp (AD6809) and 5 Volt Ref,50 Hz Bandwith with 0.1uF.
When I read now the Data on The Pic Microkontroller I see just a very little change,for Example :

when the Sensor is Idle I Read 130 thats mean I have 5 Volt/256 = 0.019mV per Unit then I have 0.019*130=2.47 Volt
2.413V-Vref/2=-0.03V
-0.03V/0.312V=-Acceleration 0.096g

Ok now when the Elevator is in movement I can Read the value 131 thats mean like the Formulas on the Top I have -0.035g Its this possible or I make somewhere a mistake?!

Thats mean i have (-0.096g) - (-0.035g)=0.061g
-0.061g*10 Seconds = Speed -0.61 Meters in 10 Seconds

-0.61 * 10 Seconds = Distance 6.1 Meters

Thank you for any Information

Regards Pesticida

skimask
- 20th August 2008, 20:34
Take the accelerometer and tip it over on it's side (or back, or front, or the other side) and take another reading. It should either read A minimum or maybe go to A maximum.

Just because something is MOVING doesn't mean it's ACCELERATING.
An elevator only ACCELERATES to get MOVING (or DECELERATES to come to a stop and/or reverse the direction it's MOVING).
Once it's MOVING, it's probably no longer ACCELERATING.

I'd doubt an elevator takes 10 seconds to ACCELERATE to it's maximum speed. 5 seconds, maybe, 10 seems like quite a long time to ACCELERATE.

Pesticida
- 20th August 2008, 20:49
Hi Skimask,

The Mnimum Value I have is 130 and the Max Value is 167 .
= 3,173 Volt - 2,5 V = 0,673 V ~ +-2g

What You mean what is the Best way to found the Speed and the ~ Distance?

Thanks

Regards Pesti

skimask
- 20th August 2008, 23:33
Hi Skimask,
The Mnimum Value I have is 130 and the Max Value is 167 .
= 3,173 Volt - 2,5 V = 0,673 V ~ +-2g
What You mean what is the Best way to found the Speed and the ~ Distance?
Thanks
Regards Pesti
So you get 130 when?
and you get 167 when?

673mV for 2g worth of acceleration is not a lot to measure or play with.
If you're trying to make a speed/distance sensor, I hope you're reading the part as fast as you possibly can and not just a few times a second.

And in your first post, the math is all wrong...


5 Volt Ref,50 Hz Bandwith with 0.1uF.
At 3v, the output is 174mV/g. At 5v, you should have 290mV/g, with ZERO g at 2.5v
So, first off, you have to set the thing so it's sitting level, sensing nothing, right at 2.5v, and/or trim the output to read 2.5v using an external means.
Turn it 90 degrees one way in the axis you are measuring, the output should drop 290mV (1g), turn it 90 degrees the other way from the original 'idle' position, the output should rise 290mV (1g).


-0.061g*10 Seconds = Speed -0.61 Meters in 10 Seconds
-0.61 * 10 Seconds = Distance 6.1 Meters
All wrong...
1g acceleration = an acceleration of 9.8 meters per second each second
If you measure 1g of acceleration continuously for one second, at the end of that second, your accelerometer will be traveling at 9.8 meters per second, but will have covered only 4.9 meters (assuming a constant rate of acceleration).

Therefore, .061g of acceleration = .5978 meters per second - per second.
At the end of 10 seconds, the speed will be 5.978 meters per second (assuming a constant rate of acceleration), and the object will have moved 2.989 meters (again, assuming a constant rate of acceleration)...

I don't want to say that it's basic math, but if you're playing with PICs, math like this should come easy once you know what to look for.
http://en.wikipedia.org/wiki/Acceleration

sayzer
- 21st August 2008, 07:38
I think our friend Pesti missed an important point that Ski made.

Accelerometer "does not" give you usable data while it is moving at a constant speed.

It gives you usable data while its speed is increasing or decreasing.

skimask
- 21st August 2008, 13:32
I think it might be easier to think of it this way...

You are an accelerometer. You are blind folded sitting in a car. It's completely quite. The car isn't moving.

How can you tell if the car starts moving? You get pushed back in the seat a little bit for little awhile.
How can you tell if the car is speeding up? You get pushed back in the seat for a bit for a little while.
How can you tell if the car is slowing down? You get 'pulled' forward out of the seat a little bit for a little while.
If you don't get pushed back in the seat or 'pulled' forward out of the seat, did the car change speed?

Pesticida
- 21st August 2008, 16:41
HI :-)

Thanks People,

Skimask the Car don't change the Speed.

Thats mean that a Elevator for a little bit is accelerating and then have a costant Speed for a time T.
When is slowing down the acceleration is going in the other direction and the speed is decreasing.

Thats mean that I need a faster Bandwith,I use ADCIN and after that Hserout on my Microcontroller every 50 mS

Is that correct?

skimask
- 21st August 2008, 16:47
For the most part, yes.
Read the ADC as fast as you can, compute the data later if you can, otherwise it'll take away from the time that could be used to capture another sample.

Pesticida
- 21st August 2008, 21:14
Skimask what bandwith should I use ,between 1Hz to 2Khz ?

I use this for the moment:

Main:

ADCIN 0, adval[0]
Pause 1
ADCIN 1, adval[1]
pause 1
hserout ["A",DEC3 Adval[0],"B",DEC3 Adval[1],13,10]
Pause 50
Goto Main

Maybe I can use this

Main:

ADCIN 0, adval[0]
ADCIN 1, adval[1]

hserout ["A",DEC3 Adval[0],"B",DEC3 Adval[1],13,10]
Pause 30
Goto Main

Regards Pesti

Pesticida
- 21st August 2008, 22:13
Ok,

Now when I correct understand I must the first Acceleration Change to measure How long the Acceleration is during then I know the distance for that Time for ex. 1 Seconds.
And I can now found the distance for one second,when the speed is constant then is the Acceleration = 0 and after 10 Seconds I can found the final Distance!

I hope is my thinking correct!

Regards

Pesticida
- 24th August 2008, 10:30
Hello,

Ok I'm coming now to the conclusion that the G sensor is not the really thing for measure if a Elevator is moving and how fast is moving ! :-)

Maybe have some one another better Ideas,I'm using for the moment current measurement to see if the Elevator is moving,but I'm searching for a Modern Solution that give me more Information like ~speed,Movement,Vibration and so on.

Thanks

Regards Pesti

luminas
- 24th August 2008, 10:36
You can add optical encoder to the main motor shaft for speed, acceleration measurement . Vibration can be measured with accelerometer

CocaColaKid
- 25th August 2008, 15:59
An accelerometer will just measure the time is takes to go from one speed to another speed, not the distance. It has no way of knowing how far it has traveled unless it is constantly accelerating and decelerating.

sayzer
- 25th August 2008, 16:17
Actually, there are ways of calculating the distance using accelerometer data.

The only important point is that you should not turn the device ON/OFF while it is moving.

1. The user must make sure that the device is first powered up when its speed is zero.
2. Then, you can log the data until it tells you that the device is no longer speeding up.
3. Then you know the formula to calculate the speed with the last data you received. Start a timer here.
a. If the subject hits somewhere, and stops suddenly you should time its speed to understand that it hit something and stopped.
4. Stop the timer when the device tells you that device speed is decelerating.
5. When the device tells you that device is no longer decelerating then
a. the subject is either stopped or
b. the subject speed is constant.

You can use basic math to distinguish between a and b.


____________________________________

Acetronics2
- 25th August 2008, 16:42
An accelerometer will just measure the time is takes to go from one speed to another speed, not the distance. It has no way of knowing how far it has traveled unless it is constantly accelerating and decelerating.

Hi, KKKid

Not really true ...

if you integrate accel*time, starting from zero ... you will be stopped for integrated result = 0 ...

But, as in real life, there are always calc. roundings and little sensor errors ... you never get a true detection.

The Proof : Model planes Heading Lock Gyros ... Yess !!! The Heading is good ( or considered good ) for a Zero integration sum ...

Alain

CocaColaKid
- 25th August 2008, 16:52
Ok, I stand corrected. You could use one to do the calculations but it would have to work perfect. I talked to an aviation engineer about this and he laughed. It is possible, but the calculations would be nasty. For example, what happens when the elevator is going up or down and some kid jumps in the elevator? Unless the math is done precisely and the event cancels itself out then you'll end up with and error in you distance.

Acetronics2
- 25th August 2008, 17:23
For example, what happens when the elevator is going up or down and some kid jumps in the elevator? Unless the math is done precisely and the event cancels itself out then you'll end up with and error in you distance.


Héhé ... no error due to children nor !

integrating their movements give a precise 0 Sum : they do not fly or pass through the floor !!!

Alain

PS: take care to aviation engineers ... they perfectly know their manuals ... but I already had some surprises about their flight mechanics knowledge ...
Especially for balancing models ... they didn't learn the stab lift effect could be from down to up !!!

Dangerous for a big liner ( can become unstable at low speeds )... but widely used for gliders in contests !!!


re-PS: Talk of inertial guiding to your engineer ... will he still laugh ???

CocaColaKid
- 25th August 2008, 17:33
That is what I meant. Every movement will have to have an opposite in order to zero it out. The problem I see would be making sure that always happens in the math. Making that many readings and trying to get them to zero out in such a short period of time I would imagine would be very difficult.

Boris
- 27th August 2008, 13:26
Hi, I'm developing a localizator with the accelerometer MMA7455L, but it don't works.
Someone used this sensor?
I'm using a PIC16F88.
I'm connected the pin 1,6,7 to 3,6 VDC; the pin 2,5 to GND, the pin 14 to micro's SCL and the pin 13 to micro's SDA. SDA and SCL have two 4,7K pull up resistors. I try to read some register without answer. I try to connect pin 4 to GND, but without effect. Is the device address $1D?
Have you some software example for read and write the registers with I2C Bus? Can you help me?

This is a piece of code:

IND1 CON $1D '%00011101

PAUSE 2000

MAIN:

ADDRESS=$1A
I2CREAD SDA,SCL,IND1,ADDRESS,[TMP]
DEBUG "MODE1 ",BIN8 TMP,13,10
PAUSE 1000

goto main

thank you