i'm a student who is studying the Arduino. I want to measure acceleration using arduino and any sensor. i looked at some acceleration sensors (ex, MPU6050, AXDL335), but they were just measuring gravity, not axial acceleration.
Could you tell me any sensor that can measure the axis-acceleration available with Arduino?
-
They are measuring any acceleration. Gravity just causes an acceleration in one direction. If you accelerate these sensors into a different direction, the resulting acceleration vector will be a combination of gravity and your acceleration. So these sensors are already capable of what you want to do. Or do you mean rotational acceleration? If yes, then you need a gyroscope (which is also a part of the MPU6050 I think)chrisl– chrisl2020年01月06日 12:25:23 +00:00Commented Jan 6, 2020 at 12:25
-
But those were not able to measure in the following cases; if the sensor is leveled and accelerated x or y-dir, the directional acc of that axis is zero, and the z-dir is 1gD.S– D.S2020年01月06日 12:38:57 +00:00Commented Jan 6, 2020 at 12:38
-
No, it isn't. The MPU6050 (I know this chip a little) has 3 accelerometers for each axis. When you accelerate in x, the corresponding acceleration value rises. Have you already tried something and failed with it? Then you can edit your question to include this information. Maybe you did something wrong and we might be able to help youchrisl– chrisl2020年01月06日 13:06:18 +00:00Commented Jan 6, 2020 at 13:06
1 Answer 1
There is no difference between gravity and other kinds acceleration. Gravity is the constant downward acceleration of ≈9.81 m/s2. You cannot feel any difference between the force of gravity and the force you would experience on a surface without gravity that's accelerating upwards at 9.81 m/s2.
You can use the gyroscope to keep track of the orientation of the sensor, so you know the downward direction of gravity, and can correct your accelerometer measurements for it.
The problem is that gyroscope orientation measurements are subject to drift. To correct the orientation for drift, the accelerometer is used (because it can measure the direction of gravity, so you know what the downward direction is). The accelerometer only measures the exact acceleration due to gravity if the sensor is not accelerating, of course, but that's most likely not the setup you're going to use an accelerometer in.
As you can see, this is kind of a chicken and egg problem.
Luckily, there are advanced sensor fusion algorithms and complementary filters available that combine the accelerometer and gyroscope measurements, and give you a pretty good approximation for both.
I've successfully used Madgwick's algorithm for a quadcopter.
Depending on your use case, you'll have to tweak some coefficients to indicate if you rely mostly on the gyro or the accelerometer data. The MPU6050 has a DMP that can run sensor fusion algorithms on the chip itself, so the Arduino doesn't have to deal with that.
-
Correction to your your 2nd sentence - gravity appears like an upward (not downward) acceleration.user1318499– user13184992020年06月05日 22:46:10 +00:00Commented Jun 5, 2020 at 22:46