Reliably turning off the LCD (for long intervalometer script)? - page 2 - Script Writing - CHDK Forum

Reliably turning off the LCD (for long intervalometer script)?

  • 21 Replies
  • 17318 Views
*

Offline SkyWalker9

  • ****
  • 301
  • SX20 IS (fw 1.02b)
Re: Reliably turning off the LCD (for long intervalometer script)?
« Reply #10 on: 23 / April / 2011, 12:36:35 »
Advertisements
But it is possible to shut down the LCD and it does save some power. You can either plug something in the AV connector or you can use a CHDK script command set_backlight 0 to disable LCD backlight (responsible of most of the LCD's power drain) after starting video record.

See e.g. http://chdk.setepontos.com/index.php?topic=3872.0 for some measurement results.
Well, I didn't find any ready script, maybe some tutorial how to write them? I tried to analyze some example scripts from CHDK package, but I'm afraid I'm really not sure all the syntax of this scripting language
Here are a couple of postings that may be of interest regarding the "scripting" of the LCD...
http://chdk.setepontos.com/index.php?topic=1768.msg17679#msg17679
http://chdk.setepontos.com/index.php?topic=2622.msg24336#msg24336

Quote
...maybe some tutorial how to write them...
Refer to the CHDK home page for links to the UBasic & LUA User's Guides. The guide has many examples included and there are many working scripts for other tasks that people have submitted that should also demonstrate the in's & out's of coding the scripts. If you get stuck, just review the previous postings or post a question/topic in this forum and most anyone will offer a tip, remedy, etc.

Re: Reliably turning off the LCD (for long intervalometer script)?
« Reply #11 on: 20 / May / 2013, 20:36:34 »
I am having problems making my D10 stay asleep. I put it into a sleep loop using the print shortcut discussed in several places, and it works fine when called via script, unless it moves. If I pick the camera up, and shake it, then it wakes up.

This is a problem, because I want it to sleep for a specified time before taking pictures while mounted to the outside of an airplane. Ideally the viewfinder will stay off because otherwise the battery will be significantly depleted before I even get to my destination.
A720 1.00c | D10 1.00b |SX220 1.01a | SX230 ? | SX30 1.00p CHDK ver. 1.1.0-r1727

*

Offline reyalp

  • ******
  • 14118
Re: Reliably turning off the LCD (for long intervalometer script)?
« Reply #12 on: 20 / May / 2013, 22:31:32 »
I am having problems making my D10 stay asleep. I put it into a sleep loop using the print shortcut discussed in several places, and it works fine when called via script, unless it moves. If I pick the camera up, and shake it, then it wakes up.
I can confirm this on my D10. It appears related to the orientation sensor. This seems quite strange, and I don't see it documented in the Canon manual. Perhaps it's a bug. I'd be interested to know of other models have the same issue.

You might be able to mitigate this some by just setting the screen off time to 10 seconds. There might also be some way to detect if the camera is in sleep mode and press the print button again if it's not.
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14118
Re: Reliably turning off the LCD (for long intervalometer script)?
« Reply #13 on: 20 / May / 2013, 23:31:30 »
There is probably a way to actually detect if the camera is in screen-off mode, but in the meantime the following seems to work fairly well

Code: [Select]
props=require'propcase'

function disp_off()
click('print')
angle=get_prop(props.ORIENTATION_SENSOR)
end

disp_off()

repeat
if angle ~= get_prop(props.ORIENTATION_SENSOR) then
print'angle changed'
disp_off()
end
wait_click(100)
until is_key'set'
Don't forget what the H stands for.


Re: Reliably turning off the LCD (for long intervalometer script)?
« Reply #14 on: 21 / May / 2013, 01:46:17 »
Thanks reyalp,

I put that in my wait loop and pretended I was an airplane shaking my camera all around, and I am happy to report that the screen spends most of its time off. Sometimes it stays on for a fair bit when I am shaking the camera but leaving it oriented the same way. Also I am wondering what the electrical cost of switching the screen on is as opposed to leaving it on. But I'll find out tomorrow.

Hopefully the script won't hiccup responding to all of that jostling for the 45 minutes it takes to get through the mountains before it triggers the intervalometer. I am taking pictures every 3 seconds, and looks like I have about 2.75 hours or so after it starts.

Here's the code I used:
Code: [Select]
-- enter powersaving sleep for delay mode
--disp_off function by reyalp
function disp_off()
    click('print')
    angle=get_prop(props.ORIENTATION_SENSOR)
end

function wait_start (wait_time)
   print("sleep for " .. wait_time .." min")
   sleep(1000)
   disp_off()
   local finishtime = get_tick_count() + (wait_time * 60000)
   repeat
    if angle ~= get_prop(props.ORIENTATION_SENSOR) then
        print("angle changed")
        disp_off()
    end
    wait_click(100)
looptime = get_tick_count()
   until finishtime < looptime
   print("awake!")
   sleep(1000)
   
end

ok, I have to add, I experimented with the wait_click() timing and taking out the print("angle changed") line, and the script is a little crazy. Sometimes the screen comes on for the full 10sec before timeout without printing anything, and sometimes it shuts down again so fast I can't read the "angle changed" text. But so far no crashing. It's a go for tomorrow. Thanks again.

Andy
« Last Edit: 21 / May / 2013, 02:13:37 by andyroo »
A720 1.00c | D10 1.00b |SX220 1.01a | SX230 ? | SX30 1.00p CHDK ver. 1.1.0-r1727

*

Offline reyalp

  • ******
  • 14118
Re: Reliably turning off the LCD (for long intervalometer script)?
« Reply #15 on: 21 / May / 2013, 02:14:07 »
Sometimes it stays on for a fair bit when I am shaking the camera but leaving it oriented the same way.
On mine it seemed to be definitely tied to orientation, but maybe I'm not using the right shaking technique  :P

Keep in mind that if the camera gets cold, battery life is likely to be reduced a lot.

edit:
You don't have to use wait_click, you could just use sleep(10) in the wait loop if you want to check more often.
« Last Edit: 21 / May / 2013, 02:16:41 by reyalp »
Don't forget what the H stands for.

Re: Reliably turning off the LCD (for long intervalometer script)?
« Reply #16 on: 21 / May / 2013, 02:17:48 »
interesting. I wonder if it would be better to just start taking pictures right away... I've been able to do about 2.5 hours just continuous shooting (5 sec intervals). The mount cradles the camera in foam, and it's tucked up in the wing, so that's probably in my favor.

My "plane simulation" consisted of shaking the camera horizontally or vertically while keeping it in a plane oriented toward the ground. The script definitely behaves differently (with more "angle changed" action and more aggressive shutoff) when I go from perpendicular to the ground to parallel, but it doesn't work as effectively when I simulate turbulence or vibration while keeping the look angle roughly the same.

If I can figure out a display property variable, then I guess I'll be set.

Thanks again.
« Last Edit: 21 / May / 2013, 02:23:45 by andyroo »
A720 1.00c | D10 1.00b |SX220 1.01a | SX230 ? | SX30 1.00p CHDK ver. 1.1.0-r1727

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Reliably turning off the LCD (for long intervalometer script)?
« Reply #17 on: 21 / May / 2013, 05:32:55 »
I am having problems making my D10 stay asleep. I put it into a sleep loop using the print shortcut discussed in several places, and it works fine when called via script, unless it moves. If I pick the camera up, and shake it, then it wakes up.
I can confirm this on my D10. It appears related to the orientation sensor. This seems quite strange, and I don't see it documented in the Canon manual. Perhaps it's a bug. I'd be interested to know of other models have the same issue.


G12, G1X, SX30 & SX40 all do the same thing.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)


Re: Reliably turning off the LCD (for long intervalometer script)?
« Reply #18 on: 21 / May / 2013, 09:03:55 »
This is a problem, because I want it to sleep for a specified time before taking pictures while mounted to the outside of an airplane. Ideally the viewfinder will stay off because otherwise the battery will be significantly depleted before I even get to my destination.
I don't know if you've looked a this :  http://chdk.setepontos.com/index.php?topic=9049  but you can save almost as much power by leaving the camera in Playback mode with the backlight off at startup and only switching to shooting mode when you are actually at the right point in your flight.

Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline ahull

  • *****
  • 634
Re: Reliably turning off the LCD (for long intervalometer script)?
« Reply #19 on: 21 / May / 2013, 11:37:30 »
What is on the display may also affect the power consumption... if all of the "transistor elements" are on, then power will be much higher than when they are off (or vice versa depending on the screen type).

Typically for an LCD this means (slightly counter intuitively) that an all white display may consume less power than an all black screen... I had a quick look for some figures to support this idea, to see if the difference might be significant. Here is an example..

"We also measured how the content displayed on the
LCD affected its power consumption: 33.1 mW for a
completely white screen, and 74.2 mW for a a black
screen. Display content can therefore affect overall
power consumption by up to 43 mW"

Given the size of the screens we are dealing with, It may not be much of a difference, but it may make *the* difference when running on batteries. 

It might therefore be worth switching off the backlight, and filling the screen with color(255,255,255) or color(0,0,0) and seeing if this has much effect.
« Last Edit: 21 / May / 2013, 11:42:28 by ahull »

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal