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

KAP & UAV Exposure Control Intervalometer Script

  • 1068 Replies
  • 343577 Views
Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #580 on: 11 / July / 2015, 15:03:45 »
Advertisements
You need to go to Config/Tuning -> Param Tree -> Cam
  • CAM_DURATION - 1
  • CAM_SERVO_OFF - 8000
  • CAM_SERVO_ON - 3000
  • CAM_TRIGG_DIST - 0
  • CAM_TRIGG_TYPE - 0
then pick an RC channel you would like to control the shutter (I used RC7):
  • RC7_FUNCTION - 10
  • RC7_TRIM - 8000
  • RC7_MAX - 32767

I notice that you set CAM_SERVO_OFF to the same value as RC7_TRIM.   What does the pixhawk generate if you make them different ( say 8000 and 11000 ) ?

Quote
Can you fix the reset by then?

I can show you how to disable it but I'd rather find a more complete solution.  The answer to my question above might help there.
« Last Edit: 11 / July / 2015, 15:05:42 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #581 on: 12 / July / 2015, 03:16:07 »

I notice that you set CAM_SERVO_OFF to the same value as RC7_TRIM.   What does the pixhawk generate if you make them different ( say 8000 and 11000 ) ?

Durring initialization for a moment the TRIM kicks in, but as firmware is loaded the CAM_SERVO_OFF is transmitted. On the shutter control channel 2 PWMS are transmitted only: CAM_SERVO_ON and CAM_SERVO_OFF.
I am still trying to figure out a way around that.

I also tested the 220 ohm version but the signal still fluctuates.
I tried to move from 8000 to 8500 but, rarely though, I still get a 9ms and a 7ms.

Let's keep the 10 second logic for the moment. Could you focus on the reset debugging so it makes the reset every 10 seconds?
S110, SX200is,

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #582 on: 12 / July / 2015, 23:14:48 »
Could you focus on the reset debugging so it makes the reset every 10 seconds?
kap_uav.lua 3.6 Beta 10

Changes in this version :
  • The PWM code changed for ardupilot use (gentwire-USB2 temporaily remove)
  • Camera waits in playback mode until first pwm1 pulse received  ( 3 mSec)
  • If camera is in Canon continuous mode then shots are released as each pwm1 pulse is received
  • if camera is shooting in continuous mode and no pwm1 pulses are receive for 10 second then continuous shooting stops
  • continuous shooting restarts (with focus & exposure reset) at the next pwm1 pulse
  • pwm2 to pwm 6 modes are ignored
Ported :   A1200    SD940   G10    Powershot N    G16

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #583 on: 13 / July / 2015, 02:57:53 »
Could you focus on the reset debugging so it makes the reset every 10 seconds?
kap_uav.lua 3.6 Beta 10

Changes in this version :
  • The PWM code changed for ardupilot use (gentwire-USB2 temporaily remove)
  • Camera waits in playback mode until first pwm1 pulse received  ( 3 mSec)
OK!
Quote
  • If camera is in Canon continuous mode then shots are released as each pwm1 pulse is received
You mean 1 shot, right?
Quote
  • if camera is shooting in continuous mode and no pwm1 pulses are receive for 10 second then continuous shooting stops
  • continuous shooting restarts (with focus & exposure reset) at the next pwm1 pulse
  • pwm2 to pwm 6 modes are ignored
this can be changed back, right?
Quote
[/list]

I made some indoor photos (with outdoor settings, true) but they all came out dark.
when the camera was waiting resetting itself the reset worked and the picture on the LCD looked fine. but by the time it got saved the picture became dark. Is this OK?

Something to bare in mind for final debugging: I cannot get my camera with PWM signal from Playback mode do any other mode as it will ask "Change Battery" it does that even with a newly charged battery. I can work around this by starting the script after camera lens are out so it is not that urgent.

S110, SX200is,


Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #584 on: 13 / July / 2015, 09:15:18 »
You mean 1 shot, right?
Yes.

Quote
this can be changed back, right?
Not so much changed back (I think the pwm1 message works well now) but added to.  The code to shutdown the camera is still there for example - we just currently have no way to generate the necessary pulse width to make it happen.

Quote
I made some indoor photos (with outdoor settings, true) but they all came out dark.
when the camera was waiting resetting itself the reset worked and the picture on the LCD looked fine. but by the time it got saved the picture became dark. Is this OK?
I don't know if its okay - I'd have to see the log file.  But if you have the minimum settings locked up high to drive fast shutter speeds then it is quite possible the script is unable to get a correct exposure in dark conditions.

Quote
Something to bare in mind for final debugging: I cannot get my camera with PWM signal from Playback mode do any other mode as it will ask "Change Battery" it does that even with a newly charged battery. I can work around this by starting the script after camera lens are out so it is not that urgent.
Strange.  None of my cameras do that.
  • Is this something new with beta10 or have you seen it for a while?
  • Do any other scripts do this (assuming the start in playback and then switch to shooting)?  Try the attached one I attached here for example
  • How old is your batttery?  It might not be holding a full charge
  • Try setting the USB Timer Precision setting back to 10 (I changed the default to 1 for this version)?
Ported :   A1200    SD940   G10    Powershot N    G16

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #585 on: 17 / July / 2015, 03:26:47 »
B10 works correctly. Still have my reserves on the ISO and F-Stop choice, but that is another issue.

I have soldered a 3000mAh RC battery cell to the camera battery so now I can shoot about 200k picture without worrying about the battery getting depleted.

Log is attached.
I had 4 short flights as I was mainly testing the vibration dampers and KAP.log is the main thing that's telling us the script performance anyway. In the first 3 flights I had speeds set between 20-25m/s, camera was set to take pictures every 17 meters
Last Flight at 25m/s (no wind whatsoever) the camera was set to take pictures every 17 meters. That means one picture every 0.68s. 
Notice, that the pictures in the last session were taken mostly at .8s intervals. While the .8s interval still offers a 78% overlap that we can work with, it is not perfect. 
Speculation:
The CAM_SERVO_ON=3500 is held for CAM_DURATION=0.1s. now the Pixhawk log is not accurate enough to determine if this is the real cause, but it surely provides the explanation for the ~0.1s loss.
Now, reverse engineering the problem:
CAM_DURATION=0.1s(100ms)- this means the the counting for the next shot is not starting from the moment CAM_DURATION began but from the moment CAM_DURATION ended. So 0.68+0.1=0.78 (~0.8).
If we can work the CAM_DURATION down to 0.02s which is the exact width of one pulse+pause the next speed development would have to be when mapping planes fly at 250m/s .  (Probably when we start mapping other planets @80m AGL.)
Final note
All in all I say the timing delays have reached an acceptable level that can be worked with, and if needed it can be compensated for during planning.

Waterwingz, that was hell of a job! CONGRATS!
« Last Edit: 17 / July / 2015, 03:30:19 by netptl39 »
S110, SX200is,

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #586 on: 17 / July / 2015, 03:43:55 »
Now, for the Photo part: this is probably because of my ignorance in the matter.

I have pictures of this flight ranging from 6M to 9M and the EXIF data is TV=1/2000 + AV=2 + ISO=800.
Code: [Select]
2015Jul16 08:43:43    KAP 3.6b10 started - press MENU to exit
2015Jul16 08:43:43    CHDK 1.3.0-4132 s110 102b Mar 31 2015
2015Jul16 08:43:43    Mode:P,Continuous_AF:0,Servo_AF:0 Drive:1
2015Jul16 08:43:43     Tv:1/5000 max:1/10000 min:1/5000 ecomp:0.0
2015Jul16 08:43:43     Av:2.0 minAv:2.0 maxAv:8.0
2015Jul16 08:43:43     ISOmin:100 ISO1:400 ISO2:800 M:0
2015Jul16 08:43:43     Focus:OFF  Video:0 USB:3 Tmo:0
2015Jul16 08:43:43     AvM:3 int:0 Shts:0 Dly:0 B/L:0
2015Jul16 08:43:44    waiting on USB signal
2015Jul16 08:43:59     * usb pulse = pwm2 idle (8 mSec)
2015Jul16 08:46:32    pwm2 idle repeated 7590 times
2015Jul16 08:46:32     * usb pulse = pwm1 shoot (3 mSec)
2015Jul16 08:46:32    USB start signal received
2015Jul16 08:46:32    Logger : log file updated.
2015Jul16 08:46:33.580 1) IMG_0001.JPG
2015Jul16 08:46:33     meter : Tv:1/640 Av:2.0 Sv:50 771:771
2015Jul16 08:46:33     actual: Tv:1/5000 Av:2.0 Sv:400
2015Jul16 08:46:33             AvMin:2.0 NDF:NDout foc:2.8m
2015Jul16 08:46:33     * usb pulse = pwm2 idle (8 mSec)
2015Jul16 08:46:34    pwm2 idle repeated 12 times
2015Jul16 08:46:34     * usb pulse = pwm1 shoot (3 mSec)
2015Jul16 08:46:34.200 2) IMG_0002.JPG

Can you please tell me the focus distance, is it really 2.8m?
EXIF ISO=800
log Sv= 400 - which is real?
Can ND Filter cause increase in file size?
S110, SX200is,

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #587 on: 17 / July / 2015, 11:44:15 »
The CAM_SERVO_ON=3500 is held for CAM_DURATION=0.1s. now the Pixhawk log is not accurate enough to determine if this is the real cause, but it surely provides the explanation for the ~0.1s loss.
Unless I am very much mistaken,  when you set CAM_SERVO_ON=3500 and CAM_DURATION=0.1s, then what you get is 5 pulses of 3.5 mSec each with a 16.5 mSec gap between each pulse.

The script will trigger a shot when the first pulse occurs and essentially ignore the other pulses while it is busy completing the shooting process. The time to complete the shooting process is essentially the same as the rate that the camera will shoot in Canon continuous mode without CHDK loaded.  Part of that time is pre-shot processing time while the rest is mostly for JPEG correction and saving to the SD card.    My tests with USB remotes indicate that the pre-shot time can be as much as 100 mSec.

Edit : looking at the script's log file,  I don't see the five 3 mSec pulses I was expecting.  There appears to have only been one produced. 

Now, for the Photo part: this is probably because of my ignorance in the matter.

Code: [Select]
2015Jul16 08:43:43     Focus:OFF  Video:0 USB:3 Tmo:0
Can you please tell me the focus distance, is it really 2.8m?
You have the "Focus at Infinity option turned off.  Why ?

Code: [Select]
...
2015Jul16 08:43:43     Focus:OFF  Video:0 USB:3 Tmo:0
...
2015Jul16 08:46:33             AvMin:2.0 NDF:NDout foc:2.8m
...
The camera seems to have picked 2.8m as a result. This might be good enough given the depth of field of the little lens & sensors on the camera.


Quote
EXIF ISO=800 log Sv= 400 - which is real?
I believe the value in the log is real.  CHDK overrides do not alway get properly saved in the EXIF info.  Although I'm not sure when that does or doesn't happen.  It should be easy enough to experiment with on a desktop though and figure it out.

Quote
Can ND Filter cause increase in file size?
I would not expect so. Not unless it gets inserted and the ISO setting goes above 800 to compensate, thereby giving a more noisy image which will compress less.
« Last Edit: 17 / July / 2015, 12:34:08 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #588 on: 17 / July / 2015, 12:34:57 »
Hi,
Quote
Quote
Can ND Filter cause increase in file size?
I would not expect so. Not unless it gets inserted and the ISO setting goes above 800 to compensate, thereby giving a more noisy image which will compress less.

That depends...
JPG given.
More details in the picture give larger filesizes.
So, if the exposure is "better" - with more details - you will get bigger filesizes.
But it has nothing to do with NDfilter in or out,
ND In can give bigger filesize than ND Out or vice versa
IXUS 970 IS 100b

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #589 on: 17 / July / 2015, 12:40:57 »
That depends... JPG given. More details in the picture give larger filesizes. So, if the exposure is "better" - with more details - you will get bigger filesizes. But it has nothing to do with NDfilter in or out, ND In can give bigger filesize than ND Out or vice versa
More detail based on "better" exposure will certainly cause some file size variation.  However, the changes that netptl39 was seeing were file sizes going from about 2M to 8M.   I would expect something  a lot more dramatic than a "better" exposure would be needed to cause that.  High ISO settings are one example.
« Last Edit: 17 / July / 2015, 12:42:29 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics