I am trying to detect a free fall scenario. I have accelerometer and gyroscope.
A simple fall I can detect by inspecting a total acceleration of 0g
However, my problem is when the IMU falls and rotates at the same time (centrifugal force). Any idea how to distinguish this scenario?
I don't have the solution, but let me state 2 points:
if the IMU is near the center of mass of your hardware, the centrifugal acceleration should be negligible
If you have a constant rotation you should read a constant rate on the gyroscope, and a constant acceleration too ( if the IMU is not in the center of mass). Morover, the constant rotation should be on an axis perpendicular to that of the constant rotation
Related
I wrote an app that writes gravity, userAcceleration, and attitude quaternion to CSV while driving in a vehicle. The intent is to capture the dynamics of the vehicle (e.g. braking, accelerating, cornering) in the earth frame using an iPhone.
Then, I sum gravity and userAcceleration, and rotate the resulting raw acceleration vector by the quaternion provided by CMAttitude to get the acceleration in the earth frame. In about 60% of recording sessions, the average z values are not +9.81m/s^2 and jump to varying magnitudes besides +9.81m/s^2. For example (each tick mark in the y-axis represents 5m/s^2):
But, I expect a plot with a consistent average value for acceleration in the z axis like the following:
When I start device motion updates, I use the xMagneticNorthZVertical attitude reference frame, like so:
motionManager.startDeviceMotionUpdates(using: .xMagneticNorthZVertical, to: OperationQueue(), withHandler: didUpdateDeviceMotion)
The following computes raw acceleration in the global frame using the attitude quaternion:
let accel = CMAcceleration(x: (motion.userAcceleration.x+motion.gravity.x), y: (motion.userAcceleration.y+motion.gravity.y), z: (motion.userAcceleration.z+motion.gravity.z))
let a = SIMD3<Double>(accel.x, accel.y, accel.z)
let a_vehicle = simd_act(attitude.quaternion, a)
I also have written the equivalent in MATLAB resulting with the same problem.
xMagneticNorthZVertical should result in an attitude that computes the direction of gravity. The direction of X or Y does not matter to me.
I do not have any magnets in the vicinity to skew the computed attitude.
In contrast: Android's rotationVector consistently rotates the accelerometer readings to the earth frame. Surely the quality of iPhone is better than Android.
What might be the cause of the attitude quaternion to not always rotate the device frame to the earth frame such that Z is in the direction of gravity?
I'm trying to make simple VR HMD that can track user's head movement in 6 DoF(Forward and Backward, Left and Right, Up and Down, Pitch, Yaw, Roll). Applying 6 DoF Accelerometer and Gyroscope(GY-521, MPU-6050) made me can track user's rotation, but I still can not track positional differences.
I have googled if there is a way to calculate its spatial velocity or acceleration with accelerometer, but there weren't. Because output values of accelerometer mean not linear acceleration, but angular acceleration.
I wonder what kind of sensor or model can measure rotation and linear motion at the same time. Also, How standalone HMD can measure user's motion with its IMU?
I am doing research on the tremors and Parkinson's disease.The plan is to use accelerometers and gyroscopes on the human arm. I plan on using Pulse for data collection and analysis. My questions are:
Is it true that there are some accelerometers that can separate gravitational acceleration from linear acceleration (heard it on the uncited grapevine). My suspicion is that we can't place an accelerometer on the patients arm to measure, say, the tremors caused by bicep and tricep contraction because if the patient rotates his wrist, the change in gravitational acceleration will contaminate our results. More to the point, can we measure acceleration due ONLY to the action of the muscles, and not due to changing gravitational forces with any of your accelerometers?
If a 3-axis accelerometer is rotating about an axis parallel to the ground, wouldn't the axis perpendicular to the ground pick up a sinusoidally varying (i.e. not DC) gravitational acceleration?
None of the accelerometers can separate the linear acceleration from the gravitational acceleration. This is achieved by sensor fusion, you merge the accelerometer and gyro readings in a clever way.
I developed a motion sensing applicaton to track human motion (elbow flexion). I am sure something similar would work fine for you.
My advice is to use orientation in your application (rotation matrices).
If you have to implement the sensor fusion yourself then the Direction Cosine Matrix IMU: Theory manuscript is a good place to start.
I currently detect movement on the y axis. How does one calculate the direction it moved on the axis?
I get the same values when moving up or down.
Is the Gyro needed for this?
Do remember that the accelerometer will reflect the force of gravity. So movement up and down will generally be reflected as 9.81 m/s2 plus or minus the actual acceleration of the device relative to the Earth.
Now that iOS 4 is no longer NDA, I would like to know what Gyroscope has to offer over the Accelerometer for developers. Is there a difference in APIs? Other things?
Actually, the accelerometer measures linear acceleration; but since force is equal to mass times acceleration, people can consider it as measuring force as well as long as it has a constant mass. Linear acceleration is the rate of change of linear velocity. A gyro on the other hand provides the angular rotational velocity measurement as oppose to the linear acceleration of movement. Both sensors measures the rate of change; they just measure the rate of change for different things.
Technically, it is possible for a linear accelerometer to measure rotational velocity. This is due to the centrifugal force the device generates when it is rotating. The centrifugal force is directly related to its rotational speed. As a matter of fact, many MEMS gyro sensors actually uses linear accelerometers to determine the rotational speed by carefully placing them in certain orientations and measuring the centrifugal forces to compute the actual rotational gyro speed.
A MEMs gyroscope is a rate of change device. As the device rotates in any its axis, you can see a change in rotation. An accelerometer only provides the force along the X,Y,and Z vectors, and cannot solve for "twist". By using both sensors, you can often implement what is referred to as a 6DOF (degrees of freedom) inertial system - or dead reckoning - allowing you to find the relative physical location of the device. (Note that all inertial systems drift, so its not stable in the long term).
In short: gyroscopes measure rotation, accelerometers measure translation.
There is a new API for reading the gyroscope.