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

KAP & UAV Exposure Control Intervalometer Script

  • 1068 Replies
  • 410882 Views
Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #120 on: 17 / March / 2014, 08:39:33 »
Advertisements
The setup outlined in the link I posted is designed to be used for aerial mapping. It would be great to use it in conjunction with your scripts ability to set the camera parameters for taking good photos from a moving object.
There is a discussion about doing aerial mapping (with pictures at the end) in this forum thread : http://chdk.setepontos.com/index.php?topic=8984 .   Most of the discussion is about getting the shot rate as fast as possible to provide maximum overlap in images.  Unfortunately, the best way to do this is to lock exposure, zoom, and focus so that the camera can fire at its maximum rate.

Quote
Something that would be nice to add to your script, for this setup, would be to have it turn the camera off after a set number of photos are taken. This would cause the lens to retract and make for safer landings.
Ummm ... you mean by using the existing script parameter settings to define the Total Shots and then selecting the Power off when done? option?   :-[

« Last Edit: 17 / March / 2014, 09:37:38 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #121 on: 17 / March / 2014, 14:00:38 »
There is a discussion about doing aerial mapping (with pictures at the end) in this forum thread : http://chdk.setepontos.com/index.php?topic=8984 .   Most of the discussion is about getting the shot rate as fast as possible to provide maximum overlap in images.  Unfortunately, the best way to do this is to lock exposure, zoom, and focus so that the camera can fire at its maximum rate.
I'm not interested in getting as many shots as quick as possible. I would rather control where the pictures are taken and the quality of the pictures to make the whole system as efficient as possible, including post processing of the photos.

Quote
Ummm ... you mean by using the existing script parameter settings to define the Total Shots and then selecting the Power off when done? option?   :-[


:-[ uhh... yes that's exactly what I was suggesting, so would your script work, as it is, to have the APM trigger the camera and your script control the camera parameters? Would I set the shot interval to 0 so the shots are just triggered by the APM/USB?
« Last Edit: 17 / March / 2014, 14:07:55 by bisenberger »

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #122 on: 17 / March / 2014, 14:05:16 »
We had some snow here yesterday, but it's warming up nicely today. To wet to play outside today though. It is suppose to be nice the rest of the week, so I should be able to do some real testing then. In the meantime, I'll set my rig up inside close to a window to see if can do some testing.

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #123 on: 17 / March / 2014, 18:54:14 »
so would your script work, as it is, to have the APM trigger the camera and your script control the camera parameters? Would I set the shot interval to 0 so the shots are just triggered by the APM/USB?
Maybe.  It will depend on how the APM trigger was configured.  If the trigger turns on the 5V USB signal and leaves it on when pictures are required, the script will happily shoot continuously if the shot interval is set to 0.   

But if the APM simply pulses the USB signal for less that 500 mSec then the script might or might not take a picture after each pulse. And shorter pulse widths will be less likely to succeed.

It would be trivial to modify the script to handle the second scenario.  I would also be easy to trigger a camera shutdown by using a longer pulse,  as suggested in some of the documentation that you linked.
Ported :   A1200    SD940   G10    Powershot N    G16


Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #124 on: 17 / March / 2014, 23:45:24 »
But if the APM simply pulses the USB signal for less that 500 mSec then the script might or might not take a picture after each pulse. And shorter pulse widths will be less likely to succeed.

It would be trivial to modify the script to handle the second scenario.  I would also be easy to trigger a camera shutdown by using a longer pulse,  as suggested in some of the documentation that you linked.

In his tutorial, he sets 4 Camera parameters in the APM:

1) CAM_TRIGG_TYPE - how to trigger the camera to take a picture. Two options; 0=Servo, 1=Relay. In the tutorial he used the value 1 (relay).

2) CAM_DURATION - How long the shutter will be held open in 10ths of a second (i.e. enter 10 for 1second, 50 for 5seconds). Range 0 to 50. In the tutorial he used the value 1 (1/10th of a second).

3) CAM_TRIGG_DIST - Distance in meters between camera triggers. If this value is non-zero then the camera will trigger whenever the GPS position changes by this number of meters regardless of what mode the APM is in. Note that this parameter can also be set in an auto mission using the DO_SET_CAM_TRIGG_DIST command, allowing you to enable/disable the triggering of the camera during the flight. Range: 0 to 1000.

 4) RELAY_PIN - Digital pin number for first relay control. This is the pin used for camera control. In the tutorial he used the value 13. This is the A9 pin on the APM that he plugged the USB cable into.

If I interpret this right, it looks like if you set the distance to 10 meters. Every time the vehicle reaches a 10 meter interval, calculated from GPS readings, a pulse that last 1/10th of a second is sent to the camera USB port via the A9 pin on the APM. If this is correct, could it be made to work as the triggering mechanism with your script?

Here's a link to the page that list the CAM_Parameters for the APM:
http://copter.ardupilot.com/wiki/arducopter-parameters/#CAM__Parameters

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #125 on: 18 / March / 2014, 08:33:30 »
If I interpret this right, it looks like if you set the distance to 10 meters. Every time the vehicle reaches a 10 meter interval, calculated from GPS readings, a pulse that last 1/10th of a second is sent to the camera USB port via the A9 pin on the APM. If this is correct, could it be made to work as the triggering mechanism with your script?
This is very close. 

The current script (for no particular reason) only checks the USB status ever 1/2 second while waiting for it to activate.  If you make a small edit to the script (line484)  you can have it check every 20 mSec (with no ill effect) like this:
Code: [Select]
repeat wait_click(20) until ((get_usb_power(1) == 1) or ( is_key("menu")))Alternatively,  you could change the value of  CAM_DURATION  to 600 and get the same result (albeit with a slightly slower average response speed).

Update : are you planning on a copter or plane approach?  I think I found the source on that site, look at it now. Doesn't look like it supports a "shut down" pulse though
« Last Edit: 18 / March / 2014, 08:53:55 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #126 on: 18 / March / 2014, 12:39:43 »
This is very close. 

The current script (for no particular reason) only checks the USB status ever 1/2 second while waiting for it to activate.  If you make a small edit to the script (line484)  you can have it check every 20 mSec (with no ill effect) like this:
Code: [Select]
repeat wait_click(20) until ((get_usb_power(1) == 1) or ( is_key("menu")))Alternatively,  you could change the value of  CAM_DURATION  to 600 and get the same result (albeit with a slightly slower average response speed).
Cool  8) thanks, I'll take a shot at modifying the script.
Quote
Update : are you planning on a copter or plane approach?  I think I found the source on that site, look at it now. Doesn't look like it supports a "shut down" pulse though
Right now I'm using a copter, but plan on also using a plane down the road. A plane can stay aloft quite a bit longer on the same amount of power. Will your script still shut off the camera after the set number of photos is reached?

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #127 on: 18 / March / 2014, 13:01:15 »
Cool  8) thanks, I'll take a shot at modifying the script.
You also need to make the same change on line 383 of the 1.6 version of the script. Note that the script will wait for the first pulse to actually switch into shooting mode, extend the lens, and set the zoom position.

I'll make the same changes in the next release of the script.

Quote
Right now I'm using a copter, but plan on also using a plane down the road. A plane can stay aloft quite a bit longer on the same amount of power.
The only issue with using a plane then is the speed over the ground. The fastest the script can shoot will vary a bit from camera to camera but you can probably assume 3 seconds per shot for planning purposes.

Quote
Will your script still shut off the camera after the set number of photos is reached?
Depending on how you configure it,  it will either put the camera into playback mode (and thus withdraw the lens) or completely shut the camera down.
« Last Edit: 18 / March / 2014, 13:03:54 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #128 on: 18 / March / 2014, 23:24:18 »
Hopefully the wind will die down soon so I can do a real test.  :)

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #129 on: 22 / March / 2014, 12:03:35 »
Hi,

Thank you for this much improved script.

As much as I like this script, I cannot seem to be able to keep any settings changes...
When I switch the camera off (Canon A2500), all data is back to start...

Thank you
« Last Edit: 22 / March / 2014, 12:07:13 by philgib »

 

Related Topics