KAP & UAV Exposure Control Intervalometer Script - page 48 - Completed and Working Scripts - CHDK Forum

KAP & UAV Exposure Control Intervalometer Script

  • 1068 Replies
  • 411113 Views
Re: s110 shot interval under 1.5s
« Reply #470 on: 19 / June / 2015, 08:56:49 »
Advertisements
Thanks waterwingz!
I will get back to you shortly, once I have merged this with a little PWM control and have the results.  I need 1.4s interval. Pictures will be merged. If I keep the shot button pushed the interval is 1.2s. that is about 5meter difference in the air. I just have to get the script right now.
Do you want to try this yourself or would you be willing to test a beta version of the kap_uav.lua script that does this? 

I assume you are okay (or even prefer) the exposure to stay "locked" once you start continuous shooting?
Ported :   A1200    SD940   G10    Powershot N    G16

Re: s110 shot interval under 1.5s
« Reply #471 on: 19 / June / 2015, 10:08:21 »
Man you read mind or what?
I also started putting the 2 scripts together, but probably you have more insight than I do so if you have a beta I will
test it tomorrow morning.
A terrain follow mission at 80m above tree level in the hills at 20m/s speed.
will that work?

S110, SX200is,

Re: s110 shot interval under 1.5s
« Reply #472 on: 19 / June / 2015, 12:02:11 »
A terrain follow mission at 80m above tree level in the hills at 20m/s speed.
will that work?
I'll get you something tonight ( 10 hrs from now plus/minus ).  I assume at this point that your flight controller will send +5V to the camera USB port when it wants continuous shooting?   We could use a PWM encode message (which the pixhawk type controllers will support) but that will take a little more testing.

WWZ

@reyalp :  if you have a moment today,  would you please move this thread to the  kap_uav.lua thread ?  TIA
« Last Edit: 19 / June / 2015, 12:09:13 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: s110 shot interval under 1.5s
« Reply #473 on: 19 / June / 2015, 12:23:37 »
I have the gentlewire as I was using APM previously.
I will also need to stop the shooting and shut down the camera before landing so I would like to keep using the the gentlewire.

I am really looking forward to test the script!
Many thanks in advance!

S110, SX200is,


Re: s110 shot interval under 1.5s
« Reply #474 on: 19 / June / 2015, 13:48:39 »
I have the gentlewire as I was using APM previously. I will also need to stop the shooting and shut down the camera before landing so I would like to keep using the the gentlewire.
Using just the USB signal,  I have it setup to shoot when USB is asserted (powered on) and switch to playback mode (i.e. lens retracted) when USB is off.  This allows you to enable shooting on a pass by pass basis and still have the lens safely retracted on landing.   With the Gentwire cables we have more options - start continuous shooting, pause continuous shooting, goto playback mode and complete shutdown being the most obvious one.

Edit :  beta version of script 3.6 attached.  Set the shot interval to 0 seconds and the script will run in "continuous mode".  I also included the fastshot.lua script so that you can test the max shot rate of your camera with a simple script.  Results with my old cameras are around 2 seconds per shot - or about 1 second faster than without continuous mode.   My S100 runs at about 1.1 to 1.2 seconds per shot.
« Last Edit: 19 / June / 2015, 23:10:11 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #475 on: 20 / June / 2015, 13:20:01 »
WWZ,

As per PM I have started the testing of the 3.6. so far the test rig was an RC receiver + gentlewire + S110
ch1up - works as it should: with interval set to 0 it makes sets shooting parameters and then it starts shooting at 1.05s interval with the same settings. if camera moved picture quality degrades.
ch1mid and ch1down I am not sure how it should work.
I will hook up the camera to the pixhawk. that way i can have precise PWM signals and know more.

I plan to chek back in about an hour with that. 
below is the KAP.log:
Code: [Select]

2015Jun20 16:23:33    KAP 3.6 started - press MENU to exit
2015Jun20 16:23:33    CHDK 1.3.0-4132 s110 102b Mar 31 2015
2015Jun20 16:23:33    Mode:PLAY,Continuous_AF:0,Servo_AF:0
2015Jun20 16:23:33     Tv:1/1000 max:1/2000 min:10 ecomp:0.0
2015Jun20 16:23:33     Av:4.0 minAv:2.8 maxAv:8.0
2015Jun20 16:23:33     ISOmin:100 ISO1:400 ISO2:800 M:800
2015Jun20 16:23:33     Focus:OFF  Video:0 USB:3 Tmo:0
2015Jun20 16:23:33     AvM:3 int:0 Shts:0 Dly:0 B/L:0
2015Jun20 16:23:33    Warning : camera ISO not in AUTO mode
2015Jun20 16:23:34    waiting on USB signal
2015Jun20 16:23:34    Menu key exit request
2015Jun20 16:23:34    Loggger : log file updated.
2015Jun20 16:31:16    KAP 3.6 started - press MENU to exit
2015Jun20 16:31:16    CHDK 1.3.0-4132 s110 102b Mar 31 2015
2015Jun20 16:31:16    Mode:PLAY,Continuous_AF:0,Servo_AF:0
2015Jun20 16:31:16     Tv:1/1000 max:1/2000 min:10 ecomp:0.0
2015Jun20 16:31:16     Av:4.0 minAv:2.8 maxAv:8.0
2015Jun20 16:31:16     ISOmin:100 ISO1:400 ISO2:800 M:800
2015Jun20 16:31:16     Focus:OFF  Video:0 USB:3 Tmo:0
2015Jun20 16:31:16     AvM:3 int:0 Shts:0 Dly:0 B/L:0
2015Jun20 16:31:16    Warning : camera ISO not in AUTO mode
2015Jun20 16:31:18    waiting on USB signal
2015Jun20 16:31:23    USB start signal received
2015Jun20 16:31:26    Mode switched to M
2015Jun20 16:31:26    Loggger : log file updated.
2015Jun20 16:31:59    KAP 3.6 started - press MENU to exit
2015Jun20 16:31:59    CHDK 1.3.0-4132 s110 102b Mar 31 2015
2015Jun20 16:31:59    Mode:PLAY,Continuous_AF:0,Servo_AF:0
2015Jun20 16:31:59     Tv:1/1000 max:1/2000 min:10 ecomp:0.0
2015Jun20 16:31:59     Av:4.0 minAv:2.8 maxAv:8.0
2015Jun20 16:31:59     ISOmin:100 ISO1:400 ISO2:800 M:800
2015Jun20 16:31:59     Focus:OFF  Video:0 USB:3 Tmo:0
2015Jun20 16:31:59     AvM:3 int:0 Shts:0 Dly:0 B/L:0
2015Jun20 16:31:59    Warning : camera ISO not in AUTO mode
2015Jun20 16:32:00    waiting on USB signal
2015Jun20 16:32:01    USB start signal received
2015Jun20 16:32:04    Mode switched to M
2015Jun20 16:32:04    Loggger : log file updated.
2015Jun20 16:33:10    KAP 3.6 started - press MENU to exit
2015Jun20 16:33:10    CHDK 1.3.0-4132 s110 102b Mar 31 2015
2015Jun20 16:33:10    Mode:PLAY,Continuous_AF:0,Servo_AF:0
2015Jun20 16:33:10     Tv:1/1000 max:1/2000 min:10 ecomp:0.0
2015Jun20 16:33:10     Av:4.0 minAv:2.8 maxAv:8.0
2015Jun20 16:33:10     ISOmin:100 ISO1:400 ISO2:800 M:800
2015Jun20 16:33:10     Focus:OFF  Video:0 USB:3 Tmo:0
2015Jun20 16:33:10     AvM:3 int:0 Shts:0 Dly:0 B/L:0
2015Jun20 16:33:10    Warning : camera ISO not in AUTO mode
2015Jun20 16:33:11    waiting on USB signal
2015Jun20 16:33:19    USB start signal received
2015Jun20 16:33:23    Mode switched to M
2015Jun20 16:33:23    Loggger : log file updated.
2015Jun20 16:33:47    KAP 3.6 started - press MENU to exit
2015Jun20 16:33:47    CHDK 1.3.0-4132 s110 102b Mar 31 2015
2015Jun20 16:33:47    Mode:PLAY,Continuous_AF:0,Servo_AF:0
2015Jun20 16:33:47     Tv:1/1000 max:1/2000 min:10 ecomp:0.0
2015Jun20 16:33:47     Av:4.0 minAv:2.8 maxAv:8.0
2015Jun20 16:33:47     ISOmin:100 ISO1:400 ISO2:800 M:800
2015Jun20 16:33:47     Focus:OFF  Video:0 USB:3 Tmo:0
2015Jun20 16:33:47     AvM:3 int:0 Shts:0 Dly:0 B/L:0
2015Jun20 16:33:47    Warning : camera ISO not in AUTO mode
2015Jun20 16:33:49    waiting on USB signal
2015Jun20 16:33:50    USB start signal received
2015Jun20 16:33:53    Mode switched to M
2015Jun20 16:33:53    Loggger : log file updated.
2015Jun20 16:50:46    KAP 3.6 started - press MENU to exit
2015Jun20 16:50:46    CHDK 1.3.0-4132 s110 102b Mar 31 2015
2015Jun20 16:50:46    Mode:PLAY,Continuous_AF:0,Servo_AF:0
2015Jun20 16:50:46     Tv:1/1000 max:1/2000 min:10 ecomp:0.0
2015Jun20 16:50:46     Av:4.0 minAv:2.8 maxAv:8.0
2015Jun20 16:50:46     ISOmin:100 ISO1:400 ISO2:800 M:800
2015Jun20 16:50:46     Focus:OFF  Video:0 USB:3 Tmo:0
2015Jun20 16:50:46     AvM:3 int:0 Shts:0 Dly:0 B/L:0
2015Jun20 16:50:46    Warning : camera ISO not in AUTO mode
2015Jun20 16:50:47    waiting on USB signal
2015Jun20 16:51:09    USB start signal received
2015Jun20 16:51:12    Mode switched to M
2015Jun20 16:51:12    Loggger : log file updated.
2015Jun20 16:55:17    KAP 3.6 started - press MENU to exit
2015Jun20 16:55:17    CHDK 1.3.0-4132 s110 102b Mar 31 2015
2015Jun20 16:55:17    Mode:PLAY,Continuous_AF:0,Servo_AF:0
2015Jun20 16:55:17     Tv:1/1000 max:1/2000 min:10 ecomp:0.0
2015Jun20 16:55:17     Av:4.0 minAv:2.8 maxAv:8.0
2015Jun20 16:55:17     ISOmin:100 ISO1:400 ISO2:800 M:800
2015Jun20 16:55:17     Focus:OFF  Video:0 USB:3 Tmo:0
2015Jun20 16:55:17     AvM:3 int:0 Shts:0 Dly:0 B/L:0
2015Jun20 16:55:17    Warning : camera ISO not in AUTO mode
2015Jun20 16:55:18    waiting on USB signal
2015Jun20 16:55:19    Menu key exit request
2015Jun20 16:55:19    Loggger : log file updated.
2015Jun20 17:12:20    KAP 3.6 started - press MENU to exit
2015Jun20 17:12:20    CHDK 1.3.0-4132 s110 102b Mar 31 2015
2015Jun20 17:12:20    Mode:PLAY,Continuous_AF:0,Servo_AF:0
2015Jun20 17:12:20     Tv:1/1000 max:1/2000 min:10 ecomp:0.0
2015Jun20 17:12:20     Av:4.0 minAv:2.8 maxAv:8.0
2015Jun20 17:12:20     ISOmin:100 ISO1:400 ISO2:800 M:800
2015Jun20 17:12:20     Focus:OFF  Video:0 USB:3 Tmo:0
2015Jun20 17:12:20     AvM:3 int:0 Shts:0 Dly:0 B/L:0
2015Jun20 17:12:20    Warning : camera ISO not in AUTO mode
2015Jun20 17:12:21    waiting on USB signal
2015Jun20 17:12:50    USB start signal received
2015Jun20 17:12:53    Mode switched to M
2015Jun20 17:12:53    Loggger : log file updated.
2015Jun20 17:39:15    KAP 3.6 started - press MENU to exit
2015Jun20 17:39:15    CHDK 1.3.0-4132 s110 102b Mar 31 2015
2015Jun20 17:39:15    Mode:PLAY,Continuous_AF:0,Servo_AF:0
2015Jun20 17:39:15     Tv:1/1000 max:1/2000 min:10 ecomp:0.0
2015Jun20 17:39:15     Av:4.0 minAv:2.8 maxAv:8.0
2015Jun20 17:39:15     ISOmin:100 ISO1:400 ISO2:800 M:800
2015Jun20 17:39:15     Focus:OFF  Video:0 USB:3 Tmo:0
2015Jun20 17:39:15     AvM:3 int:0 Shts:0 Dly:0 B/L:0
2015Jun20 17:39:15    Warning : camera ISO not in AUTO mode
2015Jun20 17:39:16    waiting on USB signal
2015Jun20 17:39:16    Menu key exit request
2015Jun20 17:39:16    Loggger : log file updated.
2015Jun20 17:41:20    KAP 3.6 started - press MENU to exit
2015Jun20 17:41:20    CHDK 1.3.0-4132 s110 102b Mar 31 2015
2015Jun20 17:41:20    Mode:M,Continuous_AF:0,Servo_AF:0
2015Jun20 17:41:20     Tv:1/1000 max:1/2000 min:10 ecomp:0.0
2015Jun20 17:41:20     Av:4.0 minAv:2.8 maxAv:8.0
2015Jun20 17:41:20     ISOmin:100 ISO1:400 ISO2:800 M:800
2015Jun20 17:41:20     Focus:MF  Video:0 USB:3 Tmo:0
2015Jun20 17:41:20     AvM:3 int:0 Shts:0 Dly:0 B/L:0
2015Jun20 17:41:20    Warning : camera ISO not in AUTO mode
2015Jun20 17:41:21    waiting on USB signal
2015Jun20 17:42:14    USB start signal received
2015Jun20 17:42:17    Loggger : log file updated.
S110, SX200is,

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #476 on: 20 / June / 2015, 13:34:28 »
ch1up - works as it should: with interval set to 0 it makes sets shooting parameters and then it starts shooting at
1.05s interval with the same settings. if camera moved picture quality degrades.
Can you be a little more specific? Is the focus off?  Or the exposure?   Remember,  when shooting in continuous mode,  the script locks the focus & exposure after the first shot.  If you point the camera somewhere different, the script does not adjust.  This should probably not be a problem when mappping if you start your shooting sequence once the UAV is on station but may seem confusing on the ground.

Once CHDK 1.4.0 is released,  I'll add the ability to have the exposure adjust "on the fly" but I can't do that in 1.3.0  effectively.

Quote
ch1mid and ch1down I am not sure how it should work.
I don't have a pixhawk so that code was just a guess.  In your PM you mentioned "ch1mid - gives me lens error and is shuts down".  It would be interesting to see the ROMLOG.LOG file for your camera - can you go to the CHDK debug menu, dump the log,  and post it here?

Note that I see something like that on my A1200 but not S100 when the script tries to shut itself down.  I think it has something to do with the script trying to do things while a 'half press' is active but I have not been able to narrow it down.

Quote
Code: [Select]
2015Jun20 17:41:20    KAP 3.6 started - press MENU to exit
2015Jun20 17:41:20    CHDK 1.3.0-4132 s110 102b Mar 31 2015
2015Jun20 17:41:20    Mode:M,Continuous_AF:0,Servo_AF:0
2015Jun20 17:41:20     Tv:1/1000 max:1/2000 min:10 ecomp:0.0
2015Jun20 17:41:20     Av:4.0 minAv:2.8 maxAv:8.0
2015Jun20 17:41:20     ISOmin:100 ISO1:400 ISO2:800 M:800
2015Jun20 17:41:20     Focus:MF  Video:0 USB:3 Tmo:0
2015Jun20 17:41:20     AvM:3 int:0 Shts:0 Dly:0 B/L:0
2015Jun20 17:41:20    Warning : camera ISO not in AUTO mode
2015Jun20 17:41:21    waiting on USB signal
2015Jun20 17:42:14    USB start signal received
2015Jun20 17:42:17    Loggger : log file updated.
Strange that no image data is recorded.   If you are getting a crash in the ch1mid code then that could explain it - the log file only writes to the SD card occasionally and never when continuously shooting.  I did not want the delay from writing a big file to throw off the fast shot rate.  Might need to reconsider that if the log buffer gets too large.

Note that the script is complaining about you having your camera's ISO setting not in AUTO.  That can cause problems on some models - YMMV.

I'm looking at allowing Canon continuous mode shooting.  On high end models like the S110 that might let you go even faster and the script should still be able to accurately time stamp each image if I get it right.

Meanwhile,  back to looking at that crash in ch1mid.

Ported :   A1200    SD940   G10    Powershot N    G16

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #477 on: 20 / June / 2015, 14:06:29 »
Incidentally,  I think that the gentwire decoding logic should probably be this :
Code: [Select]
function ch1up()
   printf(" * usb pulse = ch1up")
   shot_request = true                                 -- single shot unless interval = 0 causes continuous shooting
end
function ch1mid()                                       -- put camera into shooting mode and lock the focus
   printf(" * usb pulse = ch1mid")
   if ( get_mode() == false ) then
        switch_mode(1)
        lock_focus()
   end
end
function ch1down()
    printf(" * usb pulse = ch1down")
    if ( get_mode() ~= false ) then       
        shot_request = false                             -- cancel in case interval = 0 is causing continuous shooting
        switch_mode(0)
    end
end

with the intent being :
  • ch1up     :  sets the continuous shooting flag, telling the script to start shooting as fast as it can
  • ch1mid   :  sets the camera into shooting mode and locks the focus (but only if camera is currently in playback mode)
  • ch1down :  clears the continuous shooting flag and switches the camera into playback mode

So in theory you can just move the CH1 level up to shoot and down to stop shooting.  I hope.
Ported :   A1200    SD940   G10    Powershot N    G16


Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #478 on: 20 / June / 2015, 14:50:11 »
WWZ,
both KAP and ROMLOG are attached.
I hooked it up to the autopilot so I can give the "wire" precise PWM input.
there is a small issue.
I commented out all commands for PWM control so when I modify PWM input it should have only printed the commands on the screen, but it triggers the continuous shooting then it freezes.
Logs are empty.
S110, SX200is,

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #479 on: 20 / June / 2015, 15:34:02 »
Quote
Can you be a little more specific? Is the focus off?  Or the exposure?

both, but it doesn't really matter as we will mostly have focus at infinity and approximately identical light conditions.
your 1-2-3 step logic is correct.
as I can control the PWM pretty accurately, I can modify those commands without risking false input.
S110, SX200is,

 

Related Topics