19 March 2011

Low-Cost High-Speed Photography - Part 2

The New LED

The Cree XM-L T6 looked very much like the no-name LED that I had used previously. Being impatient, I did not modify the driver circuit immediately, which meant that the current would be about 1.5 Amps and the resulting power would be about 4.5 W. This should yield at least 5 times the brightness as compared to the no-name LED.

And this is the very first shot that I got with that LED:


Not too bad, I think. Click on the picture to get more detail.

Adding Flexibility

I wanted to experiment with several parameters, like flash pulse length, trigger delay, number of pulses to fire, pause between several pulses, and so on. While you can set these in the software, recompile it and then write it to the controller, this is a bit tedious. On the other hand I did not want to spend money on interface hardware like a display and keyboard for the project.

So I planned to use a laptop and a serial connection for changing parameters. My netbook has no serial interface, but I do have a USB adapter that interfaces to RS232 on logic level. It was once used to connect a mobile phone to the PC. You can still buy these and I am sure there is a lot of information on the net which cables you can use or how to build a RS232 interface with logic levels. This means you get the "man-machine-interface" almost for free. And it is reusable.

The tiny15L has no hardware based UART. But Atmel provides a set of simple SW UART routines. Since the controller does nothing else during UART communication, no interrupt based scheme needs to be used. And because I did not use a crystal, synchronicity could be an issue. To be on the save side, I used a relatively low baud rate (9600 bauds) and never had any problems. I only transmit a couple of bytes, so a low baud rate was more than sufficient.

I planned to keep development on the PC side at a minimum, so I decided to just use a standard ANSI terminal emulator. This meant that I had to implement all text output, input of values etc. in the tiny15L. Certainly a challenge, if you have no more than 1kByte of program memory.

Parameter Settings

There are five parameters that I can set through the menu:


And here is a diagram that shows what these parameters are:

The 'pulse width' it given in units of 100 µs. So '1' means 100 µs, 5 means 500µs and so on. The longer you make the pulses, the brighter the photos will be, but the more motion blur you get. It is a trade-off.

The meaning of 'number of pulses' is obvious. But you can also set it to 0. This has a special meaning, namely infinite. So the unit keeps flashing until you press the reset button.

Next comes pulse distance, which is the time between pulses (in units of 1ms).

The fourth parameter is the trigger delay. This is the delay between the trigger occurring and the start of the first pulse. Very important for drop photos (also in units of 1ms).

Finally there is a parameter for dead time. This helps to avoid accidental double exposures by unwanted triggering. It is given in units of 100ms, so a value of 10 means one second of blocking the sensor after the shot.


Software Operation

When the controller is ready to trigger the flash, it issues a message. It then waits for either a signal on the trigger input or for activity on the serial port. In order to invoke the menu, just press any key.

Next, press key 1 - 5 for the parameter you want to modify. Any other key aborts the menu and goes back to flash operation.

To modify a parameter use the keys q and a as up and down keys (single step) or w and s  (+/- 10 steps) respectively.

Press "  " (space) to save the parameter, again any other key aborts the modification.

All in all the menu is quite usable. Perhaps I should add an option to print all currently set parameters later. After all, there are still about 100 unused bytes in the program memory...

Please note: If you are not using any heat sink for the LED (like me), you have to make sure not to overheat the LED. I limited the pulse length to 5 ms (maximum) and the pulse distance to 10 ms (minimum). This is OK for single pulse operation. But if you use the infinite pulse option, this could be critical!

So much for the software. Find the final hardware and the SW download in part 3.

No comments:

Post a Comment