Aperture control + test script - General Discussion and Assistance - CHDK Forum  

Aperture control + test script

  • 38 Replies
  • 24441 Views
*

Offline reyalp

  • ******
  • 14080
Aperture control + test script
« on: 09 / September / 2018, 18:30:44 »
Advertisements
Working on the ND stuff and trying to figure out which cameras have a real aperture lead me down some other rabbit holes  :-[

Some general observations:
Modern cameras (starting around G12, maybe) need CAM_AV_OVERRIDE_IRIS_FIX to control the aperture in continuous shooting. This calls MoveIrisWithAv to set the aperture rather than just setting propcases. However, the define is currently only set up to work in bracketing, so scripted aperture changes in continuous mode (ala rawopint etc) doesn't work.
This should probably be changed to apply to any set call while in shooting, but the set_now/set_later logic makes it somewhat complicated. Also, it doesn't appear to be required "quick" mode, but if we just check get_shooting it would still be applied there. This would probably be harmless.

It's likely that some cameras which need this define don't have it set, or vice versa.

Some current CHDK functions use GetCurrentAvValue. This function (also discussed in https://chdk.setepontos.com/index.php?topic=13508.0) returns the current value (not a half press value or next shot setting) so mixing it with propcase values that only update on half press seems suspect. The history of this usage is unclear to me, but it seems to have been around for a long time. It's used in
* shooting_get_real_aperture - used only for misc display and _min_real below
* shooting_get_min_real_aperture - used in shooting_get_subject_distance_
* shooting_update_dof_values

Attached avtest.lua script is similar to ndtest and isoinc for aperture.

By default, the script will step through aperture values from min to max in 1/3 stops, compensating with shutter to attempt to the keep the exposure constant. It has the usual single/quick/cont modes. If it prints "no warnings" aperture control probably works with the selected settings, otherwise there are possibly problems with the scene or bugs in the port.

You can also use it to run through the available range in 1 APEX*96 steps to measure the precision of aperture control.

Testing on g7x, control is quite good (see attached chart, "m96_err" is the difference between predicted meter and actual in APEX96. I suspect the biggest outliers are ambient light changes), so smoothly ramping through the AV range for DOF effects in timelapse should be totally viable with modest software de-flicker.

Test video

edit:
Youtube compression makes it harder to see what's happening, link to original file https://app.box.com/s/r1eg4is9dqrp3kkpp0r3x458wqrlnxix

edit 2018 09 11:
Updated script to handle ISO better

edit 2018 09 13:
Fix formatting of aperture values in log

edit 2018 10 06:
* Error now calculated from baseline shots at the starting aperture
* Log av96_err (Av compared to get_current_av96) and m96_err_cur (meter 96 error assuming get_current_av96 is correct)
« Last Edit: 06 / October / 2018, 22:18:33 by reyalp »
Don't forget what the H stands for.

*

Offline c_joerg

  • *****
  • 1248
Re: Aperture control + test script
« Reply #1 on: 10 / September / 2018, 03:27:51 »
Attached avtest.lua script is similar to ndtest and isoinc for aperture.

I missed the attachment…

You can also use it to run through the available range in 1 APEX*96 steps to measure the precision of aperture control.

That has always interested me…

so smoothly ramping through the AV range for DOF effects in timelapse should be totally viable with modest software de-flicker.

That's all very interesting…
I did not expect that you can change the aperture in 1 APEX steps because this is a mechanical setting. In the ISO setting, it is still to be understood because it is probably only a DA converter here.

Test video

In continuous mode or quick?
M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

*

Offline blackhole

  • *****
  • 937
  • A590IS 101b
    • Planetary astrophotography
Re: Aperture control + test script
« Reply #2 on: 10 / September / 2018, 06:40:45 »
Some general observations:
Modern cameras (starting around G12, maybe) need CAM_AV_OVERRIDE_IRIS_FIX to control the aperture in continuous shooting. This calls MoveIrisWithAv to set the aperture rather than just setting propcases. However, the define is currently only set up to work in bracketing, so scripted aperture changes in continuous mode (ala rawopint etc) doesn't work.
This should probably be changed to apply to any set call while in shooting, but the set_now/set_later logic makes it somewhat complicated. Also, it doesn't appear to be required "quick" mode, but if we just check get_shooting it would still be applied there. This would probably be harmless.

It's likely that some cameras which need this define don't have it set, or vice versa.
I have a problem with AV bracketing in continuous mode on the sx410.
Exif is updated for each image as expected, but there are no differences in the images or in the histogram.
With CAM_AV_OVERRIDE_IRIS_FIX defined in platform_camera.h occurs a crash.
On the other hand, AV bracketing works well from a script, eg Ultra HDR v3.1 ,without defined CAM_AV_OVERRIDE_IRIS_FIX.

EDIT:ROMLOG attached.
 
« Last Edit: 10 / September / 2018, 06:58:44 by blackhole »

*

Offline reyalp

  • ******
  • 14080
Re: Aperture control + test script
« Reply #3 on: 10 / September / 2018, 13:38:32 »
I missed the attachment…
Ooops, forgot to attach it :-[  Added to the first post.
Quote
I did not expect that you can change the aperture in 1 APEX steps because this is a mechanical setting.
I wasn't sure what to expect. I suppose it doesn't require more precision then focus or zoom, but on the other hand, the stock firmware doesn't really seem to need 1 unit steps.

I will try to do a more controlled test later.
Quote
In continuous mode or quick?
Quick, it doesn't work in continuous on G7 X because of the CAM_AV_OVERRIDE_IRIS_FIX issue.
Don't forget what the H stands for.


*

Offline reyalp

  • ******
  • 14080
Re: Aperture control + test script
« Reply #4 on: 10 / September / 2018, 13:57:01 »
I have a problem with AV bracketing in continuous mode on the sx410.
Exif is updated for each image as expected, but there are no differences in the images or in the histogram.
With CAM_AV_OVERRIDE_IRIS_FIX defined in platform_camera.h occurs a crash.
On the other hand, AV bracketing works well from a script, eg Ultra HDR v3.1 ,without defined CAM_AV_OVERRIDE_IRIS_FIX.
Ultra HDR  https://chdk.wikia.com/wiki/Ultra_HDR_Script uses shoot (a half shoot cycle every shot) so that makes sense.

I think the crash is because it needs a semaphore created for MoveIrisWithAv in init_required_fw_features. G7X boot.c has an example.

av_override_semaphore should probably be at 0xCF30 on sx410 100c
Don't forget what the H stands for.

*

Offline c_joerg

  • *****
  • 1248
Re: Aperture control + test script
« Reply #5 on: 10 / September / 2018, 14:07:00 »
Quick, it doesn't work in continuous on G7 X because of the CAM_AV_OVERRIDE_IRIS_FIX issue.
Is this the same on G1x or M3?
What happens with aperture on G7x between the shoots in quick mode?
My M3 always opens the aperture in quick mode between the shoots. G1x aperture doesn’t change aperture in quick mode between the shoot. I would expect more m96_err on M3.
M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

*

Offline reyalp

  • ******
  • 14080
Re: Aperture control + test script
« Reply #6 on: 10 / September / 2018, 15:58:29 »
Is this the same on G1x or M3?
G1x almost certainly has the same problem as G7x. I don't know about M3.
Quote
What happens with aperture on G7x between the shoots in quick mode?
Like G1x, it does not open between shots.
Don't forget what the H stands for.

*

Offline blackhole

  • *****
  • 937
  • A590IS 101b
    • Planetary astrophotography
Re: Aperture control + test script
« Reply #7 on: 10 / September / 2018, 20:34:17 »
Ultra HDR  https://chdk.wikia.com/wiki/Ultra_HDR_Script uses shoot (a half shoot cycle every shot) so that makes sense.

I think the crash is because it needs a semaphore created for MoveIrisWithAv in init_required_fw_features. G7X boot.c has an example.

av_override_semaphore should probably be at 0xCF30 on sx410 100c
Thanks, now works well.
The patch is attached.


*

Offline reyalp

  • ******
  • 14080
Re: Aperture control + test script
« Reply #8 on: 10 / September / 2018, 23:52:55 »
The patch is attached.
Thanks. Added in r5100.
Don't forget what the H stands for.

*

Offline c_joerg

  • *****
  • 1248
Re: Aperture control + test script
« Reply #9 on: 11 / September / 2018, 12:07:28 »
Made just an avtest run with G1x. 16 shoots with quick and 16 with cont. As you said, cont mode doesn’t work.
I’m wondering why ISO increases every shoot in quick mode. Maybe it has something to do with the setting of ISO here (the difference of 1).
https://chdk.setepontos.com/index.php?topic=13191.msg137008#msg137008
But meter increases more than ISO…
M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

 

Related Topics