Measuring Acceleration from 3-Axis w/ PIC Microcontroller

  • Context: Undergrad 
  • Thread starter Thread starter mx tommy
  • Start date Start date
  • Tags Tags
    Acceleration Axis
Click For Summary

Discussion Overview

The discussion revolves around measuring acceleration using a 3-axis accelerometer connected to a PIC microcontroller, particularly in the context of a vehicle. Participants explore challenges related to sensor orientation, tilt correction, and the integration of acceleration data to estimate distance traveled. The conversation includes both theoretical and practical aspects of the project.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • The original poster (Thomas) seeks to measure forward acceleration and deceleration, noting that the accelerometer will not be mounted level, which complicates readings.
  • Thomas proposes using the Z-axis reading to determine tilt, suggesting that less measured gravity indicates a greater tilt angle.
  • There is uncertainty about how to determine whether the measured acceleration is positive or negative, as Thomas expresses confusion over interpreting the data directionally.
  • Another participant mentions the need for filtering techniques, such as a Kalman filter, to accurately estimate position from acceleration data, indicating that this requires advanced knowledge in controls theory.
  • Thomas later considers simplifying the problem to focus solely on obtaining raw acceleration values.
  • A suggestion is made to develop a calibration procedure for the accelerometer axes and to potentially use data from a speedometer for better accuracy.
  • There is mention of maintaining a running integration of acceleration to calculate velocity, with a recommendation to implement a "leaky" integration to manage error accumulation over time.

Areas of Agreement / Disagreement

Participants express varying levels of understanding and approaches to the problems presented. There is no consensus on the best method for integrating acceleration data or on the calibration process, indicating that multiple competing views remain.

Contextual Notes

Participants highlight the need for calibration and error management in the integration process, as well as the potential complications introduced by noise in the acceleration data. The discussion does not resolve these issues, leaving them open for further exploration.

Who May Find This Useful

Individuals interested in sensor integration, vehicle dynamics, and data processing techniques in embedded systems may find this discussion relevant.

mx tommy
Messages
7
Reaction score
0
Ok, Not sure which forum this would fall under, so if it's the wrong one feel free to move it.

I'm currently involved in a project that involved measuring acceleration from a 3 axis accelerometer using a PIC microcontroller. And I only have high school physics. :cry:

I have 2 problems I need help with...

I want to measure foward acceleration and decceleration (it's going to be mounted on a vehicle). If the sensor was mounted level, I could just read the value of the coressponding axis and be done, but the sensor will never be mounted that way. It will most likely be mounted tilted either forward or back a bit, possibly somewhat side to side, etc...

My sensors read -1.5 G's to +1.5G's, Z should always be positive as the sensor will always be mounted upright, X is positive when accelerating, and Y is side to side (though I'm not really interested in it, but I'm guessing it's needed to find the devices "tilt" or something)

So, from what little I understand, I need to find out the tilt of the sensor, by reading how strong gravity is on the Z-axis (less measured gravity = more degrees off axis) Then somehow use that and the information from the other 2 axis's (X and Y) to find out the total speed of accelration. I also need to know if it's acceleration or decceleration, IE I know decceleration is just acceleration in the opposite direction, but I need some value to "test" to to see which of the two it is... I mean if I just plug the X,Y, and Z values into an equation and get a value with no sense of direction, I don't know if it's acceleration or decceleration (If THAT makes sense :P )

Now, as to the actual equations to do any of this, I'm totally lost after 5 hours of google :confused:



Second problem is this, once I have the "corrected" acceleration value, it's only for that one "point" in time... I'll be taking a reading about 100 times a second, and need some help trying to figure out how much distance is traveled. I found the equation

s = ut+1/2at^2

where
s = distance
u = initial velocity
a = acceleration
t = time

however, I'm not seeing how to use this (I guess you could say "repeatedly") because after the first one, the initial velocity would be other then 0, and I don't know how to get the "new" initial velocity

Basically, I need to measure the time it takes to travel 50 feet (or like 15m) with a highly variable acceleration rate (which will sometimes be deceleration as far as the sensor is conserned, because of bumps etc,)

Any help will be most appreciated :) even a link to a page with some relevant math :D

Thanks, Thomas
 
Physics news on Phys.org
If I recall correctly, I remember someone who had a program to try and back out the displacement by integrating the acceleration directly. The problem was that you need to do a lot of fancy filtering to get rid of noise and other associated problems if you want to get a half descent position estimate. You can try to integrate it directly, but I'm afraid you will get anwsers that are incorrect.

You're going to need a kalman filter, and that requires graduate level controls theory.
 
Last edited:
ok, maybe forget the whole trying to find position... how about just the raw acceleration value? (IE my first problem)
 
On the first problem, I'd recommend that you come up with a calibration procedure for each axis of the accelerometer in the vehicle. Do you have data aquisition capability from the speedometer or other velocity sensor? If tilts can be an issue, you need to store non-volatile calibration info in the PIC.

On the use of the equations, you will need to keep a running integration of the accelerations and the velocities. You will need to have an error budget, and you may need to make your integrations "leaky" with a small leak of the integration value to keep the value from pegging out due to accumulation of small errors. If you have access to speedometer information, you can use that to help you leak your straight-line velocity from the value the accelerometers give you back to the speedometer value over some time interval. The vertical and horizontal values should most likely leak back towards zero, unless your vehicle is a plane or something.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 4 ·
Replies
4
Views
5K
Replies
11
Views
24K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 47 ·
2
Replies
47
Views
5K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K