yet another intervalometer Q, wanted an image/second, lua user - Script Writing - CHDK Forum

yet another intervalometer Q, wanted an image/second, lua user

  • 6 Replies
  • 5989 Views
yet another intervalometer Q, wanted an image/second, lua user
« on: 23 / January / 2013, 03:23:49 »
Advertisements
Hi All,
  I'm putting together an underwater camera for observing fish behavior.  At the moment I am using an SX100is as the base camera (8mp is plenty for what we need).  I have several power sources for trials; a 2Ah USB based battery and a 12v 4.5Ah SLA, both are regulated down to the 3.15v that Canon seems to like.  So the script is dead easy right?  Just put in a start delay (for entry into water), take a temperature reading from the "optics" ( get_temperature(0) ), for a rough baseline environmental measure, then just run shoot() until the SDCARD fills!

  Well ... it turns out that works OK but I get an image every 3 to 5 seconds depending on SDCARD and so forth.  So with the 2Ah source I get just under 5 hours of "video" and 9.5 hours with the 4.5Ah SLA.  I'd really like +24 hours, it is mentioned on the wiki that the SLA should be good for ~3 days at an image every 5 seconds.  Yeah right!

  Now to speed up the "frame rate" and extend battery life.  I set_aflock(1) and that kind of helps, or it appears to anyway as far as timing of images.  Next step was to do a shoot(), then set_aflock(1), then repeat with click("shoot_full").  That worked real well, I now get an image every 2 seconds, I can live happily with that.  Even the image every 3 secs is useful to us.  It even seems to not draw as much from the power sources.

  But not all is candy-n-roses, the camera seems to stop working after 2 hours or so, the power sources still have heaps in them.  The camera even powers off in some cases.  I've logged the "optic" temperature at the end of one of these runs and it is at 33C.  I have a suspicion that camera maybe getting too hot.  Does running the camera this way really generate that much internal heat?

  Any advice or scripting ideas would be much appreciated.

- Dirk

*

Offline lapser

  • *****
  • 1093
Re: yet another intervalometer Q, wanted an image/second, lua user
« Reply #1 on: 23 / January / 2013, 15:21:35 »
The shoot() function sometimes hangs and doesn't return. We've worked out a fix for it, but it hasn't made it into the trunk yet. In the meantime, you can replace shoot() with this:
Code: (lua) [Select]
press("shoot_half")
repeat sleep(10) until get_shooting()
click("shoot_full")
repeat sleep(10) until not get_shooting()
I'm doing some changes to CHDK that allow precise shot intervals over 1 shot per second, with exposure compensation between shots, in continuous drive mode. One advantage is that it shows the pictures on the screen as they are taken. You may not need that, so you could keep the backlight off.

Is your plan to start the script, put the camera in the underwater box, then set it up and leave it underwater for a period of time and have it shoot pictures the whole time? Do you need to adjust the exposure or focus for each shot? If not, you can put the camera in continuous mode and have your script just hold shoot_full down:
Code: (lua) [Select]
sleep(s*60000) -- s is start delay in minutes
press("shoot_full") -- must be in continuous mode. First shot sets focus and exposure
repeat sleep(10000) until false -- I think sleep(-1) works instead of this line. Try it.
This will shoot at about 2 shots per second or more. My modifications have the option to set the interval slower than this, i.e. 1 second. For more info about my time lapse tests, see this thread (I know, the name is not quite right):

http://chdk.setepontos.com/index.php?topic=8997.0
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: yet another intervalometer Q, wanted an image/second, lua user
« Reply #2 on: 23 / January / 2013, 20:24:25 »
Well ... it turns out that works OK but I get an image every 3 to 5 seconds depending on SDCARD and so forth.  So with the 2Ah source I get just under 5 hours of "video" and 9.5 hours with the 4.5Ah SLA.  I'd really like +24 hours, it is mentioned on the wiki that the SLA should be good for ~3 days at an image every 5 seconds.  Yeah right!

Any advice or scripting ideas would be much appreciated.
You might want to look at this wiki page :

http://chdk.wikia.com/wiki/Battery_Intervalometer

and this forum thread :

http://chdk.setepontos.com/index.php?topic=9049
Ported :   A1200    SD940   G10    Powershot N    G16

Re: yet another intervalometer Q, wanted an image/second, lua user
« Reply #3 on: 23 / January / 2013, 21:50:39 »
Thanks so much lapser and waterwings!

  I have looked at lapser's posts and code and came to the same conclusion on continuous with a shoot_half and am testing that now.  waterwings, I am unsure if your miser code will give much more of a boost if I use the continuous mode as it seems to need the display.  I'll have to experiment with mixing in your code bits to see how much can be added in.

  On another note I've found out that my voltage regulator is not quite keeping pace with the extra current draw of the continuous and click("shoot_full") trials I've done.  This is the cause of much of my recent head scratching.  A set of fresh AAs go great but the regulated external power drops off and the camera shuts down.  I think I'll have to look into getting a better regulator.  Unfortunately it seems all the local electronics shops are out of prefabs and kits (odd I know!) so I'll have to order one in.  Now I just wait.

*

Offline lapser

  • *****
  • 1093
Re: yet another intervalometer Q, wanted an image/second, lua user
« Reply #4 on: 24 / January / 2013, 19:17:33 »
  On another note I've found out that my voltage regulator is not quite keeping pace with the extra current draw of the continuous and click("shoot_full") trials I've done.  This is the cause of much of my recent head scratching.  A set of fresh AAs go great but the regulated external power drops off and the camera shuts down.  I think I'll have to look into getting a better regulator.  Unfortunately it seems all the local electronics shops are out of prefabs and kits (odd I know!) so I'll have to order one in.  Now I just wait.
My sx260 uses a 4.7 volt battery, and the G1X uses 7.4 volts. I found a high capacity fairly small lithium ion battery that has a switchable 5 volt or 8.4 volt output, and charges with 12 volts. The 12 volt charging connection can also be used as an 11 volt output. The G1X works great with the 8.4 volt output, and the sx260 works with the 5 volts output. You can also charge the battery with 12 volts while running the camera from the 8.4 or 5 volt output. It makes a nice 12 volt to 8.4/5 volt DC to DC converter.

So if you bought a camera with a 4.7 volt battery like the sx260, you'd be in business with your 5 volt usb battery and others.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: yet another intervalometer Q, wanted an image/second, lua user
« Reply #5 on: 25 / January / 2013, 01:13:56 »
SX260??? 5v???  doh!!  now he tells me!  =;P

*sigh* OK version 2 will be based on an SX260 body.

*

Offline lapser

  • *****
  • 1093
Re: yet another intervalometer Q, wanted an image/second, lua user
« Reply #6 on: 25 / January / 2013, 19:43:23 »
*sigh* OK version 2 will be based on an SX260 body.
I'm not sure the sx260 would be best for your application, but any camera that can run on 5 volts (or 8.4) is easier to power externally.

There's a water "proof" Canon D10 that's CHDK compatible. But it's been replaced by the D20, which hasn't been ported yet. For the best pictures, the G1X can't be beat. With the 8.4 volt external lithium battery, it should run for many hours. I'll let you know how many hours when I know. I've done 2 hours so far, and the battery still showed "full". The external connector cable on the G1X comes out the side too, and doesn't interfere with a tripod mount. The SX260 connector is on the bottom, and less secure.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

 

Related Topics


SimplePortal © 2008-2014, SimplePortal