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

KAP & UAV Exposure Control Intervalometer Script

  • 1068 Replies
  • 410856 Views
*

Offline tokm

  • *
  • 18
Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #940 on: 17 / March / 2017, 10:21:15 »
Advertisements
Here it is.
Okay - it's not seeing the start pulse.  Please run the attached script on both your cameras with the pixhawk attached and requesting shooting.

You'll see USB pulse width info on the LCD. It will also create a log file ( CHDK/LOGS/LOG_0001.TXT ) on your SD card.  Please attach results from both cameras here.

Attached

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #941 on: 17 / March / 2017, 19:49:30 »
Attached
Both logs look like the pixhawk is just "idling".  There is no "shoot pulse" (i.e. >1 mSec & < 5 mSec) in either log.   Did you actually configure the pixhawk to simulate actual shooting requests?
« Last Edit: 17 / March / 2017, 22:10:28 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline tokm

  • *
  • 18
Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #942 on: 18 / March / 2017, 06:24:40 »
Attached
Both logs look like the pixhawk is just "idling".  There is no "shoot pulse" (i.e. >1 mSec & < 5 mSec) in either log.   Did you actually configure the pixhawk to simulate actual shooting requests?

Yes I did.  After powering the camera and hooking the USB to the pixhawk I turned on the pixhawk (connected via battery) then I hooked it up to laptop and triggered camera through Mission Planner.

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #943 on: 18 / March / 2017, 08:26:51 »
After powering the camera and hooking the USB to the pixhawk I turned on the pixhawk (connected via battery) then I hooked it up to laptop and triggered camera through Mission Planner.
I'm not sure what to suggest here.

My first thought is that your pixhawk setup is not what the script is expecting for [ Pixhawk ] mode.  The pixhawk can be setup to trigger a camera a number of ways, but to get faster shooting ( < 1 second/shot ) you need to follow these guidelines :
 Pixhawk Camera Trigger Cable

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.

The mystery here is why your A4000 KAP.LOG file shows it shooting?  It must be receiving ~3 mSec pulses - it won't shoot any other way.

Before I try to hack up the script to dump more info about what your A4000 is doing, would you mind repeating the original tests for both cameras with the pixhawk remaining powered between tests.  I can only guess that you maybe lost the correct setup of the pixhawk after you tested the A4000 and before you tested the A3400?

Please accept that I'm not trying to say you've done anything wrong. I just can't figure out what else I might have missed.  Something is different - but what?

« Last Edit: 18 / March / 2017, 08:33:04 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline tokm

  • *
  • 18
Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #944 on: 18 / March / 2017, 08:57:56 »
After powering the camera and hooking the USB to the pixhawk I turned on the pixhawk (connected via battery) then I hooked it up to laptop and triggered camera through Mission Planner.
I'm not sure what to suggest here.

My first thought is that your pixhawk setup is not what the script is expecting for [ Pixhawk ] mode.  The pixhawk can be setup to trigger a camera a number of ways, but to get faster shooting ( < 1 second/shot ) you need to follow these guidelines :
 Pixhawk Camera Trigger Cable

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.

The mystery here is why your A4000 KAP.LOG file shows it shooting?  It must be receiving ~3 mSec pulses - it won't shoot any other way.

Before I try to hack up the script to dump more info about what your A4000 is doing, would you mind repeating the original tests for both cameras with the pixhawk remaining powered between tests.  I can only guess that you maybe lost the correct setup of the pixhawk after you tested the A4000 and before you tested the A3400?

Please accept that I'm not trying to say you've done anything wrong. I just can't figure out what else I might have missed.  Something is different - but what?

Sure I will re-test but I won't be able to until Monday.  I will note that I am using the 3dr x-8+ with the mapping package.  I think the setup has the port setup as relay. (https://3dr.com/wp-content/uploads/2015/04/Mapping-Package-Instructions-v1.pdf)

The entire reason I want to change from OneShot to Pixhawk is because half the pictures were coming out underexposed and from what I have read, I can get a faster picture rate using the pixhawk setting.  Regardless, I appreciate your help here and I will re-test and post the results on Monday.

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #945 on: 18 / March / 2017, 09:20:35 »
Sure I will re-test but I won't be able to until Monday. 
I may be less available next week so please excuse any delayed response

Quote
I will note that I am using the 3dr x-8+ with the mapping package.  I think the setup has the port setup as relay. (https://3dr.com/wp-content/uploads/2015/04/Mapping-Package-Instructions-v1.pdf)
That package uses a much older version of the script. It almost certainly does not support the newer & faster [ Pixhawk ] mode - you should be using [ Oneshot ] mode and shooting slower than 2 seconds per shot.   I would not expect the script to work at all when set to  [ Pixhawk ] with their software setting up the pikhawk controller.

Quote
The entire reason I want to change from OneShot to Pixhawk is because half the pictures were coming out underexposed and from what I have read, I can get a faster picture rate using the pixhawk setting. 
Can you elaborate on "half the pictures were coming out underexposed"?  Does that mean every second picture sequentially?  Or were you generalizing to say that sometimes some of the pictures are randomly underexposed? And by how much? 

Are you thus trying to shoot faster to increase the chances of getting good shots?

It would be interesting to see one of the underexposed images and to compare it and it's EXIF info to the settings in the KAP.LOG file.   The way your script is configured (according to the logs) it will not shoot slower than 1/1000 sec and will not raise the ISO above 800.  (Note : neither camera has an adjustable aperture - the f-stop will vary only with the zoom poistion).  On a cloudy day, this could lead to underexposure. 

If the script is in fact hitting an exposure limit, you could lower the Tv min value to something like 1/400 and the ISO2 Max to 1600 and still get acceptable images.
« Last Edit: 18 / March / 2017, 09:31:30 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline tokm

  • *
  • 18
Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #946 on: 18 / March / 2017, 09:38:13 »
Sure I will re-test but I won't be able to until Monday. 
I may be less available next week so please excuse any delayed response

Quote
I will note that I am using the 3dr x-8+ with the mapping package.  I think the setup has the port setup as relay. (https://3dr.com/wp-content/uploads/2015/04/Mapping-Package-Instructions-v1.pdf)
That package uses a much older version of the script. It almost certainly does not support the newer & faster [ Pixhawk ] mode - you should be using [ Oneshot ] mode and shooting slower than 2 seconds per shot.   I would not expect the script to work at all when set to  [ Pixhawk ] with their software setting up the pikhawk controller.

Quote
The entire reason I want to change from OneShot to Pixhawk is because half the pictures were coming out underexposed and from what I have read, I can get a faster picture rate using the pixhawk setting. 
Can you elaborate on "half the pictures were coming out underexposed"?  Does that mean every second picture sequentially?  Or were you generalizing to say that sometimes some of the pictures are randomly underexposed? And by how much? 

Are you thus trying to shoot faster to increase the chances of getting good shots?

It would be interesting to see one of the underexposed images and to compare it and it's EXIF info to the settings in the KAP.LOG file.   The way your script is configured (according to the logs) it will not shoot slower than 1/1000 sec and will not raise the ISO above 800.  (Note : neither camera has an adjustable aperture - the f-stop will vary only with the zoom poistion).  On a cloudy day, this could lead to underexposure. 

If the script is in fact hitting an exposure limit, you could lower the Tv min value to something like 1/400 and the ISO2 Max to 1600 and still get acceptable images.

I'm not using the 3dr version of the script anymore, I am using the latest KAP version (3.8 I think).  It's very random, sometimes the pictures are perfect and then i'll get random underexposed ones (usually in succession).  I tried to slow the frequency of the images to one every 6 seconds, but it doesn't seem to have any impact.

What setting do you suggest in the Pixhawk for the following?

CAM_DURATION to 1 (pulse length in deci-seconds)

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #947 on: 18 / March / 2017, 09:49:36 »
It's very random, sometimes the pictures are perfect and then i'll get random underexposed ones (usually in succession). 
In most of the script USB modes,  the script measures and resets exposure before each shot.

However, if you are using [ Pixhawk ] mode then the script locks the exposure when it takes the first shot in a sequence.  That's one of the tricks it uses to get cheap little Powershots to shoot faster than two seconds per frame. Exposure is reset only after a USB timeout (no shots withing a defined time interval). Typically this occurs at the end of a shooting pass while the UAV "turns around" for another pass.

How bad is the underexposure?  And can you confirm that the exposure settings are at the specified limit and the image EXIF information also show that?

Quote
I tried to slow the frequency of the images to one every 6 seconds, but it doesn't seem to have any impact.
I would not expect shooting speed to affect exposure in most script modes.

Quote
What setting do you suggest in the Pixhawk for the following?  CAM_DURATION to 1 (pulse length in deci-seconds)
I don't have a pixhawk so can't really comment on settings beyond the link I posted earlier.  I do know that the required [ Pixhawk ] mode settings are a bit of a hack on the flight controller side - the settings required are not something anyone would normally do.
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline tokm

  • *
  • 18
Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #948 on: 18 / March / 2017, 09:55:40 »
It's very random, sometimes the pictures are perfect and then i'll get random underexposed ones (usually in succession). 
In most of the script USB modes,  the script measures and resets exposure before each shot.

However, if you are using [ Pixhawk ] mode then the script locks the exposure when it takes the first shot in a sequence.  That's one of the tricks it uses to get cheap little Powershots to shoot faster than two seconds per frame. Exposure is reset only after a USB timeout (no shots withing a defined time interval). Typically this occurs at the end of a shooting pass while the UAV "turns around" for another pass.

How bad is the underexposure?  And can you confirm that the exposure settings are at the specified limit and the image EXIF information also show that?

Quote
I tried to slow the frequency of the images to one every 6 seconds, but it doesn't seem to have any impact.
I would not expect shooting speed to affect exposure in most script modes.

Quote
What setting do you suggest in the Pixhawk for the following?  CAM_DURATION to 1 (pulse length in deci-seconds)
I don't have a pixhawk so can't really comment on settings beyond the link I posted earlier.  I do know that the required [ Pixhawk ] mode settings are a bit of a hack on the flight controller side - the settings required are not something anyone would normally do.

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.

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #949 on: 18 / March / 2017, 11:16:16 »
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.
« Last Edit: 18 / March / 2017, 11:51:03 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics