Jump to content
Sign in to follow this  
PTB

Stellaris Launchpad - Camera Flash Timer and Measurement Tool

Recommended Posts

Camera Flash Timer and Measurement Tool

 

post-1105-14264605349649_thumb.jpg 

 

This project is an amalgamation of many other ideas and projects by other brilliant folks plus my own twist on things.

Hopefully I have given credit to all those whose work I have expanded upon and incorporated.

Apart from libraries, I have written the majority of the code from scratch implementing what I have learnt from this and other forums.

Still quite a few bugs and it is probably 80 - 90% complete.

I did get some perspex laser cut for it, but I didnt have the right software for it and borked the file conversion and received cute little minature versions.

Will have another shot at that in the near future.

 

Particular mention goes to the following folks for their posts and/or help.

Maurice Ribble, Creator of the Camera Axe and Original Multiflash.

@@RobG , Colour LCD with Touch https://www.tindie.com/products/RobG/color-lcd-boosterpack-touch/ I would be lost without this boosterpack and assistance.

@@jkabat , http://forum.stellarisiti.com/topic/684-stellaris-fast-analog-reads/ John's Assistance with the Fast Analog reads required was awesome. Thanks!

@@Rei Vilo, For help on many matters.

@@calinp, For the porting of PetitFatfs.

@@bluehash, For the SD card boosterpack. I have pretty much directly copied this circuit into my board.

 

Thanks guys

 

Main Components.

 

RobG's Touchscreen Booster Pack.

Stellaris Launchpad

SD Card Socket

I2C EEPROM

Flash Sensor

OptoIsoloators for Flashes

Indicator LEDs

Phototransistor

 

Useage

 

Takes the original flash signal and triggers up to 8 additonal flashes. The flashes can be either fired instantly or via delayed timings of which there are multiple modes.

 

- Instant

- Constant

- Varies

- Factor Increasing

- Factor Decreasing

- Synchronize

 

post-1105-14264605350162_thumb.jpg

 

post-1105-14264605350679_thumb.jpg

 

post-1105-14264605355842_thumb.jpg

 

post-1105-1426460535634_thumb.jpg post-1105-14264605356871_thumb.jpg

 

post-1105-14264605357377_thumb.jpg post-1105-1426460535789_thumb.jpg

 

 

It can also measure T0.1 and T0.5 camera flash durations via another menu.

 

post-1105-14264605358415_thumb.jpg

 

post-1105-1426460535892_thumb.jpg

 

For ages I couldn't figure out what the spike was prior to many of the flash measurements. I am thinking it is a prepulse to the main flash which helps ionize the flash prior to main burst.

If that's what it is, I am pretty stoked I can see it. Just need to modify my calcs routine to ignore it.

 

http://en.wikipedia.org/wiki/Flashtube

 

The purpose of measuring the flash lags and durations is an attempt to align flashes with different characteristics so that they are as closely synced as possible which removes ghosting of images.

 

Jkabats help with fast analog routine has been key to achieving the 1Msps sampling rate.

 

As each flash is profiled, the full curve data is stored in an I2C EEPROM along with summary details. This is then extracted by the Synchronize routine to set the delays for each flash.

I have 7 different modes for aligning the flashes timewise. The results don’t differ too much depending on choice of method.

 

1. Peak (default)

2. T0.1 Midpoint

3. T0.1 Centroid of area under curve

4. T0.5 Midpoint

5. T0.5 Centroid of area under curve

6. Full Curve Midpoint

7. Full Curve Centroid of area under curve

 

The faster flashes are held back, and they all cross the finish line at the same time.

The whole flash array inherits the lag of the slowest flash.

 

All the data from the I2C chip can be written to an SD Card for further analysis on a PC. Here is the data ported to excel.

 

post-1105-14264605351182_thumb.png post-1105-14264605353491_thumb.png

 

Code

 

The code is still underway but most things are working.

This is version 0.26

 

PTB_Flash_Measurement_Tool.zip

(The main file is PTB_Iridium.INO . Will need to create folder structure to suit)

 

Schematic

 

This is the current schematic but will be updated in the near future to fix some problems.

Multiflash 3.sch.pdf

 

Stellaris Launchpad Mods

 

Remove Resistors R2, R9, R10, R11, R12.

 

Bugs and Issues

 

Slowly working through things.

 

1. Flash Port 3 isn't firing for some reason. I think it used to. I wonder if it is related to issue #2 below.

2. I ran into strife with my indicator leds. They are Dual Colour red/blue and then I got a better understanding of forward voltage.

The blue is very close to the operating voltage of 3.3v. I have done arduino thing before this and it was all 5v, so it caught me. (again)

I am waiting on some lower resistance arrays, but I think this may create other problems to do with how much current the Stellaris can sink.

http://e2e.ti.com/support/microcontrollers/stellaris_arm/f/471/t/45816.aspx

Sooooo... I plan to redo the schematic in the near future implementing a darlington array to drive the optos and indicator leds.

Gotta think that through. It will be my third board revision. Can't keep doing that forever.

3. I seem to be only able to get it to run with Energia 0009 at the moment. Later versions don't seem to work with touch screen. Deffo my Software issue.

4. I2C EEPROM Speeds are very slow. There is a lot of data I am writing in there, but I think some better coding on my part will help a lot.

Luckily that only really affects 2 operations. The rest is zippy enough.

5. Haven't written code for reading back from SD card into I2C EEPROM Chip.

6. I seem to have some kind of problem with I2C addressing. I think its an Energia Wire library thing which may have been fixed in later versions.

I had a 24lc512 but I wanted more space so I dropped in a 24lc1025 which I then found is like 2 different addresses.

Couldn't write to one bank without writing to the other, so it defeated the purpose. I want more space to save longer curves from more powerful flashes.

It is currently good enough to deal with common flashes at full power.

7. I too have the problem of scanning the I2C bus and getting an address found at every address. The I2C Eeprom works as required though.

 

More as I think of them.....

 

 

Cheers

 

PTB

Share this post


Link to post
Share on other sites

Thanks !!
 
Been working on it for about a year as time permits.
 
@@Rei Vilo. No it wasn't that library suite. It was an earlier library which I believe was also by yourself. B)

http://forum.43oh.com/topic/3326-energia-library-colour-lcd-22-touch-library-for-launchpad-stellarpad/

 

I was already well underway with my own screens and user interface when I became aware of the suite, so I decided to persevere as a learning exercise.

I did think of going back and implementing the suite, but didn't. The suite definitely has some nice features.

 

Cheers

 

PTB
 

Share this post


Link to post
Share on other sites

Thought I would post an update on this project to help paint a picture with my other questions in other threads.

Hardware

========

post-29879-0-71905700-1431950044_thumb.jpg

 

I have gone to a new board layout which utilises the following new features.

a) ULN2003 Darlington arrays to drive the leds. The old arrangement didnt have enough grunt to drive the leds off the mcu.

B) Separated the bi-colour LEDS into separate discreet leds. Blue for Focus and Red For Shutter.

c) Returned to 3.5mm Audio jacks instead of RJ45 jacks. Easier to get off the shelf cables.

d) Added an extra booster pack set of pins in parallel.

e) Moved design from Eagle to KiCAD

    Schematic Iridium Schematic.pdf

e) I added a digital pot in an endeavour to make the light sensor auto-ranging for light levels. I failed on many fronts here.

    Firstly I screwed up big time on the chip socket. I somehow got a 18pin part in the board layout from a 16 pin part in the schematic.

    I only found out when I went to plug in the chip and the socket was too big. Nice work on my part.

    I am looking into making a small adaptor board to use the 16 pin chip in the 18 pin socket.

    Secondly, my thoughts of desensitising the phototransistor via programmable resistance appears futile anyway because the problem

    is actualy the phototransistor saturating. Adding resistance as per the circuit isnt going to help on that front. :(

      Did a bit of research on professional lightmeters and it would appear they cope with the problem by putting different strength filters

    on their light sensors and then you read off a different scale depending on which filter is in there.

f) And lastly but certainly not leastly. @@Fred made me some awesome laser cut panels for the new design. These are sensational.

   I added some infill to the laser engraving and it looks better than the photo appears.

post-29879-0-74459700-1431950001_thumb.jpg

Software

========

Lots of minor tweaks and improvements. Code updated to Energia 15.

One of the really annoying things was misbehaviour of Some of the GPIO's

It appears wire.begin(); screws up GPIO PD0 and PD1

I can turn pins PD0 and PD1 on and off at will until wire.begin(); is executed.

After that PD0 is stuck Low and PD1 is stuck high.

Fixed with info from this thread.....

http://forum.43oh.com/topic/7421-new-energia-release-0101e0012-03202014/?p=60448

Thanks to @reaper and @@spirilis for that thread.

And thanks again to @L.R.A for getting fast analog read back for me in Energia 15.

Current Version 0.40 Here Iridium_v0.40.zip

This code is very much a work in progress with lessons constantly being learnt.

 

Still Working On

==========

Investigating using timers instead of loops to trigger sequences.

 

 

Cheers

PTB

Share this post


Link to post
Share on other sites

And here are some example flash curve images, both single flash and multiple flash. The curves with multiple flash are currently only possible by using two of the circuit boards and two launchpads. One for measuring and one for firing off required sequence.

 

post-29879-0-82593700-1431952134_thumb.jpgpost-29879-0-75761300-1431952154_thumb.jpgpost-29879-0-32796700-1431952181_thumb.jpgpost-29879-0-67836200-1431952202_thumb.jpgpost-29879-0-81256700-1431952210_thumb.jpgpost-29879-0-83646400-1431952217_thumb.jpgpost-29879-0-45213400-1431952225_thumb.jpg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×