The mixer lesson ended on a promise: the craft needs something to decide what rotation is wanted, because left to a bare mixer it tips within a second. That something begins with measurement. Before a controller can hold the craft level it must know how the craft is oriented and how fast it is turning, and both come from a single component the size of a grain of rice, the inertial measurement unit, or IMU. It contains two sensors, a gyroscope and an accelerometer, and the art of using it is knowing exactly what each one can and cannot tell you.
MEMS, or machines etched in silicon
Both sensors are micro-electro-mechanical systems, tiny mechanical structures etched into silicon alongside the circuit that reads them. Inside is a suspended mass a fraction of a millimetre across, held on silicon springs, that moves a little when the chip accelerates or rotates, and the movement is read as a change in electrical capacitance. That a real, if microscopic, mass swinging on real springs is what a flight controller feels the world through is worth keeping in mind, because the sensor's limits are the limits of a small noisy spring and mass, not of an abstract number.
The gyroscope measures rate, not angle
The gyroscope measures the rate at which the craft is rotating, in degrees per second, about each of the three axes. It is the more important of the two for flight, because rotation rate is fast and immediate: the moment a gust starts to tip the craft, the gyro reports the turning, with almost no delay and little sensitivity to vibration or to the craft's motion through the air. A flight controller reads the gyro thousands of times a second and it is the gyro, above all, that lets the machine catch a tip before a human could see it.
The gyroscope's weakness is that it measures rate and not angle. To know the craft's actual tilt from a gyro you must add up, or integrate, the rate over time, and any small constant error in the rate, a bias, accumulates without bound. A gyro reading half a degree per second too high, sitting perfectly still, will after one minute claim the craft has rotated thirty degrees. This creeping error is drift, and it is the defining flaw of a gyroscope: excellent for how fast the craft is turning right now, useless on its own for which way is up after a while.
The accelerometer feels down, when it can
The accelerometer measures acceleration, but for a craft sitting still its most useful reading is gravity. A stationary accelerometer feels a steady 1 g pulling down, and from the way that 1 g is split across its three axes the controller can work out which way the chip is tilted. An accelerometer flat and level reads all its gravity on the vertical axis; tip it and some of that gravity appears on the horizontal axes, and the ratio gives the tilt angle directly, with no integration and so no drift. Where the gyro is blind to absolute tilt, the accelerometer sees it.
The accelerometer's weakness is the mirror of the gyro's. It cannot tell gravity from any other acceleration, because it measures their sum. A quadcopter in flight is shaking from propeller vibration and accelerating as it manoeuvres, and both add to the gravity it is trying to read, so the raw accelerometer signal in flight is a noisy mess in which the steady 1 g of gravity is buried. Trusted alone in flight it would report a tilt that jerks with every vibration and every change of speed. It is reliable about down only when the craft is still or moving smoothly, which is exactly when the gyro is least needed.
Example. A gyroscope has a bias of 0.3 degrees per second that has not been calibrated out. The craft sits motionless on the bench. If the controller estimates tilt by integrating the gyro alone, what tilt error has built up after two minutes?
Two minutes is 120 s, so the accumulated error is degrees. The craft has not moved, yet a gyro-only estimate now believes it is tilted well past level. This single number is why a gyro is never integrated on its own for attitude.
Now you. An accelerometer lies with its measured gravity split as 0.5 g on one horizontal axis and about 0.87 g on the vertical axis. Roughly what tilt angle does that correspond to?
Answer
The tilt is degrees. The horizontal component of gravity grows with the sine of the tilt, so reading it back gives the angle, no integration involved.
Bias, noise and the need for calibration
Neither sensor is perfect even at rest. Both carry a small fixed offset, the bias, and a jittery random component, the noise. The bias is why a flight controller asks to sit still on a level surface at power-up: it measures each sensor's reading while nothing is moving and subtracts it thereafter, which is calibration, and it is why a craft armed on a slope or while being carried flies out of trim. The noise is why the raw signals are filtered before use, a balance between smoothing out the jitter and not adding delay, since a filtered signal is always a little late and lateness in a fast control loop causes its own trouble. Temperature shifts the bias too, which is why a good controller recalibrates and why a cold craft can behave differently for its first minute.
Two flaws that cancel
The picture that emerges is two sensors with opposite strengths. The gyroscope is fast and drift-prone: right about rate, slowly wrong about angle. The accelerometer is slow and drift-free but noisy: right about angle on average, useless from moment to moment in flight. Neither alone can hold a craft level. The gyro-only estimate drifts away over seconds; the accelerometer-only estimate shakes to pieces. The resolution is to use each for the band it is good at, the gyro for the fast changes and the accelerometer for the slow truth of where down is, and to blend them so the drift of one is corrected by the other. That blend is the subject of the next lesson, and it is the quiet piece of mathematics that turns two flawed sensors into one trustworthy sense of which way is up.