For anyone having focusing problems with their KR I would make a few suggestions to find out what is causing the problem. It can be tricky to isolate the problem so you have to be a little scientific about it.
1. Try to rule out user error: Although charts or setting up objects to test focus aren’t 100 percent accurate they can give you a decent and more controlled idea if your camera is having problems. Make sure camera is on a tripod, white balance is set to auto, shake reduction is turned off, the aperture is open as wide as possible. Set the focus point to single center point, and use shutter release or timer. Un-focus the lens and let the AF refocus each time. Make sure you get the green hex confirmation for each shot. Also take two more shot with out moving the camera. One using tungsten white balance, and one with manual focus (for manual focus get best possible focus by eye and don’t depend on hex confirmation as this use the AF system.) Also try the testing with multiple lenses if you have them.
2. If you have another Pentax camera use the above test with the same lens/lenses to make sure it isn’t the lens.
3. If you still aren’t satisfied with the results send the KR in for service.
I got My KR in March and was having all sorts of problems with the auto focus. I think it was more of a calibration issue than FF in tungsten light. It came back and everything seems much better. I also added a Katz eye and magnifying eye piece to help. You can see the results here.
https://www.pentaxforums.com/forums/pentax-k-r-forum/145496-pentax-kr-before-after-service.html