I did some more sd override / focus at infinity testing on G7X. Previous related discussion
https://chdk.setepontos.com/index.php?topic=12062.msg125970#msg125970 (and probably some other threads, feel free to add links)
I compared the values of PROPCASE_SUBJECT_DIST* (1 and 2 always appear to be the same), get_focus() and GetFocusLensCurrentPosition
This was done by setting the camera to MF, setting the MF distance to the nearest value, and running the attached script. The script uses levent button presses to move the canon MF UI through the available range. This is only applicable to cameras with native MF. The idea to understand the range of SD and position values available through the Canon UI.
The attached CSVs include results from my cameras. I'm not particularly looking for more results from other cameras, but it might be interesting if you have multiple cameras of the same model, especially if they exhibit different focus behavior.
Observations:
There are "position" values accessible through the Canon MF interface which are inaccessible by "subject distance" value: e.g. on G7x at the wide end, there are ~14 steps beyond where the "subject distance" values go to -1. At the near end, there are ~6 values that correspond to the same subject distance.
This supports earlier reports that there are cases where set_focus() simply cannot set the value required to obtain good focus, even thought Canon AF or MF UI can. It also means that get_focus() may not be usable to tell when the right value is set.
I confirmed by manual testing that values beyond where SD goes to -1 are actually different focus.
The point where SD goes to -1 corresponds to the focus bar being full at infinity in the UI on G7x. However, there is a triangle above the bar for most of the remaining steps. At wide angle on my camera, the actual best infinity focus seems to be one or two steps before the bar is full.
The "position" values available through the Canon UI vary depending on zoom.
Setting specific position values via UI clicks is finicky (see the do_move() function in the script). It took a lot of fiddling to get repeatable values from the script, but it seems consistent on my cameras now. I have not yet tried using functions that set by position.
The subject distance values you can set with set_focus correspond to a nearby position value. e.g on G7x calling set_focus with any value from 12000 to 23000 gives position 313, sd 17553. 24000 and above result in position 312 and sd -1
Notes
I'm assuming that GetFocusLensCurrentPosition represents a real hardware value, and the "subject distance" values are derived values, but this could be wrong.
GetFocusLensCurrentPosition is registered by Mecha.Create. There two equivalent functions registered by FA.Create + InitializeAdjustmentFunction: GetCurrentFocusLensPosition and GetCurrentFocusPosition. They all call the same underlying firmware function on G7X (and probably other cams)