Faster Sync Triggering?

  • 68 Replies
  • 8962 Views
Faster Sync Triggering?
« on: 31 / January / 2015, 15:03:34 »
Advertisements
Hi all,

I was hoping someone would have some advice on increasing the rate at which I can acquire sync’d imagery from multiple cameras for a 360degree type of rig.  I want the cameras to be sync’d as accurately as possible so fast moving subjects are acquired at the same time.

With my current setup, I am able to reliably achieve a sync’d image every 4 seconds (0.25Hz).  Any faster, and occasionally a camera will take slightly longer than the rest between images, and will either miss a trigger or fire out of sync.  I was hoping to get closer to 1fps, and I understand that faster than that isn’t feasible.  Below are details on my current setup:

4 x Canon Elph 115IS cameras running CHDK 1.4.0, FW 100b

Enable Remote [on]
Switch Type [CA-1]
Control Mode [Normal]
Enable Sync [on]

iso: 100
TV: 1/800

SanDisk 32Gb, Class 10, 30MB/s

USB triggering via Arduino Loop (results in a triggering every 4 seconds)
Half Press; delay(1000);Full Press; delay(50);Release Press;delay(2680)

For my use, I don’t need the camera to autofocus, or adjust any of the shooting parameters during the shooting sequence.  Currently, it seems like a decent amount of time is spent autofocusing and adjusting those parameters between images, despite the fact that I have tried to set all the parameters as fixed.  One thing I have tried is to do the half press only once and then continually perform full presses, but it seems that a half press is required before each full press. Ideally I’d set the cameras in continuous mode, but after reading the forums it seems that syncing and continuous mode are independent of each other.

Any ideas I could try?  Is there a different camera model that I should try instead?

Thanks!

Re: Faster Sync Triggering?
« Reply #1 on: 31 / January / 2015, 15:52:49 »
Off the top of my head,  you could speed things up a lot using a script rather than the built-in USB functionality.

Leave the remote enabled but set the Switch Type and Control Mode to [ None ].   Set Enable Sync to [ On ].

In your script,   issue a press("shoot_half") and leave it pressed.  Pause for two or three seconds to let the cameras adjust exposure and focus.

Then poll the USB port to see when the Arduino assert 5V on the USB port.  Issue a press("shoot_full_only") at that point.  Shooting will start and then halt (for all cameras) at the "sync" point in the code, where they will wait for the Arduino to remove the 5V.  You can have it do that after a few hundred milliseconds.

You can then experiment with shorter delays for subsequent shots.    I would expect you to get reliable operation down to about 1.5 seonds per shot or so.

Of course if you want to get really fancy and fast,  using the focus lamp from one camera to trigger a "one shot" that in turn triggers all the cameras would let you go even faster as you could compensate for the time required to write to the SD card.  The Arduino has no way to do that - although you could have one camera flash the focus lamp when it has finished writing and have the Arduino monitor that.

Let me know if you need help with the script.


Edit : congratulations on actually implementing the CA-1 protocol on your Arduino!  You won't need it if you use my scripting suggestion though.
« Last Edit: 31 / January / 2015, 16:00:02 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Faster Sync Triggering?
« Reply #2 on: 31 / January / 2015, 17:59:04 »
Thanks waterwingz!

Awesome, that sounds promising I'll give it a try!  I haven't written any CHDK scripts yet, but have done some programming before so I will give it a go.  I'll let you know if I hit a roadblock.

Cool idea about the arduino monitoring the focus light.  I have a couple of photoresistors laying around which might be perfect for that.

Re: Faster Sync Triggering?
« Reply #3 on: 31 / January / 2015, 18:18:16 »
Awesome, that sounds promising I'll give it a try!  I haven't written any CHDK scripts yet, but have done some programming before so I will give it a go.  I'll let you know if I hit a roadblock.
This might give you a start :  http://chdk.wikia.com/wiki/Fast_Shooter_Intervalometer

Usually easier to edit that create from scratch.
Ported :   A1200    SD940   G10    Powershot N    G16


Re: Faster Sync Triggering?
« Reply #4 on: 01 / February / 2015, 15:55:30 »
Thanks for the starting point.  It made it very easy to modify it.  I think I implemented the polling of the USB port correctly, but it seems like the "sync" mode isn't working as I would like it to. 

I set the camera to: Enable remote [on], Switch Type [none], control mode [none], enable sync [on]

I then loaded and ran the script (see below).  On the arduino, I set the voltage to 5V for 1000ms, then back to ground for 2000ms ( I wanted to get it running with a slower frame rate first).  Unfortunately, the camera takes a picture immediately when press("shoot_full_only") is called, and does not wait for the USB voltage to drop to ground.  Below is the code that I am using.  Do I need to add "sync" code in there to tell the camera to wait for the arduino to remove the 5V, or should that all be happening in the background?  Any ideas?

Thanks!

Code: [Select]
--[[
@title Fast Sync
@param n number of shots
@default n 50
@param d start delay seconds
@default d 1
--]]
 
set_console_layout(10, 0, 40, 14)
print("Fast Sync Started...")
 
-- programmable delay to let you get in the picture too
sleep(d)
 
-- lock in the exposure and focus
press("shoot_half")
repeat
    sleep(50)
until get_shooting() == true
set_aflock(1)
 
 set_config_value(121,1) -- make sure USB remote is enabled
 
-- fire away as fast as possible
for i=1, n, 1 do
   ecnt=get_exp_count()
   repeat
      sleep(10)
   until get_usb_power(1) == 1
   press("shoot_full_only")
    repeat
      sleep(20)
    until(get_exp_count()~=ecnt)
   release("shoot_full_only")
end
 
-- done
set_aflock(0)
print("...done")

Re: Faster Sync Triggering?
« Reply #5 on: 01 / February / 2015, 16:56:36 »
Sorry - just rechecked the USB remote source as something was bothering me.   Sure enough,  this is not going to work the way I had hoped as the sync function is not enabled when shots are taken via a script (or the shutter button).

There is a way around this - the script force_usb_state( ) function - which is intended to allow simultaneous use of USB sync and PTP communications but should also do what you need.

Unfortunately, this is only enabled in a few cameras - not including yours at the moment.  Enabling it for your camera is trivial - if you test and report it working we can have it added to the autobuild permanently too.

Edit :   unless you get fancy with the focus assist LED trick,  this whole thing is basically open loop so you could go back to just using the standard built-in USB remote shooting with sync enabled,  but with AFL and AEL lock enabled to cut the cycle time to a minimum.  That's all the script is getting you anyway. You could even do that from a "startup script" that runs when the camera starts to make it easy to set that up on all your cameras.

 I think you tried to do this using the Ricoh CA-1 to do a half press and hold but I don't thing the CHDK code responded the way you were expecting.   I guess I should look at enabling that - or maybe let the "two press" mode cycle "shoot_full_only"' commands if the second press is short and repeats quickly enough.

« Last Edit: 01 / February / 2015, 17:23:15 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Faster Sync Triggering?
« Reply #6 on: 02 / February / 2015, 12:53:01 »
Here are some rough estimates for time between shots that I've been able to get with each of these methods.

1) Original Setup: ~4 seconds between shots
Enable Remote[On]
Switch Type [OnePush]
Control Mode [Normal]
Enable Sync [on]
AFL Lock [disabled]
AEL Lock [disabled]

2) AFL and AEL Locked: ~2.5 seconds between shots
Enable Remote[On]
Switch Type [OnePush]
Control Mode [Normal]
Enable Sync [on]
AFL Lock [enabled]
AEL Lock [enabled]

3) AFL and AEL Locked, and USB polling in script mode ~2 seconds between shots
*This isn't "sync'd", as it's not triggered by the falling pulse, the cameras are triggered by the while loop monitoring the USB pulse.

It seems that the cycle time difference for holding half_press and then calling sequential full_press_only commands vs sequential full_press commands with AFL and AEL locked, is ~0.5 seconds (maybe a bit less)

I'd be happy to try to enable force_usb_state() if you think that could help.

Alternatively, It seems that having "two-press" mode cycle sequential "shoot_full_only" commands, as you described, might work as well.

*

Offline reyalp

  • ******
  • 11514
Re: Faster Sync Triggering?
« Reply #7 on: 02 / February / 2015, 16:04:46 »
Just my two cents, but it seems like "hold half press and do synced full presses" is a use case that should be supported, as is starting a shot in script and have the actual exposure timing controlled by the remote also seems worthwhile, and shouldn't need to depend on force_usb_state().

FWIW, you could do the second one with the shutter script hook and polling USB from script, but it would introduce several tens of ms variability.
Don't forget what the H stands for.


Re: Faster Sync Triggering?
« Reply #8 on: 02 / February / 2015, 19:34:22 »
Just my two cents, but it seems like "hold half press and do synced full presses" is a use case that should be supported,
I'm not completely sure of the best way to do this with the standard "pushbutton" USB remote circuit we use.   Here are some options :

  • Long press (>2 seconds) for shoot_half,  short presses (<1 second) for repeating shoot_full_only, and then either a time out ( 10 seconds of no activity ) or cancel via another long press? 
  • A pulse counting input like the current Zoom Control Mode with  3 pulses=shoot_half,  2 pulses=cancel,  1 pulses=shoot_full_only ?
  • If we assume this will be mostly used with a uController,  then a PWM input would work. For example  50 msec=shoot_half,  100 msec=cancel,  20 mSec=shoot_full_only.
  • Finally,  the CA-1 input module could probably be modified to use the CA-1 pulse sequences  for half/full/release and still be compatible with the actual CA-1 (albeit not in a manner any CA-1 can generate).  This would allow a uController to hold half press and shoot with full presses only.

Options 1 & 2 would work with a simple USB remote switch or uController.  Options 3&4 would need a uController.

Quote
as is starting a shot in script and have the actual exposure timing controlled by the remote also seems worthwhile, and shouldn't need to depend on force_usb_state().

I can see a way to clean the current code up a bit and make this work if we add a script function to enable the sync trap for the next shot.  Something like 
Code: [Select]
activate_sync(0/1)
shoot()
where 1 = activate and 0 = cancel activation.
« Last Edit: 02 / February / 2015, 20:03:24 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 11514
Re: Faster Sync Triggering?
« Reply #9 on: 03 / February / 2015, 01:15:03 »
Options 1 & 2 would work with a simple USB remote switch or uController.  Options 3&4 would need a uController.
My inclination (as someone who doesn't actually use this remote stuff ;)) is toward #2. It seems straightforward, and reasonably easy to use manually or from a uc, and doesn't impose long delays. Working the same way as the existing zoom mode is nice too.

Do you envision these as syncable? Since you can't actually cancel after shoot full, I guess sync mode could treat any pulse after the shoot full as the sync signal.

Quote
I can see a way to clean the current code up a bit and make this work if we add a script function to enable the sync trap for the next shot.  Something like 
Code: [Select]
activate_sync(0/1)
shoot()
where 1 = activate and 0 = cancel activation.
That seems useful and straightforward to me. With this there would be less need for a non-script control mode.
Don't forget what the H stands for.

 

Related Topics