Jump to content

  • Log In with Google      Sign In   
  • Create Account

Photo

Strobr: High speed photography controller


  • Please log in to reply
6 replies to this topic

#1 AMagill

AMagill

    Noob Class

  • Members
  • 4 posts

Posted 16 November 2010 - 08:12 AM

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;
Posted Image

Here's the device itself. I call it Strobr.
Posted Image
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;
Posted Image
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):
Posted Image

PCB layout (clicky clicky):
Posted Image

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

#2 cde

cde

    Enigmatic Decadence

  • Members
  • 894 posts

Posted 16 November 2010 - 08:50 AM

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?

#3 GeekDoc

GeekDoc

    Level 4

  • Administrators
  • 1,394 posts
  • LocationO'Fallon, Illinois (St. Louis Metro area)
  • Sparkfun Wishlist


Posted 16 November 2010 - 02:37 PM

I'm guessing the board was designed for a specific enclosure.

Not sure on the BOM cost, though.
Public Service Announcement: I am a microcontroller / electronics noob! I should usually be quietly ignored or patiently instructed.
http://blog.DocsTech.net

#4 bluehash

bluehash

    Site Admin

  • Administrators
  • 5,504 posts

Posted 16 November 2010 - 02:42 PM

Love the project.
Looks like a first dev release. Normally you don't go small on the first release as you may want to probe points as you develop your code.

Stellarisiti - Join the new Tiva-C/Stellaris ARM Forums discussing Tiva-C(Stellaris) Microcontrollers.

C2kCentral - C2000 News, Projects and Forums
43oh - MSP430 Discussion, News, Projects and Hacks
MachineGrid - Robots, Hacks and Technology!


#5 AMagill

AMagill

    Noob Class

  • Members
  • 4 posts

Posted 16 November 2010 - 07:12 PM

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.

#6 GeekDoc

GeekDoc

    Level 4

  • Administrators
  • 1,394 posts
  • LocationO'Fallon, Illinois (St. Louis Metro area)
  • Sparkfun Wishlist


Posted 16 November 2010 - 07:27 PM

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?)
Public Service Announcement: I am a microcontroller / electronics noob! I should usually be quietly ignored or patiently instructed.
http://blog.DocsTech.net

#7 gatesphere

gatesphere

    Level 3

  • Members
  • 430 posts

Posted 16 November 2010 - 07:29 PM

This. Is. Awesome. Good luck with the contest, and thanks for sharing!
MSPhere - a framework of functions for rapid prototyping with the LaunchPad platform
My other pages: home page/portfolio || development blog




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users