@reyalp This has really been bugging me, especially as I wish to use SD bracketing in continuous mode (BICM) in a Lua script I'm playing with.
The issue is the SD move in the second image in a bracketing sequence when using BICM with the Canon custom timer, ie taking an explicit number of images.
As an example, if I use the Canon custom timer to control SD BICM, set manual focus to Cam min, ie 50mm on my G7X, and use a BICM delta of 100 I get the following results reported in the CHDK DoF [Canon Custom Timer (#images), SD in DoF for last image]. I've rounded the following for presentation:
[1, 150]
[2, 250]
[3, 350]
[4, 450]
What I might expect to see would be:
[1, 50]
[2, 150]
[3, 250]
[4, 350]
So here's the 'problem', with custom timer set to 1, ie just take 1 image, the SD is moved by one SD-delta.
Thus, when, for example, I set a custom timer number of shots to, say, 2, the first short in the above will be taken at 50, but this will move focus to 150, then shot 2 will be taken and focus moved again to 250, thus we see reported 250.
I've repeated the above with an SD-delta of 1000, starting at an SD of 1000. The CHDK DoF info shows the final SD as 3000 (ignoring minor differences).
But the EXIF always shows the correct distances, ie 1000 and 2000 above.
So, we have a bit of a problem Houston
For those using the screen DoF reporting, which I assume is the one used in Lua, we are not seeing the 'truth'.
Here is the relevant section in shooting.c
static void shooting_subject_distance_bracketing(int when)
{
// first shot? (actually this is called just after the first shot has been taken)
if (bracketing.shoot_counter == 0)
{
bracketing.subj_dist = shooting_get_subject_distance();
bracketing.subj_dist_step = conf.subj_dist_bracket_value;
}
// Adjust delta SD value for shot based on shot number
bracketing.dsubj_dist += (bracketing.subj_dist_step * bracket_delta[conf.bracket_type][bracketing.shoot_counter&1]);
// Calculate new SD
int value = bracketing.subj_dist + (bracketing.dsubj_dist * bracket_steps[conf.bracket_type][bracketing.shoot_counter&1]);
if (value < CAMERA_MIN_DIST) value = CAMERA_MIN_DIST;
else if (value > CAMERA_MAX_DIST) value = CAMERA_MAX_DIST;
// Inc for next shot
bracketing.shoot_counter++;
// Apply value for next shot to be taken
shooting_set_focus(value, when);
}
I'm not sure where the bracket counter "bracketing.shoot_counter" gets set, but let's assume it is zero after the first shot is taken. The code then calcs the next focus step and sets focus, ie "shooting_set_focus(value, when)", even if the number of custom timer images is 1, ie just the base image is taken.
IMHO I think this hints at where the code might need 'tweaking'. But I would value your thoughts before 'wasting' my time further.