• Announcements

    • bluehash

      Forum Upgrade   03/11/2017

      Hello Everyone, Thanks for being patient while the forums were being fixed and upgraded. Please see details and report issues in this thread. Thanks!
Sign in to follow this  
Followers 0
AMagill

Strobr: High speed photography controller

7 posts in this topic

Copied from the November 2010 contest thread, so there's a separate space to discussion.

 

My project is a programmable strobe controller for high speed photography. A device like this is crucial for many types of high-speed photography, as it can orchestrate multiple sensors such as photogates and contact microphones with several outputs, such as a flash trigger and a camera's shutter release, so as to capture a photograph of just the exact right instant with microsecond precision.

An example; I connected my device to a small electronic water valve, to my camera's cable release port, and to a flash. I arranged it so water could flow down from a bottle, through the valve, out a small nozzle, and down into a bowl of water below whenever the valve is powered. Then I wrote a script to control the device;

while (true)
{
 if (RIN0 == 1)
 { // Button 1: Double drip
   reg delay1 = 50;
   reg delay2 = 192;

   ROUT.T3 = 1;    // Prime the camera
   waitms(10);     // Setup time

   ROUT.T2 = 1;    // Open valve
   waitms(15);     // Wait for drop
   ROUT.T2 = 0;    // Close valve

   waitms(delay1); // Put some space between drops

   ROUT.T2 = 1;    // Open valve
   waitms(15);     // Wait for drop
   ROUT.T2 = 0;    // Close valve

   waitms(delay2); // Wait for drops to fall

   ROUT.R3 = 1;    // Fire the camera
   waitms(63);     // Wait for shutter to open

   ROUT.R1 = 1;    // Fire flash
   waitms(10);     
   ROUT = 0;       // Finish flash pulse, close camera

   waitms(200);    // Lockout
 }
}

Once I got the timing just right, this script has the valve release exactly two drops of water such that the second will collide with the splash from the first, and take a picture of the result. It produces pictures like this, each and every time I press a button on the device;

drip_small.jpg

 

Here's the device itself. I call it Strobr.

pcb_small.jpg

That's an MSP430F2274 in the center, driven by a 16MHz clock crystal (to keep timing more precise and repeatable). On the top left are two analog input ports, each with one input pin and a software-switchable power pin (because some sensors, like photogates, need power to work). In addition to being polled by the MSP430's ADC, it can also route them through the MSP430F2274's built-in op-amps for small signals like microphones. Top middle are a pair of buttons, just two more inputs available to the chip. Top right are a pair of ports that can be connected to each other via a pair of solid-state relays, of course software controlled as well. The idea behind adding these was to be able to switch on and off an audio signal to a speaker, for making sound sculptures. Haven't tried it yet. On the bottom right are four output jacks, each with a pair of digital output pins. Finally, on the left there's a FTDI FT232RL USB-to-serial converter, and under the power switch, you can just barely make out a USB port on the bottom side of the board.

The device connects to my computer by USB. The PC application I've written allows you two write simple scripts for the device, error-check and compile those scripts, load the compiled bytecode onto the device, and poll the device's status and display it in realtime. It looks like this;

screen2.png

The MSP430, in addition to maintaining communication with the PC, runs a very simple virtual machine that executes the scripts that have been loaded onto it. The virtual machine is fixed instruction length (32 bits), and has no stack or memory of any kind except for 16 general-purpose registers and 16 specialized registers. In the screenshot of the PC application, you can see the bytecode that the script is compiled into, as well as the registers that the virtual machine operates on. Those registers are; RIN0 (buttons input), RIN1(analog input 1), RIN2 (analog input 2), RD1 and RD2 (analog input deltas, change since last sample), RLED (the ring of LEDs), ROUT (the eight digital outputs), RPWR (power to the input ports and to the relays), RAIM (analog input mode- no amps, one amp on each port, daisy-chained amps on one port, etc.), RG1 and RG2 (amplifier gain setting), RAP (automatically poll state to the host), RFLG (flags- running, test truth), and RPC (program counter).

 

Schematic (click for full size):

circuit_small.jpg

 

PCB layout (clicky clicky):

board_small.jpg

 

And finally, for source code, you'll have to go to my web site, since the file is too big to attach to this post. It includes Eagle files for the schematic and PCB layout (including a detailed bill of materials totaling about $100), CAM files for the PCB (in case you want to get one made and don't care to muck about with Eagle), source code for the MSP430 and for the PC application, and even a few scripts to run on the whole contraption. If you do decide to make one of these, though, you should note that my design isn't perfect, and you would do well to double-check my work and address a number of issues first.

 

My web site, where I have writeups for this project and others, is OminousHum.com.

bluehash likes this

Share this post


Link to post
Share on other sites

Two questions. Why is the board so big/wide? Nothing on the board seems to call for so much real estate, and nothing requires so much copper for heat reasons, so what gives? Same for doubling up the usb connector under the switch.

 

Second being, why is the bom so high? (I havent looked at the bom file) but just by your part description, the ics should only be probably 15 at most, plus another 5 for the resistors/leds, a handful of generic audio plugs, etc, why isn't the part cost around 30 plus shipping? Does it include the price of making the board?

Share this post


Link to post
Share on other sites

The board was sized to fit one of these enclosures.

 

And to be honest, you could trim down the BOM quite a bit with some work. The big ticket items are:

$33 - PCB

$12 - Li-poly battery

$12 - Enclosure

$7 - Switch (it's a nice switch, but what was I thinking?)

$6 - MSP430F2274

$4 - Battery charger IC

 

The battery power feature turns out to be pretty useless, since in practice you're continually tweaking the script the device is running and almost never run it without USB power. So rip that out and save $17. No battery means no need for a power switch. Save another $7. No enclosure saves another $12. With enclosure no longer a constraint, a sufficiently clever person might get that PCB down to maybe 2"x2", which this guy will make three of for $20. If I amortize the PCB cost, then that brings the total to just under $40.

So.. yes, you are absolutely right about the BOM. Lessons learned from my first project of this scale.

Share this post


Link to post
Share on other sites
The board was sized to fit one of these enclosures.

Aha! I was right! Nice enclosure, though. I cram my projects into whatever I can find, or a sample enclosure I got for free (you'd be surprised what companies will send as samples! ;) ).

 

...which this guy will make three of for $20.

:D Yay for DorkbotPDX! I got some great boards made through them!

 

I noticed the LiPo battery/charger. I have some LiPo batteries from old Nokia cell phones that I would love to be able to use in projects. Any advice/tutorials on using/charging LiPo's so I don't burn something up? :? (Anyone?)

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  
Followers 0