Welcome, Guest. Please Login or Register
Home Help Search Login Register
Page Index Toggle Pages: 1
Send Topic Print
Faster exposures with current OCC hardware. (Read 2951 times)
Eric S.
Ex Member


Faster exposures with current OCC hardware.
11/28/10 at 00:35:07
 
So, my concept is to turn shutter control over to the microcontroller by coding functions directly in the MC program for each shutter length.  Then develop a way for the DS software to send instructions to the MC about which shutter lengths are desired.

I think this would allow the existing hardware to break the 1/20th second exposure barrier (with DS software and MC firmware updates).  Has this been tried before and does anyone see flaws in my logic or major obstacles I will encounter?
Back to top
 
 
IP Logged
 
Steve Chapman
Ex Member


Re: Faster exposures with current OCC hardware.
Reply #1 - 11/28/10 at 00:58:07
 
The limitation is that newer cameras may have added a minimum bulb shot length to their firmwares. I'm looking at you, 5D2!
Back to top
 
 
IP Logged
 
Eric S.
Ex Member


Re: Faster exposures with current OCC hardware.
Reply #2 - 11/28/10 at 02:47:03
 
Well that's a downer.  I was understanding it as a limitation in the GBA connection to the MC.  I guess I go back to waiting patiently for usb instructions.
Back to top
 
 
IP Logged
 
Steve Chapman
Ex Member


Re: Faster exposures with current OCC hardware.
Reply #3 - 11/28/10 at 16:05:14
 
'fastest I could push the 7D was to 1/60 with as-is OCC. This behavior was unexpected, I assumed it would work the same as a 5D2. I suspect one might garner a little less by putting timing in the MC (less time that is.) I'll look into it.
Back to top
 
 
IP Logged
 
Eric S.
Ex Member


Re: Faster exposures with current OCC hardware.
Reply #4 - 11/29/10 at 23:44:19
 
So I've attempted to modify my MC code to fire a sequence of shots to try to capture the slowest allowable speed of a camera.  In trouble-shooting, however, I came across a deal breaker for the "attachInterrupt" method and my timer.  From the Arduino online help:

Quote:
Note: Inside the attached function, delay() won't work and the value returned by millis() will not increment. Serial data received while in the function may be lost. You should declare as volatile any variables that you modify within the attached function.

http://www.arduino.cc/en/Reference/AttachInterrupt


To keep the interrupt, the Function called by it cannot contain delays.
To keep the delays, I don't know how to search for the signal to begin the sequence.

Edit:  Modified the code per Steve's idea below.  See my reply for comments.

Code:
//  >>>>-------------------------------======================================-------------------------------<<<<
//  OCC Microcontroller Firmware
//
//  Written by:  Eric Spaeth
//  Written on:  2010.11.29
// 
//  This software is designed to provide an interface between the NDS-OCC Software and DSLR Camera with
//  Remote Shutter
//
//  Updated by:  Eric Spaeth
//  Updated on:  2010.11.29
//
//  The current version is for testing the high-speed limits of the Nikon D5000 bulb mode.  Intended use only
//  utilizes a "Test" shot in the current NDS-OCC Bracket software since a single interrupt signal is used to
//  fire several shots from within the MC.
//  >>>>-------------------------------======================================-------------------------------<<<<



const int FullPressPin = 13;   // Full Press MC Output Pin
const int HalfPressPin = 5;    // Half Press MC Output Pin
const int LEDPin = 7;          // LED MC Output Pin

const int ShotNum = 10;        // # of shots to take.  Should equal the number of defined delays in "Shutter"

const int Shutter0 = 1000;     // 1/1th    Shutter time [ms]
const int Shutter1 = 500;      // 1/2th    Shutter time [ms]
const int Shutter2 = 250;      // 1/4th    Shutter time [ms]
const int Shutter3 = 100;      // 1/10th    Shutter time [ms]
const int Shutter4 = 67;       // 1/15th   Shutter time [ms]
const int Shutter5 = 50;       // 1/20th   Shutter time [ms]
const int Shutter6 = 33;       // 1/30th  Shutter time [ms]
const int Shutter7 = 20;       // 1/40th  Shutter time [ms]
const int Shutter8 = 17;       // 1/60th  Shutter time [ms]
const int Shutter9 = 11;       // 1/90th Shutter time [ms]

int Shutter[] = {Shutter0,Shutter1,Shutter2,Shutter3,Shutter4,Shutter5,Shutter6,Shutter7,Shutter8,Shutter9};
boolean ShotReq = false;       // Has a shot been requested from the NDS-OCC software?

const int Delay1 = 5000;       //  Generic Delay of 5 seconds
const int Delay2 = 1500;       //  Generic Delay of 1.5 seconds



void CloseShutter() {
//  >>>>-------------------------------======================================-------------------------------<<<<
//  The CloseShutter function sends a signal to the Remote Shutter Cable to first open the full press
//  connection, then the half press connection, then turn off the LED.

  digitalWrite(FullPressPin, LOW);
  digitalWrite(HalfPressPin, LOW);
  digitalWrite(LEDPin, LOW);
}
//  >>>>-------------------------------======================================-------------------------------<<<<



void OpenShutter() {
//  >>>>-------------------------------======================================-------------------------------<<<<
//  The OpenShutter function sends a signal to the Remote Shutter Cable to first close the half press
//  connection, then the full press connection, then turn on the LED.

  digitalWrite(HalfPressPin, HIGH);
  digitalWrite(FullPressPin, HIGH);
  digitalWrite(LEDPin, HIGH);
}
//  >>>>-------------------------------======================================-------------------------------<<<<



void TimedShutter() {
//  >>>>-------------------------------======================================-------------------------------<<<<
//  The TimedShutter function processes a series of exposures as of the length and order defined in the
//  "Shutter" array, with a delay between each shot of "Delay1".

  for(int n = 0; n < ShotNum; n++){
    OpenShutter();
    delay(Shutter[n]);
    CloseShutter();
   
    delay(Delay1);
  }
 
  ShotReq = false;			// Resets ShotReq to FALSE after a sequence is complete.
 
}
//  >>>>-------------------------------======================================-------------------------------<<<<



void ShotRequest() {
//  >>>>-------------------------------======================================-------------------------------<<<<
//  The ShotRequest function sets the value of ShotReq to TRUE when signal from NDS-OCC comes in.

  ShotReq = true;
 
  digitalWrite(LEDPin, HIGH);
  delay(Delay2);
  digitalWrite(LEDPin, LOW);
 
}
//  >>>>-------------------------------======================================-------------------------------<<<<

void setup() {
//  >>>>-------------------------------======================================-------------------------------<<<<
//  The setup function

  pinMode(HalfPressPin, OUTPUT);
  pinMode(FullPressPin, OUTPUT);
  pinMode(LEDPin, OUTPUT);
  boolean ShotReq = false;       // Has a shot been requested from the NDS-OCC software?

  //  Makes the LED flash, woohoo.
  digitalWrite(LEDPin, HIGH);
  delay(Delay2);
  digitalWrite(LEDPin, LOW);

}
//  >>>>-------------------------------======================================-------------------------------<<<<



void loop() { 
//  >>>>-------------------------------======================================-------------------------------<<<<
//  The loop function

  //  This will call "TimedShutter" when the existing DS software sends the GBA port a shutter open signal.
  //  In the interim (testing), the expected user behavior is to use the "Test" buttons in the DS to
  //  initiate the MC controlled sequence.  This will ensure only one signal is sent to the MC to initiate.

  attachInterrupt(0, ShotRequest, RISING);
 
  while(ShotRequest){
    TimedShutter();
  }
   
//  These interrupts work with the current NDS-OCC Bracket software with the DS controlling shutter timing.
//  attachInterrupt(0, CloseShutter, RISING);
//  attachInterrupt(1, OpenShutter, FALLING);

}

//  >>>>-------------------------------======================================-------------------------------<<<<
 

Back to top
« Last Edit: 11/30/10 at 01:02:27 by N/A »  
 
IP Logged
 
Steve Chapman
Ex Member


Re: Faster exposures with current OCC hardware.
Reply #5 - 11/29/10 at 23:58:10
 
(without having dug too deep into your code) could you not simply use the interrupt to set a "shootRequest" flag and run the timers outside the interrupt?
Back to top
 
 
IP Logged
 
Eric S.
Ex Member


Re: Faster exposures with current OCC hardware.
Reply #6 - 11/30/10 at 01:11:47
 
Excellent idea.  I have modified the code as suggested (see above, edited) with a certain level of success.  With the code as shown, the MC begins firing off the sequence as soon as it is powered, and if I change the "while(ShotRequest)" near the end to a "while(!ShotRequest)", the program does nothing, even when commanding a shot from the NDS-OCC.  Certainly not usable as a final solution, but it does produce data.

On my Nikon D5000, it appears that 1/10th is about the fastest I can obtain with this hardware.  Even at that, some of the 1/10th commanded exposures are registered as 1/8th in the image data.  Sad for me.

Unrelated, but why does my code link not utilize the vertical scrolling?  I know my program is obnoxiously long due to my obsessive need for function separation and over-commenting, but this forum seems to be mocking me by exaggerating it.
Back to top
 
 
IP Logged
 
Steve Chapman
Ex Member


Re: Faster exposures with current OCC hardware.
Reply #7 - 11/30/10 at 01:21:00
 
Nikon was the first to explicitly state that they added a purposeful limitation to the bulb shot length, a few years back. I recall it was a switch-debounce method?

Anyhoo, I don't think the code scrolling has anything to do with your syntax, I think it is the fault of the forum software.
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print