Synchronising two S110's via the AF lamp - page 4 - General Discussion and Assistance - CHDK Forum  

Synchronising two S110's via the AF lamp

  • 54 Replies
  • 16503 Views
Re: Synchronising two S110's via the AF lamp
« Reply #30 on: 05 / April / 2014, 12:25:43 »
Advertisements
Hi Recyclojunk64,

thanks for making it more clear to me.

Quote
2. It's more versatile: with this setup, when you change a value on the master camera, such as exposure and ISO ect. , it will be synced with slave (either immediately or just before shooting, not sure yet) ...

Do I understand you right that you want to use the master's AF LED not only to trigger the shutter but furthermore send the configuration (shutter time, aperture, etc.) of the master cam to the slave cam?

If yes what transmission protocol you will use to transfer the data from the master to the slave via AF LED?

Quote
... Canon put a lot of R&D into the camera button layouts, ...

What is R&D please?

Quote
...and to recreate a layout of easy-to-access buttons and spin-dials might take a bit of work (but still a great idea if you have the time of course). I found shooting with the camera's own shutter button ...

Sorry I don't understand this - Can you explain? Do you want to recreate the buttons and spin-dials on the cam's menu or what? What has it to do with the AF remote function?




2 x IXUS 860IS 100c
2 x Powershot S110 103a

Re: Synchronising two S110's via the AF lamp
« Reply #31 on: 05 / April / 2014, 20:35:18 »
What is R&D please?

Research and development.

(It is not a good idea to use such abbreviations on an International group.)

Re: Synchronising two S110's via the AF lamp
« Reply #32 on: 05 / April / 2014, 21:49:28 »
Quote
Do I understand you right that you want to use the master's AF LED not only to trigger the shutter but furthermore send the configuration (shutter time, aperture, etc.) of the master cam to the slave cam?
Correct

Quote
If yes what transmission protocol you will use to transfer the data from the master to the slave via AF LED?

Not completely sure yet, I'm thinking a 32-bit packet with focus (16 bits) and other 16 bits will be everything else. I do know some cameras have less than 16 bits of focus precision. For the actual transmitting part, I'm thinking a long pulse represents 1 and a short pulse represents 0. Probably something like this:
// *_____                ____  __      __  __  __      __  __      __  _____*_____             ______________*
//       ________________    __  ______  __  __  ______  __  ______  __           ______*______
//       start indicator     0     1      continued for 16/32 bits        wait      full-press    sync photo

(note that a low is when the LED is on, this is from the slave's perspective)

Quote
Sorry I don't understand this - Can you explain? Do you want to recreate the buttons and spin-dials on the cam's menu or what? What has it to do with the AF remote function?
Well I was giving an example of how someone could go about controlling two cameras with an external remote, by physically building a complex controller with buttons and stuff on it, and a micro controller that transmits either button-presses or other data to the cameras. An idea which I had some time ago, but never got around to doing it. Such an idea is not necessary with the setup I'm working on here.

Re: Synchronising two S110's via the AF lamp
« Reply #33 on: 06 / April / 2014, 07:23:00 »
Hi Recyclojunk64,

thanks for making it clear to me, I understand now.

Quote
of how someone could go about controlling two cameras with an external remote, by physically building a complex controller with buttons and stuff on it, and a micro controller that transmits either button-presses or other data to the cameras.

This is exactly what I plan to do. I want to use a micro controller (Atmels' Atmega8 or similar) to steer two cams simultaneously. So may we can work together in this case? I still try to evaluate if it is better to control the cams by middle terminal or by the USB port. If you use the 'normal' timer then the minimum pulse width will be 20ms, this will be the short pulse. The long pulse will be e.g. 30 ms. If you send e.g. 16 times low and 16 times high this will take 0.8 seconds (the start indicator not included). So roughly 1.0 second until a full sequence is sent to the slave.
In my opinion this is too much. A much faster solution is the HPTimer. Waterwingz did some great work on the HPTimer, so we can use that but there are some issues to use the HPTimer as short as possible to not influence the cam's normal behavior.
Using the HP timer will allow pulse width of around 1-2 ms (@waterwingz: is that (still) true?) which means we can drastically reduce the time until a full sequence is sent. Using this the sequence will take 0.048 seconds (if low is 1ms and high is 2ms and 16 times low and 16 times high are sent for example).
We can speed up this even more if we use the middle terminal and not only change pulse width but also the resistor value using a resistor array to DAC or whatever.

What do you think?
2 x IXUS 860IS 100c
2 x Powershot S110 103a


Re: Synchronising two S110's via the AF lamp
« Reply #34 on: 06 / April / 2014, 10:30:18 »
Quote
This is exactly what I plan to do. I want to use a micro controller (Atmels' Atmega8 or similar) to steer two cams simultaneously. So may we can work together in this case?

Sounds like a good idea, after all we have exactly the same cameras. As you want to use the external remote, both of your cameras will be running the same code that the slave would in a master-slave configuration, and the microcontroller would take the place of the master.

Quote
I still try to evaluate if it is better to control the cams by middle terminal or by the USB port.
Main advantage of the battery-terminal is you don't need a USB plug sticking out of the side of your cameras. USB mini B cables aren't exactly known for their ruggedness. Of course you get analogue control as well. Downside is you have to attach wires to the tabs on your batteries.

Quote
... but there are some issues to use the HPTimer as short as possible to not influence the cam's normal behavior.
Using the HP timer will allow pulse width of around 1-2 ms (@waterwingz: is that (still) true?) which means we can drastically reduce the time until a full sequence is sent. Using this the sequence will take 0.048 seconds (if low is 1ms and high is 2ms and 16 times low and 16 times high are sent for example).
We can speed up this even more if we use the middle terminal and not only change pulse width but also the resistor value using a resistor array to DAC or whatever.

There is another way though:

I did have another idea though; a CPU hogging approach where 0xc0242014 would be continually read in a loop, and whenever it reaches the desired value, the LED will change.
Where that address is a 20 bit timer (so about one microsecond precision)

and just to see how fast a while-statement would repeat:
Quote
Initial tests went good with this, to test how long it takes to count to 64 million.
Code: [Select]
int master_begin_transmission()
{
    while (variable_to_increment < 67108864)
    {
        variable_to_increment++;
//   unread_variable = *(short*)0xc090004a;
//   unread_variable1 = *(int*)0xc0242014;
    }
    *((volatile int *) MASTER_OUTPUT_ADDRESS) = MASTER_OUTPUT_MAGIC_NUMBER_ON;//Set LED on
}

And it did it in about two seconds, 30 million per second. When polling the temp input, it was of course slower, at about 6 million per second, which is still more than fast enough. And about 4 million per second with reading the usec timer aswell. And the live-preview didn't even freeze while it was counting (although the buttons did of course).

So by using this method, the data could be sent much faster. While the camera will freeze during sending or receiving data, it shouldn't be for long enough to cause problems, as far as I've heard anyway.

Using a resistor array or DAC probably wouldn't be worth the extra effort (building and coding) if the transfer time can be brought down to a reasonably short time without it.






So I'm thinking perhaps there should be a standard of some sort for the transmission. A standard transmitting/receiving code would be very handy for anyone who wants to control a camera(s) with a microcontroller (as you are), or another master camera (as I will be for three or four rigs). After thinking a bit though, I'm not completely sure though that I will be able to fit 'everything else' into 16 bits, especially as the S110 has smaller ISO steps. I'll have to do a bit more testing with the above method to see how fast I can get the transmission, and then decide how this could be implemented.

Have a few things to do tomorrow and Tuesday, but hopefully I might be able to transmit and receive exposure, ISO and aperture by next weekend.

Re: Synchronising two S110's via the AF lamp
« Reply #35 on: 09 / April / 2014, 05:32:43 »
Hi Reclyclojunk64,

Quote
Using a resistor array or DAC probably wouldn't be worth the extra effort (building and coding) if the transfer time can be brought down to a reasonably short time without it.

I agree if the time is reasonably short than we can go this way.
What do you think can be the shortest single pulse be to the AF LED finally?

What about error correction? How stable the transmission will be?
If e.g. a transmisison is sent to the slave how you will detect errors?
Normally we should send the data twice and do a comparision on slave side and if the two transmisisons are not equal then ask the master to resend.
But this of course will extend the transmission time. Then also we need a kind of information back to the master if the slave needs to ask for resendig the data.

What is the usec timer please and what is it for?

If we use the AF LED and cover it with a photo diode than we cannot use it anymore for it's original purpose to lighten dark areas - and the autofocus won't work properly - or not?










2 x IXUS 860IS 100c
2 x Powershot S110 103a

Re: Synchronising two S110's via the AF lamp
« Reply #36 on: 09 / April / 2014, 07:48:50 »
Quote
What do you think can be the shortest single pulse be to the AF LED finally?
I have no idea yet. I managed to flash it with a pulse-length of around 32 microseconds with those interrupt timers from the other thread, although it was extremely messy and inaccurate. But with the method I mentioned above, I imagine it could be reasonably accurate at this speed. But I'm just guessing, I'll do some testing and get back with the results shortly. I think one bit per millisecond would be plenty fast enough though.

Quote
What about error correction? How stable the transmission will be?
If e.g. a transmisison is sent to the slave how you will detect errors?
Normally we should send the data twice and do a comparision on slave side and if the two transmisisons are not equal then ask the master to resend.
But this of course will extend the transmission time. Then also we need a kind of information back to the master if the slave needs to ask for resendig the data.
Well, after some testing a data-transfer rate that is slow-enough that errors are unlikely (but still fast enough) could be decided upon. Perhaps the data could be sent twice, but as soon as the first transmission is sent, the slave will start applying the data received. Then if the second data set is different, the slave could flash a message on the screen indicating that there's an error, and the user will have to repress the shutter. Or perhaps the data could even be sent a third time for automatic data-correction.
Of course, duplex will be better, but at the expense of a photo-diode on the slave as well. In that case, the master and slave could use the same code, and either will act as the 'master' depending on which one the user is holding.


Quote
What is the usec timer please and what is it for?
It's the inbuilt 20-bit timer, which will increase every 1 / 2^20 of a second. The HPTimers use it as a reference.

Quote
If we use the AF LED and cover it with a photo diode than we cannot use it anymore for it's original purpose to lighten dark areas - and the autofocus won't work properly - or not?
Well, surprisingly enough, most of the light seems to just pass through unaffected through the translucent photodiode package (well I was using a right-angled IR LED taken out of an opto-switch (the sensor in it has some internal circuitry, so the LED was a better choice)). The master could simply turn the AF led on during half-press, or command the slave to turn it's one on. Or both.

This was one of the reasons why I wanted to use the WiFi LED instead, but unfortunately I wasn't able to find the it's address anywhere.



But if you build that multifunctional remote handle with the ATtiny you probably won't need the camera's AF LED anyway.


Re: Synchronising two S110's via the AF lamp
« Reply #37 on: 24 / April / 2014, 04:47:29 »
I've now finished with the HP timers (link in case anyone is reading this in the future), so I'm back to this thread for the next stage of this project.

I'll tackle things from the master side first. Here's how I would like it to work:

I will have the master camera either in program or manual mode, usually with autofocus (servo autofocus disabled of course). I half-press the shutter, and once the focus is locked, the transmission program will send focus, exposure, aperture, ISO and ND filter state. With which the slave will apply as soon as it can. Preferably the slave can be in either program or manual mode. If necessary, the master could alert the slave as soon as half-press is touched, if that will save any time when applying the values later on. Then of course full-press tells the slave to also full-press, where both cams will wait till the master full-press is released before syncing the shot.


I have a few questions though.
Firstly, I couldn't find how many focus bits the S110 had. In the menu, subject-distance override goes from 30 up to 131535 mm. But 17 bits of focus would give a maximum of 131071 (or 131101 starting from 30). So I'm not exactly sure what's going on here.

Secondly, what would the best method of setting focus be? According to that spreadsheet, the S110 crashes with set aflock. Do I just half-press then set the focus straight away with the property case? Or do I have to wait till the camera locks focus first?

Thirdly, would I be right in assuming I am to set the property cases here (though I'll probably use the defined macros so it will be the same on my D20) with get_property_case, and read them with shooting_get_prop?


Re: Synchronising two S110's via the AF lamp
« Reply #38 on: 24 / April / 2014, 08:33:49 »
Secondly, what would the best method of setting focus be? According to that spreadsheet, the S110 crashes with set aflock. Do I just half-press then set the focus straight away with the property case? Or do I have to wait till the camera locks focus first?
That spreadsheet also indicates that CHDK will set focus with just a set_focus() command from a script.  So if you are able to set the focus before each shot,  you will not need the equivalent of set_aflock() or set_mf() in your code.  Assuming you are still experimenting with CHDK C code,  use a call to

Code: [Select]
void shooting_set_focus(int v, short is_now)
in core/shooting.c rather than fiddling with propcases for this.


Ported :   A1200    SD940   G10    Powershot N    G16

Re: Synchronising two S110's via the AF lamp
« Reply #39 on: 25 / April / 2014, 09:54:07 »
Secondly, what would the best method of setting focus be? According to that spreadsheet, the S110 crashes with set aflock. Do I just half-press then set the focus straight away with the property case? Or do I have to wait till the camera locks focus first?
That spreadsheet also indicates that CHDK will set focus with just a set_focus() command from a script.  So if you are able to set the focus before each shot,  you will not need the equivalent of set_aflock() or set_mf() in your code.  Assuming you are still experimenting with CHDK C code,  use a call to

Code: [Select]
void shooting_set_focus(int v, short is_now)
in core/shooting.c rather than fiddling with propcases for this.

Thanks, but unfortunately it doesn't seem to do anything. I tried shooting_set_focus(100, SET_NOW); before shooting, before and after AF finished, and even continuously during half-press. Also with SET_LATER . But the camera still just focuses normally (I'm pressing the shutter by hand if it makes any difference)

I have another question about the propcases. Number 296 gives the value of iContrast. But on the S110 (and also the SX50, probably others aswell) that instead corresponds to the setting for shadow correction (which is pretty much the same), but I can't find anything that corresponds to the "DR Correction" (which can be set to off, auto, 200% and 400%). I tried reading the next and previous 10 values but coudn't find it though. Would it be likely to be found if I continue searching randomly, or is there somewhere I could find out what value it would likely be?
EDIT: Found it, it's number 318. I'll add it to that table.
« Last Edit: 25 / April / 2014, 19:51:47 by Recyclojunk64 »

 

Related Topics