Measuring Acceleration from 3-Axis w/ PIC Microcontroller

In summary, the conversation is about a project involving measuring acceleration using a PIC microcontroller and a 3-axis accelerometer. The first problem is finding the tilt of the sensor and using that information to determine the total speed of acceleration. The second problem is measuring the distance traveled with a highly variable acceleration rate. Suggestions for solving these problems include using a kalman filter and implementing a calibration procedure for each axis of the accelerometer. It is also recommended to have a running integration of the accelerations and velocities, with a small leak to prevent accumulation of errors. Access to speedometer information can also be helpful in this process.
  • #1
mx tommy
7
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
  • #2
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:
  • #3
ok, maybe forget the whole trying to find position... how about just the raw acceleration value? (IE my first problem)
 
  • #4
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.
 

1. What is acceleration and how is it measured?

Acceleration is the rate of change of velocity over time. It is typically measured in meters per second squared (m/s^2). Acceleration can be measured using a variety of methods, including using a device called an accelerometer, which measures changes in acceleration by detecting changes in motion and orientation.

2. How does a PIC microcontroller measure acceleration from 3 axes?

A PIC microcontroller can measure acceleration from 3 axes by using an accelerometer that is connected to the microcontroller through its analog input pins. The microcontroller reads the voltage output from the accelerometer, which corresponds to the acceleration in each axis, and converts it into a digital value using an analog-to-digital converter.

3. What are the benefits of using a PIC microcontroller for measuring acceleration?

PIC microcontrollers are commonly used in electronic devices due to their low cost, low power consumption, and small size. They also have the ability to process data quickly and accurately, making them ideal for measuring and analyzing acceleration data from multiple axes.

4. Can a PIC microcontroller measure acceleration in real-time?

Yes, a PIC microcontroller is capable of measuring acceleration in real-time. It can continuously read and process data from the accelerometer and provide real-time updates on the acceleration values for each axis. This allows for accurate and immediate analysis of acceleration data.

5. What are some practical applications of measuring acceleration from 3 axes with a PIC microcontroller?

Measuring acceleration from 3 axes with a PIC microcontroller has many practical applications, such as in motion detection systems, navigation devices, and robotics. It can also be used in sports equipment to track performance and in industrial machines to monitor vibrations and ensure smooth operation.

Similar threads

Replies
4
Views
4K
  • Mechanics
Replies
4
Views
600
Replies
8
Views
2K
Replies
16
Views
2K
Replies
6
Views
1K
Replies
2
Views
725
Replies
1
Views
698
Back
Top