CHDK Scripting Question - Specific to the ELPH 115 IS - General Help and Assistance on using CHDK stable releases - CHDK Forum

CHDK Scripting Question - Specific to the ELPH 115 IS

  • 3 Replies
  • 4303 Views
CHDK Scripting Question - Specific to the ELPH 115 IS
« on: 21 / May / 2015, 20:15:06 »
Advertisements
I have an ELPH 115 IS running with CHDK and the VP CRemote-2 via an RC radio on my multi-rotor.  I'm a home inspector in Arizona and looking to do roof inspections via my multi-copter.  I am able to pitch the camera via a 2-axis gimbal, which is working well.  I'm using 2 channels on my radio to control the zoom and shutter release via CHDK/VP CRemote 2.  I took a script from VP and made some modifications to do the zoom and shuttle release and everything is working.

My questions:
- Is there some kind of list relative to what each of the various basic commands actually do, relative to the ELPH 115, in other words, what limitations if any, are there to each of the specific basic commands?
- I'm specifically interested in the zoom command.  I can get the RC channel to initiate zoom in and zoom out, but there seems to be lots of delays?  There is a zoom step command but it does not seem to effect the speed of the zoom or the actual steps for that matter.  I'm trying to get the camera to react quicker to the request to zoom in and zoom out!
- Also I would like to do a half shutter (to focus) and then a release from a single switch on the RC?

What am I missing?

Re: CHDK Scripting Question - NOT Specific to the ELPH 115 IS !
« Reply #1 on: 21 / May / 2015, 20:25:15 »
I took a script from VP and made some modifications to do the zoom and shuttle release and everything is working.
As I mentioned when you PM'd me - a copy of your modified script would help here.

Quote
Is there some kind of list relative to what each of the various basic commands actually do, relative to the ELPH 115, in other words, what limitations if any, are there to each of the specific basic commands?
This is about as good as it gets :  CHDK Scripting Cross Reference Page

Quote
I'm specifically interested in the zoom command.  I can get the RC channel to initiate zoom in and zoom out, but there seems to be lots of delays? 
On some cameras,  getting reliable zoom without crashing is problematic.  It's just a limitation of the port.  So extra delays are sometime enforced to get around this.   Again,  without seeing your script I can't comment further.

Quote
There is a zoom step command but it does not seem to effect the speed of the zoom or the actual steps for that matter. 
As mentioned in the documentation,  zoom speed only worked on a few older cameras.

Quote
Also I would like to do a half shutter (to focus) and then a release from a single switch on the RC?
Have you by chance looked at this :  KAP UAV Exposure Control Script
Ported :   A1200    SD940   G10    Powershot N    G16

Re: CHDK Scripting Question - Specific to the ELPH 115 IS
« Reply #2 on: 21 / May / 2015, 21:23:13 »
Here is my modified script:

@title CR-CHDK
rem by Rich Schaefer
rem 05-11-2015

m=0
z=2
f=0
rem set_zoom_speed 10
rem set_zoom 1

rem goto "cr_fast"

rem CAMremote-1/2 (4-pin USB connector). Control Method: USB/CHDK
:cr_normal
print "CR: USB/CHDK"
while 1
 do
  c = get_usb_power
 until c>0
 print c
 if c>67 then gosub "pwroff"
 if c>21 then gosub "zout"
 if c>13 then gosub "zin"
 if c>8 then gosub "focusoff"
 if c>5 then gosub "focus"
 if c>0 then gosub "shoot"
wend
end

:shoot
 print c;":shoot"
 c=0
 press "shoot_full"
 sleep 1500
 release "shoot_full"
 release "shoot_half"
 return

:focus
 print c;":focus"
 c=0
 press "shoot_half"
 f=1
 sleep 500
 return

:focusoff
 print c;":release"
 c=0
 release "shoot_half"
 sleep 500
 return

:zin
 if f=1 then release "shoot_half"
 if z<9 then z=z+1
 print c;":zoomin"
 c=0
 click "zoom_in"
rem set_zoom_to_step z
rem set_zoom_rel +1
 sleep 500
 return

:zout
 if f=1 then release "shoot_half"
 if z<>0 then z=z-1
 print c;":zoomout"
 c=0
 click "zoom_out"
rem set_zoom_to_step z
rem set_zoom z
 sleep 500
 return

:lensoff
 print c;":lensoff not supported"
 goto "pwroff"

:pwroff
 print c;":poweroff"
 c=0
 sleep 500
 shut_down
 sleep 500
 return

Re: CHDK Scripting Question - Specific to the ELPH 115 IS
« Reply #3 on: 21 / May / 2015, 21:48:44 »
Code: [Select]
:zin
 if f=1 then release "shoot_half"
 if z<9 then z=z+1
 print c;":zoomin"
 c=0
 click "zoom_in"
rem set_zoom_to_step z
rem set_zoom_rel +1
 sleep 500
 return

:zout
 if f=1 then release "shoot_half"
 if z<>0 then z=z-1
 print c;":zoomout"
 c=0
 click "zoom_out"
rem set_zoom_to_step z
rem set_zoom z
 sleep 500
 return
The ixus132_elph115's zoom controller has 101 discrete zoom steps.    If the zoom only moves one step per call to the zin: and zout:  functions then it could indeed take a long time to step through the entire zoom range!

Using the get_zoom ,  set_zoom  . and get_zoom_steps  functions you could pretty quickly change the above code to move in increments of (for example) 10% of zoom range per pulse from the CAMremote-1/2.     Simply read the current zoom position with the get_zoom function,   and if the value is greater than zero or less that the value returned from get_zoom_steps then calculate your new desired zoom position and  use the set_zoom function to move the lens there.

I don't have a uBASIC example of this to share but I've posted some Lua code below. If you are stuck getting this done I can probably help.

Code: [Select]
function update_zoom(zpos)
    zstep=((get_zoom_steps()-1)*zpos)/100
    printf("setting zoom to "..zpos.." percent step="..zstep)
    sleep(200)
    set_zoom(zstep)
    sleep(2000)
end

Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics


SimplePortal © 2008-2014, SimplePortal