It is currently Fri Aug 29, 2014 12:00 am




Post new topic Reply to topic  [ 17 posts ] 
 Iso ramping using an arduino and DSLRRemotetest 
Author Message
User avatar

Joined: Fri Mar 12, 2010 12:16 pm
Posts: 370
Location: Gloucester UK
Post Iso ramping using an arduino and DSLRRemotetest
Iso ramping seems to be a good technique for maintaining shutter speeds as the light levels change. However, it means touching the camera. Following on from the "Little-Bramper" hardware and a discussion on iso ramping I've had a look at remotely changing the iso rather than touching the camera using the DSLRremotetest.exe programme.

Forgive me if this has been covered but I couldn't find it:

A simple arduino programme which sends the letter "a" back up the comms port to the laptap via the usb lead when a button is pressed:
Code:
const int buttonPin = 2;     
const int ledPin =  13;     
int buttonState = 0;         

void setup() {
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);     
  pinMode(buttonPin, INPUT);     
}

void loop(){
  buttonState = digitalRead(buttonPin);
  if (buttonState == HIGH) {     
    digitalWrite(ledPin, HIGH); 
    Serial.print("a");
    delay(2000);
  } 
  else {
    digitalWrite(ledPin, LOW);
  }
}


A programme called AACKeys monitors the comms port and acts as a virtual keyboard.

Another programme called AutoHotKey responds to the virtual keypress 'a' with this simple script:
Code:
a::
Run "C:\Program Files\BreezeSys\DSLR Remote Pro\DSLRRemoteTest\key_a.bat"
return


key_a.bat sits in the dslrremotetest folder and contains:
Code:
rem set iso 250
cd C:\Program Files\BreezeSys\DSLR Remote Pro\DSLRRemoteTest
DSLRRemoteTest.exe -n -I 5


Fire up DSLRRemotePro and put it in the background and the remote iso-ramping works :) Press the button on the arduino or send the letter 'a' up the serial line or press 'a' on the keyboard and the iso on the connected camera changes to 250iso (in this example).

It will be simple to make a series of batch files for all the iso settings which can be remotely changed without touching the camera :)

regards
Kev

_________________
Wildlife and Nature photography
http://www.photosbykev.com


Mon May 03, 2010 8:53 am
Profile
User avatar

Joined: Wed Jan 14, 2009 8:34 pm
Posts: 626
Post Re: Iso ramping using an arduino and DSLRRemotetest
A fruitful 10 minutes of work, Kevin.

One could presumably use this method to do aperture-stepping too. However, that way lies madness.

What we* need to do next, I think, is get this all this functionality into a handheld gadget (something akin to the Promote controller). In other words get the DSLRRemotetest brains into a microcontroller. Precisely how that is done seems to be shrouded in mystery.

* you.

_________________
Little Bramper website and on Timescapes
Link to Time-lapse FAQ


Mon May 03, 2010 9:37 am
Profile
User avatar

Joined: Fri Mar 12, 2010 12:16 pm
Posts: 370
Location: Gloucester UK
Post Re: Iso ramping using an arduino and DSLRRemotetest
astronomerroyal wrote:
A fruitful 10 minutes of work, Kevin.

One could presumably use this method to do aperture-stepping too. However, that way lies madness.

What we* need to do next, I think, is get this all this functionality into a handheld gadget (something akin to the Promote controller). In other words get the DSLRRemotetest brains into a microcontroller. Precisely how that is done seems to be shrouded in mystery.

* you.

without the Canon drivers that DSLR Remote Pro requires I don't see a method of removing a netbook from the loop although I have found some interesting threads on adding a usb host to the arduino which might have some potential. I'll pull something together on the arduino to test the ramping and see how smooth it is before jumping into the deep water lol

_________________
Wildlife and Nature photography
http://www.photosbykev.com


Wed May 05, 2010 1:46 pm
Profile
User avatar

Joined: Fri Jun 13, 2008 5:54 am
Posts: 611
Location: Oslo, Norway
Post Re: Iso ramping using an arduino and DSLRRemotetest
Do you know if the Canon drivers run on Linux? In principle one could then use an FPGA with a PowerPC or a MicroBlaze and a small linux distribution. That would allow for a handheld design. Probably not the cheapest though, and those FPGA draw pretty much power...

_________________
Canon 400D, 50D, 5D Mk II. Canon L 16-35/f2.8, Sigma 10-20. Adobe Creative Suite 4.
website:
http://www.magictimelapse.ch/en


Thu May 06, 2010 12:07 am
Profile
User avatar

Joined: Fri Mar 12, 2010 12:16 pm
Posts: 370
Location: Gloucester UK
Post Re: Iso ramping using an arduino and DSLRRemotetest
Michael wrote:
Do you know if the Canon drivers run on Linux? In principle one could then use an FPGA with a PowerPC or a MicroBlaze and a small linux distribution. That would allow for a handheld design. Probably not the cheapest though, and those FPGA draw pretty much power...
I believe the platform base that the drivers work on is very limited. Canon aren't even updating the drivers for 64-bit windows operating systems.

_________________
Wildlife and Nature photography
http://www.photosbykev.com


Thu May 06, 2010 3:16 am
Profile
Post Re: Iso ramping using an arduino and DSLRRemotetest
A quick question -- if all you're having the arduino do is "press a key" - can't you do that with the netbook directly?

Additionally, make sure to de-bounce that button =)

Are you using a pull-down resistor? If not, better to wire the button to GND and enable the internal pull-up, e.g.:


Code:
const byte buttonPin = 2;     
const byte ledPin =  13;     
byte buttonState = 0; 
byte wasState = buttonState;
unsigned long lastPress = 0;   
const unsigned int debounceTime = 200;

void setup() {
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);     
  pinMode(buttonPin, INPUT);
  digitalWrite(buttonPin, HIGH); // enable pull-up resistor 
}

void loop(){
  buttonState = digitalRead(buttonPin);
 
  if( buttonState != wasState && millis() - lastPress > debounceTime ) {
    wasState = buttonState;
    lastPress = millis();

      // low is pressed state - button wired to GND, and internal pull-up enabled
      // for pin, so HIGH is un-pressed state

    if (buttonState == LOW) {     
      digitalWrite(ledPin, HIGH);
      Serial.print("a");
      delay(2000);
   }
   else {
      digitalWrite(ledPin, LOW);
   }
}

}



!c


Wed May 12, 2010 6:32 am
User avatar

Joined: Fri Mar 12, 2010 12:16 pm
Posts: 370
Location: Gloucester UK
Post Re: Iso ramping using an arduino and DSLRRemotetest
shutterdrone wrote:
A quick question -- if all you're having the arduino do is "press a key" - can't you do that with the netbook directly?

Additionally, make sure to de-bounce that button =)

Are you using a pull-down resistor? If not, better to wire the button to GND and enable the internal pull-up, e.g.:


Code:
const byte buttonPin = 2;     
const byte ledPin =  13;     
byte buttonState = 0; 
byte wasState = buttonState;
unsigned long lastPress = 0;   
const unsigned int debounceTime = 200;

void setup() {
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);     
  pinMode(buttonPin, INPUT);
  digitalWrite(buttonPin, HIGH); // enable pull-up resistor 
}

void loop(){
  buttonState = digitalRead(buttonPin);
 
  if( buttonState != wasState && millis() - lastPress > debounceTime ) {
    wasState = buttonState;
    lastPress = millis();

      // low is pressed state - button wired to GND, and internal pull-up enabled
      // for pin, so HIGH is un-pressed state

    if (buttonState == LOW) {     
      digitalWrite(ledPin, HIGH);
      Serial.print("a");
      delay(2000);
   }
   else {
      digitalWrite(ledPin, LOW);
   }
}

}



!c

Hiya,

the idea of using the arduino to do the work was to allow some automated interaction of the iso ramping to decrease the shutter speed using the trigger pulse length on the shutter in bulb mode i.e If the shutter speed was getting too long then double the iso / half the bulb time so the exposure remained constant without having to manually touch the camera. Basically it would be another 'Shutter priority' mode but changing iso rather than aperture.

Based on what I've seen of your work I've no doubt you've already played with this approach but it's an interesting challenge for me :) My intention is to try to get the exposure control process fully automated with the arduino and netbook handling it all so I can sit back with a good book and flask of coffee and just watch the world go by until the sequence is finished or more likely tweak the rate of change etc on the fly without touching the camera at all.

All the buttons are pulled low until pressed so I get a positive 5v signal to confirm they have been pressed with a debounce routine. The original code was litte more than a snippet to prove it could work :) I've gone for the positive +5v signal rather than GND signal to minimise the power consumption on the arduino, not that the current is significant compared to the lcd display power rating but it all helps I guess.

Currently I have the shutter and pc sync interaction sorted (for a positive signal when the shutter is fired), a focus tap to keep the camera awake or auto focus (if needed). The arduino is powered by a lithium battery back pack so it's good for 30-40 hours of operation without needing any external power. I'vr also added a rtc module with the idea of using it for automating the start/finish time of a sequence.

I'm playing with an external light meter ic to see if I can completely remove the camera exposure system from the loop and trying to sort out the menu system and code so that everything is non-blocking which is great fun.

It's interesting trying to code stuff without using delay() lol

best regards
Kev

_________________
Wildlife and Nature photography
http://www.photosbykev.com


Wed May 12, 2010 10:25 pm
Profile
Post Re: Iso ramping using an arduino and DSLRRemotetest
Photosbykev wrote:
the idea of using the arduino to do the work was to allow some automated interaction of the iso ramping to decrease the shutter speed using the trigger pulse length on the shutter in bulb mode i.e If the shutter speed was getting too long then double the iso / half the bulb time so the exposure remained constant without having to manually touch the camera. Basically it would be another 'Shutter priority' mode but changing iso rather than aperture.


Ok, cool - I was just checking -- it seemed like overkill *grin*


Photosbykev wrote:
All the buttons are pulled low until pressed so I get a positive 5v signal to confirm they have been pressed with a debounce routine. The original code was litte more than a snippet to prove it could work :) I've gone for the positive +5v signal rather than GND signal to minimise the power consumption on the arduino, not that the current is significant compared to the lcd display power rating but it all helps I guess.


The only way this will make any difference to the power consumption is if your pull-down resistor is > 20k (the rating of the internal pull-up). Thereby reducing the current flow potential from ground when the button is pressed. When the button is not pressed, there is _no_ current consumption in either pull-up or pull-down, as the potential is the same on both sides of the resistor. So, any power savings (and they are abysmally minute) would come from when the switch is pressed and there is the potential of current flow. So, if you used a 40k pull-down and a switch wired to supply, then when the switch is pressed (and there is now potential for current to flow through the resistor), the resistor resists twice as much current as the internal pull-up would. Since I = V/R, and supply is 5V, I = 5/20000, or 0.00025A is sunk using a pull-up or pull-down of 20k while the switch is pressed.

There's nothing wrong with what you're doing, except the assumption that pull-up uses power when the button isn't pressed. =)

Photosbykev wrote:
I'm playing with an external light meter ic to see if I can completely remove the camera exposure system from the loop and trying to sort out the menu system and code so that everything is non-blocking which is great fun.

It's interesting trying to code stuff without using delay() lol


Just learn to love the state engine, and then everything will be magic *grin*

!c


Thu May 13, 2010 11:38 am
User avatar

Joined: Fri Mar 12, 2010 12:16 pm
Posts: 370
Location: Gloucester UK
Post Re: Iso ramping using an arduino and DSLRRemotetest
shutterdrone wrote:
Photosbykev wrote:
..............
The only way this will make any difference to the power consumption is if your pull-down resistor is > 20k (the rating of the internal pull-up). Thereby reducing the current flow potential from ground when the button is pressed. When the button is not pressed, there is _no_ current consumption in either pull-up or pull-down, as the potential is the same on both sides of the resistor. So, any power savings (and they are abysmally minute) would come from when the switch is pressed and there is the potential of current flow. So, if you used a 40k pull-down and a switch wired to supply, then when the switch is pressed (and there is now potential for current to flow through the resistor), the resistor resists twice as much current as the internal pull-up would. Since I = V/R, and supply is 5V, I = 5/20000, or 0.00025A is sunk using a pull-up or pull-down of 20k while the switch is pressed.

There's nothing wrong with what you're doing, except the assumption that pull-up uses power when the button isn't pressed. =)

Just learn to love the state engine, and then everything will be magic *grin*

!c


This is why I'm a mechanical engineer who designs, manufactures and uses remotely controlled multi-axis manipulators inside nuclear reactors typically 15 degrees of freedom, 5 metre range, payloads of 100kg and a repeatable resolution of less than a millimetre. Mechanical design I know inside out but electrickery is the work of the devil and I use the pawns of the devil to do the wire up :) However I do prefer using positive signals to make a choice or issue a command rather than potentially a loose wire causing a loss of signal and generating a spurious command.

I need to learn the arduino programming language properly and then get into state engines lol. The project certainly isn't a short term goal but it keeps me entertained and the knowledge contained in this forum is a massive help lol

best regards
Kev

_________________
Wildlife and Nature photography
http://www.photosbykev.com


Thu May 13, 2010 12:02 pm
Profile
User avatar

Joined: Fri Mar 12, 2010 12:16 pm
Posts: 370
Location: Gloucester UK
Post Re: Iso ramping using an arduino and DSLRRemotetest
Just been having a play with the TSL230R Light to Frequency Converter for measuring ambient light etc. I know others are using this chip and I'm wondering if I should consider mounting it inside a light meter lumisphere or something like the old Weston invercone so I get an good average reading. I could then mount onto the camera hotshoe so it will track with the camera, not that is a very important feature but it would be a convenient place to put it.

_________________
Wildlife and Nature photography
http://www.photosbykev.com


Sat May 15, 2010 4:09 am
Profile
User avatar

Joined: Fri Mar 12, 2010 12:16 pm
Posts: 370
Location: Gloucester UK
Post Re: Iso ramping using an arduino and DSLRRemotetest
I'm about 70-80% through the build and programming on a control box for ramping using the TSL230R as a reference light meter and programmed using the Lightrail source code ( very impressive programming and technical knowledge, thank you) with some modifications as I want to think about long exposure HDR, camera confirmation feedback, pre-programmed start/finishes so I've added a DS1307 rtc and possibly some motor control in the same box. I've used the arduino mega powered with a 2200mAh lithium battery and a 20x4 LCD for user info.

I'm wondering how to mount the TSL230R, I've got it running on a breadboard but obviously it needs to be external to the control box. From the spec I guess an external lead from the chip needs to pretty short, less than 500mm? Is this right or can I extend it further so it could be mounted on the camera? Cat-5 cable and plugs/sockets seems like a good way to connect between the sensor and control box.

_________________
Wildlife and Nature photography
http://www.photosbykev.com


Tue May 18, 2010 11:54 am
Profile
Post Re: Iso ramping using an arduino and DSLRRemotetest
Photosbykev wrote:
I'm about 70-80% through the build and programming on a control box for ramping using the TSL230R as a reference light meter and programmed using the Lightrail source code ( very impressive programming and technical knowledge, thank you) with some modifications as I want to think about long exposure HDR, camera confirmation feedback, pre-programmed start/finishes so I've added a DS1307 rtc and possibly some motor control in the same box. I've used the arduino mega powered with a 2200mAh lithium battery and a 20x4 LCD for user info.

I'm wondering how to mount the TSL230R, I've got it running on a breadboard but obviously it needs to be external to the control box. From the spec I guess an external lead from the chip needs to pretty short, less than 500mm? Is this right or can I extend it further so it could be mounted on the camera? Cat-5 cable and plugs/sockets seems like a good way to connect between the sensor and control box.


I used mine with up to 24" of lead, and didn't really have an issue. How I mounted it -- I found a stack of 1"x1" project boxes that didn't have lids, so I cut a rectangle hole in one side, and mounted the TSL230R on protoboard, and used female headers as side-baffles around the chip, then covered the back of the protoboard with liquid electrical tape =)

You'll get more length out of the chip's leads if you put the capacitor _right next to the chip_.

I used some heavy wire and just wired it straight between the two - however cat5e cable should work much better!

!c


Tue May 18, 2010 4:58 pm
User avatar

Joined: Fri Mar 12, 2010 12:16 pm
Posts: 370
Location: Gloucester UK
Post Re: Iso ramping using an arduino and DSLRRemotetest
shutterdrone wrote:
I used mine with up to 24" of lead, and didn't really have an issue. How I mounted it -- I found a stack of 1"x1" project boxes that didn't have lids, so I cut a rectangle hole in one side, and mounted the TSL230R on protoboard, and used female headers as side-baffles around the chip, then covered the back of the protoboard with liquid electrical tape =)

You'll get more length out of the chip's leads if you put the capacitor _right next to the chip_.

I used some heavy wire and just wired it straight between the two - however cat5e cable should work much better!

!c

Thanks !c, that's what I wanted to know from a practical user :) I've got plenty of conformal spray and optical grade potting compound on the shelf (not that optical grade is needed but it does give a good finish lol)

'll post up some finished details when I'm happy with the system.

regards
Kev

_________________
Wildlife and Nature photography
http://www.photosbykev.com


Tue May 18, 2010 10:14 pm
Profile

Joined: Wed Oct 20, 2010 12:46 pm
Posts: 16
Post Re: Iso ramping using an arduino and DSLRRemotetest
I posted a link over on the little bramper thread because I mistakingly thought it was arduino-based (I should have read up more)

Since it sounds like you are doing an arduino-based one, you might be interested in a USB-host shield for arduino that also has a lot of info on Canon EOS PTP protocol - so you could skip the step of sending stuff up the serial bus and having a netbook then send commands to the camera and just have the arduino itself send them.

I think you might be able to get it to use the light meter of the camera too - but your external light meter idea might give you more granular info.

You can also test controlling the bulb via the USB bus - I'm not sure if it will be as precise as the cable release, but there is even a slight chance that it could be more precise if they don't debounce a signal coming over USB.

http://www.circuitsathome.com/?s=7d is where they talk about the EOS control stuff in more depth.

I'm new to arduino but I'm a sw developer so I don't think it'd be hard for me to pick it up (the electronics part I'd be really rusty on though) so if you need help let me know and maybe I'll start building up a rig and playing with it.

The best thing about the USB control is that you could prototype it all on a full computer and test the software control out - then once you prove the concept you could move it to the arduino and make sure it will still work on the small scale. With a full computer you could have it do automatic image analysis to determine the ramping steps - something like taking the standard deviation of the overall image brightness and if it is starts to fall outside a certain region have it adjust it down a certain range... etc


Fri Oct 22, 2010 1:47 pm
Profile
User avatar

Joined: Sun Jul 25, 2010 9:25 pm
Posts: 83
Post Re: Iso ramping using an arduino and DSLRRemotetest
The other day I was reading a camera review, I think of the 40D, and it was showing that changes in ISO weren't as exact as you'd think.

There was a side-by-side comparison of something like the 5D, 40D, and Nikon D80 or D90, and it showed that you could double the ISO and halve the shutter speed and the overall exposure would remain constant with the 5D and Nikon body, but with the 40D the exposure would gradually get brighter as you ramped up the ISO and halved the shutter speed.

So just something to toss out.. when you're testing ISO ramping, and you may already have done this, I dunno, check to see if a +1.000 stop jump in ISO actually corresponds to +1.000 of actual exposure. This may vary per camera body for whatever reason.

_________________
www.ArielBravy.com/travel


Sat Oct 23, 2010 1:02 pm
Profile

Joined: Wed Oct 20, 2010 12:46 pm
Posts: 16
Post Re: Iso ramping using an arduino and DSLRRemotetest
Good point.

one other thing to test is if the exposure [flickrAdvanced=][/flickrAdvanced]compensation can be set to values other than 1/2 or 1/3 stop increments - the usb protocol lets you send arbitrary values... But I'm not sure what the camera would do if you asked for -.0963 EV.

If it would obey, you could try to meter and set an exp comp yuo ramp smoothly and possibly get smooth steps at faster shutter speeds... Although I imagine it might be tough for the camera to give you .999 of 1/8000 and .998 of 1/8000 sec exposures reliably, but who knows how precise they can be... If it rejects or rounds up invalid comp values that would make it not matter much.


Sat Oct 23, 2010 5:28 pm
Profile
User avatar

Joined: Sat Mar 07, 2009 8:37 pm
Posts: 363
Location: Dubai
Post Re: Iso ramping using an arduino and DSLRRemotetest
DSLR Remote Pro is coming to iPad/iphone, hopefully this year. I really really really hope it allows you to view the histogram...and then I could just kick back with my ipad and bramper on my lap...20 feet away and around a corner.

Ben

_________________
http://www.vimeo.com/timelapseinc
http://www.vimeo.com/delrious


Tue Nov 30, 2010 5:29 pm
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore. pozycjonowanie