Hi all,
I bought a "Adafruit Triple-Axis Accelerometer - ±2/4/8g @ 14-bit - MMA8451" for a project I want to do underwater that measures the acceleration in the 3d plane then uses this information to adjust the thrusters. For example, If my robot is in a current, I want the accelerometer to measure how much the robot is moving because of the current, and then the thrusters will adjust to counteract the current.
I used the example provided by Adafruit with my Arduino Uno, but that only gives me information about the rotation of the chip. I'm wondering if there is any tutorial or command I can use to measure the acceleration of the robot while moving up, down, forward, backward, side to side, or any combination. Am I using the right chip? I'm fairly new to Arduino and have never used any sensor like this, so any help is much appreciated.
Measuring Forward Acceleration with a MMA8451 Accelerometer
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- cornerstonerobotics
- Posts: 8
- Joined: Mon Oct 20, 2014 3:35 pm
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: Measuring Forward Acceleration with a MMA8451 Accelerome
The example code reports acceleration rates in m/S^2 for the X, Y and Z axis. When moving at a constant speed, the X and Y values should be zero and the z value should be 0.98m/S^2 due to the force of gravity.
Any deviation from these values would indicate a change in speed and/or direction. If you integrate that over time, you will get the difference between the old speed and the new speed.
Assuming you have thrusters in the X, Y and Z axis, you can activate the appropriate thruster(s) to counteract the change in speed. Continued integration of the acceleration rates will tell you when you have returned to the original speed.
Note that integration over time is subject to drift from cumulative errors due to measurement resolution and noise. For surface vehicles, GPS is typically used to periodically correct for drift. However GPS does not work underwater. I'm not sure what other sensor technologies would work for that. Perhaps sonar?
Any deviation from these values would indicate a change in speed and/or direction. If you integrate that over time, you will get the difference between the old speed and the new speed.
Assuming you have thrusters in the X, Y and Z axis, you can activate the appropriate thruster(s) to counteract the change in speed. Continued integration of the acceleration rates will tell you when you have returned to the original speed.
Note that integration over time is subject to drift from cumulative errors due to measurement resolution and noise. For surface vehicles, GPS is typically used to periodically correct for drift. However GPS does not work underwater. I'm not sure what other sensor technologies would work for that. Perhaps sonar?
Please be positive and constructive with your questions and comments.