Tool for calculating precise Av96 and TV96 values - Script Writing - CHDK Forum supplierdeeply

Tool for calculating precise Av96 and TV96 values

  • 12 Replies
  • 9825 Views
Tool for calculating precise Av96 and TV96 values
« on: 26 / June / 2012, 17:52:39 »
Advertisements
CHDK allows script programmers to specify aperture and shutter speed to an incredible degree of precision: 1/96 of an f/-stop, and 1/96 of a doubling or halving of the shutter speed.  For every click of the shutter speed dial on my old Nikon 35mm SLR, my little Canon S3 has 3 steps, which is impressive enough, but within a script, CHDK crams 96 steps in there!

I haven't found much of a use for that precision yet, but that doesn't mean there isn't one, and a CHDK hacker is the person most likely to find it.  So I wrote a spreadsheet to calculate precise values to write into set_av96 or set_tv96 commands.

Most of the spreadsheet is a pair of tables of all the standard 1/3-step values used by Canon.  (I think they're standard to the entire digicam industry.)  Down at the lower-left, at A40 and A46 are two yellow cells for entering any aperture value or shutter speed you want, and the cells to the right will produce the exact Av96 or Tv96 values to be written into your script.  The conversion uses logarithms to base 2, and agrees with the tables found in CHDK docs.  These just give you many more steps.  The answers produced will usually have one or two decimal places.  All CHDK values must be whole numbers; I just provided the decimal places to indicate how close your answer is to the exact value.

I created the spreadsheet in LibreOffice and saved it in both .ods and .xls (MS Excel) formats.  They are identical, except for the program required to open them.  As stored, the entire sheet is protected, except for the two yellow cells for inputting values.  To overcome that, use File/Save as... to save the sheet under a different filename.

I uploaded the sheet to both Google Docs and to EditGrid for online use without a dedicated spreadsheet program, but couldn't find a way to protect the sheet from unwanted changes by anyone using it.  I'll let you know when I get past that hurdle.

Remember that our cameras are mechanical devices, and that precision to 1/96 step is probably a fantasy in real life.  But if you have a use for it, give it a shot.
Eric
S3 IS with LensMate filter/hood adapter

*

Offline gjb

  • *
  • 24
    • Motoscape Rally 2012 - Team Grayson
Re: Tool for calculating precise Av96 and TV96 values
« Reply #1 on: 11 / July / 2012, 11:49:18 »
Thanks for sharing, this is incredibly useful.

Could you add Sv96 for ISO?

Re: Tool for calculating precise Av96 and TV96 values
« Reply #2 on: 11 / July / 2012, 13:32:08 »
Sure, give me a little time to get around to it.

Here are a couple of important changes to what I wrote above:

set_av96 and set_tv96 are interpreted by the Canon firmware and rounded to the nearest 1/3 stop, so they don't really give any more precision than you can enter in the Canon controls.  A new pair of commands, set_av96_direct and set_tv96_direct bypass Canon's interference and drive the controls directly.  Those are the commands that will actually take advantage of the results from the spreadsheets.  I'd never heard of this before a few days ago; they might be brand-new.

Since these bypass Canon's interpretation, they also bypass the safety limits.  If your aperture range is from f/3.5 to f/8, and you use one of these commands to try to drive it to f/2 or f/13.658, you're staging a fight between the aperture motor and the limit stops.  I hope the motor would just strain a little without any damage, but it might break either the motor or the stop, or both.  Put some error-checking into your script to disallow apertures beyond the Canon range, unless you are willing to risk your camera in the name of experimentation.  (and, hey, let us know what happened!)

There shouldn't be any danger to trying shutter times outside the range Canon uses, other than draining the battery, trying to hold the shutter open for a day and a half.

I've been meaning to experiment with low-ISO settings, myself, to blur stream motion when the day is too bright for long exposures.  I intend to use the overrides menu to set my S3 at ISO 20 or so - I just haven't got around to it.  As for the odd settings Av and Tv, I still don't have any particular use, other than maybe setting a copy of "Fahrenheit 451" on fire and shooting pics at f/4.51 and 1/451 second.  Even then, the EXIF data would show the Canon settings, not my overrides, I think, so it would be a very private joke.  But just because I don't have the imagination to put this to use doesn't mean it isn't useful for somebody.

Good luck, and thanks for the feedback!
S3 IS with LensMate filter/hood adapter

*

Offline gjb

  • *
  • 24
    • Motoscape Rally 2012 - Team Grayson
Re: Tool for calculating precise Av96 and TV96 values
« Reply #3 on: 11 / July / 2012, 14:01:41 »
I've been meaning to experiment with low-ISO settings, myself, to blur stream motion when the day is too bright for long exposures.

I have experimented with pushing the standard ISO limits, so just wanted to share my findings.

The "official" lowest ISO of my camera model is ISO 80. However, I found that I was able to achieve a lower value (either using overrides or through a script) of ISO 50. Continuing to reduce this further resulted in over-exposure due to the camera exposing for an unachievable ISO value.

I found the same with the upper limit: I was able to push the "official" ISO of 1600 by a bit (I don't recall the actual figure), but continuing to push it further resulted in under-exposure for the same reason as described above.

In summary, you can push and pull the "official" ISO values a bit without affecting the overall exposure, but keep an eye on the histogram.

Also note that lower isn't always better. ISO 50 might have lower noise than ISO 80, but it may have a reduced dynamic range. For this reason, I prefer to stick to Canon's "official" range. YMMV.


*

Offline reyalp

  • ******
  • 14117
Re: Tool for calculating precise Av96 and TV96 values
« Reply #4 on: 11 / July / 2012, 16:11:09 »
The "official" lowest ISO of my camera model is ISO 80. However, I found that I was able to achieve a lower value (either using overrides or through a script) of ISO 50. Continuing to reduce this further resulted in over-exposure due to the camera exposing for an unachievable ISO value.
I suspect you are getting tricked by Canons by "Market" and "Real" ISO. 50 "real" is roughly 80 "market".  http://chdk.wikia.com/wiki/CHDK_User_Manual#Override_ISO_value

At the high end, things are further confused because the the upper ISO levels are frequently done by software in the jpeg process (e.g. on a camera that goes to iso 800 in the canon settings, raws shot at 400 and 800 are identical)

If you want to perform a definitive test you should
1) Record the "real" ISO for all shots, with and without override
2) Compare histograms of raw files, not jpeg.

To my knowledge, no one who has done this has found a CHDK camera that goes noticeably beyond the Canon limits. That doesn't mean there aren't any, relatively few people go to the trouble to do this kind of testing.
Don't forget what the H stands for.

Re: Tool for calculating precise Av96 and TV96 values
« Reply #5 on: 11 / July / 2012, 19:50:41 »
So I don't have extreme ISO settings available, after all.  Oh, well.  I can still use my polarizer as a neutral density filter.

I'd been bragging to friends about having an inexpensive camera that achieves 1/100,000-second shutter speeds, until I laid the camera on my kitchen counter, facing up at a flood light and shot a series with ever-higher shutter speeds.  I couldn't see any change beyond 1/40,000.  Still a big step beyond the Canon settings, though.

I'm sure glad I no longer pay for film and processing for all this experimentation.
S3 IS with LensMate filter/hood adapter

Re: Tool for calculating precise Av96 and TV96 values
« Reply #6 on: 15 / July / 2012, 14:30:35 »
set_sv96_direct added:  Here is the revised spreadsheet (in two formats, again).  Changes include the name of the function required: set_av96_direct, set_tv96_direct, and set_sv96_direct.  Leaving out the "_direct" tells the camera to round to the nearest standard value, negating the whole point of setting these precise values.

set_sv96_direct allows you to change the ISO setting to values other than the standard ones.  As Reyalp points out above, you will most likely not be able to exceed your camera's native ISO range, but this should allow you to set in-between values to your heart's content.

Testing has been extremely limited: I used a script in my S3 IS to learn the Sv96 values used in each of the ISO settings.  I learned that there is a "fudge factor" involved: a number that must be subtracted from each answer to make the formula fit the results.  In my S3, that number is 227.  I would be surprised if that is the same for all Canons.  The complete script for reading the Sv96 value for each Canon ISO setting is given in a box in the spreadsheet.  It's very short; copy it into your own SCRIPTS directory and run it for each ISO setting and see if you get the same values as shown in the table in this sheet.

USING THE SPREADSHEET: After downloading and opening the spreadsheet, protect it.  (Tools/Protect Document/Sheet... in the menus in LibreOffice or OpenOffice.  Don't give it a password; this is a convenience thing, not for security.)  Then the only values you'll be able to change will be the yellow cells used as input for the conversion formulas.  Everything else is just tables for reference and shouldn't be changed, except to modify it for your model.  Answers for the set_sv96_direct conversion should always be rounded up to the nearest whole number.  You'll see that the results will match the tables values for ISO ratings from 100 to 800.  ISO 80 is apparently actually ISO 74 or maybe 74.5 in my S3.

If your camera gives different sv96 values than the table you can probably fix the conversion box by changing only the last number in the formula at location K27 (the -227 in my version).
S3 IS with LensMate filter/hood adapter

*

Offline gjb

  • *
  • 24
    • Motoscape Rally 2012 - Team Grayson
Re: Tool for calculating precise Av96 and TV96 values
« Reply #7 on: 16 / July / 2012, 08:45:26 »
set_sv96_direct added

Note that there isn't a function called set_sv96_direct -- I have just tried this, but it results in a parse error.

There is set_av96_direct and set_tv96_direct, but the only method for setting Sv is set_sv96.

Nice work with the spreadsheet.


*

Offline gjb

  • *
  • 24
    • Motoscape Rally 2012 - Team Grayson
Re: Tool for calculating precise Av96 and TV96 values
« Reply #8 on: 16 / July / 2012, 09:15:19 »
It's very short; copy it into your own SCRIPTS directory and run it for each ISO setting and see if you get the same values as shown in the table in this sheet.
I have created a new script to automate looping through all of the ISO levels and reporting the Sv96 value for each:
http://chdk.setepontos.com/index.php?topic=8316

*

Offline gjb

  • *
  • 24
    • Motoscape Rally 2012 - Team Grayson
Re: Tool for calculating precise Av96 and TV96 values
« Reply #9 on: 16 / July / 2012, 09:16:55 »
In my S3, that number is 227.  I would be surprised if that is the same for all Canons.

Incidentally, I found the Sv96 values for my Powershot SD800 IS to the same as your S3.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal