Measuring inclinations of a moving vehicle with an accelerometer

I'm developing an application with an accelerometer (ADXL335) to measure inclinations and activate an alarm when a specified angle is exceeded. Up here all right.

I need to measure these inclinations in a vehicle in motion. Problem: When there are sudden accelerations the alarm is activated even though the specified angle isn't reached.

How can I solve this problem?

Use gyro instead of accelerometer?..

You are going to need more than one sensor to accomplish this. At rest, you can easily get an angle from an accelerometer by determine the director of the of vector caused by gravity. However, for a moving car, there are other accelerations which will interfere with the acceleration due to gravity alone, so you will need another sensor such as a gyro to help determine the real angle. Using a gyro you can integrate the rotational velocity to get rotational position and apply that to a recently known accelerometer angle data point to get the current angle. The MPU6050 is a good sensor for this as it has an accelerometer and gyro on it. It also has a DMP which allows you to directly output euler angles or yaw/pitch/roll values which will save you having to write your own algorithms. Jeff Rowbergs i2C library will come in very handy if you decide to go this route. Good luck.

Thank you so much!!

So... using a MPU6050 I can measure the inclination of a moving car and set alarms as a function of the angle of inclination!!

Thanks again :slight_smile:

Check oout this application note, an-00mx-012. Also using a thermal MEMS with a natural LPF response will help reject a lot of the out-of-band vibrations.

Even using a gyro, you are going to have great difficulty distinguishing the actual tilt of the vehicle from the acceleration of the vehicle. The tiny moving parts of the accelerometer device sense acceleration, and they fundamentally cannot tell you if that is caused by gravity or by the acceleration or deceleration of the vehicle. The gyro will tell you if the car is rotating, but any normal car or vehicle does not rotate much, and the rotation effect will be difficult to distinguish from noise and from the inherent drift in the gyro.

It's a common misconception that an accelerometer is measuring the force of gravity. Actually, the accelerometer is measuring the force of the floor or ground or table pushing on it from underneath, that is preventing the accelerometer from falling into a bottomless pit.

Hi,
Has anyone used an accelerometer to measure the pitch angle (up and down hill) of a moving vehicle?

I do some trailer towing with a GMC SUV and I would like to build a "Cruise Control" that anticipates hills before the speed actually drops much. Also data about the incline would possibly inform me that a downshift will be necessary Real Soon Now.

I assume I will need to do signal averaging to get decent data.

Any ideas??

terryking228:
Hi,
Has anyone used an accelerometer to measure the pitch angle (up and down hill) of a moving vehicle?

I do some trailer towing with a GMC SUV and I would like to build a "Cruise Control" that anticipates hills before the speed actually drops much. Also data about the incline would possibly inform me that a downshift will be necessary Real Soon Now.

I assume I will need to do signal averaging to get decent data.

Any ideas??

Did you or anyone else ever find a solution to finding the pitch of a moving vehicle?

Gaxce sensors has offers a new wireless vibration recorder, the RECOVIB Tiny measures vibrations and shocks in all three axis. It is extremely practical for a vibration diagnosis, offering up to 6 hours of measurement. Its wireless technology and intuitive operation provides substantial time savings in the performance of your measurements. It is the only type of vibration and shock recorder that allows several sensors to be used simultaneously in a synchronized manner enabling the performance of modal analyses and operational deflection shape analyses on large structures such as bridges or walkways. We offer different measuring ranges : ± 2/6G, ± 15G, ± 200G. It is able to record 1024 acceleration values (shocks and vibrations) per channel per second. The RECOVIB Tiny is the smallest, lightest and the most robust recorder on the market that is able to perform recordings in extreme conditions ranging from -10°C to +50°C. It is also dust and water tight to IP65.

there are two kinds of measurement: absolute and relative. these terms are also used in addressing

if you live at 10 Penny Lane, and your friend lives at 20 Penny Lane, you can send a person looking for your friend to:

20 Penny Lane ( absolute addressing )
or
5 houses up the street ( relative addressing, in America )

OP wants to measure absolute inclination, referenced to either horizontal or vertical. an accelerometer measures acceleration, not angle. an accelerometer is a relative measuring device. they are sold as inclinometers, but the people who call it that may not be entirely clear regarding the definition of the word inclinometer, or the existence of absolute vs relative reference.

search term: Arduino inclinometer

that will keep you busy for a while.

When an accelerometer is used to measure inclination, one assumes that the acceleration measured is entirely due to the Earth's gravity, which points directly down.* Theory described in detail here.

Any other accelerations will confuse the measurement and lead to small random errors or completely wrong answers. To some extent a gyro can be used to correct for accelerations caused by rotations, but a gyro cannot correct for those accelerations caused by an accelerating vehicle, or by bumpy roads.

You will not get accurate tilt angles in a moving vehicle, and there is not much you can do about it except averaging.

  • The acceleration reported by an accelerometer resting on a flat, level surface points up, because the surface exerts a force keeping the accelerometer from falling.

I Googled "inclinometer" and told him I wanted to purchase. There are quite a few available types, even bare chips.

Paul

The only way to get anything like a true orientation in space of a moving object is a full IMU. 6DoF (ie 3D accelerometer plus a 3D gyro) is the minimum to give accurate inclination (9DoF gives yaw as well).

Movement acceleration cannot be separated from gravity, the sensor sees the sum of the two as physically they are completely indistinquishable.

For an aircraft horizon-sensing using passive IR can be employed for inclination sensing in good weather, but at ground level this isn't practical due to obstacles. A clear sky has a very low radiation temperature compared to the earth.

CV might be another way to augment an accelerometer with orientation information, visual processing taking the place of gyro sensing - after all its how most animals do it (although the inner ear helps, and is effectively a rate gyro).

Get a cheap IMU.

Hello gents,

I have a Mega board with an 6 Axis Accelerometer&Gyro from Seeed, LSM6DS3. In my design I was hopping to determine the inclination of a robot. I designed and I am building my own drive for the BB-8 droid. Due to the mouse wheel design the inclination is critical. My idea is that for a maximum thrust forward the DC motors speed to be modulated in order to keep the drive at maximum 90 degrees inclination.
I am developing the Arduino sketch one, I read Accelerometer and Gyro data but how do I use this in order to calculate a rotation angle? Do you know a sketch example?
Thank you very much!

You need code that can calculate 3D orientation from the 6DOF sensor.

The Madgwick and Mahoney AHRS filters are popular, and it is likely that someone has adapted one or both to the LSM6DS3. Google would probably know.

Why not a potentiometer attached to the suspension , one each side . Or, if you vehicle has anti roll bars then a strain gauge on that would give you a signal.
Some cars have pots so mounted for self levelling etc, so there probably are parts around you could use.