usb remote quick response - page 2 - General Help and Assistance on using CHDK stable releases - CHDK Forum

usb remote quick response

  • 22 Replies
  • 8166 Views
*

Offline srsa_4c

  • ******
  • 4451
Re: usb remote quick response
« Reply #10 on: 24 / May / 2015, 07:49:57 »
Advertisements
How is the camera waiting for that trigger? Is live view activated or is it switched off (by the DISP button)?
If live view is not 'on', the camera has to do these when it gets the trigger:
- switch on the CCD (and image processing) in live view mode
- calculate some exposure related stuff, including white balance (!)
- after those mandatory calculations are done, it goes on to take the picture
Try setting white balance to 'custom' (all other settings require white balance calculation) and leave live view on.

*

Offline ozcar

  • *
  • 13
Re: usb remote quick response
« Reply #11 on: 25 / May / 2015, 08:54:44 »
I was turning the display off because I did not want the light from it to deter the potential subjects. I hope that is what you mean by "live view". In any event, the camera was turning the display off after a while anyway, and I have to override that with CHDK to get it to stay on. If I have to leave the display on I will have to stick some sort of cover over it, but I can do that.

I have done a couple of quick tests based on your suggestions.

Camera had been waiting for the trigger for around 11 hours. Before triggering it, I turned the display back on and the response time was 3900ms. Having done that, I don't know if the response . would have been slower if I had left the display off, but 3900ms is in the sort of range I have been seeing - I have seen 4718ms when the camera had been waiting for 24 hours.

I then triggered the camera a few times. This was without leaving it waiting for an extended period of time (and for which I was getting responses of around 2200ms before with the display off). I got a response of around 1350ms, so it looks like leaving the display on does help. It probably also explains some of the variability in the results I got previously, where I did see responses of around 1350ms, it is quite possible that I had left the display on while I was testing, without realising that could make a difference.

So far, so good. I then set the white balance to custom, and tried triggering it again without leaving it waiting for a long time. (Camera is set on "P", manual focus set). Three times I tried to trigger it, and three times it failed to take the shot. It was reacting in the same way as when I had set the camera to "M" and set the aperture, shutter speed, and flash power: the camera does react, the auto focus assist light comes on briefly twice, and there is a tiny mechanical sound, but the flash does not go off, and no pictures were taken. I get the impression it is trying to tell me something, but I don't know what it means.

I set the white balance back to auto, and could trigger it again. So I tried setting it back to custom and tried again. First time, same double blink of the auto focus assist light, no picture. Second time, and wow it took a shot - response 1304ms. I have no idea why it started working now. Triggered it two more times, responses 1345ms and 1346ms, so, if does not seem changing the white balance to custom makes much of a difference.

I still seem to get the effect that the longer the camera has been waiting, the longer the rseponse time becomes - I got responses of 1839ms and 1739ms when it had been waiting for several minutes. I will leave it for a longer time and see what I get.

In summary, what I have seen so far is that leaving the display on does help, but setting the white balance to custom did not make much of a difference. Setting the white balance to custom may also have induced a re-occurrence of the problem where the camera fails to take a shot when triggered, but the local jury is still out on that.

*

Offline srsa_4c

  • ******
  • 4451
Re: usb remote quick response
« Reply #12 on: 25 / May / 2015, 17:03:48 »
I hope that is what you mean by "live view".
Yes.
It should be possible to switch off the backlight (but that requires scripting).
Thanks for the white balance trick related results (it was just a new idea and my guess was apparently wrong).
I had set the camera to "M" and set the aperture, shutter speed, and flash power: the camera does react, the auto focus assist light comes on briefly twice, and there is a tiny mechanical sound, but the flash does not go off, and no pictures were taken. I get the impression it is trying to tell me something, but I don't know what it means.
I think the camera doesn't always notice the simulated 'full press' on the shutter.
Perhaps increasing CAM_KEY_PRESS_DELAY in platform_camera.h could be worth a try? The other possibility is a script, as it was already mentioned.

*

Offline ozcar

  • *
  • 13
Re: usb remote quick response
« Reply #13 on: 27 / May / 2015, 01:24:44 »
Increasing CAM_KEY_PRESS_DELAY might be worth trying, but I will have to put that in the "later" basket at this point in time.

Some more results:

I tried the same set-up but using an A720 IS instead of the A530.

This other camera reacted in more-or-less the same way. The only difference was that when I set the camera to "M", I did not get any problem with it refusing to take a shot when triggered. So, I was able to test with the focus, ISO, shutter speed, aperture, and flash power manually set. I was getting response times of around 1680-1850ms with the display on, and up to 2600ms with the display off. Like with the A530, the response time also increases the longer it has been waiting - it was over 3 seconds after 30 minutes of waiting.

I swapped back to using the A530, and tried a *very* basic script:

Code: [Select]
rem chdk 27/05/2015, 1st attempt
@title usb remote trigger

:again
 
  press "shoot_half"

  do
    P=get_usb_power
   until P>0
 
  click "shoot_full"
  print "click"
  release "shoot_half"

goto "again"

Beginners luck - it worked!

Response is the best I have seen so far - in the range 965 - 1100ms. That is not spectacularly fast, but my initial tests now show that unlike with any of my previous attempts, the response time did not increase the longer the camera had been waiting. I left it waiting for 30 minutes and the response was 967ms, which is a big improvement over what I was getting before.

One unexpected, or unanticipated effect is that the focus assist light comes on and stays on. I know I am holding it half-pressed but I was sort-of expecting that the light would go out after the camera had done whatever it needs to. I am left wondering if there is a "put that b***** light out!" command, and if there is, whether it would be advisable to use it.

*

Offline reyalp

  • ******
  • 14125
Re: usb remote quick response
« Reply #14 on: 27 / May / 2015, 01:38:14 »
One unexpected, or unanticipated effect is that the focus assist light comes on and stays on. I know I am holding it half-pressed but I was sort-of expecting that the light would go out after the camera had done whatever it needs to. I am left wondering if there is a "put that b***** light out!" command, and if there is, whether it would be advisable to use it.
If you are setting focus manually, you may be able to just turn it off in the canon settings.

You should be able to turn the AF LED off using the set_led function. What set_led number controls a given LED is camera dependent. I think it should be 9 on this cam, but may be wrong.

Note that you don't have to release shoot_half between shots if you are holding down half press all the time. You should be able to do something like
Code: [Select]
press "shoot_half"
:again
  do
    P=get_usb_power
   until P>0
 
  click "shoot_full_only"
  print "click"
goto "again"
release "shoot_half"
The note the shoot_full_only instead of shoot_full. This is required because shoot_full implicitly includes shoot_half.
Don't forget what the H stands for.

*

Offline ozcar

  • *
  • 13
Re: usb remote quick response
« Reply #15 on: 27 / May / 2015, 03:22:58 »
Thanks for your response.

I have been setting the focus manually (if I can persuade it to respond quickly enough, then I know pretty well how far away the subject is).

I tried before, and again now, to stop the AF light from coming on by setting "AF assist Beam" to off in the Canon settings, but for some reason that is not working for me. However, set_led 9 0 in the script has done the trick.

I changed the shoot_full to shoot_full_only and it is still working but that did not make any noticeable difference to the response time. The release/press shoot_half is still in the loop at this stage as I did not want to change too much at the same time. Taking that out might get it around the whole cycle a bit faster, but that is not a big issue to me - it is the time from the USB trigger to the shot taken that I am trying to speed up.

At this stage it looks like I have got it down to around one second, while before it was getting close to five seconds after the camera had been waiting a long time for the trigger.

*

Offline ozcar

  • *
  • 13
Re: usb remote quick response
« Reply #16 on: 28 / May / 2015, 06:36:36 »
Just a further update:

Initially I was triggering the camera with a 100ms pulse on the USB power line. When I set the camera to "M" and encountered the problem where the camera refused to take a shot when I tried to trigger it, I increased the length of the trigger pulse to 750ms. This did not solve that problem, but I had left the pulse at 750ms.

So when I got the above results of a response time of around 1 second when using the script, this was still with the 750ms trigger pulse. What I have found is that, at least when using the script, it seems the camera is not getting triggered at the start of my pulse, but perhaps at the end. I set the USB trigger pulse back to 100ms, and I am now getting response times in the range 310-330ms, but a few times it was up over 400ms. I don't at this point know what is causing the variability, but overall  it is much better than I had initially.

I could perhaps try cutting the USB trigger pulse time down even more, but at this stage I don't think I will push my luck.

Re: usb remote quick response
« Reply #17 on: 28 / May / 2015, 08:33:24 »
What I have found is that, at least when using the script, it seems the camera is not getting triggered at the start of my pulse, but perhaps at the end.
This is because of the way you are using the get_usb_power function.   When you call it with no additional parameter, the uBASIC interpreter assumes you meant to pass it a zero.  That tells the function to return the width of the current pulse, which it can only do after the pulse has completed.

Documentation of that function is here :  get_usb_power()

Try using :
Code: [Select]
P=get_usb_power 1
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline ozcar

  • *
  • 13
Re: usb remote quick response
« Reply #18 on: 28 / May / 2015, 23:58:32 »
Thanks for that. It shows that you should always read the fine print, or even the not-so-fine print. With that change, it also means that the script works without needing to enable USB remote mode in the chdk menus.

With that change, I got response times from 203-245ms.

It is time for me to set the camera up again outside and wait for some real action.

usb remote quick response
« Reply #19 on: 29 / May / 2015, 00:29:33 »
With that change, I got response times from 203-245ms. It is time for me to set the camera up again outside and wait for some real action.
If the critters in your backyard that trigger your IR detector can move out of the picture in less than 245 ms then I would suggest you go outside very heavily armed.  8)

it also means that the script works without needing to enable USB remote mode in the chdk menus.
IIRC, at the time I did the USB remote v2 code,  the need to have the USB remote sometimes enabled in the CHDK menus was left that way for compatibility reasons.  In hind sight, I'm not sure there was really anything to be compatible with.  I now feel that scripted USB remote actions should really not depend on CHDK User menu settings.
« Last Edit: 29 / May / 2015, 00:44:27 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics


SimplePortal © 2008-2014, SimplePortal