Home / Hardware y Moviles / Four thousand corrections a second: how the camera in your phone cancels the tremor in your hand

Four thousand corrections a second: how the camera in your phone cancels the tremor in your hand

Nobody holds a phone still. Even with your elbows braced and your breath held, your hand swings between half a degree and two degrees: a slow component — the sway of the arm, roughly 0.5 to 5 Hz — and a fast one, physiological tremor, around 8-12 Hz. At a 1/60-second exposure that becomes several pixels of smear; at 1/8 of a second, an unusable photo. Optical image stabilisation (OIS) exists to fight that movement from inside the camera module, sliding a lens in the opposite direction to the shake. It does so thousands of times per second, within a range of less than a tenth of a millimetre.

What actually moves inside the module

A phone camera module is a tower of plastic and metal about 8 x 8 millimetres holding the sensor, the infrared cut filter, a fixed aperture and a stack of four to seven lens elements. In OIS systems the moving group — usually the middle elements, not the whole barrel — sits on a carriage that can shift along two axes perpendicular to the optical axis. That carriage hangs from four hair-thin wires or flexure springs and carries permanent magnets around its edge. Opposite them, a flat coil etched into the flexible circuit board.

It is a voice coil motor (VCM), the same principle as a loudspeaker: current through the coil produces a Lorentz force proportional to the magnetic field and the current, and the carriage moves. Reverse the current and it moves the other way; modulate it precisely and it lands within micrometres of the target. A Hall sensor next to each magnet measures the carriage’s actual position, so the system does not work blind: it is a closed loop with position feedback, not a simple actuator.

The gyroscope gives the orders, the lens obeys

The brain of the system is a MEMS gyroscope soldered to the phone’s board, often the very same one games use to detect tilt. It measures angular velocity in degrees per second, sampling at thousands of hertz. The controller integrates that velocity over time to obtain the angle travelled, works out how much to compensate and commands the equivalent displacement from the VCM: if the camera turns by θ, the lens moves f·tan(θ), where f is the focal length. With a 6-millimetre focal length and 0.3 degrees of shake, the required shift is just 31 micrometres. There lies the engineering difficulty: moving something 30 microns, in milliseconds, without ringing, rubbing or running out of travel.

Useful travel is typically ±50 to ±200 micrometres, which translates into a maximum correction of half a degree to one and a half degrees. That is why OIS saves a handheld shot but performs no miracles with a 10x telephoto: the longer the focal length, the more the same shake is magnified and the faster the actuator runs out of room.

Timing matters as much as mechanics. The gyroscope must report the lens position at the exact instant the exposure begins, and a CMOS sensor reads out progressively: the first row is exposed before the last. Good phones align gyroscope timestamps with the start of each frame; a lag of a few milliseconds ruins the correction and produces the classic video wobble that persists even when the image is sharp.

When the sensor itself moves

The variant popularised by the iPhone 12 Pro Max family and several Pixels moves the sensor instead of the lens. A stage with four VCMs and their Hall sensors shifts the CMOS chip across its own plane. The advantage is twofold: it works with any optics and tolerates large sensors, which are too heavy to hang from four wires. It also compensates rotation around the optical axis — roll, the tilt of the horizon — which a decentred lens cannot do. The price is a bulkier module, higher power draw and more heat.

In folded telephoto designs, the so-called periscopes, the problem is solved by moving the prism that bends the light or the lens group behind it. The correction is equivalent, but the actuator fights more mass and tolerances are even tighter.

What OIS cannot fix

Optical stabilisation corrects the movement of the camera, not of what is in front of it. A running child will be blurred even if the phone is bolted to a tripod; that needs a faster shutter, and a faster shutter needs light. Nor does it fix the jelly effect of the electronic shutter: if the phone rotates while the sensor reads row by row, each row captures a different orientation and the image skews. There is only one lens, and it cannot take a different position for every row.

That is where electronic stabilisation (EIS) comes in. The processor crops a margin of 5 to 15 percent of the frame, estimates motion by combining the gyroscope with optical flow analysis between frames, and warps the image on a mesh to put it back where it belongs. Because it knows when each row was read, it can correct rolling-shutter distortion row by row — something physically impossible for a lens. The cost is effective resolution and a slightly narrower field of view; the benefit is video with a steady horizon and smooth transitions. Modern systems coordinate both layers: OIS absorbs high-frequency shake while EIS handles the slow, large displacements.

Why night mode depends on this mechanism

Computational night photography works by stacking eight to fifteen frames. If each is taken at 1/10 of a second, OIS can keep it sharp; without it, hand tremor would ruin half the shots and the algorithm would have to discard them. In practice, useful per-frame exposure on a phone with good stabilisation is around 1/8 to 1/4 of a second — two to three stops more light than the 1/30 a handheld shot would demand unaided. That difference is what separates a decent night photo from a smear.

The details that give the engineering away

Shake a phone gently with the camera off and a metallic clack-clack means it is not broken: the optical group is hitting its end stops, because the magnets only hold the carriage while current flows. That same magnetism explains why the phone’s compass asks to be recalibrated after heavy camera use: the module’s permanent magnets distort the Earth’s field, which is orders of magnitude weaker. It also explains why OIS draws power even at rest, since the loop must stay active to keep the lens in place.

To check whether a phone really stabilises, beyond the spec sheet, a simple test is enough: maximum zoom, low light, a handheld shot with and without stabilisation, then compare at 100 percent. The difference shows in the edges of letters and the rims of streetlights. When it works it looks like magic; looked at closely, it is a 30-micron control loop running thousands of times a second.