supplierdeeply

Provide USB signal when shutter closes

  • 16 Replies
  • 3494 Views
Provide USB signal when shutter closes
« on: 01 / June / 2015, 13:47:22 »
Advertisements
There may already be a way to do this. Powershots are widely used for aerial photography in UAVs. The autopilot typically sends a signal to the camera to take a picture. The autopilot does not know precisely when (or if)  the camera takes the picture. This makes it nearly impossible to accurately geotag the images using flight data from the autopilot. The Autopilot community (Ardupilot) is working on a new feature that allows feedback from hot shoe plates. Using a Powershot flash has been problematic. I've thought about grabbing a signal when the speaker plays the shutter sound, but that's a lot of work. So for the feature - Provide a signal through the USB port when the shutter completes. 

Thanks!

Brian

Re: Provide USB signal when shutter closes
« Reply #1 on: 01 / June / 2015, 13:57:38 »
Powershot cameras function as slaves in the USB master/slave communication protocol.  They cannot originate communications.

Why not just blink one of the camera's LEDs when that actual shot is taken under script control?  Sensing that with a phototransistor stuck in with some putty would be trivially easy.

Incidentally,  the kap_uav.lua script logs the exposure time at the exact moment the shutter opens with a 10 mSec resolution for much the same reason.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Provide USB signal when shutter closes
« Reply #2 on: 02 / June / 2015, 14:20:43 »
The phototransister could work. I like that since no internal modifications need to be made to the camera. I have a PowerShot 115 and Powershot 300. Both have an LED above the Playback button. The LED flashes after each picture, but it's about one second after the shutter sound. Can you force it to flash at shutter close? Thanks for your KAPUAV script! You everybody uses it...

I don't think script log will help. That's precisely when the picture was taken according to the camera clock - which is not synced to the UAV GPS clock. I don't know of any way to sync them. If I had an accurate time offset I could definitely use the log, or the picture time stamp. But that's the problem. I don't know the time difference.

Brian

*

Offline reyalp

  • ******
  • 11496
Re: Provide USB signal when shutter closes
« Reply #3 on: 02 / June / 2015, 16:13:56 »
I don't think script log will help. That's precisely when the picture was taken according to the camera clock - which is not synced to the UAV GPS clock. I don't know of any way to sync them. If I had an accurate time offset I could definitely use the log, or the picture time stamp. But that's the problem. I don't know the time difference.
If you are using a script, you could easily log the time of a USB power pulse with ~10ms precision. Your script could just wait for the first USB pulse on startup, log the time, and then go to it's main shooting loop or exit if you are using the remote to shoot without any script. As long as your flight computer also logs time it sent the pulse, you'd have the offset.

Alternatively, if you use the synced remote code you could control the exposure start time directly from the flight computer with sub ~several ms precision.
« Last Edit: 02 / June / 2015, 16:42:00 by reyalp »
Don't forget what the H stands for.


Re: Provide USB signal when shutter closes
« Reply #4 on: 02 / June / 2015, 16:38:12 »
The LED flashes after each picture, but it's about one second after the shutter sound. Can you force it to flash at shutter close?
Yes - using the shooting hooks it would be very easy to do this from a script.  Shutter open is easier than shutter close though.

If you are using a script, you could easily log the time of a USB power pulse with ~10ms precision. Your script could just wait for the first USB pulse on startup, log the time, and then go to it's main shooting loop or exit if you are using the remote to shoot without any script. As long as your flight computer also logs time it sent the pulse, you'd have the offset.
The kap_uav.lua script already includes a "wait for USB remote to go active before shooting" mode.  It should be trivial to also log the event with a precision time stamp.   I'll add it to the next release.

Quote
Alternatively, if you use the synced remote code you could control the exposure start time directly from the flight computer with sub ms precision.
"sub ms" ?  Most USB remote precision sync timing is close to sub-millisecond between two identical cameras triggered at the same time.  But the actual time from trigger signal to exposure completion is a lot longer.  You could probably calibrate that delay time though.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Provide USB signal when shutter closes
« Reply #5 on: 02 / June / 2015, 17:19:16 »
LED flash on shutter open should be fantastic. The future Ardupilot will support camera feedback so the UAV location and shutter open time can all be stored in the autopilot logs. This should make it very easy to precisely geotag images - which is not available now.

Please let me know if I can test.

Thanks!

Brian
« Last Edit: 02 / June / 2015, 17:42:57 by bchristal »

Re: Provide USB signal when shutter closes
« Reply #6 on: 02 / June / 2015, 19:01:52 »
LED flash on shutter open should be fantastic. The future Ardupilot will support camera feedback so the UAV location and shutter open time can all be stored in the autopilot logs. This should make it very easy to precisely geotag images - which is not available now. Please let me know if I can test.
Here you go - a beta test version of the next release :  kap_uav.lua v3.6 beta1

There is an additional parameter in the script setup that let's you pick which LED will flash.  Unfortunately,  using set_led( ) in a CHDK script is just an amazing mess. There is no standardization of which LED# does what so you just have to guess via trial and error what number corresponds to what LED for your particular camera (or read the source code for the port for you camera and hope the person doing the port added useful comments).
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Provide USB signal when shutter closes
« Reply #7 on: 02 / June / 2015, 19:46:54 »
Thanks so much!

Settings
Powershot 115
Shot timer set to 5 seconds
All other KAP settings set to default except Shot Sync LED

I went through all 15 of the Shot Sync LED setting. They all seem to behave the same - except Off.

Mode 1-15
LED flashed exactly synced with the shutter sound - Good!
One extra flash between pictures in auto mode, 2 extra flashes in Camera mode.

Mode Off
No LED flash at camera shutter sound
One extra flash between pictures in auto mode, 2 extra flashes in Camera mode.

Can you disable the extra flashes?

Thanks!!!

Brian





Re: Provide USB signal when shutter closes
« Reply #8 on: 02 / June / 2015, 21:06:27 »
Mode 1-15
The numbers actually go from 0-15.   And looking at the lib.c code for the ixus115_elph100hs I can see that it only handles two LED's. A zero setting is for the first output and 1-15 are all treated as the other.   I suspect zero probably causes the focus assist lamp to illuminate and the others cause the little LED on the back of the camera to light up?

(In case you were actually referring to the ixus132_elph115,  that also only has two LED outputs, but the one that illuminates depends on whether the LED number you use is even or odd).

Quote
Mode Off.  No LED flash at camera shutter sound One extra flash between pictures in auto mode, 2 extra flashes in Camera mode. Can you disable the extra flashes?
I don't think that will be possible with out a whole lot of detailed hacking at the assembly level and a custom build for your camera.  Sorry.

However, the script could be changed to turn on the LED but not turn it off.  So in Auto mode, the extra flash would not be visible as I suspect it would be turning on an LED that is already on and then turning it off.
« Last Edit: 02 / June / 2015, 21:09:39 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 11496
Re: Provide USB signal when shutter closes
« Reply #9 on: 02 / June / 2015, 22:56:28 »
The AF assist lamp might be a good option. The UAV presumably has no use for actual AF assist, and it can (usually?) be turned off in the canon firmware, so it should only blink under CHDK control.
Don't forget what the H stands for.

 

Related Topics