Measuring Acceleration from 3-Axis w/ PIC Microcontroller

  • Thread starter Thread starter mx tommy
  • Start date Start date
  • Tags Tags
    Acceleration Axis
AI Thread Summary
The discussion focuses on measuring acceleration using a 3-axis accelerometer with a PIC microcontroller, specifically for a vehicle that may not be mounted level. The user seeks guidance on determining the sensor's tilt to accurately calculate forward acceleration and deceleration, as well as understanding how to differentiate between the two. They express confusion over the equations needed to compute distance traveled based on acceleration readings taken multiple times per second. Suggestions include implementing a calibration procedure for the accelerometer and using a running integration of acceleration to update velocity, while considering potential errors and noise in the measurements. The conversation highlights the complexity of accurately measuring acceleration and position in a dynamic environment.
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 totaly 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.
 
The rope is tied into the person (the load of 200 pounds) and the rope goes up from the person to a fixed pulley and back down to his hands. He hauls the rope to suspend himself in the air. What is the mechanical advantage of the system? The person will indeed only have to lift half of his body weight (roughly 100 pounds) because he now lessened the load by that same amount. This APPEARS to be a 2:1 because he can hold himself with half the force, but my question is: is that mechanical...
Some physics textbook writer told me that Newton's first law applies only on bodies that feel no interactions at all. He said that if a body is on rest or moves in constant velocity, there is no external force acting on it. But I have heard another form of the law that says the net force acting on a body must be zero. This means there is interactions involved after all. So which one is correct?
Thread 'Beam on an inclined plane'
Hello! I have a question regarding a beam on an inclined plane. I was considering a beam resting on two supports attached to an inclined plane. I was almost sure that the lower support must be more loaded. My imagination about this problem is shown in the picture below. Here is how I wrote the condition of equilibrium forces: $$ \begin{cases} F_{g\parallel}=F_{t1}+F_{t2}, \\ F_{g\perp}=F_{r1}+F_{r2} \end{cases}. $$ On the other hand...
Back
Top