I installed the latest 0.82 version of the engine. My prototype is starting to come alive. I have two questions though:
1. The code of 0.82 uses pin 14 and 15 (camera and focus). The documentation of the engine is still using 10 and 11. Have you switched to the Mega board? Or are you using other pins on the Duemilanove?
2. I don't know if this is a bug, but I am unable to use the tap function. I have switched pins on my board (13 is camera, 12 is focus) and I have modified the OpenMoco_Timelapse_Engine file accordingly. The camera is firing, the tap function is not. I have put an LED on 12 to check if the pin is fired and it's not. I see two possibilities. I am doing something wrong (set_camera tab 200), of it's a bug?
Any help would be appreciated

Hi cronix, the pin layout of
Hi cronix, the pin layout of 0.82 is completely different than 0.81, it's still designed to run on the smaller boards (not the mega). The documentation for production won't change until 0.82 is finally released (aka, get all the bugs like this one worked out =)
I'll add this to the list of issues (this makes 3 so far) with the 0.82 engine. Will definitely get them worked out.
!c
Well, my first contribution;
Well, my first contribution; a bug report :-). I hope to contribute a lot more in the future. Any idea when 0.82 will go into production?
We're looking at probably
We're looking at probably another month or two, there are a number of new features I'm working on still - including being able to say to repeat an exposure on each shot cycle, specifying distance to move and/or exposure changes to make during the repeat cycle. This should allow for easier HDR shooting, stereoscopic shooting, and panorama usage.
Do me one favor though -- I'm about to run this test in a few, and doing it would help clarify where the issue might be: change the focus pin assignment to 13 (as 13 has a built-in LED w/ resistor on the board), set your pre-focus tap time to 1000 ms, (e.g.: [5]> camera tap 1000), set your exposure time to something like 100ms, and then start a program and see if the on-board LED lights up for 1sec. I don't know if you added a resistor to your LED that you put in the arduino pin, but if you didn't, you stood a good chance to simply have blown out the LED.
!c
I used a resistor. The
I used a resistor. The circuit was how you explained it in the DIY section of this site. So, let's rule that one out :-).
I had a good look again and did exactly the following (twice to be 100% sure):
1. Both tests were done with the following script:
[2] > connect
[3] > camera exposure 100
[4] > camera cycle 5
[5] > camera tap 1000
[6] > camera on
[7] > start
[8] >
2. First test (camera trigger test)
#define CAMERA_PIN 13
#define FOCUS_PIN 12
The led on de board is blinking and my good old Nikon F100 is firing.
3. Second test (tap/focus test)
#define CAMERA_PIN 12
#define FOCUS_PIN 13
Now, nothing is happening. The onboard led is not blinking.
This really makes be believe that the void tap_focus() is not called or not working.
I did another test too. My first tests were done using my old Nikon F100. I wanted to be sure that I didn't ruin a camera. I have just connected my Nikon D2X. Now the setup is not working anymore. There is a difference between old analog Nikons and digital ones. I should have known this because the same happened during development of my previous project (an underwater live view/triggering setup for camera's without live view by using a CCD camera).
A digital Nikon camera will only trigger when the gnd/focus pins are connected during the triggering. This means that the focus pin must be HIGH during the fire_camera action. Did you know this? This is really a feature needed for Nikon cameras.
I tried to implement this by modifying the code:
// don't shoot more than the requested # of images
if( camera_max_shots > 0 && camera_fired >= camera_max_shots )
return;
digitalWrite(FOCUS_PIN, HIGH);
digitalWrite(CAMERA_PIN, HIGH);
// start timer to stop camera exposure
MsTimer2::set(exp_tm, stop_camera);
MsTimer2::start();
// update camera currently enaged
// (turn on bit)
action_status |= B10000000;
return;
}
void stop_camera() {
digitalWrite(CAMERA_PIN, LOW);
digitalWrite(FOCUS_PIN, LOW);
// turn off timer - we do this
// after the digitalWrite() to minimize
// over-shooting in case this takes some
// unusually-long amount of time
MsTimer2::stop();
// are we supposed to delay before allowing
// the motors to move? Register a timer
// to clear out status flags, otherwise
// just clear them out now.
// the delay is used to prevent motor movement
// when shot timing is controlled by the camera.
// the post-delay should be set to an amount greater
// than the max possible camera exposure timing
// update camera currently engaged
action_status &= B01111111;
// update camera cycle complete
action_status |= B00000100;
}
This code is triggering my digital D2X! How can we implement this in the codeline? I guess other camera's don't want the FOCUS_PIN to be high during firing? This bye the way eliminates my need for the tap function; but let's fix that one too!
Yeah - my pentax won't fire
Yeah - my pentax won't fire if the focus pin is connected to common when trying to trip the shutter. I found the bug, btw =)
Here's the issue, on lines 782-784 in the OM_Serial_Com_Client.pde:
if( focus_tap_tm == 0 )
action_status &= B11111110;
It should be changed to:
if( focus_tap_tm == 0 ) {
action_status &= B11111110;
}
else {
// enable pre-focus tap
action_status |= B00000001;
}
That went largely un-noticed because in 0.81 focus tap was on by default, and it seems that it was never necessary to turn it off, and then back on =) In 0.82 - all controls were set to off by default.
Thanks for finding that! I'll also include a configurable setting to keep the focus pin high with the shutter pin, so cameras that need both (as you have!) will be supported. It'll basically do what you just did, but be set via the serial protocol.
!c
I can confirm that the fix is
I can confirm that the fix is working. The tap command is now waking up my camera. This fix and the FOCUS_PIN=HIGH setting make the engine work with all Nikon cameras.