Yet Another Sunset Script (yass) v4.5 - LUA Scripting - CHDK Forum

Yet Another Sunset Script (yass) v4.5

  • 166 Replies
  • 87285 Views
Yet Another Sunset Script (yass) v4.5
« on: 04 / August / 2013, 18:38:14 »
Advertisements
YASS4.LUA
I've recently posted mods to soulf2's  excellent yass2 script, including converting to Lua and adding some user requested features.  However, in using that script, I found myself wanting it to do more. As a result, it has kind of grown into what I now call yass4.  Recent testing of boring sunsets where the brightness varied widely and quickly have give very satisfactory results with the modified script.

download link > https://app.box.com/s/mbvcb5pedlyg36bnyajs

Principal Changes :
  • The script handles the camera's built-in Neutral Density filter corr
  • You can now enter shutter speeds in units of seconds and ISO in normal units as well - no more APEX96 values.
  • Exposure ramp control now works when the ISO setting is being adjusted as well as when the shutter speed is being adjusted. Previously the exposure would jump suddenly once the script switched into ISO adjustment mode.
  • The parameters have been renamed to something that I hope makes more sense and a more clear explanation of what they do has been provided below.
  • Manual focus lock with focus at infinity and zoom position setting have been added.
  • Logging to a spreadsheet compatible CSV file has been added.
  • Various display blanking modes have been added to save power / remove some distractions.
  • The script will blink a user defined camera LED so that you know its still running while the display is off
  • The user can specify the f-stop to use (for cameras with variable iris capability) - effective v4.1

Operation
There are basically three modes of operation for this script. The mode is determined by the required shutter speed for each exposure.  Before each shot, the script checks the exposure and compares the required shutter speed to the Tv normal limit and the Tv low limit.

If the shutter speed needed is above the Tv normal limit,  a regular exposure is taken.  However, the shutter speed needed is averaged with the previous value used to avoid sudden exposure jumps.

If the shutter speed needed is below the Tv normal limit but above the Tv low limit, then the shutter speed is gradually changed after each shot by the amount specified as the Exposure ramp rate

If the shutter speed needed is below the Tv low limit,  then the shutter speed is locked at the Tv low limit and the ISO setting is allowed to increase at a rate determined by the Exposure ramp rate.  The ISO setting will not be adjusted above the ISO upper limit value.


Parameter Settings
Shot Rate (sec)
  • determines how quickly pictures are taken
  • probably won't go faster than on picture every two seconds
Compensation (f-stops)
  • a fixed offset added to the exposure calculate
  • has the same effect as the +/= compensation in the Canon menu (which won't work when this script is running)
Tv normal limit (sec)
  • changes when using shutter speeds above this value are lightly filtered
  • changes when using shutter speeds below this value move at the Exposure ramp rate
Tv low limit (sec)
  • minimum shutter speed that the script will use - ISO value will begin increasing if more exposure is needed
ISO default
  • default ISO setting - used when shutter speed is above the Tv low limit
ISO upper limit
  • the highest ISO value that the script will use when the shutter speed is at the Tv low limit
Exposure ramp rate
  • rate at which shutter speed and ISO are adjusted when shutter speed is below the Tv normal limit
Aperture Setting
  • sets the desired aperature - use the default (min_Av) for cameras with no adjustable iris or to get the most light in your pictures
First Shot Delay (min)
  • an initial delay before the script start taking images
Zoom step position
  • allows you to present the zoom lens position to a specific step position
  • the number of steps available is camera dependent
  • set to -1 to turn this feature off
Use ND Filter?
  • allow the script to use the ND filter (if present) when the shutter speed would exceed 1/1000 sec
Focus @ Infinity Mode
  • sets the method that the script will use to put the camera in MF mode and set the focus at infinity
  • manual focus is problematic with some CHDK cameras - disable this feature if it gives you trouble or see the Limitation comment at the end of this post
RAW enable?
  • enable RAW when the script starts
  • will reset to the previous setting when the script stops
Free Disk MB Shut down
  • stop the script when the SD card has only the specified space remaining
Status LED
  • selects one of the camera LED to blink slowly,  letting you know that the script is still running when the display is blanked
Display blanking mode
  • turns off the display to save power & remove distractions
  • BKLite disables the backlight only - available on all cameras - backlight flashes briefly after each shot
  • DispKey uses the camera's DISPLAY key to put the turn off the display - typically only works on cameras with optical view finders
  • ShrtCut presses the "short cut" key to enter sleep mode - not all cameras support a shortcut key
Logging
  • logs to a file in CSV value format (yass4.csv) giving settings of each shot
  • useful for later analysis via a spreadsheet

Limitations
Unfortunately, manual focus lock and focusing at infinity are difficult to do in a generic way that works with every camera.  If it doesn't work for you then I'd suggest either editing the lock_focus() function or maybe just not enabling the parameter and locking focus manually prior to starting the script. 
More information available here : CHDK Wiki page for manual focus

Recent Updates
2014/05/16 : updated to version 4.3 - changes include integration of the 1.3.0 MF updates for focus at infinity (if camera is running 1.3.0),  logging updates,  and a fix for ISO value "jumping" if scene illumination changes too quickly.
2014/06/16 : updated to version 4.5 - more set focus at infinity tune ups
« Last Edit: 14 / June / 2014, 15:04:38 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Yet Another Sunset Script (yass) v4
« Reply #1 on: 06 / August / 2013, 20:20:00 »
Hi waterwingz. Thanks for sharing that yass improvement. I've noticed there's a small type at line 155 between "1600" and "3200"; should be a , instead of a .

local sv_str = {"n/a","80","100","125","160","200","250","320","400","500","640","800","1250","1600"."3200"}

Cheers!

Re: Yet Another Sunset Script (yass) v4
« Reply #2 on: 06 / August / 2013, 20:32:30 »
Hi waterwingz. Thanks for sharing that yass improvement. I've noticed there's a small type at line 155 between "1600" and "3200"; should be a , instead of a .

local sv_str = {"n/a","80","100","125","160","200","250","320","400","500","640","800","1250","1600"."3200"}

Cheers!
Thanks - I left the 3200 out of the original attachment and spotted it while working on another script when I borrowed some of the code from YASS4.    Guess I should have tested the fix before uploading.

Fixed now.

Ported :   A1200    SD940   G10    Powershot N    G16

Re: Yet Another Sunset Script (yass) v4
« Reply #3 on: 15 / August / 2013, 17:08:28 »
I have tried to use this on my powershot sx200is but nothing seems to happen

is there any debugging output I could look at

thanks

Tkgafs

Re: Yet Another Sunset Script (yass) v4
« Reply #4 on: 15 / August / 2013, 17:41:21 »
I have tried to use this on my powershot sx200is but nothing seems to happen
What does "nothing seems to happen" mean?  Does the script start?  Do you get text console messages in the display area of the screen?    Are you able to make other scripts work on your camera ?

Quote
is there any debugging output I could look at
The program spits out lots of messages to the CHDK console area of the screen.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Yet Another Sunset Script (yass) v4
« Reply #5 on: 16 / August / 2013, 16:50:37 »
Wow, I didn't expect a major rewrite of the script.
If it works correctly, then it leaves little more to wish for.

I will try to do some field tests in the next days, using G11 and G12.

Thanks for doing the hard work!!! :D

Re: Yet Another Sunset Script (yass) v4
« Reply #6 on: 18 / August / 2013, 06:59:34 »
On G11 and G12 the script seems to ignore the aperture set before starting (for example: in a dark room it uses f2.8 instead of set f8.0). Is there any way to force script, so that it leaves set aperture as it is?
« Last Edit: 18 / August / 2013, 07:24:57 by poweredjj »

Re: Yet Another Sunset Script (yass) v4
« Reply #7 on: 18 / August / 2013, 09:36:39 »
On G11 and G12 the script seems to ignore the aperture set before starting (for example: in a dark room it uses f2.8 instead of set f8.0). Is there any way to force script, so that it leaves set aperture as it is?
The script currently picks the largest aperature (lowest f-number) supported by the camera on the assumption that's what will be needed as the sky darkens.

But what do you mean by the "aperature set before starting" ?    M or Av mode on your advanced Powershots ? (many Canon P&S cameras do not have this feature)   Or were you using CHDK overrides?   Or were you thinking CHDK should be able to figure out the exposure used on the last shot prior to the script executing ?

Another choice would be an additional script parameter for f-stop.   The default option would be min_Av - the way it works now.  The other options would be a range of fixed stops. You'd have to tweak the script if you wanted those stops to exactly match what's available on a particular camera.  (Unless we want to go back to APEX96 values).  On cameras without variable apertures,  picking anything other than min_Av will not change the aperature but would throw off the exposure.  The script would have no way of knowing whether an aperture setting request was valid or not.  (tech note : someday we will have script access to the tables in shooting.c for each camera - I hope)
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Yet Another Sunset Script (yass) v4
« Reply #8 on: 18 / August / 2013, 10:55:11 »
On G11 and G12 the script seems to ignore the aperture set before starting (for example: in a dark room it uses f2.8 instead of set f8.0). Is there any way to force script, so that it leaves set aperture as it is?
Mods added to script and the initial posted in this thread edited to reflect the changes.  Script at download link now at v4.1

@poweredjj :
Quote
When I lock focus on G11 (with normal camera mf function), the script displays a message "focus locked past hyperfocal", and crashes.
I noticed you edited your earlier post to remove this comment.  Did you get it figured out and if so,  what was the problem?
« Last Edit: 18 / August / 2013, 11:44:42 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Yet Another Sunset Script (yass) v4.1
« Reply #9 on: 18 / August / 2013, 13:09:57 »
It has crashed once, saying something about division by null.
Other times it reported "focus locked past hyperfocal", but worked ok.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal