Multi-camera setup project. - page 7 - Creative Uses of CHDK - CHDK Forum

Multi-camera setup project.

  • 462 Replies
  • 211767 Views
*

Offline reyalp

  • ******
  • 14125
Re: Multi-camera setup project.
« Reply #60 on: 14 / July / 2014, 22:33:02 »
Advertisements
P.S. : Did some testing without syncing on the cameras.They were rather synced all of them.As much as i can tell from my lame online-testing method.
How are you shooting for these shots? Specific sequence of function calls.
Quote
But i believe 64 without syncing will be a bit mess at the best.
Each command is just sent sequentially to each cam, so if you aren't using sync, 4ms per cam  there would be a minimum 1/4 second between the first and last cam.

Quote
So syncing process must be sorted out to be fast and accurate as much as it can be done.
If you always get approximately the same sync values for all the cams, then we can just use a fixed value.

It may be possible to speed the sync process up. It users 10 iterations because that was a number I picked off the top of my head, and the 10 iterations of _check are probably not needed in routine use.

I need to spend some time looking at this code, I've kind of forgotten how it works (assuming it actually works  :-[)
Don't forget what the H stands for.

Re: Multi-camera setup project.
« Reply #61 on: 14 / July / 2014, 22:59:26 »
What you are describing here is a simple exercise in Ohm's law where you have multiple power sources.  If the DC side of the power sources all use a common (low resistance) grounding point there is no issue.  That simply comes down to a large enough conductor and good bonding to minimize  "Electrical Length".

Attached Multi-Camera_Array_Concept [-Rats].png

Shows how to "...good bonding to minimize  "Electrical Length"..."

Edit #1

This Also, as compared to the "Rats Nest" method, minimizes  "Electrical Length"
because the cameras Grounds are in parallel rather than in series.

However the cheap power adapters are still able to generate currents spikes
because they most probably use cheap [i.e. no components] to filter these current spikes.

* The Canon Battery management system works with cheap power adapters.
* The cheap power adapters probably have much higher internal resistance.

H-H
« Last Edit: 15 / July / 2014, 01:10:16 by Hardware_Hacker »

*

Offline reyalp

  • ******
  • 14125
Re: Multi-camera setup project.
« Reply #62 on: 15 / July / 2014, 01:15:24 »
In chdkptp changeset 610 I made some changes which speed up the sync process a lot.

I removed the check phase since it basically didn't do anything. It can still be run manually using check_sync_single(mc.cams[camera number])

I also removed some unneeded delay from init_sync, and changed the statistics to include min, max and standard deviation. You can also pass in the number of iterations, like mc:init_sync(5). In general, I don't think a lot of iterations is going to be helpful, although there are occasional outliers in send time which could throw things off if you got unlucky. You do need to run at least one to establish the clock offsets.
Don't forget what the H stands for.

*

Offline mphx

  • ***
  • 210
Re: Multi-camera setup project.
« Reply #63 on: 15 / July / 2014, 10:18:48 »
In chdkptp changeset 610 I made some changes which speed up the sync process a lot.

I removed the check phase since it basically didn't do anything. It can still be run manually using check_sync_single(mc.cams[camera number])

I also removed some unneeded delay from init_sync, and changed the statistics to include min, max and standard deviation. You can also pass in the number of iterations, like mc:init_sync(5). In general, I don't think a lot of iterations is going to be helpful, although there are occasional outliers in send time which could throw things off if you got unlucky. You do need to run at least one to establish the clock offsets.

Do i grab multicam.lua from https://www.assembla.com/code/chdkptp/subversion/nodes/610/trunk/lua
or do i wait for some new windows binary at some point? :)
NOTE: I see util.lua has same description with multicam.lua , is it needed too?


Sync-less shooting was done simply by issuing

1.connect/start
2.preshoot + shoot
(multicam commands)

Result was pretty synced ...we are talking about 8 cameras , 20-30cm usb cables , 2x 4port powered usb hubs.
I dont know if the result would be synced in larger scale ...

EDIT :

Did some syncing with the new multicam.lua.Check screenshot..i think something isn't working right.

Did twice , once init_sync(5) , once init_sync(). Same end result (minimum sync delay 0) and same warnings.

https://www.dropbox.com/s/t9j2yfyzaq2kawj/newsync.JPG

EDIT no2 :

All ok now.Util.lua was needed after all :)
Did some tests.. sync takes 3secs for 8cameras..big improvement..Result is all images perfectly synced.Atleast with my lame sync testing.
« Last Edit: 15 / July / 2014, 11:06:35 by mphx »

*

Offline reyalp

  • ******
  • 14125
Re: Multi-camera setup project.
« Reply #64 on: 15 / July / 2014, 22:34:29 »
Do i grab multicam.lua from https://www.assembla.com/code/chdkptp/subversion/nodes/610/trunk/lua
or do i wait for some new windows binary at some point? :)
You should make sure all the lua files you use are from the same version. You can get a zip of all the files using the download button on the link you quoted.

Alternately, you can use svn and check out http://subversion.assembla.com/svn/chdkptp/trunk/lua/

This also makes it easy to switch back to an older version, and to deal with any local modifications. If you are using windows, tortoisesvn is a good svn client.
Don't forget what the H stands for.

*

Offline mphx

  • ***
  • 210
Re: Multi-camera setup project.
« Reply #65 on: 16 / July / 2014, 04:48:45 »

You should make sure all the lua files you use are from the same version. You can get a zip of all the files using the download button on the link you quoted.

Alternately, you can use svn and check out http://subversion.assembla.com/svn/chdkptp/trunk/lua/

This also makes it easy to switch back to an older version, and to deal with any local modifications. If you are using windows, tortoisesvn is a good svn client.

Ok , i hope i wont mess anything up. I downloaded tortoisesvn , right click on my lua folder , svn checkout , put remote url on the box , clicked ok , updated my files to revision 610 (didn't touch my custom lua files , and everything working ok as i can tell).
Now i have 2 different choices when i right click the folder. SVN update , SVN commit.
I think i MUST NOT , touch the second one right ? :)

I will "play" with "SVN update" when i know/think that some new versions are upoloaded by you , am i right?

Just asking in order not to mess anything up .

Re: Multi-camera setup project.
« Reply #66 on: 16 / July / 2014, 07:48:00 »
Now i have 2 different choices when i right click the folder. SVN update , SVN commit.
I think i MUST NOT , touch the second one right ? :)
Unless you have commit access to the repository, it won't make any difference what you do with the "second one".
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline mphx

  • ***
  • 210
Re: Multi-camera setup project.
« Reply #67 on: 16 / July / 2014, 09:06:37 »
Unless you have commit access to the repository, it won't make any difference what you do with the "second one".

Yes , it makes sense.Otherwise it would be a chaos in the repository :)

*

Offline mphx

  • ***
  • 210
Re: Multi-camera setup project.
« Reply #68 on: 16 / July / 2014, 12:52:40 »
Ok , next subject in the project :)

Focus and zoom setup.

I tried to play a bit with commands for setting up zoom and focus (set_aflock,set_focus,get_focus,get_zoom,set_zoom etc)

Things that i want to do.

1.Set focus on multiple cameras at once.I have made it work with one camera.Tried to connect 2 cameras and play with set_aflock and set_focus and only one camera was affected.
2.Get current focus.I mean camera gets an initial focus with set_aflock(1).Before i start issuing new focus distances , i want to see whats the current focus distance.
3.get_zoom , set_zoom didn't seem to work for me , even with one camera.Do i miss something in the syntax of the command?Do i need to do something else prior of it?

Thanks.


EDIT : Number #1 solved.
Number #3 solved (thanx to a thread of waterwingz.set_aflock() needed before any zoom related commands)
« Last Edit: 17 / July / 2014, 03:58:32 by mphx »

*

Offline reyalp

  • ******
  • 14125
Re: Multi-camera setup project.
« Reply #69 on: 17 / July / 2014, 00:07:48 »
1.Set focus on multiple cameras at once.I have made it work with one camera.Tried to connect 2 cameras and play with set_aflock and set_focus and only one camera was affected.
How are you trying to do this?

With multicam, you can execute arbitrary lua code on all cameras by using
!mc:cmd('call ... your lua code')
If you want to see the status (including return values of your code) you can do
!return mc:cmdwait('call ...')

Note that errors in your code will cause the camera side multicam script to exit, so you would need to use mc:start() again if that happens. You use pcall instead of call to catch errors, but it cannot be use the CHDK functions that yield, meaning things like shooting, waiting for key presses, sleep etc.

Before r611 (which I just checked in, use svn update to get it) mc:cmdwait would by default pick up messages left around by previous calls to mc:cmd.  Now both cmd and cmdwait will discard any existing messages before running their code.

If you find yourself using large amounts of code with call, you might want to create a new command. You can do this by adding to the rlib code at the bottom of multicam.lua, or do it on the fly.

e.g.
Code: [Select]
!return mc:cmdwait('call function cmds.foo() print(mc.args) end')
creates a new command names foo, where mc:cmd("foo hello world") will print hello world on the camera screen.
Quote
2.Get current focus.I mean camera gets an initial focus with set_aflock(1).Before i start issuing new focus distances , i want to see whats the current focus distance.
Do you expect to do this across all the cameras, or one camera at a time? Are you trying to return the focus distance value?

Quote
3.get_zoom , set_zoom didn't seem to work for me , even with one camera.Do i miss something in the syntax of the command?Do i need to do something else prior of it?
You must be in record mode for these to take effect, other than that there should be nothing special. Examples of the actual code you are using would be helpful.

Quote
EDIT : Number #1 solved.
Number #2 solved (thanx to a thread of waterwingz.set_aflock() needed before any zoom related commands)
You should not need af_lock before setting zoom (in fact, zooming with aflock set may cause problems), do you mean focus related commands?
Don't forget what the H stands for.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal