• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Photography Life

PL provides various digital photography news, reviews, articles, tips, tutorials and guides to photographers of all levels

  • Click to visit our RSS feed
  • Click to visit our Facebook page
  • Click to visit us on Twitter
  • Click to visit our YouTube channel
  • Click to visit our Instagram page
  • Reviews
    • Camera Reviews
    • Lens Reviews
    • Other Gear Reviews
  • Learn
    • Beginner Photography
    • Landscape Photography
    • Wildlife Photography
    • Portraiture
    • Post-Processing
    • Advanced Tutorials
  • Lenses
    • Lens Index
  • Photo Spots
    • Photo Spots Index
    • Submit a Photo Spot
  • Forum
  • About Us
    • Contact Us
    • Workshops
    • Subscribe
    • Submit Content
  • Shop
    • Cart
    • Support Us
  • Search
  • Log In
  • Sign Up
Home » Cameras and Lenses

How Phase Detection Autofocus Works

By Nasim Mansurov 48 Comments

  • Click to share on Facebook (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to share on Reddit (Opens in new window)

When it comes to DSLR technology, there seems to be quite a bit of confusion on how exactly phase detection autofocus works. While for most people this might not be a topic of great interest, if you are wondering how and why a camera could have an autofocus problem, this article will shed some light into what happens inside the camera in terms of autofocus when a picture is taken. There is an overwhelming amount of negative feedback on autofocus issues on such fine tools as the Canon 5D Mark III, Nikon D800, Pentax K-5 and other digital SLR cameras and it seems like most photographers do not seem to understand that the underlying problem is not necessarily with a specific model or type of a camera, but rather with the specific way these cameras acquire focus. If you search on the Internet, you will find thousands of autofocus reports on all kinds of DSLRs dating back 10+ years. Hence, the front focus and back focus issues we see in modern cameras are not anything new – they have been there ever since the first DSLR with a phase detect sensor was created.

How DSLR Cameras Work

To understand this issue in more detail, it is important to get to know how a DSLR camera works first. The typical DSLR illustrations only show a single reflex mirror positioned at a 45 degree angle. What they don’t show, is that there is a secondary mirror behind the reflex mirror that reflects a portion of light into a phase detect sensor. Take a look at the below simplified illustration that I made from a sample Nikon D800 image:

How Phase Detection Autofocus Works

Here is the description of each number shown in the above illustration:

  1. Ray of light
  2. Main/Reflex Mirror
  3. Secondary Mirror, also known as “Sub-Mirror”
  4. Camera Shutter and Image Sensor
  5. Eccentric pin (1.5mm hex) for adjusting the Main Mirror
  6. Eccentric pin (1.5mm hex) for adjusting the Secondary Mirror
  7. Phase Detect Sensor (AF Sensor)
  8. Pentaprism
  9. Viewfinder

Let’s take a look at what happens inside the camera when a picture is taken. Light rays enter the lens (1) and make it into the camera. A partially transparent main mirror (2) is positioned at a 45 degree angle, so it reflects most of the light vertically into the pentaprism (8). The pentaprism magically converts the vertical light back into horizontal and reverts it, so that you see exactly what you get when you look through the viewfinder (9). A small portion of light goes through the main mirror and gets reflected by the secondary mirror (3) that is also tilted at an angle (54 degrees on many modern Nikon cameras, as illustrated above). Next, the light reaches the Phase Detect / AF Sensor (7), which redirects it to a group of sensors (two sensors per AF point). The camera then analyzes and compares images from these sensors (similar to how focus is evaluated on a rangefinder) and if they do not look identical, it instructs the lens to make proper adjustments (see below for more details).

While the above process looks more or less straightforward, there is one major problem with this approach. The Phase Detect sensor is the one that instructs the lens to make proper adjustments, while the image is captured by a completely different device – the sensor on the back of the camera. Why is this a problem? Remember, when you take a picture, both the main and the secondary mirrors flip up, the shutter is opened and the light from the lens directly hits the camera sensor (4). For phase detection autofocus to work correctly, the distance between the lens mount and the camera sensor, as well as the distance between the lens mount and the Phase Detect sensor must be identical. If there is even a slight deviation, autofocus will be incorrect. On top of this, if the angle of the secondary mirror is not precisely what it should be, it will also result in autofocus issues.

How Phase Detect Sensor Works

As I have already said above, the phase detect system works similarly as rangefinder cameras. Light that gets bounced off the secondary mirror is received by two or more small image sensors (depending on how many focus points an AF system has) with microlenses above them. For each focus point you see in a viewfinder, there are two tiny sensors for phase difference – one for each side of the lens, as shown in the illustration on top of the page (7) (the illustration over-exaggerates this behavior by showing two separate light beams reaching two separate sensors. In fact, there are way more sensors than two on a modern phase detect device and these sensors are located very closely to each other). When the light reaches these two sensors, if an object is in focus, light rays from the extreme sides of the lens converge right in the center of each sensor (like they would on an image sensor). Both sensors would have identical images on them, indicating that the object is indeed in perfect focus. If an object is out of focus, the light would no longer converge and it would hit different sides of the sensor, as illustrated below (image courtesy of Wikipedia):

Phase Detection Autofocus

Figure 1 to 4 represent conditions where the lens is focused (1) too near, (2) correctly, (3) too far and (4) way too far. It can be seen from the graphs that the phase difference between the two profiles can be used to determine not just in which direction, but how much to change the focus to achieve optimal focus. Note that in reality, the lens moves instead of the sensor.

Since the phase detect system knows if an object is front focused or back focused, it can send exact instructions to the camera lens on which way to turn its focus and by how much. Here is what happens when a camera acquires focus on a subject (closed-loop AF operation):

  1. The light that passes through the extreme sides of the lens is evaluated by two image sensors
  2. Based on how the light reaches the image sensors, the AF system can determine if an object is front or back focused and by how much
  3. The AF system then instructs the lens to adjust its focus
  4. The above is repeated as many times as needed until perfect focus is achieved. If focus cannot be achieved, the lens resets and starts reacquiring focus, resulting in focus “hunting”
  5. Once perfect focus is achieved, the AF system sends a confirmation that the object is in focus (a green dot inside the viewfinder, a beep, etc)

All this happens in a fraction of time, which is why phase detection system is much faster than contrast detection system (which relies on changing focus back and forth until focus is achieved, with lots of image data analysis happening on the image sensor level).

The phase detection/AF system is a very complex system that sees improvements pretty much every time when a higher end camera line is refreshed. Over the years, the number of autofocus points have been increasing, as well as the number of more reliable cross-type autofocus points. For example, the Canon 1D X and the Canon 5D Mark III have a whopping 61 focus points, 41 of which are cross-type. Take a look at this complex matrix of autofocus sensors on the camera:

Canon EOS 1D X AF Layout

Not only have the number of AF points increased, but also their reliability. Most modern professional cameras today come with extremely fast and highly configurable autofocus systems that can continuously track subjects and acquire focus.

DSLR Autofocus Problems

As you can see above, the phase detection autofocus system is very complex and requires high precision to get accurate results. Most importantly, the phase detect/AF system must be properly installed and aligned during the manufacturing process. If there is even a slight deviation, which does happen quite a bit in manufacturing, autofocus would be off. This is the main reason why phase detect has been the source of problems pretty much since the first DSLR with a phase detect sensor came out. Understanding these possible deviations, all DSLR manufacturers developed a high precision calibration system that takes this into account and allows for individual camera calibration during the inspection and quality assurance (QA) process. If a phase detect sensor alignment problem is detected, the system performs automatic computerized testing that goes through each and every focus point and manually adjusts it in the camera. The points that are off are re-calibrated and re-adjusted, then the compensation values are written into the camera firmware. Think of this as a similar process to AF Fine Tune / AF Micro Adjust that happens on the phase detection level, except it is done for each AF focus point separately.

In my next article, I will talk about the Nikon D800 asymmetric focus issue (the left AF issue), why it happened and what Nikon is doing to fix it.

If you have enjoyed this article, please check out our in-depth Level 1 Photography Basics Course, where we explore all the basics of photography in much more detail. It is an intensive, 5+ hour course with enough material to not only get you started today, but also to serve as a reference material in the future.

Subscribe to Our Newsletter

If you liked this article, please subscribe below to our weekly email to get more great content like this!

Related articles:

Disclosures, Terms and Conditions and Support Options
Filed Under: Cameras and Lenses Tagged With: Advanced Photography Tips, Tips for Beginners, Photography Tips, Autofocus, Autofocus Issues, Phase Detect, Phase Detection Autofocus

About Nasim Mansurov

Nasim Mansurov is the author and founder of Photography Life, based out of Denver, Colorado. He is recognized as one of the leading educators in the photography industry, conducting workshops, producing educational videos and frequently writing content for Photography Life. You can follow him on Instagram and Facebook. Read more about Nasim here.

Reader Interactions

Comments

  1. Drazen B
    July 11, 2012 at 2:59 pm

    Another one of those fantastic articles from you, great and relevant read for both novice and pros alike.

    Thanks Nasim!

    Reply
  2. GianCarlo
    July 11, 2012 at 3:46 pm

    I think that Nikon will hate you! Thank you!

    Reply
  3. Mark Adams
    July 11, 2012 at 3:57 pm

    Thank you Nasim. Thousands of us look forward to that next post. Great work you are doing here!

    Reply
  4. Oded Shopen
    July 11, 2012 at 4:24 pm

    I can’t believe how many times I used DSLR and didn’t know these fundamental facts. very interesting stuff, thank you very much for taking the time to write this!

    Reply
  5. Sergio
    July 11, 2012 at 4:39 pm

    Great explanation, thanks a lot for such a good material.

    Reply
  6. Judd
    July 11, 2012 at 4:49 pm

    Once again you have decomposed a potentially complicated subject into a concise and understandable lesson. Thank you for the effort that you put into this Nasim, it is greatly appreciated.

    Reply
  7. Michael Baker
    July 11, 2012 at 4:53 pm

    Nasim– A GREAT read!! I am part engineering techno-geek and part photo artist
    and have never gotten over my fascination with the incredible technology we
    have today that provides detail and color definition in captured images which rivals
    the human eye.

    Reply
  8. Don
    July 11, 2012 at 5:02 pm

    A masterpiece Nasim.. As usual, outstanding work… Hopefully this will put to rest the worriers and let them know that there is a fix. Again, great work…

    Reply
  9. Jorge
    July 11, 2012 at 6:43 pm

    Another fantastic post. You are one of the most prolific photography bloggers out there. I marvel at your energy and passion for the subject and how the quality of your information and writing are unwaveringly top-shelf with every post.

    As a D800 owner waiting for the return of his camera from the Melville service center for the left-focus issue, I also anxiously await your next article where someone I have come to trust puts rhyme and reason to this vexing problem.

    Thanks again

    Reply
  10. Jano
    July 12, 2012 at 12:31 am

    Nasim, thanks for the article! I’ve been into this stuff so it wasn’t new for me but I love how you break it down so almost everyone can understand the basic principles.

    Now I have one question I’ve been asking myself for a while, especially hearing about all those D800 issues. Since you kind of wrote about it in your last part I will take the chance to ask you.
    Wouldn’t it be possible to correct autofocus only via software? Basically telling the camera that focus point xy is front focused by n. So when aquiring focus the camera does not aim to get the exact same signal on both phase detect sensors, but rather aims for a front focus of n.

    If my thinking is right you could set up your camera in front of a large wallpaper with – say – one focus star for each AF point. Then run a software on the camera that automatically focuses point xy using contrast detection in LV. Now all the camera would have to do is simply read the value of the corresponding phase detection sensors to find out that this particular point is front focused by n.
    In theory, that software could automatically go through all the AF points and add a software compensation for any misalignment. This would eliminate the need for sending anything back to Nikon or rather Nikon should run this software on every camera during QA.

    Now, why isn’t it that simple? Is the phase detect only reliable enough in detecting the exact same signal rather than being able to detect a front focus of exactly n? I’m sure there’s some problem here why camera manufacturers don’t do this. On the other hand, isn’t this exactly what AF fine adjustments do on modern DSLRs?
    I don’t get it. In my head this is not as complicated as it appears to be in reality. Please help me out ;)

    On another note: This kind of automating AF fine adjustments using contrast detection should be included with every camera. Doing it by hand is so much more work…

    Reply
  11. AK
    July 12, 2012 at 1:18 am

    Nasim,

    2.Based on how the light reaches the image sensors, the AF system can determine if an object is front or back focused and by how much
    — I still couldn’t understand what it means by ‘Front focused’ and ‘Back focused’. Is there a way to make me understand better?

    Reply
    • Axel
      July 12, 2012 at 10:07 am

      Hi AK,

      This one is easy to figure out: Imagine you focus on an object (call it X), the camera tells you “X is in focus”, i.,e. the green dot in the viewfinder lights up instead of the left/right arrows.

      Take the shot. Now imagine that in the actual image taken, object X comes out blurred, i.e. not in focus.
      If objects in front of X are sharp, the camera exhibits a “front focus”.
      If objects behind X are sharp, the camera exhibits a “back focus”.

      Cheers,
      Axel

      Reply
      • AK
        July 12, 2012 at 10:10 am

        Thanks Axel, now this explanation made me to visualize the problem. Cheers.

        Reply
  12. siango lee
    July 12, 2012 at 7:28 am

    Yes!! A beautiful and elegantly written article! I have been trying very hard to understand this mechanism (what with the recent hoollabaloo on quality control) and it is with your help that I finally got it. Thank you, Nasim!

    Reply
  13. Joe
    July 12, 2012 at 9:04 am

    Hi Nazim,

    Wonderful article and well written.. I wanted to understand this for a while!!

    couple of questions..

    1) what is the difference between vertical/hozontal/cross type points and why cross is better? is it the relative position of the microsensors and light sampling at that location??

    2) Is it better to align the focus point at the boundary of the surface for the phase detection to work faster? I mean, if I focus on the eye, is it better to focus at the edge of the white or at the middle of the white?

    thanks
    Joe

    Reply
  14. Hoang
    July 12, 2012 at 10:02 am

    Dear Nasim ,

    Great article , now I know why my D5000 always focus behind the subject !!!

    Tks a lot for this :)

    Reply
  15. foo
    July 12, 2012 at 3:51 pm

    Thanks, great article!

    Reply
  16. lorenzo
    July 13, 2012 at 1:53 pm

    Excellent article Nasim, thank you!

    I am anxious to read your next one to know if and how Nikon will address this issue. So far they deny it, however they do fix the cameras that are affected.

    In a waiting list at B&H for over a month, I will be happy if my D800E will arrive by Christmas, especially if this malfunction is corrected.

    Reply
  17. Hooman
    July 13, 2012 at 11:47 pm

    Great explanation and illustration on a topic that I frequently searched the net for
    thank you Nasim

    Reply
  18. Manzur Huq
    July 14, 2012 at 8:14 am

    As usual, it is a great article.
    It reminded me of the Sir Barnes Neville Wallis, (26 September 1887 – 30 October 1979), who was an English scientist, engineer and inventor. He is best known for inventing the bouncing bomb used by the RAF in Operation Chastise (the “Dambusters” raid) to attack the dams of the Ruhr Valley during World War II. The raid was the subject of the 1955 film The Dam Busters, in which Wallis was played by Michael Redgrave. Among his other inventions were the geodetic airframe and the earthquake bomb. He also pioneered the concept of Hovercraft, Swing Wing fighter jets, and vertical Take off fighters.
    By putting two light beams on left and right tips of the each bomber wings pointed downwards, the exact elevation of the bombers were achieved for releasing the bombs, when the beams coincided on the water surface in front of the dams, the bombs then bounced on the water surface before hitting the side of the dams. The same way, as kids we played by throwing flat stones in ponds.
    This is off course used in the range finder cameras manually.
    The problem appears to be Manufacturing/Quality Control and not design, therefore, it should not be difficult for Nikon to fix this.
    Thanks a lot.
    Manzur

    Reply
    • lorenzo
      July 14, 2012 at 11:15 am

      Manzur,
      I hope you are not too optimistic on Nikon Quality Control. If you read what an “expert” (possibly a lawyer?) said on NikonRumors about this issue you probably will agree with him.

      He basically said that today it takes hours for each camera to be re-aligned by Repairs technicians and that Nikon can’t afford to waste these hours in production at the factory.

      Given the fact that few people are able to test and prove this malfunction (repairs wants a documented PDAF failure) Nikon still saves money on Quality Control as only a low percentage of cameras return to service.

      It is sad, makes one lose faith in the Great Nikon of the old days but it might be the reality today.
      lorenzo

      Reply
  19. Ümit Alper TÜMEN
    July 14, 2012 at 8:45 am

    Hello, Nasim;
    Thank you very much for very useful article. Before DSLR I mean SLR cameras; They have already used Phase Detect Sensor for AF. Is there any difference between SLR and DSLR camera Phase Detect Sensor for AF function. What about the sub-mirror angle of SLR (you indicate DSLR is 54 degree)
    Thanking you advance for your kind reply
    Best Regard,
    Ümit Alper TÜMEN

    Reply
  20. Bijan
    July 16, 2012 at 1:18 pm

    very informative article.
    thanks a lot Mr Mansurov

    Reply
  21. Wilba
    September 4, 2012 at 12:14 am

    Congratulations on a nice clear article, and for correctly describing PD AF as a closed-loop control process. For an in-depth exploration of that aspect, check out www.dpreview.com/artic…-autofocus

    Reply
  22. Oyunu
    September 6, 2012 at 10:58 am

    I do agree with all the concepts you have offered on your
    post. They are really convincing and can definitely work.
    Nonetheless, the posts are very short for newbies. May you please extend them a little from next time?
    Thanks for the post.

    Reply
  23. lpef
    December 19, 2012 at 7:39 am

    great article, very clear

    Reply
  24. Maarten
    January 22, 2013 at 7:12 am

    This is a really good article, i’m using parts of it for a Dutch version about this subject.

    Reply
    • Don
      January 22, 2013 at 7:14 am

      I hope you bothered to ask Nasim before using his information…

      Reply
      • Maarten
        January 22, 2013 at 7:24 am

        Not yet, but the article will not be published before I’ve done that.

        Reply
  25. Shawn
    December 17, 2013 at 9:22 pm

    So how does autofocus work on mirrorless cameras?

    Reply
  26. Keith R. Starkey
    December 18, 2013 at 11:57 am

    You know, I am not the least bit technical, and after reading (well, skimming) past this article, I thought “What am I wasting my time reading this for? I’m never going to understand, or need, this.” And then I went back and re-read it, and it makes perfect sense. (So I’m quitting my job and going to ingenn…engeener…that kind of school…after I learn to spell!).

    Thanks for a great article!

    Reply
  27. Oscar Rqoue
    October 3, 2014 at 10:15 pm

    Excellent articule Nasim, it could not be better, thank you so much for a very well detailed and esay to understand information. I suggest you to write a book, putting together your articles and sharing your intense knowledge. I would be the fisrt to buy it.
    Thanks again.

    Reply
  28. Brijesh
    November 21, 2014 at 10:07 pm

    Nasim

    Hats off to your understanding n expressing ability. I have read a number of articles on phase detection but this is simply superb.

    Gets straight into your brain.

    Complex system explained in simplest way.

    Thank you.

    Reply
  29. Brijesh
    November 21, 2014 at 10:10 pm

    Please intimate if you are posting article on Mirror less AF system.

    Thanks

    Reply
  30. Rex Decker
    December 4, 2014 at 10:08 pm

    Excellent read! Thanks for your time I writing this.

    Reply
  31. Harry
    June 23, 2015 at 7:08 am

    Great article explaining how it works. I was expecting tips on how to use it to make my camera acquire faster in low light, i.e., techniques for auto focus, how many points should I use, etc? Any key settings to optimize auto focus for typical low light conditions?

    Reply
  32. Michael
    October 16, 2015 at 2:28 am

    Thanks I just love these Articles.

    Reply
  33. Dan Bahrami
    December 5, 2015 at 7:44 pm

    may I ask what is AF detection of Nikon D810? is f/5.6 or f/8?

    Reply
  34. Thijs Schouten
    December 10, 2016 at 12:29 pm

    Thanks for the great article! :)

    Reply
  35. s prakash
    January 26, 2017 at 12:14 am

    It is said it is easier to make things complicated while it is very tough to make things easy to understand complicated things. You have done a great job of explaining Phase detection in the common mans language. Thanks a million.

    Prakash

    Reply
  36. David Pharo
    February 13, 2017 at 9:17 am

    Thanks, this was clear and really helpful.

    Reply
  37. thones
    November 10, 2017 at 7:30 am

    Dear Nasim,

    Another excellent article from you. More than a thank to you. Not regarding to your topic in the article, I am wondering how the Liveview mode could work according to the DSLR illustration you showed ( I mean how LV mode could work when the secondary mirror as well shutter blocked the light to the image sensor) ??

    Reply
    • Srikanth
      November 20, 2017 at 7:23 am

      It’s done by a method called ‘contrast detection’ by the image sensor. It is explained here in the below article.
      photographylife.com/dslr-…-explained

      Reply
  38. Srikanth
    November 20, 2017 at 7:23 am

    It’s done by a method called ‘contrast detection’ by the image sensor. It is explained here in the below article.
    photographylife.com/dslr-…-explained

    Reply
  39. Vimal
    January 6, 2018 at 3:24 am

    Really great Article . Thank you so much .

    Reply
  40. Nagy Sándor m&m
    August 4, 2018 at 12:28 am

    Thanks,
    Sándor

    Reply
  41. Ivo L. Castro
    August 7, 2018 at 2:19 pm

    Its a very good article, special thanks!!!

    Reply
  42. Moshe Marton
    November 16, 2018 at 7:39 am

    What about AF calibration for EACH lens ?! How does Nikon cope with calibrating AF for each separately produced lens ? Body fabricated at A plant and Nikkor lens at B plant have to be coupled and calibrated TOGETHER for acurate AF performance. How is this problem fixed ?

    Reply

Comment Policy: Although our team at Photography Life encourages all readers to actively participate in discussions, we reserve the right to delete / modify any content that does not comply with our Code of Conduct, or do not meet the high editorial standards of the published material.

Leave a Comment Cancel reply

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

Primary Sidebar

Categories

  • Composition and Art
  • Essays and Inspiration
  • Photography Techniques
  • Photography Tutorials
  • Post-Processing
  • Reviews

Photography Tutorials

Camera BasicsPhotography Basics
Landscape PhotographyLandscape Photography
Wildlife PhotographyWildlife Photography
Macro PhotographyMacro Photography
Composition & CreativityComposition & Creativity
Black & White PhotographyBlack & White Photography
Night Sky PhotographyNight Sky Photography
Portrait PhotographyPortrait Photography
Street PhotographyStreet Photography
Advanced PhotographyAdvanced Photography

Recommended Gear

  • Best DSLR Cameras
  • Best Mirrorless Cameras
  • Best Entry-Level DSLRs
  • Best Cameras for Landscape Photography

Support Us

B&H Photo Video Banner

Recent Topics

  • Can Lightroom 6 be used for Nikon Z files
  • Can’t get photos to be right exposure
  • HDR Bracketing + Interval Timer mode + Silent shutter not compatible
  • focusing
  • Fuji 16-55mm f/2.8 R LM WR sharpness
  • Your country is blocked
  • Shutter Repair Options
  • AF-S NIKKOR 24-120mm f/4G ED VR
  • High speed sync
  • Nikon Z6 save to clean with Eyelead?

Footer

Site Menu

  • Beginner Photography
  • Lens Database
  • Photo Spots
  • Search
  • Submit Content
  • Subscribe
This site uses cookies to improve your experience. To find out more, please see our Privacy Policy

Reviews

  • Camera Reviews
  • Lens Reviews
  • Other Gear Reviews

Copyright © 2019 · Photography Life
DMCA.com Protection Status