another camera trigger

[moved from FAQ by Nargt, better place for it?]

I'd like to set up a camera trigger that triggers during a minimum in motion. The camera is on the bob of a 1 to 4 meter wire pendulum driven by xyz motion at it's attachment. If pendulum motions are large I want to trigger the camera when (or just before) the pendulum reverses direction. If pendulum motions are very small I would like to trigger bursts of pictures. If Z-axis rotation exceeds a cut off the camera should not be triggered. Planning to use a canon CHDK camera with two different pulse lengths through the USB port for shoot and burst. It will either be set for manual focus or periodic half-press (focus+meter) prior to receiving signal. I was hoping to use an adxl 300 accelerometer and a cheap single axis gyro. There may be a light sensor which modifies the behavior of the system.

Has anyone done anything like this? I'm wondering about code that is either fast or anticipates valleys and peaks in acceleration.