No, the title does not refer to the forces of good versus those of evil. Nor am I referring to my stance when chopping firewood with an axe. Instead, let’s see if we can straighten out some of the terminology that you’ll hear when people start to talk about sensors. Even folks in the business sometimes get it wrong, so here is my attempt to establish a common language.

**Degrees of Freedom** – AKA DOF, this term gets misused more than any I can think of. It is often confused with “number of axes”, which I’ll discuss below. But if you consult any text on the dynamics of rigid bodies, you will quickly learn that any movement of any rigid body from point A to point B can be characterized as a translation plus a rotation.

It takes six numbers to characterize that movement: change in X, Y, and Z and rotations about X, Y and Z axes. Notice that we’re talking about the minimum set of numbers required to unambiguously specify a given movement. We are NOT talking about the number of sensors required to measure that movement.

So now, let’s talk about sensors. A basic **3-axis accelerometer** returns values for linear acceleration in each of 3 orthogonal directions.

When you look at the figure, you can immediately see where the terms axis/axes come from. They refer to the sensor coordinate system axes.

There’s an important thing you should consider about accelerometers at rest. When one of the axes associated with the sensor frame of reference is parallel to the gravity vector, as it is in the figure above, you will get no additional information from the other two acceleration numbers. They will both be zero, and you will be unable to tell if the accelerometer is rotated about the axis parallel to gravity.

The next device in our toolbox is the gyro which returns rates of rotation about each of the 3 sensor axes. Notice that I’m talking about *sensor *axes here. As the sensor rotates, so does its frame of reference for the next measurement.

A 3-axis magnetometer will return the X, Y & Z components of the ambient magnetic field. This is nominally the earth field for many applications, but may include significant offsets and distortions due to hard/soft iron effects. The magnetometer is subject to the same issue as an accelerometer – if one of the sensor axes is parallel to the ambient magnetic field vector the other two sensor axes will return values of zero. The good news is that since the earth magnetic field and gravity are never colinear, between our accelerometer and magnetometer, we have enough information to figure out the current device orientation, regardless of how we rotate the sensor.

Our 1st three sensors each returned a 3-dimensional vector. But the pressure sensor returns just a single scalar value. As discussed in previous postings, pressure can be used to infer changes in altitude, which adds another source of information when computing vertical locations.

Combine an accelerometer with a gyro and you get a **6-axis Inertial Measurement Unit, or IMU**.

Add a magnetometer to an IMU, and you have a **MARG (Magnetic, Angular Rate, and Gravity) sensor**. Add a compute engine to a MARG, and you get an **AHRS (Attitude and Heading Reference System)**.

Add a pressure sensor to a MARG or AHRS, and you get a slightly smarter MARG or AHRS – I haven’t found any standard terms. I simply refer to them as “10-axis solutions”.

So remember, use “DOF” when describing motion. Use “axis” or “axes” when describing sensor configurations. And when in doubt, draw a picture.

Mike Stanley develops advanced algorithms and applications for MCUs and sensors, including sensor fusion and sensor data analytics. He is a founding member of the MEMS Industry Group’s Accelerated Innovation Community and a contributor to the IEEE Standard for Sensor Performance Parameter Definitions (IEEE 2700-2014). He is co-author of a chapter on intelligent sensors in “Measurement, Instrumentation, and Sensors Handbook” (volume two), and speaks on sensor topics. When the Arizona temperature drops below 100 degrees, you'll find Mike flying his F450 quadcopter . Follow him @SensorFusion.

## 6 Comments

[…] posted on Freescale’s The Embedded Beat […]

Mike,

Well done, Used this with my robotic students and left them with the “Deer in the headlight” look.

I beleive some of the DOF confusion came out of robotics. The axis and DOF being equated as the same. A joint on most industrial robots only has one value. Mostly angular change, I have not seen linear changing joint that rotates but not out of the question. So basicly each joint rotates about it’s axis and with no linear component creates a 1 DOF so right or wrong the axis equates to DOF.

I also do robotic vehicles and usually have to change my hat as I work with our INS system we designed because of the difference in motion. Our system is what you called MARG but with a twist, our processor also has GPS data being fed in.

Bill

Great write-up. I’m in to RC aircraft and the current area of high-interest is accelerometer and gyro stabilized quad-copters. There are numerous applications where accelerometers and gyros are integrated into a single inexpensive board incorporated into very small air vehicles. Presently, many enthusiasts are using these platforms for aerial photography and a stable craft is critical for useful imagery. The flight control code accessing the sensor data is often difficult to read, but, knowing what key outputs should be contributing operation should be useful.

Mike

It’s great tutorial and simple description on IMU.

Thanks a lot.

—Byoung

[…] Michael Stanley – In my last post (“Degrees of freedom vs. axes”) we discussed some basic terminology for sensor fusion. This time around, we get to put that […]

[…] my last post (“Degrees of freedom vs. axes”) we discussed some basic terminology for sensor fusion. This time around, we get to put that […]