Mirrorless AF Calibration – Part 5: The Autofocus Processor

In previous posts, I’ve covered issues that might affect the AF Sensor and the Lens. The last part of the Autofocus System is the AF Processor – the brains behind the whole operation.

When I talk about the AF Processor, I’m talking about a conceptual block of functionality – It may be a dedicated chip inside the camera or an algorithm run inside another processor. 

Render of a processor on top of a sensor and exploded lens image.

The AF Processor takes inputs from the AF Sensor and the lens, then gives instructions to the lens to move the focus group in a specific direction by a certain amount, which changes the focus of our image.

Using these inputs and outputs, the processor does its very best to get the point of focus for your image just perfect. 

But as the previous posts show, the measurements from the AF sensor aren’t perfect, the information from the lens isn’t always accurate, and our control over the mechanical aspects of the lens can be imprecise. And all these little imperfections can add together to end up with a soft shot.

Let’s put everything together and take a look at why.

About this Series

This post is part of a series looking at on-sensor phase-detect autofocus, the whole autofocus system, and why mirrorless autofocus might still need some calibration.

The full list of posts are:

Open Loop or Closed Loop?

The first thing to address is whether the AF System is an open-loop or closed-loop system, and this will be down to the algorithm in the AF Processor.

What do I mean by “open loop” and “closed loop”? Well, in the context of the autofocus system:

  • Open-loop means that the processor will take a measurement from the sensor – which for a phase-detect sensor we’ve seen is both a direction and an amount of defocus – and tell the lens to move to the appropriate position. One measurement, one action.
A block diagram showing open-loop focus operation
How open-loop focus would work
  • Closed-loop does the same, but adds an extra critical step: once the lens has moved, take another reading from the AF sensor, and confirm that we’re in the right position – i.e. we’ve closed the loop from sensing to moving and back to sensing again.
A block diagram showing closed-loop focus operation
How closed-loop focus would work

Essentially, a closed-loop system “checks its workings” and adjusts again if things aren’t quite right.

Phase-detect autofocus systems have the potential to be open-loop, and that would beautifully explain a whole host of autofocus issues, especially with what we’ve learnt over the previous posts in this series! Imagine: take a reading that’s not quite right, tell a slightly imperfect mechanical system to move the lens, and then just assume everything is good. Boom! There’s your reason for out-of-focus images!

But that’s not the reality: given the capabilities of the autofocus system to check its result, it would make much more sense for camera manufacturers to use a closed-loop system if they could. And indeed, in most circumstances, that’s exactly what happens.

Consider the following closed-loop autofocus scenario:

  • Get a direction and distance to focus from the AF Sensor
  • Move the lens
  • Check the result – it’s not quite right, so take the new direction and distance from the AF Sensor and try again.
  • Keep going until the measurements from the AF Sensor says we’re in focus focused.

All the time in the world

The first thing to think about for the closed-loop system is this: how many times do you repeat the measure-move-check operation?

The seemingly obvious answer to this is “until it’s in focus”.

For a one-shot (AF-S) style autofocus operation, that’s great. Keep repeating the measurement and moving the lens until the AF sensor reports that everything is in focus.

But what about when you want a shot quickly?

And what if the AF Sensor never reports that it’s in focus?

Time-limited Situations

The big advantage of an open-loop system – one that takes a single measurement, then performs the focus and assumes it will be correct – is that it’s very fast.

Quick Shooting

It’s pretty much impossible to get definitive answers from camera manufacturers about the intricate details of their autofocus systems, but a certain amount can be established through careful testing.

One time where open-loop control has been shown to be used is when:

  • The subject is (reported to be) only a little out of focus
  • The shutter button is fully pressed in one movement

This makes sense, as a full press of the shutter button with no pause for AF confirmation from the camera implies the desire for immediate capture, and if the AF Processor believes the subject to be only a little defocused, then a single small movement of the lens should result in correct focus.

Continuous AF

It is also quite likely that in continuous AF mode with a high frame rate, there is limited time to repeat the measure-move-check cycles required for closed-loop operation. While unlikely to be truly open-loop, with minimal checks the system will rely heavily on the accuracy of both the sensing and moving of the focus position.

As an extreme example, take the Z9 which can shoot with full autofocus at 120 frames per second. That allows less than 8.3 milliseconds (thousandths of a second) between shots, to measure, calculate and move the focus of the lens.

120fps still capture option doesn’t leave a lot of time to autofocus!

While the speed of the electronics is highly impressive with today’s technology, there is still a physical movement – including all the acceleration, deceleration and backlash compensation required – and 8mS is really not a lot of time to be shifting lumps of glass accurately even over small distances! And for every measure-move-check cycle, you reduce the time available – so check just once and adjust and you’ve only got 4 milliseconds!

Now try doing that with an older F-mount lens, with its less precise motor control…

Biased Shooting

A lot of cameras have options to change the focus and release priorities of the shooting, and when the setting is pushed more in favour of release instead of focus, it’s highly likely that the number of loops is reduced.

Here are a couple of options on the Z9 to change the priority and bias the operation of the autofocus system:

Putting it all together

So, now we’ve looked at the limitations of the AF Sensor, the lens and the AF Processor, let’s see how the whole system interacts and how these limitations can result in soft images.

AF Sensor/Lens Issues

We’ve looked at a few things that can cause issues with the measurement of focus offset at the AF sensor:

  • Mask position errors
  • Microlens imperfections
  • Lens optic issues

Some of these – e.g. lens element placement errors – can result in a fixed sensor-wide change in the focus point, which will also affect the focus position of the captured image. Under these conditions, for an out-of-focus image, the AF Sensor will report a different amount of defocus compared to a “perfect” sensor. Instead of saying “26 to the left” it’s now saying “24 to the left”.

If we think back to our likely open-loop (or time-limited) cases above – where there’s a single measurement and then movement to the focus position – then we can see how an error in the reported amount of defocus can have a direct effect on the eventual focus position, and lead to potentially soft images.

With limited time or user-bias towards focus speed, AF Sensor or lens issues can directly affect focus accuracy

But that doesn’t matter in a closed-loop system, does it? We just keep repeating measure-and-move until we’re in focus.

Some of the issues I’ve covered in previous posts – e.g. mask position errors, lens tilting or decentering – can have an effect on the AF Sensor results in different ways at various points on the sensor. For example, mask position errors may affect left and right masks in different ways, potentially leading to reporting an image being in focus when it’s actually fractionally and consistently out-of-focus.

AF Sensor or optical path issues can lead to fixed offsets in reporting of in-focus objects

Help me out here, Lens!

Let’s assume that the AF sensor is behaving perfectly and reporting exact and reliable focus offsets. The next thing for the AF Processor to do is move the lens focus group to the desired position.

We’ve got information from the AF sensor – e.g. “26 to the left” – but how do we translate that into an instruction to move the lens the correct amount?

Remember that AF Correction Data that’s stored in the lens? Well, now it comes into play!

The AF Processor gets some information from the lens which allows it to calculate a precise amount to move the lens from its current position to the desired position, taking into account the zoom setting, lens design and any quirks of this particular lens.

Quirks? Yep. The lens was calibrated in the factory to take into account any slight deviations from the perfect lens design that our physical lens may exhibit.

Think about that for a moment. 

The lens on your camera is a few years old. It’s your favourite lens, it’s been used a lot. It’s a zoom lens, so you’ve racked the zoom countless times, and every shot you take has moved the focus elements back and forth in their guides.

And you still expect the calibration data in the lens to reflect the state of the lens as it was in the factory?!

Lens Mechanics

There are a bunch of physical components inside the lens that are all subject to wear and tear, changing their behaviour a little.

Combine that with slight deviations in the position of the lens mount, and the optical elements in the lens, and you have a clear potential for the calculated instructions to drive the lens to be somewhat incorrect.

In the time-limited cases, we can end up with the focus being slightly wrong and an image that’s softer than expected.

When there’s time to check the focus result, we can end up with a couple of effects.

If the lens drives to the wrong point, when we measure we’ll see that the image is still out of our acceptable range of focus and have to run through the movement again. This will slow down the autofocus process by some amount, which may become more critical as the time taken to achieve focus is reduced.

In severe cases, a movement in either direction may overshoot the range that we consider to be in focus, and the lens may pulse back and forth, never achieving focus.

Furthermore, depending on how the autofocus algorithm is implemented, it is quite possible that the final focus position is within acceptable limits but biased away from the “perfect” focus position a little in a fixed direction – the perfect situation for a small AF Fine-tune adjustment.

Lens calibration data can become inaccurate due to mechanical or optical changes in the lens, and can result in focus errors.

The Evidence

Through this series, I hope I’ve clearly explained a number of potential issues that may result in a need for tuning your lenses even on a mirrorless camera:

Now it’s time to take a look at the evidence that shows that these issues really can result in a need for calibration – Part 6: The Evidence.

Leave a Reply

Your email address will not be published. Required fields are marked *