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

KAP & UAV Exposure Control Intervalometer Script

  • 1068 Replies
  • 449529 Views
*

Offline tokm

  • *
  • 18
Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #950 on: 18 / March / 2017, 11:31:10 »
Advertisements
I don't have the kap.log files from previous flights but here are two images from the same flight. I resize them so I could attach to this post.
Now we are getting somewhere.  Assuming the resize operation did not mangle the internal EXIF info, this is quite interesting.  You've picked two sequential shots with dramaticly different exposures.

Here's the info from the EXIF data :

Code: [Select]
IMG_0569.JPG  Tv :  1/1250   Av: f9.0  Sv: 160
IMG_0570.JPG  Tv :  1/1250   Av: f3    Sv: 200

Same shutter speed, slightly higher sensitivity in the second (brighter) image.  Not enough to explain the exposure difference though.

But notice the Av (aperture value) settings :  f9.0  vs f3!! This is a huge change - enough to completely explain the exposure difference.  But note my previous comment - the A4000 does not have an adjustable aperture. The fixed aperture should be reported as somewhere between F3 & F5.9 depending on the zoom position (the effective aperture gets smaller as you zoom in).  If you are shooting at the widest angle, that would be f3.   So that only leaves one thing - the internal switchable neutral density filter.

In the first image - the underexposed one - the image EXIF information indicates that the internal ND filter was used.  In the second, correctly exposed image it was not. Why?

This is where it would be really nice to have the KAP.LOG file.  I'm pretty certain that the script did not try to insert the ND filter in the first shot.  In fact, it would have tried to force the ND filter to stay out.  But the Canon exposure logic appears to have inserted it - ignoring CHDK's override.

All of which leads me to the conclusion that the script command that controls the ND filter might not work on your A4000.

We can test that if you have time.  I've attached a little script that takes two sequential shots - one in "auto" and the other with the ND filter forced to the opposite state from whatever the camera picks for the first shot.   If you point the camera at something really bright (a 60W light bulb from 12" away for example) and shoot in Canon AUTO mode, it should insert the ND filter.  Let's see if a script can override that in the second shot.  Do the resulting images look the same or different?


Edit : is seems that I have been down this road before without a clear resolution : ND filter swinging in even when "ND filter state" is "Out"  A work-around might be to configure the camera so that it does not try to use the ND filter on its own. Not sure what those settings are though.

I will test this Monday and let you know.  Thank you again for all your help.  Keep in mind the exact same thing happened with the A3400 in OneShot mode.  It's 100% hit or miss.  I flew 5 flights that day, the first one was flawless and every image was perfect.  It was roughly the same time of day too, so the brightness shouldn't have changed too much between flights.

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #951 on: 18 / March / 2017, 11:57:09 »
Keep in mind the exact same thing happened with the A3400 in OneShot mode. 
I can't find anything in the A3400 or A4000 porting thread indicating that the ND filter override was ever tested.  It's possible neither of them work properly - they were probably created from the same code base.  And they were both done as "blind ports" - meaning the CHDK developer did not have access to the camera during the porting process.  Testing was likely left to CHDK beginners and may not have been too complete.

The USB mode used should not be an issue relative to this problem.

Quote
It's 100% hit or miss.  I flew 5 flights that day, the first one was flawless and every image was perfect.  It was roughly the same time of day too, so the brightness shouldn't have changed too much between flights.
The constant brightness makes me wonder why the camera would decide to activate the ND filter on its own.  It really should have set it in or out and left it there - seems unlikely it would change it. But if the script set_nd_filter( ) function is flakey, it could cause changes each shot.

So it's also possible the script has a bug. But with over 7100 downloads to-date,  I would have expected this to have been mentioned before.  And the script logic for controlling the ND filter is pretty simple.
« Last Edit: 18 / March / 2017, 12:10:48 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #952 on: 18 / March / 2017, 12:31:36 »
I will test this Monday and let you know. 
In addition to the ndtest script, it would be instructive to know if the ND Filter State setting in the CHDK Enhanced Photo Operation menu works properly.

With the camera in Canon AUTO mode,  take three shots of the same subject, changing the setting of that option between shots :  [ Off ]  , [  In ] , [ Out ].  Make sure the Disable Overrides menu option is set to [ No ] and that no other overrides are enabled.

You should see one of the three shots (typically the one corresponding to the [ In ] setting) be much darker than the others.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline tokm

  • *
  • 18
Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #953 on: 20 / March / 2017, 08:57:27 »
I don't have the kap.log files from previous flights but here are two images from the same flight. I resize them so I could attach to this post.
Now we are getting somewhere.  Assuming the resize operation did not mangle the internal EXIF info, this is quite interesting.  You've picked two sequential shots with dramaticly different exposures.

Here's the info from the EXIF data :

Code: [Select]
IMG_0569.JPG  Tv :  1/1250   Av: f9.0  Sv: 160
IMG_0570.JPG  Tv :  1/1250   Av: f3    Sv: 200

Same shutter speed, slightly higher sensitivity in the second (brighter) image.  Not enough to explain the exposure difference though.

But notice the Av (aperture value) settings :  f9.0  vs f3!! This is a huge change - enough to completely explain the exposure difference.  But note my previous comment - the A4000 does not have an adjustable aperture. The fixed aperture should be reported as somewhere between F3 & F5.9 depending on the zoom position (the effective aperture gets smaller as you zoom in).  If you are shooting at the widest angle, that would be f3.   So that only leaves one thing - the internal switchable neutral density filter.

In the first image - the underexposed one - the image EXIF information indicates that the internal ND filter was used.  In the second, correctly exposed image it was not. Why?

This is where it would be really nice to have the KAP.LOG file.  I'm pretty certain that the script did not try to insert the ND filter in the first shot.  In fact, it would have tried to force the ND filter to stay out.  But the Canon exposure logic appears to have inserted it - ignoring CHDK's override.

All of which leads me to the conclusion that the script command that controls the ND filter might not work on your A4000.

We can test that if you have time.  I've attached a little script that takes two sequential shots - one in "auto" and the other with the ND filter forced to the opposite state from whatever the camera picks for the first shot.   If you point the camera at something really bright (a 60W light bulb from 12" away for example) and shoot in Canon AUTO mode, it should insert the ND filter.  Let's see if a script can override that in the second shot.  Do the resulting images look the same or different?

Edit 1 : is seems that I have been down this road before without a clear resolution : ND filter swinging in even when "ND filter state" is "Out"  A work-around might be to configure the camera so that it does not try to use the ND filter on its own. Not sure what those settings are though.

Edit 2 : it looks like nafraf did the A4000 port blind.  I don't see anything in the porting thread that indicates the ND filter override was actually tested.

Here are the results of the ndtest.lua.  I made sure that Disable Overrides was set to No. I'll post the log, then the two images.

*

Offline tokm

  • *
  • 18
Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #954 on: 20 / March / 2017, 08:59:01 »
Here are the images

*

Offline tokm

  • *
  • 18
Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #955 on: 20 / March / 2017, 14:36:03 »

When you set the script to [ Pixhawk ] mode, it expects at 3 mSec pulse from the pixhawk to start shooting and another 3 mSec pulse for each additional shot.  According to the test script logs from either camera,  your setup is generating 100 mSec pulses. 

The KAP.LOG file for your A3400 also shows it receiving only 100 mSec pulses - which is why it does not start shooting.


Good news on the USB Control setting for pixhawk.  The default setting in Mission Planner for CAM_DURATION is 1 (in 10ths of a second).  I changed this setting to .3 to send the 3 millisecond pulse and now both cameras trigger correctly using USB Control = Pixhawk.

KAP & UAV Exposure Control Intervalometer Script
« Reply #956 on: 20 / March / 2017, 22:23:44 »
I changed this setting to .3 to send the 3 millisecond pulse and now both cameras trigger correctly using USB Control = Pixhawk.
That makes sense. 

But there is still a potential issue with the ND filter. 

The images you posted suggest that it is working - or at least that it can force the filter in. Your mobile phone lamp isn't really bright enough to force the filter in.  A 60w build from 12" away would be a better subject.

Try setting the ISO high with the Canon menu and see if you can get the script's first shot to have the filter inserted? That should produce an over exposed second shot, showing that the filter can also be forced out?
« Last Edit: 20 / March / 2017, 22:26:12 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline tokm

  • *
  • 18
Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #957 on: 21 / March / 2017, 06:40:22 »
I changed this setting to .3 to send the 3 millisecond pulse and now both cameras trigger correctly using USB Control = Pixhawk.
That makes sense. 

But there is still a potential issue with the ND filter. 

The images you posted suggest that it is working - or at least that it can force the filter in. Your mobile phone lamp isn't really bright enough to force the filter in.  A 60w build from 12" away would be a better subject.

Try setting the ISO high with the Canon menu and see if you can get the script's first shot to have the filter inserted? That should produce an over exposed second shot, showing that the filter can also be forced out?

Ok I will retest with a brighter object.  I probably won't be able to test today but I will test and post the results ASAP.

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #958 on: 17 / September / 2017, 17:40:55 »
Hi Everyone, Thankyou waterwingz for the time you spend making this awesome script better and better!
I have a Pixhawk FW APM:Copter V3.5.2 and S100 running CHDK 1.3.0-4228 S100-100e with KAP UAV 3.8 Beta script. My RC is a FrSky Taranis X9D with X8R receiver running latest firmware, OpenTX and FlightDeck.

My setup works successfully when I set it up the "old fashioned way" using my DIY cable to trigger S100 from Pixhawk via USB.
I have been reading up here and in the SH260 forum (https://chdk.setepontos.com/index.php?topic=13028.0) and on the tuffwing page (http://tuffwing.com/support/pixhawk_camera_trigger_cable.html) about the option in the script to trigger via USB called "PIXHAWK" which gives greater accuracy in the logs for GPS positioning when mapping. I am also interested in the LED feedback for even more precise GPS tagging.
I would like to use these methods, but for now, I don't have a design to build for the feedback cable, and I am currently unable to get the "PIXHAWK" USB Mode working.
So first things first, I need to get the trigger side working.

The following is from the Tuffwing page, listing the parameters to adjust in Mission Planner's Full Parameter List:
CAM_DURATION  1
CAM_SERVO_OFF  8000
CAM_SERVO_ON  3000
CAM_TRIGG_TYPE  0
RC10_FUNCTION  10
RC10_TRIM  8000
RC10_MAX  32767
I can find and adjust all of the parameters except for the RC10_FUNCTION parameter. It just does not exist in the parameters list. I have searched for RC, FUNCTION, even OPT for option. Is this an APM:Plane only setting? Is there a way to use this in Copter?
As a side note I have CH10_OPT set to 9 (Camera Trigger).
I also read in this forum waterwingz gave advice saying that the script is looking for a precise PWM pulse 3mS long, but the CAM_DURATION Parameters are set in 10ths of a second (i.e 1 = 10mS) and trying to input .3 results in a 0... So a pulse 0 seconds long is sent when triggered! That obviously doesn't work lol.

What am I missing?


« Last Edit: 17 / September / 2017, 18:09:12 by sandysound »

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #959 on: 17 / September / 2017, 19:21:44 »
What am I missing?
I really hate to say this, but I don't think I can help. I don't own a pixhawk (although I'd like to someday) so I can't comment on the software with any knowledge.  Sorry.

Maybe one of the people using the script and still following this forum thread will comment?  The tuffwing support is usually pretty good too.
« Last Edit: 17 / September / 2017, 19:23:36 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics


SimplePortal © 2008-2014, SimplePortal